Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    First, when I read your answer, I thought "yes, that is the core point". But after rethinking the question again, I thought it is not necessarily so abstract or unrealistic. If one picks blindly the completely wrong architecture, TDD won't solve that, not after 1000 iterations. Commented Jan 9, 2017 at 22:26
  • @Doc Brown Agreed, it won't solve that problem. But it will give you a suite of tests that exercise every assumption and business rule so that you can iteratively improve the architecture. Architecture so bad it needs a ground up rewrite to fix is very rare (I'd hope) and even in that extreme case the business rule unit tests would be a good starting point. Commented Jan 9, 2017 at 22:38
  • When I say "wrong architecture", I have cases in mind where one needs to throw away the existing test suite. Did you read my answer? Commented Jan 10, 2017 at 6:45
  • @DocBrown - Yes I did. If you meant "wrong architecture" to mean "change the entire test suite" maybe you should have said that. Changing the Architecture does not mean that you have to trash all of the tests if they are Business Rule based. You will probably have to change all of them to support any new interfaces you create and even completely re-write some, but the Business Rules are not going to be superseded by a technical change so the tests will remain. Certainly investmenting in unit tests shouldn't be invalidated by the unlikely possibility of completely effing up the architecture Commented Jan 10, 2017 at 8:27
  • sure, even if one needs to rewrite every test in a new programming language, one does not need to throw away everything, at least one can port the existing logic. And I agree to you 100% for the major real-world projects, the assumptions in the question are quite unrealistic. Commented Jan 10, 2017 at 9:07