Home > Software Quality Tips > Software Testing > The effectiveness of code coverage tools in software testing
Software Quality Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

SOFTWARE TESTING

The effectiveness of code coverage tools in software testing


vemula srinivasa rao
03.20.2008
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Coverage tools when run with the application under test will tell you how much code is covered by the executed test cases. These tools will perform runtime analysis and provide different statistics about the line coverage, branch coverage, statement coverage, etc. with the given set of tests executed.

How do they work?

Instrumentation
The coverage tools will first instrument the application under test dlls and exes. Instrumentation is a process of inserting additional code in to the compiled program for the purpose of collecting measurement data while the program is running.

Running the use cases (test cases) on the application
Once the instrumentation process is over, the coverage tool will bring up the application under test. The next step is to execute all the different use cases on the application under test. These use cases can be either automated or manual. While the user runs different use cases on the application, in the background the coverage tool will analyze the coverage of the application code w.r.t of the use cases we ran.

Getting the statistics
Once the above step is over, the application needs to be closed. Then the coverage tool will populate the different statistics as a result of executing the give tests on the application.

Coverage tools can give different views of the coverage for analysis. They can provide both high-level coverage information and detailed line-by-line coverage information. They also provide information for single runs and for multiple runs. If the use cases are run multiple times, tools can be used to merge the different runs and get the consolidated output coverage.

Where to use coverage tools?
The coverage tools can instrument a


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Software Testing
10 steps to acing Web app security assessments
Three software regression testing steps can perfect defect fixes
Exploring mobile layout testing, emulators and goals
Preparing for testing applications in the cloud
Hack maliciously to boost your software's security
Testing functionality, performance of mobile Web applications
Testing mobile Web applications for usability and context
Using SBTM for exploratory testing coverage problems
Web 2.0, RIAs push load testing to the max
Using session-based test management for exploratory testing

Software security testing tools
Spotting rich Internet application security flaws with WebGoat
Adobe ColdFusion websites being compromised
Attack code targets Microsoft ActiveX zero-day flaw
Commonly-overlooked security flaws in rich Internet applications
10 steps to acing Web app security assessments
New tools target software QA, testing: Spring roundup
Hack maliciously to boost your software's security
What is fuzz testing? What are some ways to use fuzz testing?
Why the quality assurance department should be involved in testing
Using the Firefox Web Developer extension to find security flaws

Software testing and quality assurance (QA) fundamentals
Spotting rich Internet application security flaws with WebGoat
Adobe ColdFusion websites being compromised
Configuration testing: QA pros discuss 10 things you may not know
Five roles test managers play in agile development: Tutorial, part one
Three software regression testing steps can perfect defect fixes
Software Testing: Assessing risk and scope
Software Testing: How to know you're ready to start testing
Quality assurance (QA) and testing's role in requirements
Test case preparation for a Web-based application
The difference between functional testing and regression testing

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
penetration testing  (SearchSoftwareQuality.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


nd give the statistics for .NET, Java, Visual C/C++ and Visual Basic applications.

Why use coverage tools?
The advantages of using the coverage tools in the project include the following:

What should be the coverage target?
Ideally the entire code base should be covered with one or more use cases, i.e. one should achieve 100% code coverage. But due to some exceptional input conditions that can not be simulated, the entire code base cannot be reached.

However, 100% code coverage does not mean that all the code is 100% correct. Coverage only gives an indication that there is no existing code that is not exercised, but there could always be a situation where some functionality is missed out while implementation. So, we can keep reasonable target of greater than 80% function coverage and 100% line coverage. Our practical experience as shown below also illustrates that these coverage targets are acceptable.

Practical example

We have used the coverage tool from Rational, named Rational-Pure Coverage, as part of testing many of the MR applications. The below figure shows the coverage report for the Control Parameter Editor module developed as part of the SCSD project.

The achieved coverage for the CPE module when all the use cases are executed is as follows:

With the above achieved coverage targets, we concluded that maximum methods that can be reached with the possible inputs are reached. And with 100% function coverage, we concluded that all the code is covered, i.e. the test cases are complete w.r.t the code base. As indicated earlier, this coverage output shows only that there is no dead code and no required test cases are missing to cover the existing code.


Rate this Tip
To rate tips, you must be a member of SearchSoftwareQuality.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Software Design & Testing - Project Management
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2006 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts