What are some of the strategies for designing code to be unit tested?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
In general, write the unit test *before* you write the code. This way your code
is designed to be unit tested by default. It also provides a better way to
verify that your implementation of a desired feature actually works as
intended.
For example, when I'm writing a new module I document it
I've found that bottom-up development favors testable code. That is,
rather than thinking of the problem to be solved, thinking in terms of
the tools (functions) one would use to solve the problem. These tools
can be written to be testable, and then it all builds up in this tower
of