SlideShare a Scribd company logo
1 of 51
Growing software
from examples
Seb Rose, Claysnow Limited
Twitter:   @sebrose
Blog:      www.claysnow.co.uk
E-mail:         seb@claysnow.co.uk
Heavily influenced by GOOS book:
They’re called different things
The difference is that one is called Behaviour
Driven Development – and some people find that
wording useful – and one (or two) is called
(Acceptance) Test Driven Development – and
some people find that wording useful in a different
way.
And that’s it.
                                                             Liz Keogh, 2011
  http://lizkeogh.com/2011/06/27/atdd-vs-bdd-and-a-potted-history-of-some-related-stuff/
est                      Tes
        tom   er T                        De    tD
    Cus                                      velo riven
                                                 pm
                                                    ent
                                Domain D
                                        riven
   Specif                         Design
          ication
                  b   y Exam
                               ple
                                                    e Dr  iven
                                            Exam pl        ent
  A  cceptan ce Test                         D  eve l o pm
       en Deve l op m e n t
D ri v
                               Behaviour
                                         Driven
                                Developme
                                           nt
Pattern                     Generally good for                                     Generally bad for
                              Tests that require                                        • Tests that have
                              •a lot of setup OR                                            unimportant/simple/obvious
                              •easily forgotten setup                                       preconditions
                              Tests that have a non-obvious trigger
                              Tests with few expected outputs
                                                                                        •   Tests where there are multiple
      Given/When/Th                                                                         different inputs and multiple
      en                                                                                    different outputs
                                                                                        •   Tests where a single
                                                                                            Given/When/Then only
                                                                                            describes one of numerous very
                                                                                            similar test scenarios


                                 Tests that have numerous:                              •   Simple tests
                                 Inputs that affect output behavior                     •   Tests that are more about
                                 Outputs/expected behaviors                                 verifying simple UI behavior
                                 Tests where it’s important to test a lot For instance – “Test that an error
        Specification By of different data scenarios                                        message is displayed when the
        Example -                Tests where the trigger event is                           user enters an incorrect
        Conceptual or somewhat obvious                                                      password.”
        Concrete                 Any test where it seems like a table                   •   Test where there is really only
                                 would be useful to:                                        one input or precondition
                                 describe the test better, or
                                 help explore all of the possible inputs
                                 and outputs for a test.
http://www.scrumcrazy.com/file/view/ScrumCrazy.com_StoryTestingPatternsSummary3.pdf/391066838/ScrumCrazy.com_StoryTestingPatternsSummary3.pdf
Outside-in




             http://bddkickstart.com
http://exampler.com
Understandable
 Maintainable
  Necessary
  Granular
   Reliable
Understandable




                 http://plus.maths.org/latestnews/sep-dec08/proof/proof.jpg
Maintainable
Necessary
Granular
Reliable
Prefer declarative examples


Declarative - makes a statement (.)
Imperative - makes a command (.)
Interrogative - asks a question (?)
Exclamatory - shows excitement (!)
Imperative vs Declarative Style

Feature: Sign up
  Scenario: New user redirected to their own page
    Given I am not logged in
    And I visit the homepage
    And I follow "Sign up"
    And I fill in "Username" with "Seb"
    And I fill in "Password" with "password"
    And I fill in "Confirm password" with "password"
    When I press "Sign up"
    Then I should be on my feeds page
    And I should see "Hello, Seb"
Imperative vs Declarative Style




Feature: Sign up
  Scenario: New user redirected to their own page
    When I sign up for a new account
    Then I should be taken to my feeds page
    And I should see a greeting message
Imperative vs Declarative Style



Feature: The entire system

  This feature illustrates what can happen when you
  take the declarative style too far.

  Scenario: It works
    When I use the system
    Then it should work perfectly
Remember your audience


