摘要
故障修复后,程序员还需验证那些与修复故障相关的区域是否还存在故障或者引入了新的故障,这时有可能需要补充新的测试用例.现有研究大多依赖符号执行等技术,这样可能导致状态空间过大.且现有的研究统一地来考虑程序中控制流相关的故障和数据流相关的故障,但程序中控制流相关的故障与数据流相关的故障存在区别.由于程序运行时的行为与变量密切相关,并且在人工程序调试时程序员经常会关注变量的状态变化.因此该文提出了一种基于变量影响分析和数据变异的回归测试用例方法,通过分析程序中动态执行的变量状态的变化,提炼出了一种变量行为模型,该模型描述了变量自身的状态变化和变量间的依赖关系.利用变量行为模型来找到影响故障的语句集合,基于该语句集合并利用数据变异的方法可以有针对性地补充测试用例.经过实验验证,基于变量影响分析和数据变异的回归测试用例方法,在针对数据流相关的故障修复情况进行验证时效果明显,且要优于随机测试用例生成方法和基于路径覆盖的测试用例生成方法.
Programmers need to verify program correctness after fault repairing.They often need to add new test cases to test programs for fault repairing,which may bring out new faults.There are many technologies depended on symbol execution which will cause state space explosion,and furthermore these technologies are unified to consider the control flow related faults and data flow related faults in program.However,the control flow related faults and data flow related faults are different.The behaviors of the program and the variables are closely related.Programmers often pay attention to variables state changes in the process of manual debugging.This paper proposes an approach of regression test case generation based on variable impact analysis and data mutation because of these factors.First,it analyses dynamic variable state change and gets a variable behavior model,which describes state change of the variables and the dependence relationship of variables.Then,statements related to fault can be obtained by analyzing the variable behavior model.Last,test cases can be getting by using these statements and data mutation technology.The main research of this paper is verified by experiments.The experimentalresults show that the proposed approach is good for finding data related fault and achieving better results comparing with random approach and paths coverage approach.
出处
《计算机学报》
EI
CSCD
北大核心
2016年第11期2372-2387,共16页
Chinese Journal of Computers
基金
国家自然科学基金(61502011
61370051
61402016)
北京市教委科技计划(KM201610009007)
北京市大学生科研训练计划深化项目(XN003-16)
北方工业大学科研启动基金项目
北方工业大学开放实验项目资助~~
关键词
故障修复
影响分析
变量
数据变异
回归测试
fault repair
impact analysis
variable
data mutation
regression testing