首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到19条相似文献,搜索用时 156 毫秒
1.
C++程序中异常处理的分析与测试技术研究   总被引:2,自引:1,他引:2  
异常处理机制是一种运行时错误通知机制,将程序的正常控制代码和错误处理代码分离.然而异常机制的引入使得程序控制信息变得更为复杂;且开发人员一般难以熟练使用它,导致程序中会潜伏许多异常错误.扩展已有的显式异常分析技术,对隐式异常也进行了全面的分析并提出了过程间(内)控制流图的构造方法,并以此为基础给出了一个C++程序健壮性改进模型.同时还提出了针对异常的两种动态测试策略:基于约束求解的异常测试策略和统计结构性异常测试策略.最后实现了一个初步的异常分析与测试原型工具并进行了初步实验分析,其结果表明本文提出的分析与测试方法对程序质量有较大程度的提高.  相似文献   

2.
故障注入技术在BIT软件测试中是一种有效的手段。针对电路板级BIT软件测试中遇到的问题,介绍了一种基于开源模拟器QEMU实现的处理器类故障模拟方法。采用该方法对多种处理器故障进行仿真建模,通过对QEMU的扩展开发,加入故障行为模拟模块和故障注入模块,以实现一个具有处理器类故障注入功能的系统级模拟器BitVaSim。首先分析处理器功能故障模式,提取故障的关键字值对,用XML Schema定义故障并用于故障建模;其次对QEMU代码进行二次开发以实现对处理器故障行为的模拟;然后通过配置故障注入接口实现模拟器运行时的故障模式匹配、故障按条件触发等功能;最后通过实验案例来观察模拟器的故障表现,评价这种基于模拟器的故障注入技术。实验过程和结果显示这种方法是有效可行的。  相似文献   

3.
故障注入技术在BIT软件测试中是一种有效的手段。针对电路板级BIT软件测试中遇到的问题,介绍了一种基于开源模拟器QEMU实现的处理器类故障模拟方法。采用该方法对多种处理器故障进行仿真建模,通过对QEMU的扩展开发,加入故障行为模拟模块和故障注入模块,以实现一个具有处理器类故障注入功能的系统级模拟器BitVaSim。首先分析处理器功能故障模式,提取故障的关键字值对,用XML Schema定义故障并用于故障建模;其次对QEMU代码进行二次开发以实现对处理器故障行为的模拟;然后通过配置故障注入接口实现模拟器运行时的故障模式匹配、故障按条件触发等功能;最后通过实验案例来观察模拟器的故障表现,评价这种基于模拟器的故障注入技术。实验过程和结果显示这种方法是有效可行的。  相似文献   

4.
以研究对嵌入式系统鲁棒性进行评价和基于软件故障注入技术的嵌入式系统鲁棒性测试为目的。对嵌入式系统鲁棒性测试的相关概念以及软件故障注入技术原理进行了介绍,以Linux操作系统内核函数测试为例,通过对系统API参数的故障注入接口进行分析,提出基于GDB工具的软件故障注入方法来实现系统鲁棒性故障注入测试。完成了相应的Linux操作系统API接口故障注入测试实例并给出了测试结果。为嵌入式系统鲁棒性测试提供了更为直观、有效的方法。  相似文献   

5.
董燕  王小丽 《测控技术》2016,35(4):117-119
研究了星载嵌入式软件安全性测试问题.提出一种基于故障注入的安全性测试框架,通过构建全数字仿真测试环境,模拟目标系统输入异常故障及运行态异常故障,可以灵活地实现故障注入.根据软件实际运行结果与预期结果的一致性来评价软件检错、容错能力,进而完成对软件的安全性测试及验证过程.  相似文献   

6.
赵翔  李志蜀 《计算机应用》2007,27(B06):319-321
实现了一种在动态不变量探测工具Daikon帮助下,为Java类自动生成JUnit测试用例的方法。它以待测代码以及少量使该待测代码正确运行的代码为输入,以Daikon导出的程序运行模型为基础,全自动地生成了包含测试断言的JUnit测试用例。该方法主要解决了传统方法在生成单元测试用例时无法自动插入测试断言的不足。  相似文献   

7.
自定义ASSERT宏   总被引:1,自引:1,他引:0  
提出修改标准的ASSERT宏的方法,对断言进行改进。详细分析在某些场合,标准断言无法发挥作用的原因.通过分析Windows下的结构化异常处理机制给出修改方案:为了方便进一步修改断言对话框的显示内容和功能,重写调用断言对话框函数。  相似文献   

8.
针对软件接口类型多、接口故障注入自动控制复杂的困难以及目前缺少有效的软件接口故障注入工具现状,对软件故障注入中的交联接口故障注入技术展开研究,提出了一种基于模型的软件接口故障注入测试平台技术。通过交联接口测试可视化建模和接口故障注入算子设计,自动生成XML 格式的测试用例,并且通过基于XSLT的脚本自动化生成与执行技术实现测试的控制与执行。故障注入测试主机与接口故障注入器网络连接,接口故障注入器将接口故障数据转换成以太网、串口或CAN网络数据注入到被测软件中,并返回被测件输出数据到测试主机实现测试数据收集与判断。基于模型的软件接口故障注入测试平台具有较强的通用性与易用性,提高了接口故障注入测试的效率,降低了接口测试的成本。  相似文献   

