Font Size: a A A

Research And Implementation Of Automatic Stub Generation Technology In Unit Test

Posted on:2013-01-14Degree:MasterType:Thesis
Country:ChinaCandidate:A ZhouFull Text:PDF
GTID:2248330371966785Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
In order to improve test efficiency and reduce software development cycle, automatic software testing has gained more and more attention. As the first step of software test, unit test focuses on the smallest module of software. Any module needs to call other modules to complete the target. Unit tests commonly apply stub generate technique when encountering callee. There are some shortcomings of traditional stub generate technique, such as resulting in low coverage, so it needs further research.With the goal of improving the automation and coverage of unit test, the author has completed the following tasks:(1) The author proposes an automatic stub generation method. The method first selects a path, and then introduces a path-sensitive and variable-related interval arithmetic technology to calculate path constraints. Finally, it uses the constraint to reduce the return interval of callee. After that, it automatic generates the stub code using the reduced interval. (2) In order to support unit regression testing, the author defines a JSON-based grammar and designs the corresponding serialization algorithm to achieve the storage of stub post-condition. In regression testing, it generates stub code according to the information stored in the database.Finally, the author has implemented the technique in UATS and applies UATS to validate plenty open source projects. The result shows that the average unit coverage is from 50% up to 81%. Especially for the function which has many equality expressions, the coverage is improved by 10 times. The experiment suggests that applying our technique to unit test improves the coverage of automatic unit test.
Keywords/Search Tags:software test, unit test, dynamic test, logic coverage, stub generate
PDF Full Text Request
Related items