I've thought about getting into test-driven development myself, but one thing I don't quite understand yet is what happens if I make a design mistake, like create a class and later on realize that it should be removed altogether. Removing it would mean all the tests I've written for that class would fail, right? Should I then just remove or modify the tests, too? Somehow it sounds like it shouldn't work this way, but maybe I'm missing something :-/

Recommended Answers

All 2 Replies

>Should I then just remove or modify the tests, too?
That makes sense. You should also modify the tests that rely on that class as well, which (depending on your level of coupling) could mean changes in other classes and other tests.

Ah, well, I guess I was thinking too complexly. At least TDD would make it easier in this case to spot dependencies and fix them away.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.