摘要
单元覆盖测试的目标是达到尽可能高的覆盖率。为了提高单元自动覆盖测试的覆盖率,该文提出了一种面向目标覆盖元素的可达路径选择方法。该方法首先选定一段从函数入口到目标覆盖元素的半条路径,然后根据区间运算判定该路径的不可达性并改造不可达路径,进而得到一条包含目标覆盖元素的可达路径。最后结合测试用例的生成对10个函数单元进行语句覆盖测试实验,单元平均覆盖率从46%提升到了70%,验证了该方法能有效地提高覆盖率。
单元覆盖测试的目标是达到尽可能高的覆盖率。为了提高单元自动覆盖测试的覆盖率,该文提出了一种面向目标覆盖元素的可达路径选择方法。该方法首先选定一段从函数入口到目标覆盖元素的半条路径,然后根据区间运算判定该路径的不可达性并改造不可达路径,进而得到一条包含目标覆盖元素的可达路径。最后结合测试用例的生成对10个函数单元进行语句覆盖测试实验,单元平均覆盖率从46%提升到了70%,验证了该方法能有效地提高覆盖率。
出处
《清华大学学报(自然科学版)》
EI
CAS
CSCD
北大核心
2011年第S1期1402-1406,1413,共6页
Journal of Tsinghua University(Science and Technology)
基金
国家"八六三"高技术项目(2009AA01Z404)
国家自然科学基金资助项目(91018002)