7. Approval Tests make it EASY…
For Woody… For Lynn…
• … for human evaluation of • … in multiple languages
test results • … with visual results…
• … to set up Tests
• … to modify test output for
readability Golden Master
• … to maintain tests
9. Approving the Reported Result
• Contents are serialized to a file as binary (to compare)
• Rename *.received to *.approved
• Right click ‘Use whole file’
• Copy ‘Move’ statement from Test Results to command window.
11. A Little About Reporters
• Reporters provide a rich, expressive, human-friendly view of
a failed test.
• Reporters usually hook into DiffTools (Text, Image, Sound…)
• Support for many diff tools included in Reporters
• Can add hooks to your favorite diff tool
13. Best test output has...?
Granularity
• What is the result of a break
• What is the specific cause of a break
Feedback
• Frequent (or even constant) feedback
Specification
• What is this code supposed to do?
• How do we use it?
Regression-Proofing
• Did what I just do break something?
Automatic Design Process
• TDD can be thought of as Test Driven Design
18. Code must be Testable
Code must include Tests
Code should be written so that it is easy to write
its required tests
“Reduce to Functional”
Code Tests must be kept runnable
19. Unit Test Frameworks are Multi-Purpose
New Code • Application code (components)
• Functionality
Testing APIs • Edge cases
• Locking tests
Legacy Code • Characterization tests
Learning new • Scope
APIs • Functionality
21. Locking Tests (Characterization Tests)
Ensures Quickly
Test to Most often
system still results in
enable used with
works the high test
refactoring Legacy Code
same coverage
23. For More Information
www.ApprovalTests.com
Pick your language & download
Pick your diff tool
Reference, Approve & Enjoy
Learn more – videos (.NET)
Podcast - HerdingCode