Top 5 Ways to Measure Test Coverage

I am working on a backup software lately which works on different platforms. Testing involves different Hypervisors, Oss, Storage types and hardware. Looking at this scope I always wonder, how do I measure the test coverage?

It is a challenge for testers like us to measure a test coverage on different aspects. Test coverage ideally measures the amount of testing performed by a set of tests. It will include gathering information about which parts of a program are actually executed when running the test suite in order to determine which branches of conditional statements have been taken.

In simple terms, it is a technique to ensure that your tests are actually testing your entire code or how much of your code you exercised by running these test. Let’s discuss different ways to evaluate test coverage.

Importance of Test coverage?

  • Finding area of a requirement not implemented by a set of test cases
  • Helps to create additional test cases to increase coverage
  • Identifying meaningless test cases that do not increase coverage

What are the Benefits of Test coverage?

  • It can assure the quality of test
  • It can help identify what portions of the code were actually tested for the release or fix
  • It can help to determine the paths in your application that were not tested
  • Prevent defect leakage
  • To keep Time, Scope and Cost under control
  • Early Defect prevention.

I propose some practical ways to measure Test coverage

1) Test coverage by feature

A Software feature are the changes made in the system to add new functionality or modify the existing functionality.

We design a new test set for testing that new feature. The extremely important and generally used new features ought to be tested thoroughly in each build of that release and also regression testing should be done relevant to impacted areas.

2) Test coverage by GUI icon

This covers different GUI elements from screens under test. The user interface has a number of screens, buttons, labels, drop-downs, tabs, menus, etc. We make sure we have them all listed and have tests which execute every one.

GUI testing will focus on application’s user interface and to verify if it is functionally correct. GUI testing involves executing set of tests and comparing the result with the expected output. It also repeats same set of tests multiple times with different data set and same level of accuracy. GUI Testing covers different keyboard and mouse events, how different GUI components like menu bars, toolbars, dialogs, buttons, text box, radio, list controls, images etc. react to user input and ensure it works in the desired manner. GUI testing early in the software development cycle speeds up development, improves quality and reduces risks. GUI Testing can be performed both manually or could be performed with automation suite.

3) Test coverage by instrumentation

Traditionally code coverage measurement tools have been built using static code instrumentation. During program compilation or linking, these tools insert instrumentation code into the binary executable file. Instrumentation helps counters to record which statements are executed. The code inserted into the executable remains in the executable throughout the execution.

4) Test coverage by structure

Structural testing is a ‘white box’ or ‘glass box’ testing because in structural testing we are interested in what is happening ‘inside the system/application. Testers are required to know the internal implementations of the code. Here the testers need to know how the software is implemented, how it works. It establishes traceability between the test cases and code structure.

Structural coverage analysis identifies the code that is implemented without being linked to requirements. Such code could result in unintended functions.

5) Test coverage by use case

Use case testing technique covers an application on transaction by transaction basis. Use case covers a user interaction with the system for different tasks. It is a sequence of steps describing user and system interaction. Traceability metrics from test case to use case will help us identify the test coverage.

Leave a Reply