Who should be able to read the examples?
What is their interest in them?
Keep things clear.
Don’t hide the context




  [Test] public void asterisk_should_format_to_em()
  {
   String expected = "This is <em>em</em> text";
   String actual = f.Format("This is *em* text");

      Assert.AreEqual(expected, actual);   }
Don’t hide the context




Scenario: Increased delivery charges for zip code
Given my delivery zip code is in Alaska
When I go to the checkout
Then I will have to pay the higher delivery charges
 I will have to pay the higher delivery charges
Don’t hide the context




    @Test    public void
smoker_requires_manual_referral()    {
     Referral referral = underwriting.process(smoker);

     Assert.assertEquals(Referral.Manual, referral); }
Assert.assertEquals(Referral.Manual, referral); }
Make data explicit



    @Test     public void
smoker_requires_manual_referral()    {
     Customer customer = new Customer(“Joe”, “Smith”,
       “12/12/1980”, “Accountant”, “$300,000”, “Yes”,
       “No”);

    Referral referral = underwriting.process(customer);

     Assert.assertEquals(Referral.Manual, referral); }
Assert.assertEquals(Referral.Manual, referral); }
Emphasise interesting details


    @Test    public void
smoker_requires_manual_referral()    {
     CustomerBuilder builder = new CustomerBuilder();
     Customer customer = builder
       .withSmokerFlag()
       .build();

    Referral referral = underwriting.process(customer);

     Assert.assertEquals(Referral.Manual, referral); }
Assert.assertEquals(Referral.Manual, referral); }
Work collaboratively


Create a ubiquitous language.
Use examples to discover the domain.
Decompose ruthlessly.
User / Stakeholder Story

    Online subscriptions
   In order to increase subscriptions
   visitors should be able to
   subscribe online with a VISA card
User / Stakeholder Story

   VISA subscriptions
   In order to increase subscriptions
   visitors should be able to
   subscribe online with a VISA card
Acceptance Criteria

 VISA subscriptions
 Credit Card Processing
 Acceptance criteria:
  •Must support increase subscriptions
 In order to VISA
  •Does not need to support MasterCard, Switch
  •...
 visitors should be prevented from entering
  •Customers should be able to
  invalid credit card details
 subscribe online with
  • ...                         a VISA card
"Customers should be prevented from
       entering invalid credit card details"


Really? So tell me...
   • What exactly makes someone's
      credit card details invalid?
   • Can they use spaces?
   • Should we checksum the digits?
   • How do we feed back that the details
      are invalid?
Avoid workflow style


Every journey is made from single steps.
Workflows are more brittle.
A few workflows go a long way.
Exploratory
                      and
                    manual




https://www.ibm.com/developerworks/library/j-aopwork11/TestingPyramid.jpg
Workflow style


Scenario: Happy path for registration and purchase
Given I am on the homepage
And I register for an account in Alaska
And I go to the most popular item page
And I add the most popular item to my basket
And I go to checkout
And I select my delivery address
And I give valid payment details
When I confirm acceptance of terms and conditions
Then my purchase will be confirmed
 my purchase will be confirmed
Workflow style



Scenario: Correct postage price for Alaska
Given I am on the homepage
And I register for an account in “Alaska”
And I go to the most popular item page
And I add the most popular item to my basket
And I go to checkout
When I select delivery to my home address
Then I have to pay the higher delivery charge
 I have to pay the higher delivery charge
Focus on a single step




Scenario: Correct postage price for Alaska
Given I am on the checkout page
When I select delivery to “Alaska”
Then I have to pay the higher delivery charge
 I have to pay the higher delivery charge
Consider costs and benefits


Remove unnecessary examples
Exercise the thinnest slice possible
Automate when viable
Manual
Cost




                       Automate




                Risk
Don’t let example dictate mechanism


Visibility depends on interest not layer.
Insulate examples from technical details.
Acceptance tests not always end-to-end.
Make technical tests visible




