forked from shoaibsufi/boot-camps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Outline of contents for testing cheat sheet.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Testing Cheat Sheet | ||
=================== | ||
|
||
Terminology | ||
----------- | ||
|
||
* A *unit test* acts on an isolated component within an application. | ||
* A *test fixture* is the input data that a test acts on. | ||
* The *interface* of a function is its public face, defined by its | ||
input and output. | ||
* The *implementation* of a function is how it gets from the input to | ||
the output. | ||
* A *stub* is a very simple implementation of one function that is | ||
used in a test of a different function. | ||
|
||
Unit Testing | ||
------------ | ||
|
||
* A *normal case* is a test case that reflects what is expected to be | ||
typical usage of a function. | ||
* A *boundary case* is a test case that reflects a less typical but | ||
potentially troublesome type of usage. | ||
|
||
Exceptions | ||
---------- | ||
|
||
* raise | ||
* catch | ||
* define | ||
|
||
Assertions | ||
---------- | ||
|
||
* syntax | ||
* stops execution | ||
|
||
Unittest | ||
-------- | ||
|
||
* extending TestCase | ||
* assertions, e.g. self.assertEquals | ||
|
||
Nose | ||
---- | ||
|
||
* invocation: nosetests | ||
* naming conventions: test_* | ||
* fixtures: setup | ||
* per-test fixtures with @with_setup decorator | ||
* assertions, e.g. assert_equal, assert_almost_equal... |