CORC  > 软件研究所  > 计算机科学国家重点实验室  > 学位论文
题名C程序测试数据生成与死循环检测研究
作者阮辉
学位类别博士
答辩日期2009-06-05
授予单位中国科学院软件研究所
授予地点软件研究所
关键词自动软件测试 程序分析 测试数据生成 死循环
其他题名Test Data Generation and Deadloop Detection for C Programs
中文摘要软件测试是保证软件质量的重要手段. 随着软件技术的发展, 软件的规模越来越大, 程序的复杂度也逐渐增加. 软件测试也由原来的人工操作逐渐走向自动化. 自动化软件测试已经成为国内外软件工程研究的热点之一. 本文研究了自动软件测试中的两个问题, 它们分别属于自动测试数据生成和错误查找两方面. 主要贡献如下: 本文提出了一种对含有字符串和字符串函数调用的C语言程序自动生成测试数据的方法. 具体做法是将C语言程序中的字符变量看成是取值范围在0~255之间的整数, 并使用字符数组来表示字符串, 同时将字符串函数建模成一阶逻辑公式和赋值语句. 通过使用前置条件和后置条件来描述函数调用语句, 将程序中的字符串函数调用语句替换成逻辑公式和赋值语句, 之后使用路径分析技术自动生成程序的测试数据. 此外, 本文还实现了一个自动化工具, 能够为真实的C程序自动生成测试数据. 另一方面, 本文还提出了一种自动检查程序中是否含有死循环的方法. 该方法基于静态代码分析, 结合了循环展开和路径可行性分析技术. 具体做法是首先通过遍历控制流图生成待查循环的检验路径, 之后通过分析检验路径的可行性以及路径之间的联系, 判断这些路径是否符合死循环模式. 在此基础上, 本文实现了原型工具, 并对一组基准程序进行测试. 实验结果表明, 工具能高效地检测出C语言程序中的死循环, 准确率较高. 工具的自动化程度较高, 能处理复杂的控制流以及嵌套的循环.
英文摘要Software 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.
语种中文
公开日期2011-03-17
页码75
内容类型学位论文
源URL[http://124.16.136.157/handle/311060/7516]  
专题软件研究所_计算机科学国家重点实验室 _学位论文
推荐引用方式
GB/T 7714
阮辉. C程序测试数据生成与死循环检测研究[D]. 软件研究所. 中国科学院软件研究所. 2009.
个性服务
查看访问统计
相关权益政策
暂无数据
收藏/分享
所有评论 (0)
暂无评论
 

除非特别说明,本系统中所有内容都受版权保护,并保留所有权利。


©版权所有 ©2017 CSpace - Powered by CSpace