There are no appeals to authority here, just references to more information. You know, this "web" thing, with links and stuff. I don't think it'll ever take off...
> rephrase my doubt about TDD
Hmmm...so you no longer hold on to your previous claim of TDD being about selectively turning the brain off?
> TDD proponents claim that
> A. Developers not following TDD tend to produce poorly testable code that may be unnecessarily general
No. Pretty much all developers have a tendency to do that:
> B. TDD solves the problems by setting a prescriptive template (red -> green -> refactor)
No. First, no mechanical prescription can solve this problem. Second, if anything the "solution" is to follow YAGNI[1] and DTSTTCPW[2]. As I have explained before and you continue to ignore, where TDD helps is by splitting the task into two, or better, three phases
1. Write a test
You are asked to produce a specific test case, not really that much of a chance of overgeneralising (though not zero chance, see parallel thread).
2. Write minimal code to make the test pass
Since you are only asked to make the test pass, and the goal is to do this as "stupidly" as possible, chances of overgeneralising are again minimised.
3. After the test passes, refactor to remove duplication
At this point, you are only trying to remove duplication, you are no longer trying to solve the original problem, so your scope is much more constrained.
Is this some sort of mechanical or mathematical guarantee that you cannot overgeneralise? Hell no! As I have consistently maintained, TDD is not a "brain off" technique, though you seem to insist on introducing that straw man, only to then object to it. However, it helps tremendously, by drastically reducing the opportunities for overgeneralising (one phase out of three), and even there drastically reducing the incentive and scope for overgeneralising, because you are focused on something very concrete.
There are no appeals to authority here, just references to more information. You know, this "web" thing, with links and stuff. I don't think it'll ever take off...
> rephrase my doubt about TDD
Hmmm...so you no longer hold on to your previous claim of TDD being about selectively turning the brain off?
> TDD proponents claim that
> A. Developers not following TDD tend to produce poorly testable code that may be unnecessarily general
No. Pretty much all developers have a tendency to do that:
> B. TDD solves the problems by setting a prescriptive template (red -> green -> refactor)No. First, no mechanical prescription can solve this problem. Second, if anything the "solution" is to follow YAGNI[1] and DTSTTCPW[2]. As I have explained before and you continue to ignore, where TDD helps is by splitting the task into two, or better, three phases
1. Write a test
You are asked to produce a specific test case, not really that much of a chance of overgeneralising (though not zero chance, see parallel thread).
2. Write minimal code to make the test pass
Since you are only asked to make the test pass, and the goal is to do this as "stupidly" as possible, chances of overgeneralising are again minimised.
3. After the test passes, refactor to remove duplication
At this point, you are only trying to remove duplication, you are no longer trying to solve the original problem, so your scope is much more constrained.
Is this some sort of mechanical or mathematical guarantee that you cannot overgeneralise? Hell no! As I have consistently maintained, TDD is not a "brain off" technique, though you seem to insist on introducing that straw man, only to then object to it. However, it helps tremendously, by drastically reducing the opportunities for overgeneralising (one phase out of three), and even there drastically reducing the incentive and scope for overgeneralising, because you are focused on something very concrete.
[1] https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it
[2] http://c2.com/xp/DoTheSimplestThingThatCouldPossiblyWork.htm...