Memory Modeling-Based Automatic Test Data Generation for String-Manipulating Programs

Feiyu Li,Yunzhan Gong
DOI: https://doi.org/10.1109/apsec.2012.75
2012-01-01
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.
What problem does this paper attempt to address?