Test Driven Design

Richard Sheridan (Cofounder and CEO, Menlo Innovations) wrote Joy Inc to share insight into all XP practices that worked for his Org. Here he shares the rigor and discipline they practice to get the quality needed in software.

Commercial pilots pair, of course. Do surgeons, anesthesiologists, nurses work in pairs too?

Software is now in everything. Your car. Airlines. Nuclear reactors. Banking systems. Software errors can cause great risk to humans, to companies, and to economies. Pairing increases quality and attention to detail particularly in cases of pressure, stress, and fatigue.

Heroes on Heroics, Great Teams Rely on Discipline

Rigor and discipline are hard, and it’s always easy to say, “Tomorrow I will do better.” If you can get your entire team into a disciplined routine of applying a rigorous approach you all believe in, and the effects become noticeable, morale soars even if the rigor is difficult.

One such rigor for us is that our programmers must write automated unit tests before they write the code to be tested. Most programmers wont do it and it is easy to fall out of this habit, but it is so crucial to the level of quality we aspire to in the code. However, our discipline guarantees that we write the test before we write the code, and it guarantees we will do it every time.

Test Driven Design! The effect on quality is unparalleled. This rigour ensures that silly human mistakes are caught automatically without having to remember all the little things that can go wrong. Think of this as a auto mechanic who lives in your garage. Every night while you are sleeping, this tireless worker is checking tire pressure, window visibility, electrical systems, and making sure that every little nut and bolt is properly secured and in tip-top shape. Your car will probably last a million miles with this attention, but it’s more important than that.

Many bosses may ask you to forget about TDD because we had real work to do!

The rigorous application of an automated unit testing framework at Menlo is one of the strongest technical disciplines of our shared belief system. New programmers being on-boarded are taught this approach by their pair partner. Quality soars, morale soars, and productivity soars, because we can move ahead faster with the confidence that we are not breaking things that have worked in the past. The tests are there to help us catch those mistakes.

Still Doesn’t Mean the Whole System Works

Integration issues is a factor. In a performance, even if every individual works flawlessly, audience can see chaos. Seasoned directors know better. They continually do small integrations every step of the way to work through the flaws that aren’t obvious until all are on the stage at the same time.

Deliver Tangible Results Frequently

The best way we know to constantly test our system for weaknesses is to share our work with our clients. Show and Tell. Power Point, status reports, stage gate committee reviews, and so forth are no substitute for delivering working software.

Humans like to see, feel and touch things they have a stake in. If you are building a custom home, you will visit and check often or even daily. Even when you are not an expert in construction, carpentry or plumbing.

Conclusion

Sports teams have routines they go through to establish rigour and discipline. The best teams are dedicated to these routines, not just with their bodies but with their souls. The mediocre pay lip service to these. The difference can be seen and felt in the field.

Rigor and discipline and the quality that results reinforce your organization’s definition of “why” you exist, a concept so elegantly explored by Simon Singh in his book Start with Why. As Sinek explains, all organizations know what they do, some even know how they do it, but surprisingly few know why they do what they do. Your company’s WHY goes straight to your purpose, your mission, and what you believe. If you can get to that level of quality, you can then achieve what most organizations believe is the ultimate goal: long-term sustainability of a culture and an organization.