摘要
基于扩展状态机对资源泄漏故障进行描述,给出了资源泄漏缺陷状态机,定义了缺陷的状态、状态迁移图和状态转换表。设计和实现了资源泄漏检测算法。该算法在对控制流进行遍历的过程中,按照资源泄漏缺陷状态机给出的转换条件进行状态计算,如果计算结果为故障,则报告1个资源泄漏故障。应用该算法对大型开源软件进行测试,发现多个资源泄漏故障。测试结果表明:该算法具有测试效率高和误报率低等特点。
By using extended state machine, this paper describes the resource leak defect, gives its state machine, and defines its state and state-transition graph and table. Then the testing method of resource leak defects is designed and implemented. It computes the states according to transition conditions given by the resource defect state machine in the course of traversing control flow, and reports a resource leak fault if a fault state is reached. It is applied to testing large open-source programs and has found a number of resource leak defects. The experiments show that it can test the code efficiently with low false report.
出处
《装甲兵工程学院学报》
2009年第1期70-72,共3页
Journal of Academy of Armored Force Engineering
关键词
软件测试
静态分析
缺陷模式
状态机
software testing
static analysis
defect patterns
state machine