Today started off in a bad, bad way. Because of some issues I had earlier in the week with my source control repository (SCR) I was doing a ton of work offline. Today I was able to regain access to my SCR I decided to do a full get. I was fully expecting SourceOffSite (crappy overlay tool on top of VSS -- BTW, VSS is the devil) to prompt me for conflicts or do merges...... NOPE
When I finished doing my SCR pull I re-opened Visual Studio and did a compile. To my dismay I had TONS of build errors. After about 3 seconds of looking into the errors I knew I was screwed. It turns out I lost about 2 days worth of code because the source files were not merged they were overwritten....THIS SUCKS
The good news for me is that much of the code that was overwritten was plumbing work and was fixed in about 1 hour. However, there was a bit of logic code that was overwritten as well. This is where my unit tests came to the rescue.
Because I has pretty good code coverage with my tests I was able to re-create the logic with very little fear that the new implementation changed the intent of the original logic. Also because I had my tests I was able to infer logic based on what the tests were meant to verify.
I am not trying to say that tests made this all ok, but having my tests did make me feel a little better in thinking that I have not broken anything. Sadly, I wasted a large portion of my morning doing this.
Till next time,
[----- Remember to check out DimeCasts.Net -----]
10-02-2008 9:44 AM