Refinements, Clarifications, and Simplifications of a Tune-Up

So after much discussion and confrontation, both mine and others, of A Tune-Up for TDD? I have some refinements, clarifications, and simplifications. First and for most it is clear that refactor to remove duplication should always be done to the best of your ability. In A Tune-Up for TDD? I wrote a P.S. that said “Once you have mastered testability I would add in duplication.” I would not wait to begin your mastery of removal of duplication. Begin today if you have not already.


Now then I would like to begin to discuss concerns of testability not being any easier to understand. I am having a hard time empathizing with this. It seems so easy for me as well I do find it easy to convey understanding of testability in person. I wonder if the masters of anti-duplication have a similar experience? Anyway, I did a little reading on simplicity to try and help things out. BTW it is funny how simplicity is complex. Let’s focus on observability. I fail to see how what I wrote before is not simple: “To test something you must be able to observe or sense that it did what it was supposed to do.” In fact Michael Feathers talks a good bit on this in WEWLC. So at Ron’s insistence I reduced it to: “Could it be easier to get the information needed to assert on? If so make it easier.” This seemed to sooth him and I did not hear more from others on this issue either. I assume that it did the trick. Here is the complete list of simplifications:

Could it be easier to get the information needed to assert on? If so make it easier.
Could it be easier to make the test subject do what the test case needs it to do? If so make it easier.
Could it be easier to isolate the test subject? If so make it easier.
Could it be easier to understand the test subject? If so make it easier.

I am itchy about how pared down they feel. I am nervous that some important part of the meaning has been lost yet I can’t identify it.


Charlie Poole recently wrote: “You can’t remove duplication if you don’t create any.” The same sentiment is true for testability. If you already create highly testable software this proposed tune-up of TDD will seem silly. It is not so silly for those you do not create highly testable products. I think that most of the people that have been concerned about the focus on testability already fulfill the goals that I have stated in their normal operation. It is something that they have learned to do but never thought about. Removal of duplication and good design in general do not address all the needs of testability. Take the points made in A Crucial Difference and Do You Smell That?. So if this is true one of two things must be. These concerned people are writing software that could be easier to test, or they unconsciously address testability in their normal operation. The point is that if you are not already creating highly testable software this tune-up should be important to you. If you are creating highly testable software then it may only be interesting to you.

kick it on DotNetKicks.com