• Like
  • Save
Shallow Depth of Tests Scallable BDD and TDD
Upcoming SlideShare
Loading in...5
×
 

Shallow Depth of Tests Scallable BDD and TDD

on

  • 592 views

http://fabiopereira.me/blog/2012/02/05/speaking-at-qcon-beijing/...

http://fabiopereira.me/blog/2012/02/05/speaking-at-qcon-beijing/
QCon Beijing presentation.
Shallow Depth of Tests - Scalable TDD/BDD
Test automation is prevalent in the software development community. Practices like TDD and BDD are widespread and applied almost unquestionably. However, several organisations have struggled in attempting to scale automated test suites, which very often become slow, brittle, non-deterministic, unreliable and difficult to maintain.
In this talk, I will discuss some common mistakes, Tautological TDD (TTDD), for example, and also present patterns that I have successfully applied, such as Shallow Depth of Tests and Testing Pyramid. These have enabled us to achieve maintainable and scalable tests that fulfill their purpose - to help software development teams deliver faster and more confidently the features required by business people.

Statistics

Views

Total Views
592
Views on SlideShare
592
Embed Views
0

Actions

Likes
0
Downloads
6
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Shallow Depth of Tests Scallable BDD and TDD Shallow Depth of Tests Scallable BDD and TDD Presentation Transcript

    • Shallow Depth of Test Scalable TDD/BDD  www.fabiopereira.me  
    • TDDCall Centre   •  Slow •  Brittle •  Non-deterministic •  Difficult to maintain •  They do not scale
    • TDD Evolution   ???????   TODAY   No Tests
    • 29 year old man wants:-  Car insurance-  Travel insurance Quote Car $25 System   Travel $15
    • 62 year old man wants:-  Car insurance-  Travel insurance Quote Car $25 System   Travel (Too Old)
    • Can sell car insurance to people between 18 and 65.Can sell travel insurance to people between 18 and 60 Car Travel 17 L 18 J 17 L 18 J Quote 60 J 60 J 61 J 61 L System   65 J 66 L
    • InternetQuoteSystem  
    • JavaScript   WebServer ReverseProxies Authentication JSON Services   Controller  Repository   Domain Model  
    • Error Handler   Validations   Pricer   JSON Quote Mandatory Controller   Validator   Pricing   Validator   Price BusRule Domain Calculator   Validator   Model      Cover1 Cover2 BR1 BR2 BRN … … Repository   PRICING DATA
    • Error Handler   Validations   Pricer   JSON Quote Mandatory Controller   Validator   Pricing   Validator   Price BusRule Domain Calculator   Validator   Model      Cover1 Cover2 BR1 BR2 BRN … … Age Restriction Repository   PRICING Rule   DATA
    • Error Handler   Validations   Pricer   JSON Quote Mandatory Controller   Validator   Pricing   Validator   Price BusRule Domain Calculator   Validator   Model      Cover1 Cover2 BR1 BR2 BRN … … Repository   PRICING DATA
    • Most  so6ware  organiza;ons  today  suffer  from  what  I    called  the  “Inverted  Tes+ng  Pyramid”  (…)   h#p://blogs.agilefaqs.com/  
    • h#p://jamescrisp.org  
    • h#p://clipboarded.blogspot.com  
    • Error Handler   Validations   Pricer   JSON Quote Mandatory Controller   Validator   Pricing   Validator   Price BusRule Domain Calculator   Validator   Model      Cover1 Cover2 BR1 BR2 BRN … … Age Restriction Repository   PRICING Rule   DATA
    • Shallow Depth of Test  
    • Shallow Depth of Test  
    • MyTest   Stimulate   Operate   Mock/Stub   Simulate  
    • Error Handler   Validations   Pricer   JSON Quote Mandatory Controller   Validator   Pricing   Validator   Price BusRule Domain Calculator   Validator   Model      Cover1 Cover2 BR1 BR2 BRN … … Repository   PRICING DATA
    • www.fabiopereira.me  
    • BDD   Business   Devs   Broker   user  Renewal   Edit   Risk   UBD_CD  Address   TB_ADR   Insurer   en:ty    
    • Given BWhen DThen D
    • BDD at the Unit Level  
    • Use Builders and Fixtures   h#p://en.wikipedia.org/wiki/Builder_pa#ern  
    • BDD   Concept   Tools/ Current Practices  
    • web_steps.rb  h#p://blog.carbonfive.com/2011/11/07/modern-­‐cucumber-­‐and-­‐rails-­‐no-­‐more-­‐training-­‐wheels/  
    • Simulate Http  
    • Wiring
    • IN MEMORY DB (HSQL)
    • You can test Spring Config  
    • High level and Test Journeys at the UI LevelAn authenticated insurance adviser should be able to sell insurance to a customer who fulfills all mandatory requirements Business rules should be applied to all customers who attempt to buy insurance Customers should be given the right insurance premium based on their insurance requirements
    • High level and Test Journeys at the UI LevelAn authenticated insurance adviser, should be able to sell insurance to a customer who fulfills all mandatory requirements Business rules should be applied to all customers who attempt to buy insurance Customers should be given the right insurance premium based on their insurance requirements
    • High level and Test Journeys at the UI LevelAn authenticated insurance adviser, should be able to sell insurance to a customer who fulfills all mandatory requirements Business rules should be applied to all customers who attempt to buy insurance Customers should be given the right insurance premium based on their insurance requirements
    • TTDD – Tautological TDD   Tauto… WHAT?!
    • Tautology:  from  Greek:  tauto:  the  same    logos:  word/idea          Tautological:    -­‐  needless,  redundant  repe;;on  of  an  idea  -­‐  repe;;on  of  same  sense  in  different  words;  -­‐  the  phrase  ”a  beginner  who  has  just  started”  is  tautological  
    • T  A  U  T  O  L  O  G  I  C  A  L  
    • TTDD – Mocks   Setup MocksCall a method/function Assert that mocks were called
    • (Dependency Injection Code)    
    • (Mocks Setup)    
    • Shallow DoTLet’s evolve…   Test Pyramid Unit BDD UI Journeys Stop TTDD   Slow, brittle, etc   No Tests
    • www.fabiopereira.me  
    • Thanks  Referencesh#p://apcj.blogspot.com/2005_04_01_archive.html  h#p://wa;rmelon.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/  h#p://fabiopereira.me/blog/2012/03/18/introducing-­‐depth-­‐of-­‐test-­‐dot/  Images   www.fabiopereira.me  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/  h#p://www.whatsgo#ago.com/wp-­‐content/uploads/2007/12/angry_phone2.jpg