Font Size: a A A

Research And Design Of C/C++ Automatic Unit Coverage Testing Framework

Posted on:2012-02-11Degree:MasterType:Thesis
Country:ChinaCandidate:H J SunFull Text:PDF
GTID:2178330335460407Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
With advancement of information technology, usage of software is becoming increasingly extensive, and software itself is more and more complex. How to ensure software quality has been a hot research field of computer technology. Unit testing is an important part of software quality assurance. Testability of software and automatic software test are the key issues to the implementation of unit testing.This paper mainly studies the testability of software and how to establish a framework for automated unit testing coverage for C/C++. This paper presents a unit testing framework that automatically analyzes code; generates abstract syntax tree,control flow graph,symbol table,function call graph,test cases,test stub and test driver; monitors the execution of test cases; detects dead loop and exception, and reports test results to user.Based on the abstract interpretation theory, this paper proposes a way of generating stubs by using function summary and path interval reduction. Through analyzing the feedback message of instrumentation, unit automatic testing system calculates coverage rate; selects a new target cover element; finds a path to cover this selected target cover element, generates a test case for this path, executes test case and loops this until no more new target cover element.10 open-source C/C++ projects are selected to evaluate the performance of the framework. The results show that UATS can automatically create test environment; through the comparison results of different way of generating stubs, we can see that using function summary and interval reduction to generate stubs can increase coverage rate in a certain extent and can also solve the problem of testability.
Keywords/Search Tags:unit test, coverage test, instrumentation, function Summary, stub
PDF Full Text Request
Related items