9.
孙毅刚  徐畅  刘哲旭 《计算机应用》2018,38(9):2650-2654
综合模块化航空电子(IMA)平台网络通信结构复杂,在进行故障注入测试时,存在难以选取合适的测试路径及等效、无效故障注入较多的问题。根据IMA平台网络通信结构特点,提出一种新的故障注入策略。首先,根据IMA平台网络对实时性和确定性的要求,提出一种基于通信链路的测试路径优化算法,生成最优测试路径,实现对IMA平台网络测试任务的有序覆盖;然后,在确定测试路径之后,采用有色Petri网(CPN)建模方法搭建测试案例自动生成模型,排除等效与无效故障,精简测路径中每个测试任务所需的测试案例。仿真结果表明,所提方法在测试次数与测试时间等方面均少于传统的故障注入策略,能够克服传统策略中的无序性及盲目性的缺点,降低测试的时间成本。  相似文献   

10.
二进制翻译应用级异常处理   总被引:2,自引:2,他引:0  
二进制翻译可以用于解决遗产代码的迁移问题,也可以实现不同硬件平台之间软件的通用.异常处理是二进制翻译的一个重要方面,如何解决异常处理和二进制翻译效率的矛盾是问题的关键.提出了在库函数包装层面处理主动异常和被动异常的方法,一个算法可以高效处理信号异常,另一个算法使用栈展开技术,得到调用地址用于处理try catch异常.实验结果表明,上述方法能够正确处理异常函数,同时对于普通应用程序加入异常处理机制之后性能并不受影响.  相似文献   

11.
Java异常处理策略研究   总被引:1,自引:0,他引:1  
异常处理机制是程序设计语言的重要标志之一,在程序设计过程中用来处理程序运行中的异常。传统的程序设计语言里异常处理较为繁杂。Java是一种面向对象的程序设计语言,且引入了异常处理机制。合理完备的异常处理可以增强程序运行的可靠性、提高软件的健壮性,可以较为快速地确定错误的位置。文章分析了Java异常处理的逻辑,阐述了异常类、异常处理机制以及异常处理方法,提出了异常处理的一些策略。综合运用这些策略可以使编程人员编写出更加简洁、高效的程序代码。  相似文献   

12.
This paper presents an in‐depth study of the adequacy of the AspectJ language for modularizing and reusing exception‐handling code. The study consisted of refactoring existing applications so that the code responsible for implementing error‐handling strategies was moved to newly created exception handler aspects. We have performed quantitative assessments of five systems—four object‐oriented and one aspect‐oriented—based on four key quality attributes, namely separation of concerns, coupling, cohesion, and conciseness. Our investigation also included a multi‐perspective analysis of the refactored systems, including (i) the extent to which error‐handling aspects can be reused, (ii) the beneficial and harmful aspectization scenarios for exception handling, and (iii) the scalability of AOP to support the modularization of exception handling in the presence of other aspects. Copyright © 2009 John Wiley & Sons, Ltd.  相似文献   

13.
When building dependable systems by integrating untrusted software components that were not originally designed to interact with each other, it is likely the occurrence of architectural mismatches related to assumptions in their failure behaviour. These mismatches, if not prevented during system design, have to be tolerated during runtime. This paper presents an architectural abstraction based on exception handling for structuring fault-tolerant software systems. This abstraction comprises several components and connectors that promote an existing untrusted software element into an idealised fault-tolerant architectural element. Moreover, it is considered in the context of a rigorous software development approach based on formal methods for representing the structure and behaviour of the software architecture. The proposed approach relies on a formal specification and verification for analysing exception propagation, and verifying important dependability properties, such as deadlock freedom, and scenarios of architectural reconfiguration. The formal models are automatically generated using model transformation from UML diagrams: component diagram representing the system structure, and sequence diagrams representing the system behaviour. Finally, the formal models are also used for generating unit and integration test cases that are used for assessing the correctness of the source code. The feasibility of the proposed architectural approach was evaluated on an embedded critical case study. Patrick Brito is supported by Fapesp/Brazil under Grant No. 06/02116–2 and CAPES/Brazil under Grant No. 0722–07–3. Cecília Rubira is partially supported by CNPq/Brazil under Grant Nos. 301446/2006–7 and 484138/2006–5.  相似文献   

