![Page 1: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/1.jpg)
An open source library for better Unit Testing
Woody Zuill & Lynn Langit
Agile 2012 – August 2012
![Page 2: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/2.jpg)
Dan
Who wrote ApprovalTests?
Llewellyn
![Page 3: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/3.jpg)
Approval Tests and Test Types
Integration Tests
Unit Tests Unit Tests
Function Tests
Performance Tests
Acceptance Tests
Installation Tests
![Page 4: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/4.jpg)
DEMO GETTING STARTED
![Page 5: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/5.jpg)
Building your Testing Toolkit
Test Runner
Test Code
Libraries
Manual tests
Automated tests & tools
![Page 6: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/6.jpg)
TDD - Red, Green, Refactor
![Page 7: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/7.jpg)
Approval Tests make it EASY…
For Woody…
• … for human evaluation of test results
• … to set up Tests
• … to modify test output for readability
• … to maintain tests
For Lynn…
• … in multiple languages
• … with visual results…
Golden Master
![Page 8: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/8.jpg)
DEMO EXPRESSIVENESS
![Page 9: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/9.jpg)
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.
![Page 10: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/10.jpg)
More about
reporters…
![Page 11: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/11.jpg)
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
![Page 12: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/12.jpg)
Best test output has…?
![Page 13: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/13.jpg)
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
![Page 14: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/14.jpg)
DEMO ARRAYS
![Page 15: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/15.jpg)
Approval Tests in Java…
![Page 17: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/17.jpg)
Code must be Testable
![Page 18: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/18.jpg)
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
![Page 19: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/19.jpg)
Unit Test Frameworks are Multi-Purpose
• Application code (components) New Code
• Functionality
• Edge cases Testing APIs
• Locking tests
• Characterization tests Legacy Code
• Scope
• Functionality
Learning new APIs
![Page 20: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/20.jpg)
Legacy Code
How much of your code base is dead code?
![Page 21: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/21.jpg)
Locking Tests (Characterization Tests)
Test to enable
refactoring
Ensures system still works the
same
Most often used with
Legacy Code
Quickly results in high test coverage
![Page 22: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/22.jpg)
DEMO Legacy Code – Chart Smart
![Page 23: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/23.jpg)
For More Information
www.ApprovalTests.com
Pick your language & download
Pick your diff tool
Reference, Approve & Enjoy
Learn more – videos (.NET)
Podcast - HerdingCode
![Page 24: ApprovalTests a library for you - Agile Alliance · 2019-12-16 · Agile 2012 – August 2012 . Dan Who wrote ApprovalTests? Llewellyn . Approval Tests and Test Types ... •TDD can](https://reader033.vdocuments.site/reader033/viewer/2022060307/5f09e8627e708231d42913d6/html5/thumbnails/24.jpg)
Q & A
@LynnLangit
@WoodyZuill