Devlico.Us
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @devlicious

Derik Whittaker

Thoughts on Software Development, .Net, OOP, Design Patterns and all things cool



Unit Tests to the rescue

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 -----]



Comments

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# October 2, 2008 11:30 AM

Dave Schinkel said:

That's a very good point.  Never really thought of the fact that your unit tests could save you time in rebuilding that lost logic.

# October 2, 2008 11:32 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Derik Whittaker

Derik is a .Net Developer/Architect specializing in WinForms working out the northern suburbs of Chicago. He is also believer and advocate for Agile development including SCRUM, TDD, CI, etc.

When Derik is not writing code he can be found spending time with his wife and young son, climbing on his bouldering wall, watching sports (mostly baseball), and generally vegging out. Check out Devlicio.us!

Our Sponsors

Proudly Partnered With


This Blog

Syndication

News