Hi All,
Decided to try have a play with a code coverage tool today, and pointed it at parser.php whilst parserTests.php was being run.
The purpose of doing this is try and see if the code coverage of the parserTests are good - and they are, at around 83% coverage - and also to try and indicate if there are any areas that might potentially benefit from a few more tests.
You can see the code coverage results online at: http://files.nickj.org/MediaWiki/coverage/Parser.php.html and http://files.nickj.org/MediaWiki/coverage/Sanitizer.php.html (red = not executed, blue = executed, grey = thinks it is not executable).
If you would like to reproduce these results, I've written up a quick step-by-step how-to guide indicating what you need to do at: http://nickj.org/MediaWiki_code_coverage_howto
All the best, Nick.
Nick Jenkins wrote:
Decided to try have a play with a code coverage tool today, and pointed it at parser.php whilst parserTests.php was being run.
The purpose of doing this is try and see if the code coverage of the parserTests are good - and they are, at around 83% coverage - and also to try and indicate if there are any areas that might potentially benefit from a few more tests.
Awesome!
-- brion vibber (brion @ pobox.com)
I've had a go at increasing the code coverage of the current ParserTests.
The starting coverage was 82.62%. I've managed to increase by a bit over 4%, to 86.69%, with 17 new tests. I've heard people remark before that as your coverage gets closer to 100%, increasing it gets exponentially harder, and having tried it, I'm now inclined to agree. ;-) Of course, if anyone can improve on this coverage, then please do so. Enabling some options such as using tidy & raw mode HTML for some tests would get the percentage up, but I was just looking at ways of increasing it without changing the configuration.
In the process of adding this I found one minor issue with E_ALL enabled (logged as bug 6560).
The parserTests diff for these tests is located at: http://files.nickj.org/MediaWiki/coverage/parsertests-code-coverage.txt ; Could some kind soul please check it in?
I'm also not 100% sure of correctness of the "!! result" sections - I made a best effort attempt at what I think the results should be, but please feel free to alter the results as you see fit.
All the best, Nick.
Nick Jenkins wrote:
Decided to try have a play with a code coverage tool today, and pointed it at parser.php whilst parserTests.php was being run.
The purpose of doing this is try and see if the code coverage of the parserTests are good - and they are, at around 83% coverage - and also to try and indicate if there are any areas that might potentially benefit from a few more tests.
Awesome!
-- brion vibber (brion @ pobox.com)
wikitech-l@lists.wikimedia.org