{"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}
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.