Life of Increasing Code Coverage

The goal of this doc is to provide guidance on how to write better tests using code coverage information rather than increase code coverage itself.

  1. Pay attention to untested code in both the coverage dashboard and code coverage in Gerrit during code review.

  2. Is this dead code? If yes, draft a CL (example) to remove it, otherwise, please go to step 3.

  3. Think about why the code is not covered by any test. Is it because it's too complicated to be testable? If yes, draft a CL to refactor the code and add tests (example), otherwise, please go to step 4.

  4. If the code is testable, but a test was forgotten, draft a CL to add tests for it (example).

Anytime you upload a CL to refactor or add tests, you can use code coverage in Gerrit to help you verify the previously untested code is now tested by your CL.

Please refer to code_coverage.md for how code coverage works in Chromium in general.

Contacts

For any breakage report and feature requests, please file a bug.

For questions and general discussions, please join code-coverage group.