@@ -6539,9 +6539,12 @@ <h2>Why is testing important?</h2>
65396539test the application under test.</ p >
65406540< p > There are many forms of testing and they should all be used together. When
65416541a single function of a program is isolated for testing, that is called
6542- < em > unit testing</ em > . Testing more than a single function in an application at
6543- the same time is known as < em > functional testing</ em > . < em > User interface testing</ em >
6544- ensures the correctness of how a user would interact with the software.</ p >
6542+ < a href ="/unit-testing.html "> unit testing</ a > . Testing more than a single function
6543+ in an application at the same time is known as < em > functional testing</ em > .
6544+ < em > User interface testing</ em > ensures the correctness of how a user would
6545+ interact with the software. There are even more forms of testing that large
6546+ programs need, such as < em > load testing</ em > , < em > database testing</ em > , and
6547+ < em > browser testing</ em > (for web applications).</ p >
65456548< h2 > Testing in Python</ h2 >
65466549< p > Python software development culture is heavy on software testing. Because
65476550Python is a dynamically-typed language as opposed to a statically-typed
@@ -6550,14 +6553,56 @@ <h2>Testing in Python</h2>
65506553< h2 > Testing resources</ h2 >
65516554< ul >
65526555< li >
6553- < p > Google has a < a href ="http://googletesting.blogspot.com/ "> testing blog</ a > where
6554- they write about various aspects of testing software at scale.</ p >
6556+ < p > < a href ="http://late.am/post/2015/04/20/good-test-bad-test.html "> Good test, bad test</ a >
6557+ explains the difference between a "good" test case and one that is not
6558+ as useful. Along the way the post breaks down some myths about common
6559+ testing subjects such as code coverage, assertions and mocking.</ p >
6560+ </ li >
6561+ < li >
6562+ < p > < a href ="http://pythontesting.net/ "> Python Testing</ a > is a site devoted to testing
6563+ in - you guessed it - the Python programming language.</ p >
65556564</ li >
65566565< li >
65576566< p > < a href ="http://michaeldehaan.net/post/120522567217/the-case-for-test-driven-development "> The case for test-driven development</ a >
65586567 by Michael DeHaan explains how automation is the only way to build software
65596568 at a large scale.</ p >
65606569</ li >
6570+ < li >
6571+ < p > Google has a < a href ="http://googletesting.blogspot.com/ "> testing blog</ a > where
6572+ they write about various aspects of testing software at scale.</ p >
6573+ </ li >
6574+ </ ul >
6575+ < h1 > Unit testing</ h1 >
6576+ < p > Unit testing is a method of determining the correctness of a single function
6577+ isolated from a larger codebase. The idea is that if all the atomic units
6578+ of an application work as intended in isolation, then integrating them
6579+ together as intended is much easier.</ p >
6580+ < h2 > Why is unit testing important?</ h2 >
6581+ < p > Unit testing is just one form of < a href ="/testing.html "> testing</ a > that works in
6582+ combination with other testing approaches to wring out the bugs from a
6583+ piece of software being developed. When several functions and classes are
6584+ put together it's often difficult to determine the source of a problem if
6585+ several bugs are occurring at the same time. Unit testing helps eliminate
6586+ as many of the individual bugs as possible so when the application comes
6587+ together as a whole the separate parts work as correct as possible. Then
6588+ when issues arise they can often be tracked down as unintended consequences
6589+ of the disparate pieces not fitting together properly.</ p >
6590+ < h3 > Unit testing resources</ h3 >
6591+ < ul >
6592+ < li >
6593+ < p > < a href ="https://realpython.com/blog/python/the-minimum-viable-test-suite/ "> The Minimum Viable Test Suite</ a >
6594+ shows how to set unit tests and integration tests for a Flask example
6595+ application.</ p >
6596+ </ li >
6597+ < li >
6598+ < p > < a href ="http://www.diveintopython3.net/unit-testing.html "> Dive into Python 3's chapter on unit testing</ a >
6599+ has a complete example with code and a detailed explanation for creating
6600+ unit testing with the unittest module.</ p >
6601+ </ li >
6602+ < li >
6603+ < p > < a href ="https://docs.python.org/3/library/unittest.html "> unittest</ a > is the
6604+ built-in standard library tool for testing Python code.</ p >
6605+ </ li >
65616606</ ul >
65626607 < h1 > Code Metrics</ h1 >
65636608< p > Code metrics can be produced by static code analysis tools to determine
@@ -6653,6 +6698,9 @@ <h1>Change Log</h1>
66536698< h2 > 2015</ h2 >
66546699< h3 > August</ h3 >
66556700< ul >
6701+ < li > Created a new page on < a href ="/testing.html "> testing</ a > that will be fleshed out
6702+ over the next few weeks.</ li >
6703+ < li > Added new < a href ="/django.html "> Django</ a > resources, especially for migrations.</ li >
66566704< li > Added new < a href ="/web-application-security.html "> web app security</ a > resources on
66576705 HTTPS.</ li >
66586706</ ul >
0 commit comments