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.
-
Pay attention to untested code in both the coverage dashboard and code coverage in Gerrit during code review.
-
Is this dead code? If yes, draft a CL (example) to remove it, otherwise, please go to step 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.
-
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.
For any breakage report and feature requests, please file a bug.
For questions and general discussions, please join code-coverage group.