Scenario: High Risk rates for Test Pilots
Given an applicant with occupation “Test Pilot”
When the underwriting engine is invoked
Then we will use the “High Risk” rates table
 we will use the “High Risk” rates table
Is this end to end?


@domain_model
@stubbed_underwriting
Scenario: Applicant with high risk occupation
Given a standard, single-life, male applicant
But with a high risk occupation
When the application is processed
Then it will be referred for manual underwriting
 it will be referred for manual underwriting
Categorise in multiple dimensions


Faster feedback is better.
Other dimensions are also useful.
Take advantage of partitioning.
Summary


Example-based methods are very similar.
Minor variations by target audience.
Skills are transferable.
Nomenclature


Check
Example
Specification
Test
Seb Rose
Twitter:  @sebrose
Blog:     www.claysnow.co.uk
E-mail:seb@claysnow.co.uk
Backup
Drive out traceability


-
-
-
Verify dependencies


-
-
-

More Related Content

Similar to Growing software from examples

Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examplesSeb Rose
 
Clean tests
Clean testsClean tests
Clean testsAgileee
 
Acceptance And Story Testing Patterns - By Charles Bradley
Acceptance And Story Testing Patterns - By Charles BradleyAcceptance And Story Testing Patterns - By Charles Bradley
Acceptance And Story Testing Patterns - By Charles BradleySynerzip
 
Testable Requirements
Testable Requirements Testable Requirements
Testable Requirements Bharti Rupani
 
Why Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOpsWhy Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOpsdpaulmerrill
 
Automated Acceptance Test Practices and Pitfalls
Automated Acceptance Test Practices and PitfallsAutomated Acceptance Test Practices and Pitfalls
Automated Acceptance Test Practices and PitfallsWyn B. Van Devanter
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerAndrew Siemer
 
You have no idea what your users want - WordCamp PDX
You have no idea what your users want - WordCamp PDXYou have no idea what your users want - WordCamp PDX
You have no idea what your users want - WordCamp PDXEvan Solomon
 
Tuhin Mitra: How I Automate My Negative Tests
Tuhin Mitra: How I Automate My Negative TestsTuhin Mitra: How I Automate My Negative Tests
Tuhin Mitra: How I Automate My Negative TestsAnna Royzman
 
Living with acceptance tests: Beyond Write-Once (XP NYC)
Living with acceptance tests: Beyond Write-Once (XP NYC)Living with acceptance tests: Beyond Write-Once (XP NYC)
Living with acceptance tests: Beyond Write-Once (XP NYC)Daniel Wellman
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques2PiRTechnologies
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniquesAshutosh Garg
 
Best Practices for Test Case Writing
Best Practices for Test Case WritingBest Practices for Test Case Writing
Best Practices for Test Case WritingSarah Goldberg
 
Test Requirements
Test RequirementsTest Requirements
Test Requirementstelab
 
Specification-by-Example: A Cucumber Implementation
Specification-by-Example: A Cucumber ImplementationSpecification-by-Example: A Cucumber Implementation
Specification-by-Example: A Cucumber ImplementationTechWell
 
Regression Testing: Down the Rabbit Hole (MEWT 2014)
Regression Testing: Down the Rabbit Hole (MEWT 2014)Regression Testing: Down the Rabbit Hole (MEWT 2014)
Regression Testing: Down the Rabbit Hole (MEWT 2014)Neil Studd
 
Mal12 qa tand-automatedtesting
Mal12 qa tand-automatedtestingMal12 qa tand-automatedtesting
Mal12 qa tand-automatedtestingandytinkham
 
Software testing with examples in Angular (and AngularJS)
Software testing with examples in Angular (and AngularJS)Software testing with examples in Angular (and AngularJS)
Software testing with examples in Angular (and AngularJS)Paweł Żurowski
 
So You Think You Can Write a Test Case - XBOSoft Webinar
So You Think You Can Write a Test Case - XBOSoft WebinarSo You Think You Can Write a Test Case - XBOSoft Webinar
So You Think You Can Write a Test Case - XBOSoft WebinarXBOSoft
 

