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 <[email protected]>

> On Thu, Aug 22, 2013 at 3:03 PM, Jeroen De Dauw <[email protected]>wrote:
>
>> 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.annotations.covers
>>
>
> 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
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
>

-- 
Daniel Werner
Software Engineer

Wikimedia Deutschland e.V. | Obentrautstr. 72 | 10963 Berlin
Tel. (030) 219 158 26-0

http://wikimedia.de

Wikimedia Deutschland - Gesellschaft zur Förderung Freien Wissens e.V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für
Körperschaften I Berlin, Steuernummer 27/681/51985.
_______________________________________________
Wikidata-tech mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech

Reply via email to