Font Size: a A A

A Method Of Modeling For Input/Output And Constraint Extraction In The Automatic Testing System

Posted on:2016-01-27Degree:MasterType:Thesis
Country:ChinaCandidate:Y W YangFull Text:PDF
GTID:2298330467492589Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
Unit testing is the first stage in the software testing. Sufficient and effective unit testing can find as many software failures as possible, reduce development costs and improve software quality. Code Testing System is a software testing system implemented by the Java language, realizes the automation of the unit testing. The main purpose is running statement coverage test, branch coverage test and MC/DC test for C programs.Library functions and system calls have been a major difficulty faced by automatic test. Testers have to interact with the test procedures if the test program contains such functions, resulting in inefficient of automatic test. Self-adaptive stub generation algorithm is used for ordinary functions in the CTS. Input/Output (I/O) functions are a class of common library functions. Unlike normal function, the association between I/O functions and operating on a specific I/O device makes ordinary stub method disabled. To solve this problem, this paper proposes one solution by I/O device modeling and I/O function modeling. The main work is as follows:(1Constructing models for the I/O device and the I/O functions, and constructing operations for the semantics of the I/O functions equivalence to the operations on the I/O device models. Modeling the I/O device, the states and properties of a specific I/O device are represented by the models, including the console, file, and socket. Modeling the I/O functions, the semantics of the I/O function are stored in the I/O function models, and the operations of I/O functions are equivalent to the I/O device models. The final states and properties of the I/O device are represented by the models.(2)This paper proposes a constraint extraction algorithm for the constraint condition of the I/O device models and the I/O function models. The algorithm takes the source code, the abstract syntax tree, the control flow graph as input. Modifying and storing the attributes and the states of the I/O device models by analyzing the control flow graph for each node, the constraint conditions in the I/O device models is also stored. Finally the algorithm generates the stub functions by the constraint conditions.Experimental results show that the proposed method can effectively enhance the coverage of the program which contains I/O functions, and improve the efficiency of automatic testing. The analysis of an example shows that this method can automatically generate the stub functions which satisfy the constraints of the path for the I/O functions in the path.
Keywords/Search Tags:unit testing, automatic testing, I/O modelingstub generation
PDF Full Text Request
Related items