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.
Comments
dzonelurker replied ago:
"design for unit testing" - an important design principle!
apolci replied ago:
The link send me to an error page
apolci replied ago:
Solved
wekempf replied ago:
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.
,
Voters For This Link (16)
Voters Against This Link (2)