高级检索

    基于编译支持错误跟踪的测试用例自动化生成方法

    Automatically Generating Error-Traceable Test Cases Based on Compiler

    • 摘要: 测试用例的自动生成是实现测试自动化的重要保障,是验证可信软件的基本方法.在分析现有测试用例自动生成方法的基础上,提出了一种基于编译的错误可跟踪的测试用例自动生成方法.该方法以编译器为依托,通过对其语法和语义进行扩展,将测试需求很好地融入到源程序中参与分析,并利用代码生成器在生成目标代码的同时根据相应的分析结果直接生成对应的测试用例.该方法将测试用例和目标代码生成统一到编译器中,避免了独立的测试用例自动生成工具在获得编译器相关分析结果时而导致的接口开销.同时,通过对源程序行号信息的跟踪,使得测试用例在无法通过测试时能够很快定位出错位置,以方便程序开发者修改.最后,通过一个示例程序说明了该方法的具体实现过程,证明了该方法的有效性.

       

      Abstract: Automatic test case generation is an important guarantee to achieve automated testing and to verify the trustness of software. After analyzing the existing methods of automatic test case generation, we propose a compiler-based error-traceable method to generate the test cases automatically. This method relies on the compiler and inserts the test requirements into the source codes properly by expanding the existing syntax and semantics of the source codes. Therefore, when the code generator generates the object codes, it can generate simultaneously the test cases according to the results of the testing requirement analysis. This method unifies the test case generation and the object code generation and brings them in the compiler. By doing this, we can avoid the overhead of information transferring interface commonly included in the situation, in which we develop a single automatic test cases generator that uses the information of another compilers analysis. At the same time, when the test case cannot pass, it is very convenient for the programmer to correct the errors of their codes because the error positions can be found quickly by the error tracking information of the source codes. Finally, a sample program illustrates the concrete process of this method and proves that the method is effective.

       

    /

    返回文章
    返回