基于内存建模的字符串处理程序测试数据自动生成

Feiyu Li, Yunzhan Gong
{"title":"基于内存建模的字符串处理程序测试数据自动生成","authors":"Feiyu Li, Yunzhan Gong","doi":"10.1109/APSEC.2012.75","DOIUrl":null,"url":null,"abstract":"String is a fundamental data type in C programming language, and is accessed through character pointer. Programs that manipulate string variables often use a set of string library functions. When generating test data for a path in a function with string parameters, the string length and each character element of the string must be determined. In this paper, we present an automatic string test data generation method based on memory modeling. We introduce a string abstract memory model, which is used to assist symbolic execution of the tested path. The operation of character pointer pointing to string and the string library functions can be simulated accurately through the operation on the abstract memory model. After symbolic execution of the tested path, we can get path constraints on argument strings in the abstract memory model. The string constraints contain two parts: the constraints on string length and special constrained character's location, and the constraints on each character element of string. We adopt a two-step constraint solving method to solve these constraints to generate the string test data. Experiments on functions from oSIP library and other benchmarks show that our method is feasible.","PeriodicalId":364411,"journal":{"name":"2012 19th Asia-Pacific Software Engineering Conference","volume":"49 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2012-12-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Memory Modeling-Based Automatic Test Data Generation for String-Manipulating Programs\",\"authors\":\"Feiyu Li, Yunzhan Gong\",\"doi\":\"10.1109/APSEC.2012.75\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"String is a fundamental data type in C programming language, and is accessed through character pointer. Programs that manipulate string variables often use a set of string library functions. When generating test data for a path in a function with string parameters, the string length and each character element of the string must be determined. In this paper, we present an automatic string test data generation method based on memory modeling. We introduce a string abstract memory model, which is used to assist symbolic execution of the tested path. The operation of character pointer pointing to string and the string library functions can be simulated accurately through the operation on the abstract memory model. After symbolic execution of the tested path, we can get path constraints on argument strings in the abstract memory model. The string constraints contain two parts: the constraints on string length and special constrained character's location, and the constraints on each character element of string. We adopt a two-step constraint solving method to solve these constraints to generate the string test data. Experiments on functions from oSIP library and other benchmarks show that our method is feasible.\",\"PeriodicalId\":364411,\"journal\":{\"name\":\"2012 19th Asia-Pacific Software Engineering Conference\",\"volume\":\"49 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2012-12-04\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2012 19th Asia-Pacific Software Engineering Conference\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/APSEC.2012.75\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2012 19th Asia-Pacific Software Engineering Conference","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/APSEC.2012.75","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

字符串是C语言的基本数据类型,通过字符指针进行访问。操作字符串变量的程序通常使用一组字符串库函数。在为带有字符串参数的函数中的路径生成测试数据时,必须确定字符串长度和字符串的每个字符元素。本文提出了一种基于内存建模的字符串测试数据自动生成方法。我们引入了一个字符串抽象内存模型,用于辅助测试路径的符号执行。通过对抽象内存模型的操作,可以准确地模拟字符指针指向字符串的操作和字符串库函数。在测试路径的符号执行之后,我们可以在抽象内存模型中获得参数字符串的路径约束。字符串约束包括两个部分:对字符串长度和特殊约束字符位置的约束,以及对字符串中每个字符元素的约束。我们采用两步约束求解方法来求解这些约束以生成字符串测试数据。在oSIP库和其他基准测试函数上的实验表明,我们的方法是可行的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Memory Modeling-Based Automatic Test Data Generation for String-Manipulating Programs
String is a fundamental data type in C programming language, and is accessed through character pointer. Programs that manipulate string variables often use a set of string library functions. When generating test data for a path in a function with string parameters, the string length and each character element of the string must be determined. In this paper, we present an automatic string test data generation method based on memory modeling. We introduce a string abstract memory model, which is used to assist symbolic execution of the tested path. The operation of character pointer pointing to string and the string library functions can be simulated accurately through the operation on the abstract memory model. After symbolic execution of the tested path, we can get path constraints on argument strings in the abstract memory model. The string constraints contain two parts: the constraints on string length and special constrained character's location, and the constraints on each character element of string. We adopt a two-step constraint solving method to solve these constraints to generate the string test data. Experiments on functions from oSIP library and other benchmarks show that our method is feasible.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信