Excalibur Solutions
  • Home
  • Our Services
  • Our Clients
  • Upcoming Events
  • Blog
  • Contact Us
  • About Us

TDD Saves the Day!

10/18/2011

0 Comments

 
I'm excited to be working in code again.  It has been fun to get back into the rhythm of Test-Driven Development (TDD): write a test and watch it fail; make it pass; clean it up.  I'm pleased, too, with the results.  There's a certain satisfaction that comes from knowing you have the program working (the "make it pass" step), then incrementally refining it through refactorings (the "clean it up" step) until you cannot see any more improvements that should be made.

The other really big benefit I see with TDD is the safety net provided by the tests.  I used to think this paid off only in the long run.  You know, years after the original programmer is gone and no one remembers how the system works, the tests are there to provide guidance and to show that any recent changes have not broken any existing (and tested!) functionality.  However, in the past few weeks, I've noticed that having these tests helps me to catch minor, almost trivial errors caused generally when my brain goes into neutral for a moment.  I write the test and watch it fail, then I attempt to make it pass.  Sure I've done everything properly, I run the tests and am surprised to see a red bar, not a green one.  It takes only a minute in most cases to fix the issue, but without the tests, it is highly probable that the bug would have remained and may or may not have been caught in later testing.

If I wasn't already a TDD convert, this kind of realization would go a long way towards convincing me.
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Author

    Robert Walsh has been a teacher, a programmer, a speaker, and a business owner.  His unique blend of skills and experiences allows him to relate to people of all backgrounds and technical levels.

    View my profile on LinkedIn

    Archives

    October 2014
    May 2012
    October 2011
    August 2011

    Categories

    All
    Agile
    Apache
    Cloud
    Continuous Integration
    CSS
    Database
    Ebean
    Eclipse
    Envisionware
    HTML
    Idea
    IntelliJ
    Javascript
    Jenkins
    Kent Beck
    Library
    Maven
    Mississippi State University
    Object-Relational Mapping
    ORM
    Play!
    Quality
    Refactoring
    REST
    Restlet
    Robert Martin
    Rob Sabourin
    Scala
    Stpcon
    Stylesheet
    Tdd
    Test Driven Development
    Test-Driven Development
    Testing
    WebApp
    Web Application

    RSS Feed

    Copyright©2011 , 2014
    Excalibur Solutions, Inc.
    All Rights Reserved

Powered by Create your own unique website with customizable templates.