From the course: Agile Software Development: Code Quality

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

What is code coverage?

What is code coverage? - SonarQube Tutorial

From the course: Agile Software Development: Code Quality

Start my 1-month free trial

What is code coverage?

- [Instructor] Code coverage measures how much of your code base is executed when your test suite runs. It's typically measured as a percentage. Don't worry about the actual value the program spits out. In fact, it's best if your team pays attention to how the code coverage value changes over time. As your code base grows, your code coverage value will decrease unless you are running tests to cover the code that runs in production. If it stays the same or starts going up, your team is being really consistent with running tests. So what's a good value target? Many teams strive for 100% code coverage. I find this to be unrealistic for most software systems. Instead, I find that teams should be really proud if they are able to attain and sustain about 85% coverage. A detail which makes this discussion difficult is that test means different things to different teams. When some teams say test, they're referring to a unit test, which just executes a small part of the system, often just a…

Contents