针对C单元的测试用例自动生成的研究,提出在基于OCAML(object CAML)的CIL(Cintermediate language)工具包上的类型系统构建方法。通过工具前端对单元中代码的类型插桩,对基本数据类型以及每个全局对象、自定义对象进行类型统计,实现自动检测C单元中对象类型,在工具后端根据这些对象类型和其内存布局将当前的测试用例可视化。结合具体的CIL开源工具,为解决这类测试用例可视化的问题提供一个解决方案。
Aiming at the study of automatic test data generation on C units, a method is proposed on how to construct type system based on CIL toolkit in object CAML. The front-end of tool instruments type of C units, and add up the primitive data type, each global object and object user-defined. Automatic detection of object type in C units is implemented. Finally, the back-end of tool prints the runtime test case based on the object type and memory layout. The tool supports a solution for the problem of test case visualization to combine open source tool CIL.