0

Using test frameworks for "To Do" lists

by Jeremy 21. October 2009 17:28
Many times during a development cycle, you find bugs and/or receive new feature requests that you need to keep track of.  Typically, this is added to a list of some sort, be it a bug tracking system or just a post-it note on your monitor.  While there is certainly value in having items like this documented and tracked in a formal (or informal) fashion, I find it helpful to create a stubbed test that reminds me of my outstanding coding tasks.  

As an example of adding a "to do" test, consider the following scenario.  I am currently working on a system which allows the logging of activities; attachments can be associated with those activites.  While manually testing this system that is currently under development, I noticed that upon saving one of these logs, the attachment was not being saved.  Rather than add this to a list of todo tasks for myself - I went ahead and created a test called "ShouldAddAnAttachmentToExistingLogUponUpdate" that simply throws a NotImplementedException (for now).  (Note: I am using mbUnit, but any unit testing framework will work with this concept).

As a result, when I go to run all tests for my solution, I will see this exception and remember that I need to fix this bug by making this test pass.  In my opinion, this is a helpful way to keep track of the items that you need to fix and/or implement, as well as a great way to get in the habit of using test driven development.  Creating tests as "To Do" items reminds you to code the test and, subsequently, code the logic to pass the test.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

TDD

Powered by BlogEngine.NET 1.4.5.0
Original Design by Laptop Geek, Adapted by onesoft