TDD is not about testing!!!
Lots of people confuse “test first methodologies” with TDD, it is very common to listen comments like “TDD is just about writing your tests first”, which are completely wrong, these kind of affirmations are not describing TDD at all, they are talking about test first development.
The main reason for confusing TDD and test first development is its own name: “test driven development”. If someone that doesn’t know about TDD would had to guess based on the name what TDD is, would probably guess that is just a test first methodology. But is not!
TDD as invented by Kent Beck, (who also invented Xtreme programming and Junit), goes beyond that. In the core of TDD there is a process to follow, which makes it already different from a simple test first approach.
Image source: Wikipedia
This is also known as red (make your test fail), green (make it pass) and refactor . Where this may be seen as a small difference from a test first approach, if combined with some other agile engineering practices and development philosophies, makes TDD quite different from any other test first approach, it actually switches the focus from testing to design.
TDD is a design practice, is more related with emergent design than with testing. TDD looses much of its potential if it is not combined with other agile engineering practices, or agile philosophies as YAGNI and KISS, in TDD having a large set of tests is a nice side effect, not just its purpose.
To know if you are doing TDD the right way, look at your code, TDD code should look simple and lean, TDD also usually generates more testing code than production code, and you should feel that it helps you to design your code.
So, next time you say you are doing TDD make sure you don’t mean that you are doing test first development.
Related posts:
![[Google]]( http://www.makinggoodsoftware.com/wp-content/plugins/easy-adsenser/google-light.gif)
[...] This post was mentioned on Twitter by Erwan ALLIAUME, Morten Jokumsen. Morten Jokumsen said: Liked "TDD is not about testing!!!" http://ff.im/-bOyW4 [...]
Tweets that mention TDD is not about testing!!! | Making Good Software -- Topsy.com
21 Nov 09 at 4:01 pm
I wrote about this in the not too distant past.
http://devmentia.blogspot.com/2009/11/people-will-use-tdd-when-we-start.html
Devmentia
22 Nov 09 at 4:43 am
[...] Test Driven Development Posted in Acceptance testing by testing in London on the November 22, 2009 From Making Good Software [...]
Test Driven Development « London software testing news UK
22 Nov 09 at 5:57 am
Spot on about TDD being a design approach rather than writing your tests first. But I don’t agree that TDD is not useful if you are not pair programming. Even if you are coding all by yourself, TDD is the right way to go about it. TDD turns you into becoming the first consumer of your own code, thereby making you think about the APIs that you write. This helps you clean up the APIs.
Aneesh
22 Nov 09 at 9:14 pm
>>TDD is pointless if it is not combined with other agile engineering practices, as pair programming, or agile philosophies as YAGNI and KISS
This is not true. TDD!=agile. It produces very good results even without that stuff.
Bubak
23 Nov 09 at 2:12 am
Hi Bubak! That’s a good observation, maybe I was too extremist with my article, TDD is not pointless without other agile techniques, but certainly helps to use them.
Alberto Gutierrez
23 Nov 09 at 2:21 am
Hi Aneesh, you are right, pair programming is not necessary to perform TDD, I obviously was too extrimist on my paragraph >>TDD is pointless if it is not combined with other agile engineering practices, as pair programming, or agile philosophies as YAGNI and KISS, I am going to correct it now, thanks for your observation
Alberto Gutierrez
23 Nov 09 at 2:26 am
Hi Alberto, your post is very interesting. I’ve translated it in french TDD ne concerne pas que le test !!!
Regards, Fabrice
Fabrice Aimetti
28 Nov 09 at 1:21 am
[...] Making Good Software, leí una vez un post muy interesante titulado “TDD is not about testing!!!” que me llamó mucho la atención al principio. Mucha gente piensa que escribir los tests primero es [...]
TDD con Python « il libero
26 Dec 09 at 7:39 am
Hi Alberto, good point.
Actually, I think that (1) TDD should not be seen in an agile context at all because (2) TDD is essentially a general programming technique which produces some desirable side effects (like e.g. ‘good’ code, repeatable tests). But the bottom line is: TDD is programming. I wrote a quite detailed blog post about this, which is called TDD is not about testing, it’s about how we develop software (sic)…
Thomas Weller
1 Feb 10 at 3:30 am
Hi Thomas! I’ve just read your post, quite interesting! Thank for you comment!!
Alberto Gutierrez
1 Feb 10 at 6:51 am
[...] is lately a lot of hype around engineering practices as TDD, Refactoring, keeping things simple (KISS)… and while they are great, it is important to remember [...]
Antes de Programar… Pensá! | nadaia
7 Jun 10 at 4:49 am