Every time somebody reports me a bug I create unit test exposing it, fix it and keep the bar green. Usually. However sometimes there's a time pressure. What then?
Then I make the quickfix, test it manually, commit it and create test stub prefixed with the TOCOVER string. For example:
class TOCOVER_ShouldAssignUserToDocument { @Test void shouldAssignUserToDocument() { fail("http://foocompany.com/jira/ABC-123") } }
Prefix makes Maven's Surefire plugin to ignore the test till I implement it (I use Should*.class pattern for test classes).
I'm addicted to my test coverage stats so whenever I can I find all files matching TOCOVER.*groovy (I write tests in Groovy) pattern and complete the missing test for regression purposes (and higher coverage stats).
How above @Ignore annotation to ignore testcases?
ReplyDeleteActually I need my TODO tests to start with the given prefix in order to easy find them using the IDE (ctrl+shift+n in Idea or ctrl+shift+r in Eclipse).
ReplyDelete