73.1. Overview73.2. Why Write Tests?73.2.1. Preventing Bugs in the First Place73.2.2. Gaining the Confidence to Refactor73.2.3. Driving Improvements in Design73.2.4. Writing Testable Software73.2.5. Happy Developers and Effortless Documentation73.3. Technology and Terminology73.3.1. The FlexUnit Library73.3.2. Unit Tests, Test Cases, and Test Suites73.3.3. Running Tests73.4. Test-Driven Development by Example73.4.1. Preparing for Unit Testing73.4.1.1. Download FlexUnit73.4.1.2. Adding the Library73.4.1.3. Creating the Test Folder73.4.2. Creating a Test Case73.4.3. Assembling a Test Suite73.4.4. Failing the Test!73.4.5. Prepare, Invoke, Assert73.4.5.1. Assertion Functions73.4.5.2. Examining Actual Values73.4.5.3. Failure Messages73.4.5.4. Fleshing Out the Test Case73.4.5.5. Some Real Coding73.4.6. Happy and Unhappy Paths73.4.6.1. Strengthening the Tests73.4.6.2. Strengthening the Code73.4.6.3. Enough Is Enough73.4.6.4. The Virtuous Cycle73.4.7. Setting Up and Tearing Down73.4.8. White Belt in Testing73.5. Further Topics73.5.1. Organizing Test Suites73.5.2. Removing Dependencies with Mock Objects73.5.2.1. The Collaborating Class73.5.2.2. The Delegate Interface73.5.2.3. The Real and Mock Implementations73.5.2.4. Unit Testing with the Mock Delegate73.5.2.5. Don't Make a Mockery of Your Unit Tests73.5.3. Continuous Integration with Ant and Maven73.5.4. Eventful Test Cases73.5.5. Test Coverage73.5.6. Behavior-Driven Development73.6. Summary