Browse Prior Art Database

Method of Calculating Unit Test Coverage for Changed Code Disclosure Number: IPCOM000238000D
Publication Date: 2014-Jul-25
Document File: 3 page(s) / 72K

Publishing Venue

The Prior Art Database


This disclosure presents a method about how to calculate Unit Test coverage for changed code.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 57% of the total text.

Page 01 of 3

Method of Calculating Unit Test Coverage for Changed Code

Problem statement and background

It's common for a software product to change source code regardless a bug fix or feature enhancement. So code coverage becomes critical to ensure the quality of code changes.

It's quite challenging for existing code coverage tools to accurately get the coverage of code changes only. So this disclosure introduces a brand new method which laser focuses the accurate coverage for code changes.

Core Ideas and Claims

This disclosure describes an approach or method on how to get the Unit Test code coverage of code changes . Regarding the execution results of existing coverage tool, the pure coverage of code changes can be calculated only through the following formula:

Detailed Description

The detailed method process illustrated as below:
1. Get changed code line number information
Firstly, generate a file name list based on the changed files.

Then use text compare tool to compare the new-old code files directory.

-r new old > diff.txt

diff.txt will contain the line changed method to show the difference between the new code and the old code . For example:

-r c:\new\test\test1.cpp c:\old\test\test1.cpp 33,34d32







Page 02 of 3

... 100,114c95,96

2.Retrieve UT coverage data of the system with changed code

Test coverage data is generated by using coverage tool. The coverage data can identify the code execut...