中国科学院软件研究所机构知识库
Advanced  
ISCAS OpenIR  > 计算机科学国家重点实验室  > 学位论文
题名:
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.
语种: 中文
内容类型: 学位论文
URI标识: http://ir.iscas.ac.cn/handle/311060/7516
Appears in Collections:计算机科学国家重点实验室 _学位论文

Files in This Item:
File Name/ File Size Content Type Version Access License
10001_200628015029019阮辉_paper.pdf(771KB)----限制开放-- 联系获取全文

Recommended Citation:
阮辉. C程序测试数据生成与死循环检测研究[D]. 软件研究所. 中国科学院软件研究所. 2009-06-05.
Service
Recommend this item
Sava as my favorate item
Show this item's statistics
Export Endnote File
Google Scholar
Similar articles in Google Scholar
[阮辉]'s Articles
CSDL cross search
Similar articles in CSDL Cross Search
[阮辉]‘s Articles
Related Copyright Policies
Null
Social Bookmarking
Add to CiteULike Add to Connotea Add to Del.icio.us Add to Digg Add to Reddit
所有评论 (0)
暂无评论
 
评注功能仅针对注册用户开放,请您登录
您对该条目有什么异议,请填写以下表单,管理员会尽快联系您。
内 容:
Email:  *
单位:
验证码:   刷新
您在IR的使用过程中有什么好的想法或者建议可以反馈给我们。
标 题:
 *
内 容:
Email:  *
验证码:   刷新

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

 

 

Valid XHTML 1.0!
Copyright © 2007-2017  中国科学院软件研究所 - Feedback
Powered by CSpace