From: Anthony Scopatz Date: Tue, 3 Apr 2012 01:56:32 +0000 (-0500) Subject: Some testing updates. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fca12f21b2060e02bbb29c6ed889745764c035dd;p=swc-testing-nose.git Some testing updates. --- diff --git a/5-Testing/Readme.rst b/5-Testing/Readme.rst index ee9265f..d977b3e 100644 --- a/5-Testing/Readme.rst +++ b/5-Testing/Readme.rst @@ -1,54 +1,58 @@ -[[Back To NumPy | Python9-NumPy]] - [[Forward To Home | Home]] - ----- - -**Presented By Tommy Guy** - -**Based on materials by Katy Huff and Rachel Slaybaugh** - -**What is testing?** - -Software testing is a process by which one or more expected behaviors and results from a piece of software are exercised and confirmed. Well chosen tests will confirm expected code behavior for the extreme boundaries of the input domains, output ranges, parametric combinations, and other behavioral edge cases. - - -**Why test?** - -Unless you write flawless, bug-free, perfectly accurate, fully precise, and predictable code every time, you must test your code in order to trust it enough to answer in the affirmative to at least a few of the following questions: - -Does your code work? - -Always? - -Does it do what you think it does? - -Does it continue to work after changes are made? - -Does it continue to work after system configurations or libraries are upgraded? - -Does it respond properly for a full range of input parameters? - -What about edge or corner cases? - -What’s the limit on that input parameter? - - -**Verification** - -Verification is the process of asking, “Have we built the software correctly?” That is, is the code bug free, precise, accurate, and repeatable? - -**Validation** - -Validation is the process of asking, “Have we built the right software?” That is, is the code designed in such a way as to produce the answers we’re interested in, data we want, etc. - -Where are tests ? +`Back To Debugging`_ - `Forward To Documentation`_ + +.. _Back To Debugging: https://github.com/thehackerwithin/UofCSCBC2012/tree/master/4-Debugging/ +.. _Forward To Documentation: https://github.com/thehackerwithin/UofCSCBC2012/tree/master/6-Documentation/ + +----------- + +**Presented By Anthony Scopatz** + +**Based on materials by Katy Huff, Rachel Slaybaugh, and Anthony Scopatz** + +What is testing? +================ +Software testing is a process by which one or more expected behaviors and +results from a piece of software are exercised and confirmed. Well chosen +tests will confirm expected code behavior for the extreme boundaries of the +input domains, output ranges, parametric combinations, and other behavioral +edge cases. + +Why test software? +================== +Unless you write flawless, bug-free, perfectly accurate, fully precise, and +predictable code every time, you must test your code in order to trust it +enough to answer in the affirmative to at least a few of the following questions: + +* Does your code work? +* Always? +* Does it do what you think it does? +* Does it continue to work after changes are made? +* Does it continue to work after system configurations or libraries are upgraded? +* Does it respond properly for a full range of input parameters? +* What about edge or corner cases? +* What's the limit on that input parameter? + +Verification +************ +*Verification* is the process of asking, "Have we built the software correctly?" +That is, is the code bug free, precise, accurate, and repeatable? + +Validation +********** +*Validation* is the process of asking, "Have we built the right software?" +That is, is the code designed in such a way as to produce the answers we are +interested in, data we want, etc. + +Where are tests? +================ Say we have an averaging function: -:: +.. code-block:: - def mean(numlist): - total = sum(numlist) - length = len(numlist) - return total/length + def mean(numlist): + total = sum(numlist) + length = len(numlist) + return total/length The test could be runtime exceptions in the function. @@ -330,4 +334,4 @@ Oh no! Something failed. The failure was on line in this test: assert overlap(red, blue) == ((1, 3), (2, 4)) -Can you spot why it failed? Try to fix the method so all tests pass. \ No newline at end of file +Can you spot why it failed? Try to fix the method so all tests pass.