Similar to Growing software from examples (20)

Growing software from examples
Growing software from examplesGrowing software from examples
Growing software from examples
 
Clean tests
Clean testsClean tests
Clean tests
 
Testable requirements
Testable requirementsTestable requirements
Testable requirements
 
Acceptance And Story Testing Patterns - By Charles Bradley
Acceptance And Story Testing Patterns - By Charles BradleyAcceptance And Story Testing Patterns - By Charles Bradley
Acceptance And Story Testing Patterns - By Charles Bradley
 
Testable Requirements
Testable Requirements Testable Requirements
Testable Requirements
 
Why Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOpsWhy Automated Testing Matters To DevOps
Why Automated Testing Matters To DevOps
 
Automated Acceptance Test Practices and Pitfalls
Automated Acceptance Test Practices and PitfallsAutomated Acceptance Test Practices and Pitfalls
Automated Acceptance Test Practices and Pitfalls
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew Siemer
 
You have no idea what your users want - WordCamp PDX
You have no idea what your users want - WordCamp PDXYou have no idea what your users want - WordCamp PDX
You have no idea what your users want - WordCamp PDX
 
Tuhin Mitra: How I Automate My Negative Tests
Tuhin Mitra: How I Automate My Negative TestsTuhin Mitra: How I Automate My Negative Tests
Tuhin Mitra: How I Automate My Negative Tests
 
Living with acceptance tests: Beyond Write-Once (XP NYC)
Living with acceptance tests: Beyond Write-Once (XP NYC)Living with acceptance tests: Beyond Write-Once (XP NYC)
Living with acceptance tests: Beyond Write-Once (XP NYC)
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques
 
Best Practices for Test Case Writing
Best Practices for Test Case WritingBest Practices for Test Case Writing
Best Practices for Test Case Writing
 
Test Requirements
Test RequirementsTest Requirements
Test Requirements
 
Specification-by-Example: A Cucumber Implementation
Specification-by-Example: A Cucumber ImplementationSpecification-by-Example: A Cucumber Implementation
Specification-by-Example: A Cucumber Implementation
 
Regression Testing: Down the Rabbit Hole (MEWT 2014)
Regression Testing: Down the Rabbit Hole (MEWT 2014)Regression Testing: Down the Rabbit Hole (MEWT 2014)
Regression Testing: Down the Rabbit Hole (MEWT 2014)
 
Mal12 qa tand-automatedtesting
Mal12 qa tand-automatedtestingMal12 qa tand-automatedtesting
Mal12 qa tand-automatedtesting
 
Software testing with examples in Angular (and AngularJS)
Software testing with examples in Angular (and AngularJS)Software testing with examples in Angular (and AngularJS)
Software testing with examples in Angular (and AngularJS)
 
So You Think You Can Write a Test Case - XBOSoft Webinar
So You Think You Can Write a Test Case - XBOSoft WebinarSo You Think You Can Write a Test Case - XBOSoft Webinar
So You Think You Can Write a Test Case - XBOSoft Webinar
 

More from Seb Rose

Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSeb Rose
 
Micro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsMicro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsSeb Rose
 
DevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfDevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfSeb Rose
 
Contract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfContract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfSeb Rose
 
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfExample mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfSeb Rose
 
Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Seb Rose
 
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021Seb Rose
 
A brief history of requirements - Unicom 2022
A brief history of requirements  - Unicom 2022A brief history of requirements  - Unicom 2022
A brief history of requirements - Unicom 2022Seb Rose
 
Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022Seb Rose
 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Seb Rose
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021Seb Rose
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021Seb Rose
 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021Seb Rose
 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021Seb Rose
 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Seb Rose
 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021Seb Rose
 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020Seb Rose
 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019Seb Rose
 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019Seb Rose
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Seb Rose
 

