SlideShare une entreprise Scribd logo
1  sur  33
Building .NET
Applications with BDD
NDC 2011
             GASPAR NAGY
             gn@techtalk.at
             Twitter: @gasparnagy

             JONAS BANDI
             jonas.bandi@techtalk.ch
             Twitter: @jbandi


Oslo, 8. June 2011


                                       COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
TechTalk at a glance
•   Established: 1993
•   Branches: Austria, Hungary, Switzerland
•   3 Managing partners: no external owners
•   Employees: ~ 60 employees
•   Turnover 2010: ~ 7 Mio CHF
•   Risk rating: very low risk
•   Self-financing, healthy growth




                                                            TechTalk office, Vienna/Austria


                                              COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
Background
• At TechTalk we are trying to live a BDD
  process for several years
• We started SpecFlow in 2009 out of a
  need to implement BDD
• We have implemented and improved
  our BDD process and knowledge in
  many projects
• … we are still learning    The research is partially supported by the
                             project of Eötvös Loránd University:
                             TÁMOP-4.2.1.B-09/1/KMR-2010-0003

3
BDD – A definition from Dan North
    BDD is a second-generation,
    outside-in, pull-based, multiple-
    stakeholder, multiple-scale, high-
    automation, agile methodology.

    It describes a cycle of
    interactions with well-defined
    outputs, resulting in the delivery
    of working, tested software that
    matters.        Dan North, Agile Testing, Specifications and BDD Exchange 2009

4
The BDD Development Process
                    … how we live it
          Requirements Analysis

        Executable & Automated
                   Specifications


      Improving Feedback with a
Transparent Development Process

           Living Documentation
5
Requirements Analysis & Colaboration
    We want to encourage new users to place an order.
    Therefore we are going to offer 10% discount on
    every initial order.




                                                              Register as “bart_bookworm”
                                                              Go to “/catalog/search”
                                                              Enter “ISBN-0955683610”
                                                              Click “Search”
                                                              Click “Add to Cart”
                                                              Click “View Cart”
                                                              Verify “Subtotal” is “$33.75”



             public void CalculateDiscount(Order order)
             {
               if (order.Customer.IsNew)
                 order.FinalAmount = Math.Round(order.Total * 9/10);
             }

6
Capturing and Organizing
Requirements


    DEMO



                           Your Product Backlog is more than just a list!
                                                    www.speclog.org

7
Outcome of Requirements Analysis
• Sprint Planning
    •User Stories
    •Acceptance Criterias
    •… illustrated by Examples




8
Executable & Automated
    Specifications
          Requirements Analysis

        Executable & Automated
                   Specifications


      Improving Feedback with a
Transparent Development Process

           Living Documentation
9
Automation
• Why?
     • iterative & incremental
       development demand a
       continuous feedback
• Challenges
     • Abstraction vs. Reliability
     • Trust
     • Shared Understanding
     • Effort
10
Scenarios: Automating Examples
• Some Formality is needed
     •But: Keep it „business readable“
• Gherkin




11
40 Spoken Languages




12
Writing Maintainable Scenarios


             Specification by Example
             by Gojko Adzic




13
Scripts vs. Declarative Scenarios
Given a clear database
And the database is loaded from "sample-data.sql"
And the webserver is running
When I go to URL: http://localhost:8080/myapp
And I click the "Login" link
And I enter username: john
And I enter password: john99
And I click the "Login" button
Then the page contains text: Hello John!

                      Background:
                      Given the following users:
                      | First Name | Last Name |
                      | John       | Smith     |
                      When John logs in
                      Then a greeting "Hello John!" is displayed.




14
Decouple, Reduce Noise, Focus on
Value
     Given a clear database
     When I create a user "John Smith" with login "jsmith"
     When I login as "jsmith"
     Then a greeting "Hello John!" is displayed.




                          Background:
                          Given the following users:
                          | First Name | Last Name |
                          | John       | Smith     |
                          When John logs in
                          Then a greeting "Hello John!" is displayed.




15
Automation on Different Levels




16
Challenges of UI Automation
• Technical
     •Infrastructure Dependency (Speed, Stability …)
     •Tests run in another Process
• Development Process
     •80% of all changes are in the UI

