Outline of contents for testing cheat sheet.
[swc-testing-nose.git] / testing / cheat-sheet.md
1 Testing Cheat Sheet
2 ===================
3
4 Terminology
5 -----------
6
7 * A *unit test* acts on an isolated component within an application.
8 * A *test fixture* is the input data that a test acts on.
9 * The *interface* of a function is its public face, defined by its
10   input and output.
11 * The *implementation* of a function is how it gets from the input to
12   the output.
13 * A *stub* is a very simple implementation of one function that is
14   used in a test of a different function.
15
16 Unit Testing
17 ------------
18
19 * A *normal case* is a test case that reflects what is expected to be
20   typical usage of a function.
21 * A *boundary case* is a test case that reflects a less typical but
22   potentially troublesome type of usage.
23
24 Exceptions
25 ----------
26
27 * raise
28 * catch
29 * define
30
31 Assertions
32 ----------
33
34 * syntax
35 * stops execution
36
37 Unittest
38 --------
39
40 * extending TestCase
41 * assertions, e.g. self.assertEquals
42
43 Nose
44 ----
45
46 * invocation: nosetests
47 * naming conventions: test_*
48 * fixtures: setup
49 * per-test fixtures with @with_setup decorator
50 * assertions, e.g. assert_equal, assert_almost_equal...