ISCAS OpenIR  > 基础软件与系统重点实验室
C程序测试数据生成与死循环检测研究
Alternative TitleTest Data Generation and Deadloop Detection for C Programs
阮辉
2009-06-05
Degree Grantor中国科学院软件研究所
Degree Level博士
Place of Degree Grantor软件研究所
Keyword自动软件测试 程序分析 测试数据生成 死循环
English Abstract软件测试是保证软件质量的重要手段. 随着软件技术的发展, 软件的规模越来越大, 程序的复杂度也逐渐增加. 软件测试也由原来的人工操作逐渐走向自动化. 自动化软件测试已经成为国内外软件工程研究的热点之一. 本文研究了自动软件测试中的两个问题, 它们分别属于自动测试数据生成和错误查找两方面. 主要贡献如下: 本文提出了一种对含有字符串和字符串函数调用的C语言程序自动生成测试数据的方法. 具体做法是将C语言程序中的字符变量看成是取值范围在0~255之间的整数, 并使用字符数组来表示字符串, 同时将字符串函数建模成一阶逻辑公式和赋值语句. 通过使用前置条件和后置条件来描述函数调用语句, 将程序中的字符串函数调用语句替换成逻辑公式和赋值语句, 之后使用路径分析技术自动生成程序的测试数据. 此外, 本文还实现了一个自动化工具, 能够为真实的C程序自动生成测试数据. 另一方面, 本文还提出了一种自动检查程序中是否含有死循环的方法. 该方法基于静态代码分析, 结合了循环展开和路径可行性分析技术. 具体做法是首先通过遍历控制流图生成待查循环的检验路径, 之后通过分析检验路径的可行性以及路径之间的联系, 判断这些路径是否符合死循环模式. 在此基础上, 本文实现了原型工具, 并对一组基准程序进行测试. 实验结果表明, 工具能高效地检测出C语言程序中的死循环, 准确率较高. 工具的自动化程度较高, 能处理复杂的控制流以及嵌套的循环.
AbstractSoftware testing is an important method to guarantee the quantity of software. As the development of the software technology, programs have become larger and more complex. Software testing procedure has gradually developed into automation from manual work. Automatic software testing has become a hot topic in the worldwide software engineer research area. This paper focuses on two problems in automatic software testing, which belongs in automatic test data generation and bug detection respectively. The main contributions are: Firstly, a method is proposed to automatically generate test data for C programs with character strings and string-handling function. In this method, each character variable is treated as an integer variable with the restriction that the value should be between 0 and 255. A character string is treated as an array of characters with a predefined fixed length. Many commonly used character library functions are modeled by formulae in predicate logic with assignment statements. Through the pre-condition and post-condition, function call statements are replaced by formulae with assignment statements. Then the path analysis technique is used to generate the test data. Based on this idea, an automatic tool has been implemented to generate test data for the real C programs with string handling functions. Another method is also proposed, which can automatically detect the infinite loop in C programs. This method is based on program analysis techniques, including loop unwinding technique and path feasibility analysis. By traversing the control flow graph, it firstly generates a set of test paths for a specified loop. Then the paths are analyzed according to their test data and relationship to decide whether they can be concluded to an infinite loop pattern. A prototype tool is developed to illustrate the feasibility of this method. The experimental results on some benchmark programs show that the tool can detect the infinite loops effectively, with high accuracy of results. The tool has a high degree of automation, which can also process complex control flow and nested loops.
Pages75
Language中文
Content Type学位论文
URIhttp://ir.iscas.ac.cn/handle/311060/7516
Collection基础软件与系统重点实验室
Recommended Citation
GB/T 7714
阮辉. C程序测试数据生成与死循环检测研究[D]. 软件研究所. 中国科学院软件研究所,2009.
Files in This Item:
File Name/Size DocType Version Access License
10001_20062801502901(771KB) 开放获取--Application Full Text
Related Services
Recommend this item
Bookmark
Usage statistics
Export to Endnote
Google Scholar
Similar articles in Google Scholar
[阮辉]'s Articles
Baidu academic
Similar articles in Baidu academic
[阮辉]'s Articles
Bing Scholar
Similar articles in Bing Scholar
[阮辉]'s Articles
Terms of Use
No data!
Social Bookmark/Share
All comments (0)
No comment.
 

Items in the repository are protected by copyright, with all rights reserved, unless otherwise indicated.