«« Next » « Previous
«« Next » « Previous

Link Details

You pick the winners! Login and vote now.
Link 45107 thumbnail

By ph111
via buunguyen.net
Published: Oct 01 2007 / 05:28

Unit testing can be difficult sometimes. In some cases, you need to refactor your code-under-test to make it more testable; in other cases, you need to apply some special techniques into your test code so that it can do what you want; and in the worst cases, you can’t think of any such techniques nor are able to refactor the production code and thus, don’t write any test at all. It’s in my experience working with many teams applying unit testing that they often have troubles writing tests for the data access layer (DAL), the UI layer, and multi-threading code, mostly because they are not aware of the techniques for doing that. That is not surprisingly difficult to understand though, business logic is much more intuitive and straight-forward to be tested and every single article or book out there will have examples writing test for the business logic firstly.
  • 12
  • 0
  • 1439
  • 430

Comments

Add your comment
User 217678 avatar

mostlyharmless replied ago:

1 votes Vote down Vote up Reply

Well written. Thanks.
My favorite part is I do exactly what he describes. It makes me feel good to know that many people are using the same tools and techniques that I do.

User 221312 avatar

pentolino replied ago:

0 votes Vote down Vote up Reply

seems down at the moment - wordpress error :-(

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.