Test Driven Development with JUnit
Please turn off all
Test Driven Development
Test Driven Development
Out of the Box
Demo: Complex Arithmetic
Eclipse Instructions
Command Line
Your first test method
Writing the Complex class
Run the test
Debug until the test passes
Write another test
Repaired code
Any other obvious bugs?
Adding a feature
Unit Testing
Reinitialization Example
Consequences
static data is not reinitialized
Fixtures
Freeing resources after each test
Assertion Messages
Floating point assertions
Integer assertions
Object comparisons: asserting object equality
Object comparisons: asserting object identity
Asserting Truth
Asserting Falsity
Asserting Nullness
Asserting Non-Nullness
Deliberately failing a test
Tests that throw Exceptions
Testing exceptional conditions
Test Suites
Test Suites
Test Suites Can Be Combined Into Larger Suites
What to Test
What Not to Test
To Learn More
Questions?
Entire Presentation as Single File
Start
|
Cafe con Leche
Copyright 2005, 2006 Elliotte Rusty Harold
Last Modified May 18, 2006