How To Build an Effective Automated Test Suite
-
Upload
david-adsit -
Category
Technology
-
view
139 -
download
1
Transcript of How To Build an Effective Automated Test Suite
![Page 1: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/1.jpg)
Thanks to our Sponsors!
To connect to wireless 1. Choose Uguest in the wireless list
2. Open a browser. This will open a Uof U website 3. Choose Login
![Page 2: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/2.jpg)
How to build anEffective Automated
Test Suite
David Adsit@davidadsit
codeobsession.blogspot.com
![Page 3: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/3.jpg)
Why test?
![Page 4: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/4.jpg)
Why test?
“Code without tests is bad code. It doesn't matter how well written it is; it doesn't matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably.Without them, we really don't know if our code is getting better or worse.”
- Michael Feathers
![Page 5: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/5.jpg)
3 Great Virtues
“We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris.”
- Larry Wall
![Page 6: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/6.jpg)
The Full Test Suite
![Page 7: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/7.jpg)
The Full Test Suite
Unit Tests
Integration Tests
Acceptance Tests
UI Tests
![Page 8: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/8.jpg)
The Full Test Suite
Unit Tests
Integration Tests
Acceptance Tests
UI Tests
![Page 9: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/9.jpg)
The Full Test Suite
Unit Tests
Integration Tests
Acceptance Tests
UI Tests
![Page 10: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/10.jpg)
The Full Test Suite
Unit Tests
Integration Tests
Acceptance Tests
UI Tests
![Page 11: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/11.jpg)
Unit Tests
Strengths▪ Fast - which means you can have a lot of them▪ Focused feedback when code breaks▪ Provide executable documentation for each unit
Weaknesses▪ Do not verify external dependencies▪ Do not verify that units will work properly together▪ Do not verify that the system supports desired features▪ Do not answer questions about the “-ilities” of the system
![Page 12: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/12.jpg)
Integration Tests
Strengths▪ Verify that external dependencies behave as expected▪ Provide early notification of API changes▪ Facilitate changing external system providers▪ Can tell us about the “-ilities” of external dependencies▪ Help ensure clean boundaries with external dependencies
Weaknesses▪ Usually significantly slower than unit tests▪ Test only a very narrow part of the system▪ Do not verify that the system supports desired features
![Page 13: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/13.jpg)
Acceptance Tests
Strengths▪ Help communicate features and requirements with business▪ Verify the existence of features▪ Help drive a clean API for the system▪ Exercise the full system (excluding the UI)
Weaknesses▪ Slower than unit tests▪ Do not answer questions about the “-ilities” of the system
![Page 14: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/14.jpg)
The Double Loop
![Page 15: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/15.jpg)
Layered Architecture
Eric Evans, Domain Driven Design
![Page 16: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/16.jpg)
User Interface Tests
Strengths▪ Verify that the system can be assembled▪ Verify that the user can interact with the system▪ Can answer questions about the “-ilities” of the system
Weaknesses▪ Slower than the pitch drop experiment▪ Unreliable▪ Require significant maintenance when changes occur▪ Cannot provide confidence about system correctness
![Page 17: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/17.jpg)
Questions
&
Demos
![Page 18: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/18.jpg)
Links
Unit & Integration & Acceptance & UI:https://github.com/davidadsit/LegacyCodeRescue
Unit & Acceptance: https://github.com/davidadsit/bddtddfitnesse
Slides: http://www.slideshare.net/davidadsit
Blog Post:http://codeobsession.blogspot.com/2012/03/simpler-tests-what-kind-of-test-are-you.html
![Page 19: How To Build an Effective Automated Test Suite](https://reader031.fdocuments.net/reader031/viewer/2022020208/55a856f91a28ab7c2d8b4691/html5/thumbnails/19.jpg)
Final Questions?
David Adsit@davidadsit
codeobsession.blogspot.com