Code coverage is one (not the only) metric you can use to measure the effectiveness of your test cases. Usually, you’ll use it to find holes in your test model or test coverage. For example, if you run your full suite of tests for an API, and then code coverage shows you that you only touched 50% of the code making up the API, you know you need to go back and add more test cases.
- Perform code coverage analysis on your API tests before you mark a deliverable as “done”.
- After completing your API tests, run coverage analysis at least once per milestone to make sure any changes to the public APIs are still being covered properly