Test coverage

Test coverage image
What is test coverage?

Test coverage quantifies how thoroughly you've tested your software. It measures what percentage of your code executes during tests and how many requirements you've verified. While high coverage doesn't guarantee quality, it helps identify testing gaps. 


Do you have any examples of test coverage? 

Let's look at a login feature as an example. Coverage metrics might show that your tests: 
  • Verify successful login with valid credentials 
  • Check password validation rules 
  • Test the "forgot password" flow 
  • Validate error messages for incorrect inputs 
  • Exercise session timeout handling 

Together, these test cases achieve 90% coverage of the login module's code, though some edge cases remain untested. 

Why is test coverage important? 

Test coverage reveals blind spots where bugs could hide and gives you data to discuss testing progress with stakeholders. Higher coverage typically means lower risk, as you've verified more of your system's behavior. When coverage drops after code changes, you know you need additional tests. 


What are the challenges with test coverage?

Coverage metrics can be misleading. High percentages might hide shallow tests that don't validate behavior effectively. Complex features like concurrent operations are difficult to cover completely. Focus on balancing coverage goals with test quality, prioritizing critical business logic over perfect coverage. 

Remember that some code paths matter more than others—comprehensive testing of your core features beats 100% coverage of simple utility functions. 
The membership for software testing professionals image
Join thousands of other software testers in levelling up their careers
Explore MoT
Software Testing Live image
Software Testing Live: Episode 03
MoT Foundation Certificate in Test Automation
Unlock the essential skills to transition into Test Automation through interactive, community-driven learning, backed by industry expertise
This Week in Testing
Debrief the week in Testing via a community radio show hosted by Simon Tomes and members of the community
Subscribe to our newsletter
We'll keep you up to date on all the testing trends.