14.
大规模面向服务软件运行环境的动态性和不确定性使其异常处理逻辑复杂度高,导致异常处理过程的可终止性验证异常困难。而异常处理过程的可终止性是确保其正确性的重要基础,如果异常处理过程不能终止将导致面向服务软件无法正常运行。目前缺乏异常处理过程的可终止性验证方法,从而无法保证异常处理达到预期的目标。基于着色Petri网(colored Petri net,CPN)提出了一种面向服务软件异常处理过程的可终止性验证方法。该方法建立了包括正常流程和异常处理逻辑的异常层次CPN模型(hierarchy CPN model for exception handling,HCPN4EH)。基于此模型验证了异常处理过程的可终止性。通过一个实例说明了该方法的可行性和有效性。得到的可终止性验证结果可为进一步分析异常处理过程的正确性提供基础。  相似文献   

15.
吴青  应时  贾向阳 《计算机科学》2011,38(4):170-174
面向服务软件异常处理的开发工作量大且程序逻辑复杂。若只在设计阶段后期或是编码阶段考虑异常处理功能的开发,则可能由于没有充分、完整、系统地考虑待处理的异常而严重影响软件整体可靠性。针对面向服务软件中异常处理机制的特点,提出一种基于着色Petri网的异常处理模型。通过对异常处理组成元素和异常处理模式分别进行形式化描述,可提供可重用的异常处理模型元素。设计者根据面向服务软件中异常处理的实际需求,使用异常处理模式连接异常处理组成元素,形成一个完整的异常处理模型。利用该模型可以精确描述面向服务软件中异常处理总体方案,便于辅助设计人员检测异常处理设计方案中的缺陷。  相似文献   

16.
容错是保障软件可靠性的重要手段。该目标是利用对软件系统静态分析的信息,生成具有容错能力的方面文件来增强软件系统的容错能力。首先利用抽象语法树的分析工具,来获得一些有用信息,比如异常类型和抛出异常的方法。然后通过模板生成工具生成相应的恢复代码,利用面向方面机制,将代码动态编织入系统中。最后做一个案例证明方法在实现容错增强方面的可行性。  相似文献   

17.
Since the signature of an Ada subprogram does not specify the set of exceptions that the subprogram can propagate, computing the set of exceptions that a subprogram may encounter is not a trivial task. This is a source of error in large Ada systems: for example, a subprogram may not be prepared to handle an exception propagated from another subprogram several layers lower in the call-tree. In a large system, the number of paths in exceptional processing is so great that it is unlikely that testing will uncover all errors in inter-procedural exception handling. Nor are compilers or code inspections likely to locate all such errors. Exception handling is an area where static analysis has a high potential payoff for systems with high reliability requirements. We discuss fundamental notions in computing exception propagation and describe an analysis tool that has proved to be effective in detecting inconsistencies in the exception-handling code of Ada applications.  相似文献   

18.
穆强 《计算机测量与控制》2012,20(2):536-537,555
星载软件均为嵌入式软件,中断是星载软件与外界进行信息交互的重要接口,中断的响应是否及时对星载软件的性能有着较大的影响;且由于星载软件的实时性要求,中断处理的延迟可能会导致软件功能性错误,无法完成正常的功能,而且该错误随机性较强,难以定位;中断响应时间是衡量一个星载软件对外部中断处理的及时性的重要参数,文中说明了如何对软件进行最大中断响应时间的分析,为星载软件中断处理的设计提供参考;文中给出两个实例,分别介绍在允许中断嵌套和禁止中断嵌套的情况下,中断响应时间的具体分析方法,经过分析得出结论,示例1中断处理余量仅5.63%,无法进一步提升性能,示例2中断处理余量为86.38%,系统还有较大的扩展空间。  相似文献   

19.
ContextIn software, there are the error cases that are anticipated at specification and design time, those encountered at development and testing time, and those that were never anticipated before happening in production. Is it possible to learn from the anticipated errors during design to analyze and improve the resilience against the unanticipated ones in production?ObjectiveIn this paper, we aim at analyzing and improving how software handles unanticipated exceptions. The first objective is to set up contracts about exception handling and a way to assess them automatically. The second one is to improve the resilience capabilities of software by transforming the source code.MethodWe devise an algorithm, called short-circuit testing, which injects exceptions during test suite execution so as to simulate unanticipated errors. It is a kind of fault-injection techniques dedicated to exception-handling. This algorithm collects data that is used for verifying two formal contracts that capture two resilience properties w.r.t. exceptions: the source-independence and pure-resilience contracts. Then we propose a code modification technique, called “catch-stretching” which allows error-recovery code (of the form of catch blocks) to be more resilient.ResultsOur evaluation is performed on 9 open-source software applications and consists in analyzing 241 catch blocks executed during test suite execution. Our results show that 101/214 of them (47%) expose resilience properties as defined by our exception contracts and that 84/214 of them (39%) can be transformed to be more resilient.ConclusionOur work shows that it is possible to reason on software resilience by injecting exceptions during test suite execution. The collected information allows us to apply one source code transformation that improves the resilience against unanticipated exceptions. This works best if the test suite exercises the exceptional programming language constructs in many different scenarios.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号