Upload
fabiopereirame
View
1.434
Download
1
Embed Size (px)
DESCRIPTION
Presentation given at ThoughtWorks XConf2011.
Citation preview
Shallow Depth of Test
Test at the appropriate level and achieve a testing pyramid
www.fabiopereira.me
Quote System
Male 29y 100K wants IP 5K and Life 500K
IP $25 Life $15
Quote System
Male 62y 100K wants IP 5K and Life 500K
IP $25 Life error
Quote System
Can sell life cover to people between 18 and 60. Can sell IP cover to people between 18 and 65
Life 18 J 17 L 60 J 61 L
IP 18 J 17 L 60 J 61 J 65 J 66 L
Internet
Quote System
Controller Domain Model
JavaScript
Repository
WebServer ReverseProxies Authentication
JSON Services
Controller Quote Pricing Validator Mandatory
Validator
BusRule Validator
BR1 BR2 BRN …
Domain Model
Validations
Price Calculator
Cover1 Cover2 …
PRICING DATA
Pricer Error Handler
Repository
JSON
Controller Quote Pricing Validator Mandatory
Validator
BusRule Validator
BR1 BR2 BRN …
Domain Model
Validations
Price Calculator
Cover1 Cover2 …
PRICING DATA
Pricer Error Handler
Repository
JSON
Controller Quote Pricing Validator Mandatory
Validator
BusRule Validator
BR1 BR2 BRN …
Domain Model
Validations
Price Calculator
Cover1 Cover2 …
PRICING DATA
Pricer Error Handler
Repository
JSON
h#p://blogs.agilefaqs.com/
h#p://jamescrisp.org
h#p://clipboarded.blogspot.com
h#p://wa9rmelon.com
www.fabiopereira.me
BDD at the Unit Level
Use builders and Fixtures
h#p://en.wikipedia.org/wiki/Builder_pa#ern
Controller Quote Pricing Validator Mandatory
Validator
BusRule Validator
BR1 BR2 BRN …
Domain Model
Validations
Price Calculator
Cover1 Cover2 …
PRICING DATA
Pricer Error Handler
Repository
JSON
Shallow Depth of Test
Stimulate
Operate
Simulate
MyTest
Mock/Stub
Stimulate
Operate
Simulate
MyTest
Mock/Stub
Simulate
Easy to Stub
And… Mock
Simulate Http
Wiring
You can test Spring Config
IN MEMORY DB (HSQL)
High level and Test Journeys at the UI Level
High level and Test Journeys at the UI Level
h#p://blog.carbonfive.com/2011/11/07/modern-‐cucumber-‐and-‐rails-‐no-‐more-‐training-‐wheels/
www.fabiopereira.me
Questions
Answers
Comments
www.fabiopereira.me
References h#p://apcj.blogspot.com/2005_04_01_archive.html h#p://wa9rmelon.com h#p://jamescrisp.org h#p://clipboarded.blogspot.com h#p://anton.kovalyov.net/2011/02/20/why-‐i-‐forked-‐jslint-‐to-‐jshint/ h#p://en.wikipedia.org/wiki/Builder_pa#ern h#p://jawr.java.net/ h#p://pivotal.github.com/jasmine/ h#p://code.google.com/p/js-‐test-‐driver/ h#p://blogs.agilefaqs.com/
Images h#p://www.flickr.com/photos/nburrows h#p://www.luxury-‐insider.com/uploads/news/2010/06/korean-‐air-‐first-‐class-‐award-‐1.jpg h#p://one7.files.wordpress.com/2010/06/browsers.jpg h#p://www.luxury-‐insider.com/uploads/news/2010/06/korean-‐air-‐first-‐class-‐award-‐1.jpg h#p://www.digital-‐photography-‐student.com/wp-‐content/uploads/2009/01/DOF-‐Shallow-‐Deep.png h#p://www.flickr.com/photos/bullgod/2604300680/
Thanks
www.fabiopereira.me