This is an interim report of a survey of TDD - experience and current usage. The survey asks only 3 questions.
- When you started to do TDD?
- How often do you use TDD now?
- Please tell us your reason about the answer for question 2.
Here is the summary from about 90 responses.
Next chart shows an analysis across experience and current usage.
Orange part (seldom / occasionally) increase beyond 1 year (18%→24%→26%) as experience extends.
We picked up a few reasons from responses. (Translation from Japanese by the author.)
- regularly but not much as before
- changed how to use TDD. e.g. I write code non-TDD and when in doubt I try TDD.
- I have to use many new languages and cost to examine each language's unit testing increased.
- At first I used TDD as a method to learn and earn excellent skills. Currently I know pros and cons of TDD and only use TDD when it's good.
- Doing TDD to the letters exhausts me. I gain maximum value with minimum effort.
- seldom / occasionally
- Same as "TDD is Dead" dictates. I write unit tests only for complicated models. Others are covered with end-to-end tests. For newbies I ask them to learn TDD as a basic skill.
- I learned good designs TDD produces. Now I can do good design without TDD.
- I write integration tests.
- Doing everything TDD takes too much time to be on schedule.
- Longevity of software has been shortened. No much gains in writing tests for code which rarely changes. I do TDD but not for everything.
- I do TDD when it works and don't when not.
- no usage now
- Because I start implementation before deciding what I/O the class will have. I don't use xUnit until I/O are fixed.
- Test-first costs too much because there are many spec changes after starting implementation.
- Writing mocks are too cumbersome. It's impossible to foretell which methods in which module is called in what order.
- People write code that just pass tests. Many bug ensues. So I stopped using TDD.
We categorized the reason for responses with more than 2 years experience AND less than "regularly" used (= regularly but not much, seldom / occasionally, none.)
|reason||2-5 years||> 5 years||total|
|environment||6 (75%)||2 (25%)||8 (100%)|
|only when effective||4 (40%)||6 (60%)||10 (100%)|
|discarded||1 (50%)||1 (50%)||2 (100%)|
|unknown||6 (100%)||0 (0%)||6 (100%)|
- products or working environment are unsuitable to TDD. I no longer code. etc.
- only when effective
- I choose to do TDD only when it's effective and I know how to choose.
- I understand TDD but I found it not having significant value, so I don't do TDD
- no answer, others.