More from Seb Rose (20)

Software contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdfSoftware contracts - Global Enterprise Agile 2023.pdf
Software contracts - Global Enterprise Agile 2023.pdf
 
Micro-service delivery - without the pitfalls
Micro-service delivery - without the pitfallsMicro-service delivery - without the pitfalls
Micro-service delivery - without the pitfalls
 
DevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdfDevSecOps - Agile Get-Together 2022.pdf
DevSecOps - Agile Get-Together 2022.pdf
 
Contract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdfContract testing - Sealights 2022.pdf
Contract testing - Sealights 2022.pdf
 
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdfExample mapping - slice any story into testable examples - SoCraTes 2022.pdf
Example mapping - slice any story into testable examples - SoCraTes 2022.pdf
 
Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)Software testing - learning to walk again (expoQA22)
Software testing - learning to walk again (expoQA22)
 
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
DevSecOps - Unicom Agile and DevOps Expo (Adaptive Challenges) 2021
 
A brief history of requirements - Unicom 2022
A brief history of requirements  - Unicom 2022A brief history of requirements  - Unicom 2022
A brief history of requirements - Unicom 2022
 
Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022
 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021
 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021
 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020
 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021
 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020
 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019
 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...
 

Recently uploaded

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 

Recently uploaded (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Growing software from examples

  • 1. Growing software from examples Seb Rose, Claysnow Limited Twitter: @sebrose Blog: www.claysnow.co.uk E-mail: seb@claysnow.co.uk
  • 3.
  • 4.
  • 5. They’re called different things The difference is that one is called Behaviour Driven Development – and some people find that wording useful – and one (or two) is called (Acceptance) Test Driven Development – and some people find that wording useful in a different way. And that’s it. Liz Keogh, 2011 http://lizkeogh.com/2011/06/27/atdd-vs-bdd-and-a-potted-history-of-some-related-stuff/
  • 6. est Tes tom er T De tD Cus velo riven pm ent Domain D riven Specif Design ication b y Exam ple e Dr iven Exam pl ent A cceptan ce Test D eve l o pm en Deve l op m e n t D ri v Behaviour Driven Developme nt
  • 7. Pattern Generally good for Generally bad for Tests that require • Tests that have •a lot of setup OR unimportant/simple/obvious •easily forgotten setup preconditions Tests that have a non-obvious trigger Tests with few expected outputs • Tests where there are multiple Given/When/Th different inputs and multiple en different outputs • Tests where a single Given/When/Then only describes one of numerous very similar test scenarios Tests that have numerous: • Simple tests Inputs that affect output behavior • Tests that are more about Outputs/expected behaviors verifying simple UI behavior Tests where it’s important to test a lot For instance – “Test that an error Specification By of different data scenarios message is displayed when the Example - Tests where the trigger event is user enters an incorrect Conceptual or somewhat obvious password.” Concrete Any test where it seems like a table • Test where there is really only would be useful to: one input or precondition describe the test better, or help explore all of the possible inputs and outputs for a test. http://www.scrumcrazy.com/file/view/ScrumCrazy.com_StoryTestingPatternsSummary3.pdf/391066838/ScrumCrazy.com_StoryTestingPatternsSummary3.pdf
  • 8. Outside-in http://bddkickstart.com
  • 10. Understandable Maintainable Necessary Granular Reliable
  • 11. Understandable http://plus.maths.org/latestnews/sep-dec08/proof/proof.jpg
  • 16. Prefer declarative examples Declarative - makes a statement (.) Imperative - makes a command (.) Interrogative - asks a question (?) Exclamatory - shows excitement (!)
  • 17. Imperative vs Declarative Style Feature: Sign up Scenario: New user redirected to their own page Given I am not logged in And I visit the homepage And I follow "Sign up" And I fill in "Username" with "Seb" And I fill in "Password" with "password" And I fill in "Confirm password" with "password" When I press "Sign up" Then I should be on my feeds page And I should see "Hello, Seb"
  • 18. Imperative vs Declarative Style Feature: Sign up Scenario: New user redirected to their own page When I sign up for a new account Then I should be taken to my feeds page And I should see a greeting message
  • 19. Imperative vs Declarative Style Feature: The entire system This feature illustrates what can happen when you take the declarative style too far. Scenario: It works When I use the system Then it should work perfectly
  • 20. Remember your audience Who should be able to read the examples? What is their interest in them? Keep things clear.
  • 21. Don’t hide the context [Test] public void asterisk_should_format_to_em() { String expected = "This is <em>em</em> text"; String actual = f.Format("This is *em* text"); Assert.AreEqual(expected, actual); }
  • 22. Don’t hide the context Scenario: Increased delivery charges for zip code Given my delivery zip code is in Alaska When I go to the checkout Then I will have to pay the higher delivery charges I will have to pay the higher delivery charges
  • 23. Don’t hide the context @Test public void smoker_requires_manual_referral() { Referral referral = underwriting.process(smoker); Assert.assertEquals(Referral.Manual, referral); } Assert.assertEquals(Referral.Manual, referral); }
  • 24. Make data explicit @Test public void smoker_requires_manual_referral() { Customer customer = new Customer(“Joe”, “Smith”, “12/12/1980”, “Accountant”, “$300,000”, “Yes”, “No”); Referral referral = underwriting.process(customer); Assert.assertEquals(Referral.Manual, referral); } Assert.assertEquals(Referral.Manual, referral); }
  • 25. Emphasise interesting details @Test public void smoker_requires_manual_referral() { CustomerBuilder builder = new CustomerBuilder(); Customer customer = builder .withSmokerFlag() .build(); Referral referral = underwriting.process(customer); Assert.assertEquals(Referral.Manual, referral); } Assert.assertEquals(Referral.Manual, referral); }
  • 26. Work collaboratively Create a ubiquitous language. Use examples to discover the domain. Decompose ruthlessly.
  • 27. User / Stakeholder Story Online subscriptions In order to increase subscriptions visitors should be able to subscribe online with a VISA card
  • 28. User / Stakeholder Story VISA subscriptions In order to increase subscriptions visitors should be able to subscribe online with a VISA card
  • 29. Acceptance Criteria VISA subscriptions Credit Card Processing Acceptance criteria: •Must support increase subscriptions In order to VISA •Does not need to support MasterCard, Switch •... visitors should be prevented from entering •Customers should be able to invalid credit card details subscribe online with • ... a VISA card
  • 30. "Customers should be prevented from entering invalid credit card details" Really? So tell me... • What exactly makes someone's credit card details invalid? • Can they use spaces? • Should we checksum the digits? • How do we feed back that the details are invalid?
  • 31. Avoid workflow style Every journey is made from single steps. Workflows are more brittle. A few workflows go a long way.
  • 32. Exploratory and manual https://www.ibm.com/developerworks/library/j-aopwork11/TestingPyramid.jpg
  • 33. Workflow style Scenario: Happy path for registration and purchase Given I am on the homepage And I register for an account in Alaska And I go to the most popular item page And I add the most popular item to my basket And I go to checkout And I select my delivery address And I give valid payment details When I confirm acceptance of terms and conditions Then my purchase will be confirmed my purchase will be confirmed
  • 34. Workflow style Scenario: Correct postage price for Alaska Given I am on the homepage And I register for an account in “Alaska” And I go to the most popular item page And I add the most popular item to my basket And I go to checkout When I select delivery to my home address Then I have to pay the higher delivery charge I have to pay the higher delivery charge
  • 35. Focus on a single step Scenario: Correct postage price for Alaska Given I am on the checkout page When I select delivery to “Alaska” Then I have to pay the higher delivery charge I have to pay the higher delivery charge
  • 36. Consider costs and benefits Remove unnecessary examples Exercise the thinnest slice possible Automate when viable
  • 37. Manual Cost Automate Risk
  • 38. Don’t let example dictate mechanism Visibility depends on interest not layer. Insulate examples from technical details. Acceptance tests not always end-to-end.
  • 39.
  • 40. Make technical tests visible Scenario: High Risk rates for Test Pilots Given an applicant with occupation “Test Pilot” When the underwriting engine is invoked Then we will use the “High Risk” rates table we will use the “High Risk” rates table
  • 41. Is this end to end? @domain_model @stubbed_underwriting Scenario: Applicant with high risk occupation Given a standard, single-life, male applicant But with a high risk occupation When the application is processed Then it will be referred for manual underwriting it will be referred for manual underwriting
  • 42. Categorise in multiple dimensions Faster feedback is better. Other dimensions are also useful. Take advantage of partitioning.
  • 43. Summary Example-based methods are very similar. Minor variations by target audience. Skills are transferable.
  • 45. Seb Rose Twitter: @sebrose Blog: www.claysnow.co.uk E-mail:seb@claysnow.co.uk
  • 47.
  • 48.
  • 49.