• Tools can help:
     •Mara, MVCContrib (“Capybara like”)

17
Organization of Features
Features are               TODO: Screenshot

project artifacts:
     •versioned in VCS
     •Hierarchies
     •Change over time     TODO: Screenshot




18
Organizing Steps
• Steps are code
• Organize steps along domain
  concepts. Avoid feature-
  coupled steps
• Scoped steps




19
Organizing Steps
• Application Driver Layer
     •Abstraction
     •Functional composition
     •Reuse




20
Outside-In Development
• Starting from the UI Layer is
  difficult
     •Start with a scribble / sketch
     •Good conventions help (aka.
      semantic markup)                1

     •Progress step by step. Building     2
                                              3
      the UI incrementally                        4
                                                      5


• Progressing to TDD
     •Not always needed?
21
Improving Feedback with a
     Transparent Development Process
           Requirements Analysis

         Executable & Automated
                    Specifications


      Improving Feedback with a
Transparent Development Process

            Living Documentation
22
Transparency
• Why?
     •Trust, Feedback, Learning, Embracing Change
• Scrum Tools
     •Standup, Taskboard, Burndown, Demo,
      Retrospective
• How can BDD help to improve it?
     •Technical Feedback
     •Different Perspective
     •Shared understanding

23
The Project
Dashboard

 DEMO




24
Build Server Integration
• Generating Reports
• Using Tags
• Demo: Build Config




25
Using Tags




31
Living Documentation
           Requirements Analysis

         Executable & Automated
                    Specifications


      Improving Feedback with a
Transparent Development Process

            Living Documentation
32
Evolving the living documentation

           Product Backlog                    Living Documentation

                      AccCrit 1                             AccCrit 1
       User Story 1
                      AccCrit 2   „Done“                    AccCrit 2
                                              Feature 1
                      AccCrit 3                             AccCrit 3
       User Story 2
                      AccCrit 4                             AccCrit 5
                      AccCrit 5                             AccCrit 4
       User Story n                           Feature n
                      AccCrit m                             AccCrit m

     • Units of work                       • Documentation
     • Organized according to              • Organized according to
       priority/value/effort                 functionality/overview
                                           • Versioned/maintained with
                                             source code

33
Living documentation
                                                                           Current sprint                    Features “done”
                                                                                                   merge
                                                                                                    when                       F
      Sprint                                                                US                    accepted
                                                                                    US
     Backlog                                                                 AC                                           F           F
          Acceptance
            Criteria                                                                  AC
     US   Acceptance
                                          refine
                                                                             AC
            Criteria                                                                  AC
                                                                             AC
          Acceptance                      the                                                                         F       F           F
            Criteria
     US                                   specification                               AC
          Acceptance
            Criteria
          Acceptance
            Criteria
                                                                                                             F            F
          Acceptance
     US     Criteria
          Acceptance                                                                                             AC           AC
            Criteria        Given       …            {…}                           validate
                                                              Automation



                                                                                                                 AC           AC
                            When        …            {…}                           continuously
                                                                                                                 AC       living documentation
                            Then        …            {…}
                       specification with examples


                                                                                                                          validate
                                                      executable                                                          continuously
                                                     specification




34
Living Documentation: Feature Tree




35
Pushing Living Documentation
     further


     DEMO




36
Other BDD Sessions at the NDC
Thursday Morning:
• Gojko Adzic
• Scott Bellware




 37
Questions &
Discussion




  GASPAR NAGY                                    JONAS BANDI
  gaspar.nagy@techtalk.at           jonas.bandi@techtalk.ch
  Twitter: @gasparnagy                      Twitter: @jbandi

                            COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH

Contenu connexe

En vedette (15)

