电子学报 ›› 2015, Vol. 43 ›› Issue (8): 1555-1560.DOI: 10.3969/j.issn.0372-2112.2015.08.013

• 学术论文 • 上一篇    下一篇

基于子路径扩展的不可达路径检测方法

王红阳1, 姜淑娟1, 王兴亚1, 鞠小林1,2, 张艳梅1   

  1. 1. 中国矿业大学计算机科学与技术学院, 江苏徐州 221116;
    2. 南通大学计算机科学与技术学院, 江苏南通 226019
  • 收稿日期:2014-09-23 修回日期:2014-12-15 出版日期:2015-08-25
    • 通讯作者:
    • 姜淑娟
    • 作者简介:
    • 王红阳 男,1990年出生,黑龙江伊春人.中国矿业大学研究生.研究方向为软件测试、不可达路径检测. E-mail:wanghongyang@cumt.edu.cn
    • 基金资助:
    • 国家自然科学基金 (No.61340037,No.61202006); 中央高校基本科研业务费专项资金 (No.2013NB17); 江苏省青蓝工程; 江苏省333高层次人才培养工程项目; 江苏省研究生培养创新工程 (No.CXZZ12_0935); 南通市应用研究计划 (No.BK2014055)

An Approach for Detecting Infeasible Paths Based on Sub-Path Expansion

WANG Hong-yang1, JIANG Shu-juan1, WANG Xing-ya1, JU Xiao-lin1,2, ZHANG Yan-mei1   

  1. 1. School of Computer Science and Technology, China University of Mining and Technology, Xuzhou, Jiangsu 221116, China;
    2. School of Computer Science and Technology, Nantong University, Nantong, Jiangsu 226019, China
  • Received:2014-09-23 Revised:2014-12-15 Online:2015-08-25 Published:2015-08-25

摘要:

不可达路径是造成软件测试资源消耗的一个重要方面.在路径测试之前,检测程序中的不可达路径可以有效节约软件测试资源.提出了一种基于子路径扩展的不可达路径静态检测方法.该方法首先生成程序的子路径集,将路径的可达性问题转换为不等式组的求解问题.使用约束求解器判断子路径的可达性,可以分为:可达子路径,不可达子路径和无法判定三个部分,并对后面两部分的子路径扩展出的路径做二次可达性检测,最终获得程序中所有路径的可达性信息.可达性检测工作主要在子路径集上进行,因此有效地解决了路径爆炸问题.实验结果表明本文方法可以准确有效地检测出程序中的不可达路径.

关键词: 软件测试, 子路径扩展, 不可达路径检测, 约束求解

Abstract:

Infeasible paths are one of the most important parts to cost the test resources.Before path testing, infeasible paths detecting in a program can save test resources efficiently.This paper presents a static method to detect infeasible paths which is based on sub-path expansion.First, the proposed method generates sub-path set, and the feasibility issues will be converted into inequalities.Second, the constraint solver is used to solve the inequalities, and then we can distinguish the sub-paths into three parts:one part is infeasible sub-paths, the second part is feasible sub-paths, and the third part is undetermined.The paths that are expanded from the latter two parts will be tested again to determine their feasibility.Eventually, the feasibility of all the paths is detected.Most of the detecting work is on sub-path set, so our method makes an effective solution to the path-explosion problem.Experimental results show that the proposed method can detect infeasible paths more accurately and effectively.

Key words: software testing, sub-path expansion, infeasible path detection, constraint solving

中图分类号: