Download - Automated testing - back to the roots
![Page 2: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/2.jpg)
goodies
levels
crosstab
lessons
![Page 3: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/3.jpg)
✓ Product quality
Frequency and severity of defects
![Page 4: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/4.jpg)
✓ Documentation
Business requirements
Technical specification
![Page 5: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/5.jpg)
The authorization page
✓ should be at the correct url (3531ms)
✓ should display client_not_specified if client_id is missing as a parameter (2818ms)
✓ should display invalid_redirect_uri if wrong redirect_uri is sent as a parameter (2796ms)
✓ should display invalid_redirect_uri if client does not have a redirect_uri configured (2789ms)
✓ should redirect to the login page if the user is not logged in (2434ms)
✓ should redirect back to client with an access token on successful login (6149ms)
✓ should go back to client, when clicking on browser back button after successful login (5674ms) When the user is already logged in
✓ should redirect back to client with an access token (1975ms)
✓ should redirect back to client with an id_token if the requested scope includes openid (2036ms)
✓ should redirect back to client with an id_token that contains the provided nonce (2150ms)
✓ should redirect back to client with a code as a query parameter (2100ms)
✓ should redirect back to client with a code and id_token if response_type includes both (2232ms)
✓ should go back to client, when clicking on browser back button (2448ms)
✓ should redirect to the login page if the login state has expired (4210ms)
![Page 6: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/6.jpg)
✓ Continuous integration and deployment
Rapid cycles = early feedback
Smaller scope = smaller risk
![Page 7: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/7.jpg)
Effort per feature
Time
✓ Refactoring
![Page 8: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/8.jpg)
Gerard Meszaros (2003)
✓ Efficiency
![Page 9: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/9.jpg)
Category Business value
Product quality Frequency and severity of defects
Continuous integration and deployment Rapid cycles
DocumentationBusiness requirements Efficiency of team communication
Technical specification Effort for understanding the system
Development
Enables refactoring Cost of new features and bugfixes
Modular design Cost of new features and bugfixes
Reduce interactive debugging Cost of new features and bugfixes
![Page 10: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/10.jpg)
Component2 Component3
C3
moc
k
Component1
Unit1 Unit2
component test
unit testU
2 m
ock
unit test
manual exploratory test
end-to-end test
acceptance test
minutes / hours
~10 s / ~ 10 min
~10 ms / ~ 10 s
~30 s / ~ 2 min
![Page 11: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/11.jpg)
✓ goodies
✓ levels
crosstab
lessons
![Page 12: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/12.jpg)
Production bug
prevention
Continuous integration
and deployment
Documentation Development support
Business requirements
Technicalspecification
Enables refactoring
Flexible design
Reduceinteractive debugging
Exploratory ■
Prod-Smoke ▪ ■
Acceptance ▪ ■ ■
End-to-end ▪ ■ ▪
Component ▪ ■ ■ ■
Unit ▫ ■ ■ ▪ ■ ■
![Page 13: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/13.jpg)
Unit tests - focus on describing the intention
Coverage 100%
Atomic
Independent
Aggressive maintenance
Critical code review
Production bug
prevention
Continuous integration
and deployment
Documentation Development support
Business requirements
Technicalspecification
Enables refactoring
Flexible design
Reduceinteractive debugging
Unit ▫ ■ ■ ▪ ■ ■
![Page 14: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/14.jpg)
Component tests - focus on enabling refactoring
Cover 100% interface
Avoid referring internals
Mock dependencies
Production bug
prevention
Continuous integration
and deployment
Documentation Development support
Business requirements
Technicalspecification
Enables refactoring
Flexible design
Reduceinteractive debugging
Component ▪ ■ ■ ■
![Page 15: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/15.jpg)
Recap
- Code review is your only chance for testing the readability of the specification
- Don’t let unit tests pile up and rot
- Acceptance tests and contract tests for business requirements tracking
- Unit tests for technical specification
- Maintain component tests interface-coverage
![Page 16: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/16.jpg)
Why not?
![Page 17: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/17.jpg)
![Page 18: Automated testing - back to the roots](https://reader036.vdocument.in/reader036/viewer/2022083023/58ae4f441a28ab57678b48c1/html5/thumbnails/18.jpg)
References
Meszaros G. (2007). xUnit Test Patterns: Refactoring Test Code. Addison Wesley
http://xunitpatterns.com/~gerard/xpau2003-test-automation-manifesto-paper.pdf
http://xunitpatterns.com/~gerard/xunitTutorialSlides-V1.pdf
Clemson T. (2014). Testing Strategies in a Microservice Architecturehttp://martinfowler.com/articles/microservice-testing/