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

Link Details

Link 54868 thumbnail
User 119725 avatar

By PeterStofferis
via theserverside.com
Published: Nov 29 2007 / 01:09

This article, by Akshay Sharma, walks through a set of requirements to help developers design for unit testing, including some tips for the design stage. Thinking about unit testing during design leads to a good design. Unit tests are not just pieces to catch 'bugs', they also drive the design. Unit tests enforce the contract of the classes and methods and thus making sure the design adheres to the contract of the system.
  • 16
  • 2
  • 1232
  • 420

Comments

Add your comment
User 236137 avatar

dzonelurker replied ago:

0 votes Vote down Vote up Reply

"design for unit testing" - an important design principle!

User 171053 avatar

apolci replied ago:

0 votes Vote down Vote up Reply

The link send me to an error page

User 171053 avatar

apolci replied ago:

0 votes Vote down Vote up Reply

Solved

User 224257 avatar

wekempf replied ago:

0 votes Vote down Vote up Reply

An interesting counter argument can be made that designing for testing adds complexity to the actual code with no benefit other than easing testing. I'm not taking sides in that argument, but this article provides a good counterpoint: http://www.codeproject.com/dotnet/StopDesign4Tests.asp.

Also, I'd like to point out that this article advocates practices that are counter to TDD/BDD: specifically it advocates documenting APIs before writing tests. If you write the tests first, most of his other points about designing for testing would be automatically done in the first place.
,

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.