Top tag
Next privilege 200 Rep.
See reduced ads
~8k people reached

  • 0 posts edited
  • 0 helpful flags
  • 37 votes cast
comment A weakness of the TDD method?
@Belin Spoike has said what I would have - you should only be writing one test at a time. These tests can come from various places - the spec, known bugs or limitations in the current code, or known parts of the implementation that need testing (for example if you introduce an if statement, you know you need to test both branches). As you add these new tests you will often break (and then fix) earlier tests - this is part of the methodology. Of course TDD is also a pragmatic methodology, so these rules are often breakable, but when learning the approach it is advised to follow them closely.
comment A weakness of the TDD method?
What you have described is for many reasons not TDD. Two most obvious are that rather than writing a test, you have started with three, and that you have missed the "Do the simplest possible thing to make the test pass" step and replaced it with "write production code" which is not at all TDD. You have jumped directly to an implementation. By jumping to an implementation your tests will tend to be more tightly coupled to that implementation.