Main Contents

Developing With Mocks When Development is Down

test driven development, software development

One unexpected bonus of implementing TDD in our shop came up this week. Mocks can be a development tool as well.

The situation is pretty simple, our legacy development environment is down. Since it is our main data source on the project in the past this would have left the team dead in the water. Turns out they’ve mocked all of the DAOs that return some predetermined data using Spring. No developer downtime at all. Of course they can’t turn over the current new code for testing by QA against the real legacy system, but at least they can continue on without interruption. They didn’t even really mention the mainframe environment being down as an impediment in the daily Scrum.

So mocks have come in handy not just for a lot more than enabling unit testing. If you have to depend on some flakey resource they can be a lifesaver.

Ed Gibbs @ April 27, 2006

3 Comments

  1. Dave Nicolette April 28, 2006 @ 4:33 am

    Ed, mocks are a development tool. You don’t need the “as well.” Mocks are used in TDD, and TDD is a development discipline, not a testing discipline. Your code should be isolated from externalities routinely at all levels of testing until you get to “system” testing.

  2. Ed Gibbs April 30, 2006 @ 6:05 am

    Agreed, mocks are not neccessarily a testing tool. The way I was able to sell the approach though was through using them to enable easier unit testing. Now the developers are seeing some of the added benefits, and we’re getting better designs.

Leave a comment


Feed