герої мb[
герої мb[герої мb[
герої мb[
 
IPRO 497-212 Poster
IPRO 497-212 PosterIPRO 497-212 Poster
IPRO 497-212 Poster
 
resume 19 new
resume 19 newresume 19 new
resume 19 new
 
Docmeto 6 tra
Docmeto  6 traDocmeto  6 tra
Docmeto 6 tra
 
Indagini
IndaginiIndagini
Indagini
 
Resume J
Resume JResume J
Resume J
 
Marcus Dwyer in Souther Courier 110815
Marcus Dwyer in Souther Courier 110815Marcus Dwyer in Souther Courier 110815
Marcus Dwyer in Souther Courier 110815
 
прил.име(упр)
прил.име(упр)прил.име(упр)
прил.име(упр)
 
Teste Ágeis para todo o time
Teste Ágeis para todo o timeTeste Ágeis para todo o time
Teste Ágeis para todo o time
 
IT Act 2000
IT Act 2000IT Act 2000
IT Act 2000
 
Koledna magiya
Koledna magiyaKoledna magiya
Koledna magiya
 
collection development policy for e-resources
collection development policy for e-resourcescollection development policy for e-resources
collection development policy for e-resources
 
намиране на лице на правоъгълник
намиране на лице на правоъгълникнамиране на лице на правоъгълник
намиране на лице на правоъгълник
 
Урок 7 числата от 21 до 60
Урок 7 числата от 21 до 60Урок 7 числата от 21 до 60
Урок 7 числата от 21 до 60
 
Bdd training v5.2.0 - public
Bdd training   v5.2.0 - publicBdd training   v5.2.0 - public
Bdd training v5.2.0 - public
 

Similaire à NDC 2011 - Building .NET Applications with BDD

Application development using the wso2 developer studio
Application development using the wso2 developer studioApplication development using the wso2 developer studio
Application development using the wso2 developer studio
WSO2
 
Ágil x Lean Startup no Caipira Ágil
Ágil x Lean Startup no Caipira ÁgilÁgil x Lean Startup no Caipira Ágil
Ágil x Lean Startup no Caipira Ágil
alexandre freire
 

Similaire à NDC 2011 - Building .NET Applications with BDD (20)

Application development using the wso2 developer studio
Application development using the wso2 developer studioApplication development using the wso2 developer studio
Application development using the wso2 developer studio
 
JIRA Performance After 300,000 Issues
JIRA Performance After 300,000 IssuesJIRA Performance After 300,000 Issues
JIRA Performance After 300,000 Issues
 
Knolidge - Discover What You Have
Knolidge - Discover What You HaveKnolidge - Discover What You Have
Knolidge - Discover What You Have
 
Apache Flink Adoption at Shopify
Apache Flink Adoption at ShopifyApache Flink Adoption at Shopify
Apache Flink Adoption at Shopify
 
Must-have Plugins for Confluence & JIRA - Atlassian Summit 2010
Must-have Plugins for Confluence & JIRA - Atlassian Summit 2010Must-have Plugins for Confluence & JIRA - Atlassian Summit 2010
Must-have Plugins for Confluence & JIRA - Atlassian Summit 2010
 
Brisbane MuleSoft Meetup 2023-03-22 - Anypoint Code Builder and Splunk Loggin...
Brisbane MuleSoft Meetup 2023-03-22 - Anypoint Code Builder and Splunk Loggin...Brisbane MuleSoft Meetup 2023-03-22 - Anypoint Code Builder and Splunk Loggin...
Brisbane MuleSoft Meetup 2023-03-22 - Anypoint Code Builder and Splunk Loggin...
 
Technical Debt - SOTR14 - Clarkie
Technical Debt -  SOTR14 - ClarkieTechnical Debt -  SOTR14 - Clarkie
Technical Debt - SOTR14 - Clarkie
 
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
NDC 2011 - SpecFlow: Pragmatic BDD for .NETNDC 2011 - SpecFlow: Pragmatic BDD for .NET
NDC 2011 - SpecFlow: Pragmatic BDD for .NET
 
Cincom Smalltalk News
Cincom Smalltalk NewsCincom Smalltalk News
Cincom Smalltalk News
 
Get your Project back in Shape!
Get your Project back in Shape!Get your Project back in Shape!
Get your Project back in Shape!
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013
 
Ágil x Lean Startup no Caipira Ágil
Ágil x Lean Startup no Caipira ÁgilÁgil x Lean Startup no Caipira Ágil
Ágil x Lean Startup no Caipira Ágil
 
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
 
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
 
Behavioral driven development with Behat
Behavioral driven development with BehatBehavioral driven development with Behat
Behavioral driven development with Behat
 
Software Development Life Cycle Kb V8.0
Software Development Life Cycle Kb V8.0Software Development Life Cycle Kb V8.0
Software Development Life Cycle Kb V8.0
 
Managed Beans: When, Why and How
Managed Beans: When, Why and HowManaged Beans: When, Why and How
Managed Beans: When, Why and How
 
IBM Cognos 10 Framework Manager in Action
IBM Cognos 10 Framework Manager in ActionIBM Cognos 10 Framework Manager in Action
IBM Cognos 10 Framework Manager in Action
 
Start Your Notes App the SuperNTF Way
Start Your Notes App the SuperNTF WayStart Your Notes App the SuperNTF Way
Start Your Notes App the SuperNTF Way
 
User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖User first! 前端的最後一塊拼圖
User first! 前端的最後一塊拼圖
 

Plus de jbandi

There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014
jbandi
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
jbandi
 

Plus de jbandi (11)

From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reaction
 
From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reaction
 
Angular 2: What's New?
Angular 2: What's New?Angular 2: What's New?
Angular 2: What's New?
 
The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015The curious Life of JavaScript - Talk at SI-SE 2015
The curious Life of JavaScript - Talk at SI-SE 2015
 
Java & JavaScript: Best Friends?
Java & JavaScript: Best Friends?Java & JavaScript: Best Friends?
Java & JavaScript: Best Friends?
 
There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014
 
Professional JavaScript Development (An Introduction for Java Developers)
Professional JavaScript Development (An Introduction for Java Developers)Professional JavaScript Development (An Introduction for Java Developers)
Professional JavaScript Development (An Introduction for Java Developers)
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVM
 
Kann JavaScript elegant sein?
Kann JavaScript elegant sein?Kann JavaScript elegant sein?
Kann JavaScript elegant sein?
 
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
Testing Heute: ein Relikt aus dem Zeitalter des goldenen Wasserfalls?
 
Testing: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile WorldTesting: Chances and Challenges in an agile World
Testing: Chances and Challenges in an agile World
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

NDC 2011 - Building .NET Applications with BDD

  • 1. Building .NET Applications with BDD NDC 2011 GASPAR NAGY gn@techtalk.at Twitter: @gasparnagy JONAS BANDI jonas.bandi@techtalk.ch Twitter: @jbandi Oslo, 8. June 2011 COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
  • 2. TechTalk at a glance • Established: 1993 • Branches: Austria, Hungary, Switzerland • 3 Managing partners: no external owners • Employees: ~ 60 employees • Turnover 2010: ~ 7 Mio CHF • Risk rating: very low risk • Self-financing, healthy growth TechTalk office, Vienna/Austria COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH
  • 3. Background • At TechTalk we are trying to live a BDD process for several years • We started SpecFlow in 2009 out of a need to implement BDD • We have implemented and improved our BDD process and knowledge in many projects • … we are still learning The research is partially supported by the project of Eötvös Loránd University: TÁMOP-4.2.1.B-09/1/KMR-2010-0003 3
  • 4. BDD – A definition from Dan North BDD is a second-generation, outside-in, pull-based, multiple- stakeholder, multiple-scale, high- automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters. Dan North, Agile Testing, Specifications and BDD Exchange 2009 4
  • 5. The BDD Development Process … how we live it Requirements Analysis Executable & Automated Specifications Improving Feedback with a Transparent Development Process Living Documentation 5
  • 6. Requirements Analysis & Colaboration We want to encourage new users to place an order. Therefore we are going to offer 10% discount on every initial order. Register as “bart_bookworm” Go to “/catalog/search” Enter “ISBN-0955683610” Click “Search” Click “Add to Cart” Click “View Cart” Verify “Subtotal” is “$33.75” public void CalculateDiscount(Order order) { if (order.Customer.IsNew) order.FinalAmount = Math.Round(order.Total * 9/10); } 6
  • 7. Capturing and Organizing Requirements DEMO Your Product Backlog is more than just a list! www.speclog.org 7
  • 8. Outcome of Requirements Analysis • Sprint Planning •User Stories •Acceptance Criterias •… illustrated by Examples 8
  • 9. Executable & Automated Specifications Requirements Analysis Executable & Automated Specifications Improving Feedback with a Transparent Development Process Living Documentation 9
  • 10. Automation • Why? • iterative & incremental development demand a continuous feedback • Challenges • Abstraction vs. Reliability • Trust • Shared Understanding • Effort 10
  • 11. Scenarios: Automating Examples • Some Formality is needed •But: Keep it „business readable“ • Gherkin 11
  • 13. Writing Maintainable Scenarios Specification by Example by Gojko Adzic 13
  • 14. Scripts vs. Declarative Scenarios Given a clear database And the database is loaded from "sample-data.sql" And the webserver is running When I go to URL: http://localhost:8080/myapp And I click the "Login" link And I enter username: john And I enter password: john99 And I click the "Login" button Then the page contains text: Hello John! Background: Given the following users: | First Name | Last Name | | John | Smith | When John logs in Then a greeting "Hello John!" is displayed. 14
  • 15. Decouple, Reduce Noise, Focus on Value Given a clear database When I create a user "John Smith" with login "jsmith" When I login as "jsmith" Then a greeting "Hello John!" is displayed. Background: Given the following users: | First Name | Last Name | | John | Smith | When John logs in Then a greeting "Hello John!" is displayed. 15
  • 17. Challenges of UI Automation • Technical •Infrastructure Dependency (Speed, Stability …) •Tests run in another Process • Development Process •80% of all changes are in the UI • Tools can help: •Mara, MVCContrib (“Capybara like”) 17
  • 18. Organization of Features Features are TODO: Screenshot project artifacts: •versioned in VCS •Hierarchies •Change over time TODO: Screenshot 18
  • 19. Organizing Steps • Steps are code • Organize steps along domain concepts. Avoid feature- coupled steps • Scoped steps 19
  • 20. Organizing Steps • Application Driver Layer •Abstraction •Functional composition •Reuse 20
  • 21. Outside-In Development • Starting from the UI Layer is difficult •Start with a scribble / sketch •Good conventions help (aka. semantic markup) 1 •Progress step by step. Building 2 3 the UI incrementally 4 5 • Progressing to TDD •Not always needed? 21
  • 22. Improving Feedback with a Transparent Development Process Requirements Analysis Executable & Automated Specifications Improving Feedback with a Transparent Development Process Living Documentation 22
  • 23. Transparency • Why? •Trust, Feedback, Learning, Embracing Change • Scrum Tools •Standup, Taskboard, Burndown, Demo, Retrospective • How can BDD help to improve it? •Technical Feedback •Different Perspective •Shared understanding 23
  • 25. Build Server Integration • Generating Reports • Using Tags • Demo: Build Config 25
  • 27. Living Documentation Requirements Analysis Executable & Automated Specifications Improving Feedback with a Transparent Development Process Living Documentation 32
  • 28. Evolving the living documentation Product Backlog Living Documentation AccCrit 1 AccCrit 1 User Story 1 AccCrit 2 „Done“ AccCrit 2 Feature 1 AccCrit 3 AccCrit 3 User Story 2 AccCrit 4 AccCrit 5 AccCrit 5 AccCrit 4 User Story n Feature n AccCrit m AccCrit m • Units of work • Documentation • Organized according to • Organized according to priority/value/effort functionality/overview • Versioned/maintained with source code 33
  • 29. Living documentation Current sprint Features “done” merge when F Sprint US accepted US Backlog AC F F Acceptance Criteria AC US Acceptance refine AC Criteria AC AC Acceptance the F F F Criteria US specification AC Acceptance Criteria Acceptance Criteria F F Acceptance US Criteria Acceptance AC AC Criteria Given … {…} validate Automation AC AC When … {…} continuously AC living documentation Then … {…} specification with examples validate executable continuously specification 34
  • 31. Pushing Living Documentation further DEMO 36
  • 32. Other BDD Sessions at the NDC Thursday Morning: • Gojko Adzic • Scott Bellware 37
  • 33. Questions & Discussion GASPAR NAGY JONAS BANDI gaspar.nagy@techtalk.at jonas.bandi@techtalk.ch Twitter: @gasparnagy Twitter: @jbandi COPYRIGHT 2011, TECHTALK - WWW.TECHTALK.CH