When Unit Tests aren’t Enough

Unit Testing of your work is generally accepted as the mark of a professional developer. However – have you thought about what happens when you make a boo-boo on the tests you create?

You guessed it – everything goes to hell in a handbasket. If the tests are flawed, they aren’t really telling you anything. 

Sometimes it can be better (and faster)  to create an old-fashioned, Windows Forms test harness to exercise your “stuff”.

Right now, I’m working on a complex project with many dozens of classes – more of them every single day. Often we are asked to make changes to many of these classes. When I do these, all I need to do is fire up my Winforms Test Harness and press one of the buttons. I can have breakpoints in the code at strategic places, and I can view the end result in a DataGridView that’s on the form. Sure, you can do that with a unit test, but then what you’re doing is “testing a test”.

Unit Tests are definitely the way to go, but sometimes just being a Duct Tape Programmer solves the problem more easily.

Comments

  1. I agree with you abstractly, but if you offered a concrete example, I would show you a test that would remove the need for a manual test harness.

    ReplyDelete
  2. Derick1:06 AM

    People have been shot for less ;-)

    ReplyDelete
  3. brianmrush9:47 PM

    One of the things I wish these unit test frameworks did was allow for dynamic user input. Kind of like when you right click on a stored proc and click execute you can input the values for the the parameters.

    Maybe it could some type of additional tags on the unit test that detail what can be dynamic values. When a unit test is invoked from a client, it would prompt for the input values.

    In essence combine the approach of unit tests with the traditional win form testing harness

    ReplyDelete
  4. @brianmrush Check out row tests in MbUnit and NUnit 2.5

    ReplyDelete

Post a Comment

Popular posts from this blog

Some observations on Script Callbacks, "AJAX", "ATLAS" "AHAB" and where it's all going.

IE7 - Vista: "Internet Explorer has stopped Working"

FIREFOX / IE Word-Wrap, Word-Break, TABLES FIX