Does writing tests up front really take longer?




Lean-Agile Straight Talk show

Summary: Does testing make your OO project take longer? "Writing tests up-front sounds good in theory, but in practice, doesn't testing like this really take longer in an object-oriented way? Don't design patterns make it harder to write tests?" That was a question I received recently. The answer is no, but not why you might think. One of Alan Shalloway's favorite sayings is "Fixing bugs does not take very much time... finding bugs - that's what takes time. Once I know where the bug is, it is usually easy to fix." And this only gets worse as your system grows more complex or goes through more releases / revisions. Lean teaches us to focus on the entire value stream, to aim for perfection, to optimize the whole. One way to do this is to capture mistakes early and never to let mistakes repeat themselves. That is why we advocate writing tests early, testing automatically, and keeping your test suite up to date. Using your time to write tests that help you find bugs is ultimately more efficient and speedier than spending lots of time debugging code. Particularly if you are writing code that is meant to endure and grow. You might say, "Debugging is for a moment; tests are forever." Alan shares how he learned this the hard way - that writing more tests means writing fewer traces. And how writing object-oriented code actually requires upfront testing... Think "trust, but verify" - you want to know that you can trust an object. Recommendations - Training by Net Objectives Test Driven Design Lean Software Development Design Patterns Thinking Scrum Recommendations - Reading Design Patterns Explained, 2nd Edition, by Alan Shalloway and Jim Trott Reading recommendations including testing and validation Creating a Lean Culture: Tools to Sustain Lean Conversions, by David Mann Recommendations - Tools AgileCraft LeanKit Music used in this podcast: “Pizzaman” and “Chocolate” ©2006 William Cushman: ghostnotes.blogspot.com “On the Cool Side” ©2006 Kevin McLeod: http://www.incompetech.com/ For more information, contact info@netobjectives.com or visit us at www.netobjectives.com Blog Type: PodcastLog in or register to post comments