Developing With Mocks When Development is Down

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.