Hey,
I'd like to reiterate over the importance of using @covers tags [0] for test cases rather then writing "Test for SomeClass". These tags make coverage reporting a lot more accurate, and thus make it easier to spot areas lacking tests.
Today I added a bunch of @covers tags in the DataModel component. The reported coverage dropped from 85% to 57%, quite a difference.
[0] http://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.a...
Cheers
-- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. ~=[,,_,,]:3 --
On Thu, Aug 22, 2013 at 3:03 PM, Jeroen De Dauw jeroendedauw@gmail.comwrote:
Hey,
I'd like to reiterate over the importance of using @covers tags [0] for test cases rather then writing "Test for SomeClass". These tags make coverage reporting a lot more accurate, and thus make it easier to spot areas lacking tests.
Today I added a bunch of @covers tags in the DataModel component. The reported coverage dropped from 85% to 57%, quite a difference.
[0] http://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.a...
Surely the test infrastructure can tell what code paths are executed without a human annotating them (and to a much finer granularity than class or method since most methods have conditional flow of control).
Tom
Using @covers could be a simple way to ensure that you do not forget to unit test parts of your classes. Even if you had integration tests that cover all code paths, you still want unit tests to cover whole classes since integration tests can change due to different circumstances. So perhaps just use @covers for unit tests.
2013/8/23 Tom Morris tfmorris@gmail.com
On Thu, Aug 22, 2013 at 3:03 PM, Jeroen De Dauw jeroendedauw@gmail.comwrote:
Hey,
I'd like to reiterate over the importance of using @covers tags [0] for test cases rather then writing "Test for SomeClass". These tags make coverage reporting a lot more accurate, and thus make it easier to spot areas lacking tests.
Today I added a bunch of @covers tags in the DataModel component. The reported coverage dropped from 85% to 57%, quite a difference.
[0] http://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.a...
Surely the test infrastructure can tell what code paths are executed without a human annotating them (and to a much finer granularity than class or method since most methods have conditional flow of control).
Tom
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
wikidata-tech@lists.wikimedia.org