This post originated from an RSS feed registered with .NET Buzz
by Raymond Lewallen.
Original Post: Iâm you pusher. Unit tests are my drugs.
Feed Title: Raymond Lewallen
Feed URL: /error.htm?aspxerrorpath=/blogs/raymond.lewallen/rss.aspx
Feed Description: Patterns and Practices, OOP, .Net and Sql
I just finished a bunch of refactorings on some files in a project. Nothing major, just your normal fixing of code smells and duplications that get left behind when you rush through some stuff. So I finished all the refactorings I was going after and ran my unit tests.
Doesnât that feel good? Donât you just love your unit tests? I want to take them to bed with me and feed them strawberries and champagne. I had to make the pic small cause there is a bunch of stuff in there that you aren't supposed to see :)
Yes, I did break 2 tests. Both of which are easily fixable and will take less than a few minutes to rectify. There were simply the tests that test the Object.Equals and Object.GetHashCode of one of my types. Still, you people who have unit tests know how good it feels to see all the green lights light up and get that nice green bar in your unit test GUI.
I actually touched quite a few files (dozens). Framework files, mind you. Things that if broken would cause awful bad problems back up the dependency chain, as these files I changed are highly responsible to the other pieces of the application (thats high afferent coupling for you metrics geeks out there like me).
What a nice little security blanket. Unit tests keep me all warm and fuzzy and feeling safe. Youâve heard it plenty of times, you should have unit tests in place. Every once in awhile I pull out the old GUI and run them that way instead of just getting a report or watching them run in the console. The green lights are euphoric. You should try it out.
Like that Ice-T song, âIâm Your Pusherâ. Lyrics were his drugs. Well, Iâm you pusher. Unit tests are my drugs. Theyâll make you happy.