Pushing towards 90% doctest coverage for Sage 5.0
This is an edited version of my post to sage-devel. One of the main goals of the upcoming Sage 5.0 release is to get doctest coverage of the Sage library up to at least 90%. As of Sage 4.4.4.alpha0, the overall weighted coverage is 82.7%. To get a sense of which modules in the Sage library need work on their coverage scores, you could use the coverage script as follows:
$ ./sage -coverage /path/to/module.py[x]
Or you could do the following to get the coverage scores of all modules, including a coverage summary:
$ ./sage -coverageall
You might be interested in knowing which modules have a certain coverage percentage, in which case you could save the output of -coverageall to a text file and then grep that file for certain coverage scores. At this repository is a script to generate various types of coverage analysis reports. You can also find the script here. The script currently supports the following reports
- The coverage summary of all modules.
- Modules with 100% coverage.
- Modules with zero coverage.
- Modules with between 1% and 9% coverage.
- Modules with between 10% and 19% coverage.
- Modules with between 20% and 29% coverage.
- Modules with between 30% and 39% coverage.
- Modules with between 40% and 49% coverage.
- Modules with between 50% and 59% coverage.
- Modules with between 60% and 69% coverage.
- Modules with between 70% and 79% coverage.
- Modules with between 80% and 89% coverage.
- Modules with between 90% and 99% coverage.
Each report has links to detailed reports for individual modules. To run the script, copy it to the SAGE_ROOT of a Sage source or binary installation and do
[mvngu@sage sage-4.4.4.alpha0]$ ./coverage-status.py Coverage report of all modules... Summary of doctest coverage... Modules with 0% coverage... Modules with 100% coverage... Coverage reports within certain ranges... Detailed coverage report for all modules... Format the detailed coverage reports... Format the summary reports... Generate index.html...
And you’re done. Here is a report generated by the script. The idea is to provide an overview of which modules need work. I’d be interested to know what other types of doctest coverage reports people would like to see. Comments, suggestions, critiques, etc. are welcome.