Sunday, November 26, 2006

Unit test addicted

I have become addicted to unit testing. So far I haven't noticed any side effects :)

Enough small talk... This is why I like unit testing so much:
  • It forces me to initially focus on functionality.
  • It lets me refactor central code bits and see if any dependant projects break because of it.
    I have worked on projects where nobody wanted to change stored procedures on the database. Instead new stored procedures were created. Thereby not breaking existing code.
  • It lets me open up old projects that i don't remember anything about and experiment when fixing an error. It more or less functions as a description and validation of what the application does.
  • It feels good when delivering a product knowing that it actually does what you expect of it.

2 comments:

  1. Hello,

    Unit testing is a good practise.

    For re-using project, don't you keep a small readme.txt that you keep updated.
    What I am doing is inserting a #ifdef that when compiling a release it tells you to update the file (manually it is).

    ReplyDelete
  2. Hi Anthony
    I guess you comment on opening up old projekts. Ofcourse I do comment my projects (even with more than text files). But if the application is complex and has a lot of internal dependancies I think fixing an error can be like changing a card in a cardhouse; very likely to break the whole thing. If you have unit tests, you can experiment and see if anything is broken when done.

    ReplyDelete