freedombox/Plinth — pull request #26 by BobGirard (2014-11-18 20:29:12+00:00)
Title: Test coverage measurement and reporting

This change adds test coverage measurement and reporting to the Plinth package. This functionality will quantify the testing effort and provide precise indications of where testing is sufficient and where it's still lacking.

From the documentation added to the HACKING file:
"Invoking this [the 'python3 setup.py test_coverage'] command generates a binary-format '.coverage' data file in the top-level project directory which is recreated with each run, and writes a set of HTML and other
supporting files which comprise the browsable coverage report to the 'plinth/tests/coverage/report' directory. Index.html presents the coverage summary, broken down by module. Data columns can be sorted by clicking on the column header or by using mnemonic hot-keys specified in the keyboard
widget in the upper-right corner of the page. Clicking on the name of a particular source file opens a page that displays the contents of that file, with color-coding in the left margin to indicate which statements or branches were executed via the tests (green) and which statements or branches were not executed (red)."

If desired, a possible follow-on enhancement would be to merge the test coverage functionality in with the built-in 'test' command, so that the tests and coverage measurement are automatically executed one after the other, as a single process.