On 11/06/12 16:05, brian arb wrote:

Highly recommend writing unittest, each unit test sends a specific input
to a method and verifies that the method returns the expected value, or
takes the expected action. Unit tests prove that the code you are
testing does in fact do what you expect it to do.


While unit testing is absolutely essential we need to remember the limitations. They only test that output matches the expected results for the inputs that we remember to test. Many of the bugs found in system testing are the result of inputs the programmer never thought to unit test... So "prove" in the statement above may be a tad optimistic.

One reason that testing should ideally never be done by the person writing the code. (And even when it isn't things still get missed!)
But in practice unit testing usually is.


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to