Mark,
“I don’t know why that test is failing…Silly me, my index is off by one!”, edit, continue, test passes, get on with life.
That’s not really an accurate depiction of typical TDD.
TDD practices often result in designs that are more reusable and thus classes that are reused more frequently. Making a change to code therefore could cause cascading defects.
The thinking is more often, “I KNOW why that test is failing…Silly me, my index is off by one. I’m going to fix that and run the unit test suite because I can’t completely guarantee that the change to a reusable class won’t cause failures elsewhere in the code.”
Even if a change is done in Edit Continue, the unit test suite will need to be executed after the change is done. It’s more likely that a test will fail, the problem localized, fixed, and then the suite executed. Most often this happens without necessitating time in the debugger. Since testability is a design concern, code is designed naturally by the shaping forces of test-first programming such that problems can be localized outside of the debugger.
Further, Edit Continue could leave the code in an invalid state along code paths that I have yet to traverse in the debugger after making a change with Edit Continue - especially for code paths that are re-entrant into the code changed in Edit Continue. This could lead to false positives or false negatives during the test execution, which is something that is pretty strictly eschewed in TDD. In fact calibrating out false positives and false negatives is what the Red and Green phases are all about in TDD’s Red-Green-Refactor process.
TDD in general is more often a design practice than a quality assurance practice aimed at finding bugs. But unit tests are certainly good at doing that to.
If I find myself in the debugger in the course of a test execution, I’m usually not deep in the call stack because TDD produces code with shallow stacks and low opacity. Upon localizing a problem in the debugger I would be more apt to stop the execution of the test, make the fix, and then verify that the fix didn’t cause un-localized failures.
If I had code that had to be tested into deep call stacks, with branching, and with opacity, I might consider the utility of Edit Continue, but that’s not the kind of code that TDD typically produces.