Testing
This lecture looks at the basics of testing software.
- Introduction (pdf, ppt)
- Why you should do testing
- Limitations of testing
- Introduction to unit tests
- Basic testing pattern
- Exceptions (pdf, ppt)
- Causes of errors
- Error handling via status codes
- Error handling via exceptions
- Producing informative error messages
- Raising your own exceptions
- Unit Testing (pdf, ppt)
- Python’s “Nose” library
- Creating useful test cases
- Interface and Implementation (pdf, ppt)
- The difference between “interface” and “implementation”
- Isolating components for testing
- Using StringIO instead of external files
- Important rules for testing
- Floating Point (pdf, ppt)
- Storing floating point numbers on computers
- Mathematical operations in floating point systems
- Absolute and relative error
- Floating point numbers in testing
- Fixtures (pdf, ppt)
- Why fixtures are useful
- Creating fixtures using Nose
- Nose’s “setup” function vs. global variables
- Using decorators to deal with modified fixtures

Why nose and not unit test?
Good question: it’s because Nose doesn’t require classes or objects, so newcomers can start with it earlier.
Unless it’s somewhere and I missed it, it might be useful to indicate a link or a quick information on how to install nose (e.g. a random one: http://somethingaboutorange.com/mrl/projects/nose/0.11.2/)
The link Magali supplied seems to have changed into http://somethingaboutorange.com/mrl/projects/nose/1.0.0/
Shameless self promotion: I’ve uploaded a presentation about using testing frameworks that I wrote a couple of years ago. It has all-new audio.
http://4dpiecharts.com/2011/02/10/presentation-on-testing-frameworks/