Skip to content

Commit

Permalink
shorten section on unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
esc committed Oct 8, 2010
1 parent dfaee09 commit e33c917
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 35 deletions.
47 changes: 12 additions & 35 deletions slides.wiki
Expand Up @@ -234,57 +234,34 @@
[block]>

* We wish to automate testing of our units
* In python we have several package available
** '''unittest''', '''nosetest''', '''pytest'''
* Simple overview today, hands on exercise tomorrow
* In python we have several package available:
** \href{http://docs.python.org/library/unittest.html}{unittest}, \href{http://somethingaboutorange.com/mrl/projects/nose/0.11.2/}{nosetest}, \href{http://codespeak.net/py/dist/test/}{pytest}
* Tests increase the confidence that your code works correctly, not only for yourself but also for your reviewers
* Tests are the only way to trust your code
* It might take you a while to get used to writing them, but it will pay off quite rapidly
==== Example ====

\lstinputlisting[style=basic,language=python]{my_product_test.py}

\lstinputlisting[style=basic,frame=none]{test-output}

==== Goals ====
==== Goals and Benefits ====

<[block]{Goals}
* check code works
* check design works
* catch regression
[block]>

==== Benefits ====

<[block]{Benefits}
* Easier to test the whole, if the units work
* Can modify parts, and be sure the rest still works
* Provide examples of how to use code
[block]>

==== What Makes a Good Test? ====

* independent (of each other, and of user input)
* repeatable (i.e. deterministic)
* self-contained
==== Test Suits ====

* All unit tests are collected into a test suite
* Execute the entire test suite with a single command
* Can be used to provide reports and statistics
==== Some Last Thoughts ====

* Tests increase the confidence that your code works correctly, not only for yourself but also for your reviewers
* Tests are the only way to trust your code
* It might take you a while to get used to the idea, but it will pay off quite rapidly
\hspace{4cm}

* Questions?
* Hand-on exercise tomorrow!
== Development Methodologies ==

Expand Down
15 changes: 15 additions & 0 deletions unused.wiki
Expand Up @@ -157,3 +157,18 @@ sic Version Control Workflow ====
* Questions

==== What Makes a Good Test? ====

* independent (of each other, and of user input)
* repeatable (i.e. deterministic)
* self-contained
==== Test Suits ====

* All unit tests are collected into a test suite
* Execute the entire test suite with a single command
* Can be used to provide reports and statistics

0 comments on commit e33c917

Please sign in to comment.