Follow @RoyOsherove on Twitter

Test Driven Source Control–Safe Points

Having worked quite a bit now with Git and Mercurial, and tests, I got an interesting idea. An addin that runs inside your favorite IDE, and listens to test related events.

Every time the test suite is finished running, the addin performs a commit of all the current files and state into the local source control system. BUT, it also includes the current results of all the test runs.

essentially, it will associate the state of the system as part of an automated commit on every run of the tests.

What do you get?


You get a wonderful ability of reverting back to the time where all the tests passed, or to a time when a specific test passed.

You also don’t need to remember to commit locally when you get to any kind of stable state.

Each commit will be saved and visualized as a “Safe Point” – and you can travel up and down the source history, based on the test results that you’d like to get to.

This is great if you get down a rabbit hole and break everything. You just revert back to the time when everything was passing, or even partially passing. Today, without this, if you forgot to locally commit during the work or before it, you’re out of luck.

with this system you never forget to commit, and you get access to different states of the system

you also get, if you work in a Test Driven way, a nice way to perhaps visual the history of how some functionality was created. You might play-back the steps it took to make something.

If no one builds it, I will!

20% discount, and new location - Two Day TDD Class UK

Measuring Simplicity in TDD