3 ms·
I must admit that I don't fully do TDD, but sometimes it helps me getting my tests out first, so that I can "figure out" what to do in my real code whilst runni
by showsover 13y ago
I must admit that I don't fully do TDD, but sometimes it helps me getting my tests out first, so that I can "figure out" what to do in my real code whilst running the tests.
I see the return values of certain functions and computations, and while debugging my failing test, I can see a path to the solution I need.
Once the test succeeds, it's time to clean up the ugly code and refactor it into clean subsections, be it functions or classes.
So yeah, TDD is a great tool.
One of many in my toolbox.
- pauloortins 13y agoI love clean and well-written code but to achieve clean code we should be able to refactoring without break our code. This is the point for TDD.
- _pmf_ 13y ago> I love clean and well-written code but to achieve clean code we should be able to refactoring without break our code. This is the point for TDD. That's also true for vanilla regression tests. There's nothing special that TDD adds in this regard.
- pauloortins 13y agoI disagree with you at this point. When using TDD we tend to do a better code design and we avoid to write unnecessary code. Take a loot at http://www.ime.usp.br/~aniche/files/tdd-and-design-draft.pdf http://www.ime.usp.br/~aniche/files/tdd-and-design-draft.pdf
- stonemetal 13y agoTake a loot at What are we supposed to be looking at there? Like most TDD literature I see a lot of assertions, but no evidence to back it up.
- pauloortins 13y agoWhat would be a good evidence for you about the TDD influence in design ?
- stonemetal 13y agoMe personally, I would take several projects with TDD and non TDD methodologies, control variables like team size, project size, team experience, etc. and compare outcomes like defects rates, schedules, performance, etc. Try looking at SEED http://evidencebasedse.com/ http://evidencebasedse.com/ . TDD comes out not to bad. Quality correlates very well with # of unit tests regardless of methodology. TDDers tend to have more unit tests. Therefore TDD tends to produce quality code at better rates than other methodologies because it tends to produce more tests.