56969Re: [scrumdevelopment] Convince the team of writing unit tests even if you have got integration tests
- Jun 24, 2013Hi Martin,On Jun 21, 2013, at 2:53 AM, m.schneider@... wrote:
I'm working with a new team and try to convince the team members that it
is important to write unit tests and have got covered at least methods
which consist of logic. Also it is important (for me) to write unit
tests for existing code if you touch it and it is not covered yet.
Unfortunately some of the team members tell me that they do not want to
write unit tests because we have got integration tests and those will
test the correctness of the code and with that make unit tests
What can I tell those guys why it is important to write unit tests even
if you have got integration tests?
Let's recap. If …
- First of all, I note that logic rarely convinces people. That said ...
- I assume that your defect list is quite short. (One or two known defects.) Otherwise, your team might want to have more and better tests.
- Of course you have coverage measurements and your integration tests cover essentially 100% of the system.
- I assume that your integration tests take only a few minutes to run, can be run any time anyone wants, and that they always report zero errors, so that in the rare event someone DOES make a mistake, they can find out in seconds that they've done something wrong? If they take a long time to run, or are already reporting lots of errors, your team might want to have more and better tests.
- I suppose that when an integration test fails, it is immediately clear which individual's (or pair's) code has failed, and where in the code base the error is. If the existing tests don't say exactly where the error is, your team might want to have more and better tests.
… then you don't need any more testing.
- Your product has only a few known defects;
- Your integration test coverage is approximately 100%;
- Your tests take just a few minutes to run;
- Your tests can be triggered by any programmer at any time;
- Your tests immediately identify what part of the code has failed.
- << Previous post in topic Next post in topic >>