You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: all.html
+50-1Lines changed: 50 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6571,6 +6571,12 @@ <h2>Testing resources</h2>
6571
6571
<p>Google has a <ahref="http://googletesting.blogspot.com/">testing blog</a> where
6572
6572
they write about various aspects of testing software at scale.</p>
6573
6573
</li>
6574
+
<li>
6575
+
<p>Still confused about the difference between unit, functional and
6576
+
integration tests? Check out this
6577
+
<ahref="http://stackoverflow.com/questions/4904096/whats-the-difference-between-unit-functional-acceptance-and-integration-test">top answer on Stack Overflow</a>
6578
+
to that very question.</p>
6579
+
</li>
6574
6580
</ul>
6575
6581
<h1>Unit testing</h1>
6576
6582
<p>Unit testing is a method of determining the correctness of a single function
@@ -6590,7 +6596,9 @@ <h2>Why is unit testing important?</h2>
6590
6596
<h2>Unit testing tools</h2>
6591
6597
<p>There are many tools for creating tests in Python. Some of these tools, such
6592
6598
as pytest, replace the built-in unittest framework. Other tools, such as
6593
-
nose, are extensions that ease test case creation.</p>
6599
+
nose, are extensions that ease test case creation. Note that many of these
6600
+
tools are also used for <ahref="/integration-testing.html">integration testing</a>
6601
+
by writing the test cases to exercise multiple parts of code at once.</p>
<ahref="https://wiki.python.org/moin/PythonTestingToolsTaxonomy">Python testing tools and extensions</a>.</p>
6640
6648
</li>
6649
+
</ul>
6650
+
<h1>Integration Testing</h1>
6651
+
<p>Integration testing exercises two or more parts of an application at once,
6652
+
including the interactions between the parts, to determine if they function
6653
+
as intended. This type of <ahref="/testing.html">testing</a> identifies defects in
6654
+
the interfaces between disparate parts of a codebase as they invoke
6655
+
each other and pass data between themselves.</p>
6656
+
<h2>How is integration testing different from unit testing?</h2>
6657
+
<p>While <ahref="/unit-testing.html">unit testing</a> is used to find bugs in individual
6658
+
functions, integration testing tests the system as a whole. These two
6659
+
approaches should be used together, instead of doing just one approach over
6660
+
the other. When a system is comprehensively unit tested, it makes
6661
+
integration testing far easier because many of the bugs in the individual
6662
+
components will have already been found and fixed. </p>
6663
+
<p>As a codebase scales up, both unit and integration testing allow
6664
+
developers to quickly identify breaking changes in their code. Many times
6665
+
these breaking changes are unintended and wouldn't be known about until
6666
+
later in the development cycle, potentially when an end user discovers
6667
+
the issue while using the software. Automated unit and integration tests
6668
+
greatly increase the likelihood that bugs will be found as soon as possible
6669
+
during development so they can be addressed immediately.</p>
6670
+
<h3>Integration testing resources</h3>
6671
+
<ul>
6672
+
<li>
6673
+
<p><ahref="http://eigenhombre.com/2013/04/13/integration-testing-in-python-with-context-managers/">Integration testing with Context Managers</a>
6674
+
gives an example of a system that needs integration tests and shows how
6675
+
context managers can be used to address the problem. There are a couple
6676
+
other useful posts in this series on testing including
6677
+
<ahref="http://eigenhombre.com/2013/04/18/thoughts-on-integration-testing/">thoughts on integration testing</a>
6678
+
and <ahref="http://eigenhombre.com/2013/04/19/processes-vs-threads-for-testing/">processes vs. threads for integration testing</a>.</p>
6679
+
</li>
6680
+
<li>
6681
+
<p>Pytest has a page on <ahref="https://pytest.org/latest/goodpractises.html">integration good practices</a>
6682
+
that you'll likely want to follow when testing your application.</p>
6683
+
</li>
6684
+
<li>
6685
+
<p><ahref="http://enterprisecraftsmanship.com/2015/07/13/integration-testing-or-how-to-sleep-well-at-nights/">Integration testing, or how to sleep well at night</a>
6686
+
explains what integration tests are and gives an example. The example is
6687
+
coded in Java but still relevant when you're learning about integration
6688
+
testing.</p>
6689
+
</li>
6641
6690
</ul>
6642
6691
<h1>Code Metrics</h1>
6643
6692
<p>Code metrics can be produced by static code analysis tools to determine
0 commit comments