Editor's Notes

  1. Scene setting Properties of examples Commonalities between approaches Nomenclature
  2. Background &amp; GOOS book
  3. TDD red/green/refactor
  4. Extended
  5. Examples or tests - Liz Keogh
  6. Various methods &amp; brief potted history
  7. The Bradley document
  8. - Try to get a manager to explain what TDD is - summarise / generalise that explanation: we start with a clear goal, before doing the work to achieve it - we can use this same pattern at lots of levels in a software project: if statements in the centre, business goal on the outside
  9. Example based Marick
  10. Example based properties
  11. Living documentation - at all layers - ubiquitous language - single source of truth - required domain knowledge varies
  12. Pragmatic ideas - DRY
  13. How exhaustive should we be?
  14. Single behaviour - granular
  15. Must be reliable - cost of failures in time &amp; reputation
  16. Commonality 1 - Understandable - Maintainable
  17. Declarative vs. Imperative - relate to maintainability and readability - all layers
  18. - Understandable - Necessary
  19. Background/setup
  20. Background/setup
  21. Data
  22. Data
  23. Builders
  24. Understandable - Ubiquitous language - Structure of examples Maintainable - Removal of repetition
  25. - Credit Liz Keogh for this version of the template - Don&apos;t let the template stop you from thinking! - Anti-pattern: In order to X as a user I want X - &apos;Why&apos; is the cure
  26. - Credit Liz Keogh for this version of the template - Don&apos;t let the template stop you from thinking! - Anti-pattern: In order to X as a user I want X - &apos;Why&apos; is the cure
  27. - Mention Agile Estimation &amp; Planning / User Stories Applied - Traditional agile - Mike Cohn calls them &apos;conditions of satisfaction&apos; - rules about scope, but not (normally) expressed as examples
  28. -Understandable -Maintainable -Granular -Reliable
  29. Testing pyramid
  30. Background/setup
  31. Background/setup
  32. Background/setup
  33. Consider Cost &amp; benefit - reliable - necessary
  34. Cost/risk graph - don’t automate everything - Necessary?
  35. Understandable Reliable
  36. Testing iceberg
  37. Making technical tests visible
  38. Mocking/stubbing - only at technical layers? - not interesting to business consumers?
  39. Necessary? Granular? Feedback velocity - know the purpose of every example - partition by speed and value
  40. Summary - pretty much the same. minor variations depending on target audience
  41. Nomenclature - Examples not tests.
  42. Testing quadrants - Marick/Hendrickson Is this useful?
  43. Decoupling as a matter of course
  44. Ports &amp; adaptors
  45. Drive Out Traceability - how do we know it’s tested? - how can we be sure it’s only tested once?
  46. Verify dependencies - External components - contract &amp; collaboration