Pro’s and Con’s of unit testing after the fact

I think there are several advantages to unit testing existing code

  • Regression management
  • Better understanding of the code. Testing it will reveal cases you did not anticipate and will help define the behavior of the code
  • It will point out design deficiencies in the code as you stuggle to test poorly defined methods.

But I think it’s more interesting to consider the cons of unit testing code. AFAIK, there are no cons. All of the time spent adding tests will pay for themselves even in everything but the shortest of time cycles.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)