摘要
异常处理是现代程序设计语言提供的用来提高软件健壮性的一种机制。由于在 C^(++)的函数界面中并不要求声明该函数所能传播出的异常的类型,所以要想提高系统的健壮性,必须清楚在程序的执行过程中可能引发的异常、异常的传播路径等。然而在大型系统中,要想确定这些信息是非常困难的。本文针对 C^(++)的异常处理机制,首先提出了一个描述 C^(++)异常结构信息的模型,并把该模型应用于递归函数中。然后,描述了一个基于该模型的分析C^(++)程序异常结构信息的工具 CETool。该工具能提供所有显式引发异常的有关信息,为系统中异常处理结构的改进和程序的结构测试提供有价值的信息。最后给出了该工具的实现方法和应用实例。
Exception handling in modem programming languages is a mechanism that can improve software robustness. Since the signature of an C^++ function may not specify the set of exceptions that the function can propagate, it is necessary to figure out the exceptions that may be raised during executing program, the origins of the exceptions and their exception propagation paths. Unfortunately, in large programs, this exceptional information can be difficult, if not impossible, to determinc. Firstly, the paper presents a model that can describe the exception handling information for C^++ exception handling mechanism, and applies the model to recursive functions. Then describes CETool, a static analysis tool we have developed to provide exception-flow information for C^++ systems based on this model. The CETool provides the information related to the explicit exceptions. The information is helpful to support the improvements to the exception handling structure of a system and structure testing of a program. It also presents the implementation of CETool and its application.
出处
《计算机科学》
CSCD
北大核心
2006年第4期288-291,F0004,共5页
Computer Science
基金
国家自然科学基金(60373066)
国家973重大基础研究(2002CB312000)
教育部跨世纪杰出人才基金
教育部博士基金(20020286004)
江苏省计算机信息处理技术重点实验室(苏州大学)基金资助
关键词
异常处理
静态分析
异常传播
结构测试
Exception handling, Static analysis, Exception propagation, Structure testing