Does writing tests up front really take longer?

September 5, 2006 — Posted by Jim Trott

Listen to the podcastDoes 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

Recommendations - Reading

Recommendations - Tools

Music used in this podcast:

For more information, contact info@netobjectives.com or visit us at www.netobjectives.com

Blog Type: 
Podcast
Subscribe to our blog Net Objectives Thoughts Blog

Share this:

About the author | Jim Trott

Jim Trott is a senior consultant for Net Objectives. He has used object-oriented and pattern-based analysis techniques throughout his 20 year career in knowledge management and knowledge engineering. He is the co-author of Design Patterns Explained: A New Perspective on Object-Oriented Design, Lean-Agile Software Development: Achieving Enterprise Agility, and the Lean-Agile Pocket Guide for Scrum Teams.



        

Blog Authors

Al Shalloway
Business, Operations, Process, Sales, Agile Design and Patterns, Personal Development, Agile, Lean, SAFe, Kanban, Kanban Method, Scrum, Scrumban, XP
Cory Foy
Change Management, Innovation Games, Team Agility, Transitioning to Agile
Guy Beaver
Business and Strategy Development, Executive Management, Management, Operations, DevOps, Planning/Estimation, Change Management, Lean Implementation, Transitioning to Agile, Lean-Agile, Lean, SAFe, Kanban, Scrum
Israel Gat
Business and Strategy Development, DevOps, Lean Implementation, Agile, Lean, Kanban, Scrum
Jim Trott
Business and Strategy Development, Analysis and Design Methods, Change Management, Knowledge Management, Lean Implementation, Team Agility, Transitioning to Agile, Workflow, Technical Writing, Certifications, Coaching, Mentoring, Online Training, Professional Development, Agile, Lean-Agile, SAFe, Kanban
Ken Pugh
Agile Design and Patterns, Software Design, Design Patterns, C++, C#, Java, Technical Writing, TDD, ATDD, Certifications, Coaching, Mentoring, Professional Development, Agile, Lean-Agile, Lean, SAFe, Kanban, Kanban Method, Scrum, Scrumban, XP
Marc Danziger
Business and Strategy Development, Change Management, Team Agility, Online Communities, Promotional Initiatives, Sales and Marketing Collateral
Max Guernsey
Analysis and Design Methods, Planning/Estimation, Database Agility, Design Patterns, TDD, TDD Databases, ATDD, Lean-Agile, Scrum
Scott Bain
Analysis and Design Methods, Agile Design and Patterns, Software Design, Design Patterns, Technical Writing, TDD, Coaching, Mentoring, Online Training, Professional Development, Agile
Steve Thomas
Business and Strategy Development, Change Management, Lean Implementation, Team Agility, Transitioning to Agile
Tom Grant
Business and Strategy Development, Executive Management, Management, DevOps, Analyst, Analysis and Design Methods, Planning/Estimation, Innovation Games, Lean Implementation, Agile, Lean-Agile, Lean, Kanban