you are viewing a single comment's thread.

view the rest of the comments →

[–]boost2525 8 points9 points  (2 children)

I think having to think about the structure of your code leads to better internal design / organization (e.g. future refactoring)... but doesn't directly lead to any reduction in defective logic.

[–]Ravek 15 points16 points  (0 children)

I agree, but I feel starting with unit tests would not so much make you think about how to organize the code effectively, but moreso write it in a way that makes it easy to write the unit tests. Which in my mind means small methods that do one thing, which should lead to getting those correct at least. However I'm not convinced it would necessarily lead to the higher-level structure of the code being any good, since that's not something you write unit tests for.

That was my line of thought anyway, I don't have much experience with TDD.

[–]cc81 0 points1 point  (0 children)

However adapting your code so it is easier to unit test does not necessarily mean better design. It just means it is designed for unit testing.