SlideShare une entreprise Scribd logo
1  sur  37
Bridging the communication Gap & Continuous Delivery

                      Case study of a top retailer in UK




                                               Masood Jan
                                               Mazataz Ltd
Agenda
   Communication Gap.
   Bridging the Gap.
   Simplifying Automated Functional
    & Unit Testing.
   Continuous Integration.
   Path to Continuous Delivery.
The Communication
Gap
     • The BA/Arch agree with business regarding
       stories (epics) and creates HLD/LLD.
     • The Developer reads the LLD and sometimes
       makes a different set of assumptions to create
       code.
     • The Tester reads the requirements and may
       make a second set of assumptions to create
       test plans
     • The Developer finishes the story, does the
       “Works On My Machine” stuff, and checks in.
     • The Testers wait for a build in Test
       Environment, usually couple of hours/days.
     • If Build was successful tester verifies function
       against test plans.
     • Identifies defects raises them.
     • Developer analyses the defect, debugs to fix it.
     • The Testers wait for another build.
The Result
   Late feedback.
   Confusion during development and
    testing.
   Change of requirements not clearly
    propagated.
   Surprises.
What was needed

       Focus on development and delivery of
        Prioritised, Verifiable Business Stories.
       Focus on providing a common vocabulary that
        bridges the gap between Business and
        Technology.
       Focus on exposing business rules to be reviewed
        by stake holders.
       Focus collaboration between
        Developers, Testers, Architects, BA’s and the
        Business.
       Make it easy to Automate functional testing.
What did we do


We behaved ourselves!
How did we do that
   Have Small Vertical stories of Business Value.
   Agree & Document business rules.
   Agree & Document the behaviour.
   Agree how story would be accepted.
   Create executable scenarios for each behaviour.
        Given, When and Then.
   Develop the behaviour and verify the scenarios.
   Show completed scenarios to Truth.
   React to feedback.




                                 We synched up!
The Result
   Business and engineering team
    speak same language.
   Quick Feedback.
   Requirements changes were easily
    communicated.
   No surprises.
What tools we used ?
   JBehave (Java)
   Selenium for web applications.
Why JBehave?
   Java, all the teams were aware of
    it.
   Built on JUnit framework.
   Scenarios written in text file.
   Given , When & Then
    annotations.
   JBehave code generator
    (custom).
   Integrates well on CI.
The JBehave Framework
See it in Action !
   Simple Login Story
Example Story
Story Title: Login to the Customer Service Centre (CSC)
So That: I can resolve customer issue with an order
As: A user
I Need: To Login to the CSC


Acceptance Criteria:
1.   I should be able to login using valid username and
     password
2.   I should not be able to login using invalid username or
     password
Defining Scenarios
Scenario 1: Valid Login

Given the user is on Login Page
When the user types user name service
 And the user types password service
 And clicks login button
Then the user should be logged in
 And the user should see a message,
           Welcome, Service Administrator.

Scenario 2: Invalid Login

Given the user is on Login Page
When the user types user name wrong
 And the user types password wrong
 And clicks login button
Then the user should not be logged in
 And the user should see a message,
           Invalid Username or Password.
JBehave Code Generator

   • Create valid_login.scenario file in eclipse.

   • Copy login scenario into it and save.

   •   Right click on this file and choose
       • JBehaveCodeGenerator
          • Generate Code

   •   This will create two java files
       • ValidLogin.java
       • ValidLoginSteps.java
ValidLogin.java

public class ValidLogin extends
  Scenario {
  public ValidLogin () {
     super(new ValidLoginSteps());
  }
}
ValidLoginSteps.java
       public class ValidLoginSteps extends Steps {

        @Given("the user is on the Login Page")
         public void theUserIsOnTheLoginPage() {
           throw new RuntimeException("Step not yet implemented");
         }

           @When("the user types username $username")
           public void theUserTypesUsername(String username) {
             throw new RuntimeException("Step not yet implemented");
           }

           @When("the user types password $password")
           public void theUserTypesPassword(String password) {
             throw new RuntimeException("Step not yet implemented");
           }

           @When("clicks login button")
           public void clicksLoginButton() {
             throw new RuntimeException("Step not yet implemented");
           }

           @Then(“the use should be logged in")
           public void theUserShouldBeLoggedIn() {
             throw new RuntimeException("Step not yet implemented");
           }
       }
Working Example
  A Happy Path Order Capture
JUnit Testing using BDD
   Mockito
Mockito
   Mockito library enables mocks
    creation, verification and stubbing.
   Similar to Jbehave with
    given, when, then steps..
   Enables Behaviour testing of java
    components i.e
    Formhandlers, Managers, Repositories..
    etc.
   Mocks all objects a component uses and
    verifies if it is using it correctly according
    to the behaviour.
Mockito Example
    public class RepositoryUpdaterTest {

        @Mock MutableRepository mockRepository;
        @Mock MutableRepositoryItem mockRepsitoryItem;
                @Test
        public void shouldUpdateRepositoryWithAString() throws Exception {
                //given
                String valueToBeCreated ="Test";
                RepositoyUpdater repositoyUpdater = new RepositoyUpdater();
                repositoyUpdater.setSomeRepository(mockRepository);

              //when

        repositoyUpdater.updateRepositoryWithThisString(valueToBeCreated);

               //Then
               verify(mockRepository).createItem(valueToBeCreated);

        }


    }
Continuous Integration
     A quick feedback
What we have
   CI Topology
   Check in build Pipeline
   Release Builds Pipeline
   Check-in best practice
The CI
Check-in Builds Pipeline
Check-in Builds
Static Code Analysis
Sonar Report
Release Build Pipeline
Release Builds
Deployment Pipeline
Automated Database Change
Process
                Using DBDeploy
Acceptance Tests
The Status
Check-in Best Practice
       CI monitor close vicinity
       Checkout when CI is green
       Just before checkin see if CI is still green
       If Red then wait until green, find out why it is red
       Do a get when its green
       Build locally again with tests.
       Then Checkin
       Check for CI building your code.
       If Red due to your checkin, fix it ASAP
       When CI is green after your checkin, then relax
For more information

   BDD : http://dannorth.net/introducing-bdd/
   Jbehave : http://jbehave.org/
   Mockito :
    http://mockito.googlecode.com/svn/tags/latest/j
    avadoc/org/mockito/Mockito.html
   Jbehave Code generator :
       http:/www.mazataz.com/resources.html
Questions?

Contenu connexe

Tendances

Beginning AngularJS
Beginning AngularJSBeginning AngularJS
Beginning AngularJS
Troy Miles
 

Tendances (20)

Functional Testing for React Native Apps
Functional Testing for React Native AppsFunctional Testing for React Native Apps
Functional Testing for React Native Apps
 
Node.JS error handling best practices
Node.JS error handling best practicesNode.JS error handling best practices
Node.JS error handling best practices
 
Beginning AngularJS
Beginning AngularJSBeginning AngularJS
Beginning AngularJS
 
Code Quality Practice and Tools
Code Quality Practice and ToolsCode Quality Practice and Tools
Code Quality Practice and Tools
 
2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd2015 in tothebox-introtddbdd
2015 in tothebox-introtddbdd
 
Codeception
CodeceptionCodeception
Codeception
 
Unit Testing 101
Unit Testing 101Unit Testing 101
Unit Testing 101
 
[CLIW] Web testing
[CLIW] Web testing[CLIW] Web testing
[CLIW] Web testing
 
Controller Testing: You're Doing It Wrong
Controller Testing: You're Doing It WrongController Testing: You're Doing It Wrong
Controller Testing: You're Doing It Wrong
 
The Testing Planet - July 2010
The Testing Planet - July 2010The Testing Planet - July 2010
The Testing Planet - July 2010
 
Sync Workitems between multiple Team Projects #vssatpn
Sync Workitems between multiple Team Projects #vssatpnSync Workitems between multiple Team Projects #vssatpn
Sync Workitems between multiple Team Projects #vssatpn
 
SpecFlow and some things I've picked up
SpecFlow and some things I've picked upSpecFlow and some things I've picked up
SpecFlow and some things I've picked up
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern
 
Intro to Service Worker API and its use cases
Intro to Service Worker API and its use casesIntro to Service Worker API and its use cases
Intro to Service Worker API and its use cases
 
Practical Test Automation Deep Dive
Practical Test Automation Deep DivePractical Test Automation Deep Dive
Practical Test Automation Deep Dive
 
Functional Dependency Injection in C#
Functional Dependency Injection in C#Functional Dependency Injection in C#
Functional Dependency Injection in C#
 
TDD with Visual Studio 2010
TDD with Visual Studio 2010TDD with Visual Studio 2010
TDD with Visual Studio 2010
 
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Automate testing with behat, selenium, phantom js and nightwatch.js (5)Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
 
Functional programming in C#
Functional programming in C#Functional programming in C#
Functional programming in C#
 
Embrace Unit Testing
Embrace Unit TestingEmbrace Unit Testing
Embrace Unit Testing
 

En vedette

Enabling Continuous Delivery For Major Retailer using open source Jenkins
Enabling Continuous Delivery For Major Retailer using open source JenkinsEnabling Continuous Delivery For Major Retailer using open source Jenkins
Enabling Continuous Delivery For Major Retailer using open source Jenkins
Masood Jan
 
ATG - Common Terminologies
ATG - Common TerminologiesATG - Common Terminologies
ATG - Common Terminologies
Keyur Shah
 
Bridging the Generation Gap in the Workplace
Bridging the Generation Gap in the WorkplaceBridging the Generation Gap in the Workplace
Bridging the Generation Gap in the Workplace
beatyaall
 

En vedette (12)

Enabling Continuous Delivery For Major Retailer using open source Jenkins
Enabling Continuous Delivery For Major Retailer using open source JenkinsEnabling Continuous Delivery For Major Retailer using open source Jenkins
Enabling Continuous Delivery For Major Retailer using open source Jenkins
 
Achieving the Ultimate TTM with ATG
Achieving the Ultimate TTM with ATGAchieving the Ultimate TTM with ATG
Achieving the Ultimate TTM with ATG
 
Bridging The Communication Gap, Fast
Bridging The Communication Gap, Fast Bridging The Communication Gap, Fast
Bridging The Communication Gap, Fast
 
ATG Advanced Profile Management
ATG Advanced Profile ManagementATG Advanced Profile Management
ATG Advanced Profile Management
 
ATG - Common Terminologies
ATG - Common TerminologiesATG - Common Terminologies
ATG - Common Terminologies
 
Communication gap
Communication gapCommunication gap
Communication gap
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg framework
 
ATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your FigertipsATG - Web Commerce @ Your Figertips
ATG - Web Commerce @ Your Figertips
 
Bridging the Generation Gap in the Workplace
Bridging the Generation Gap in the WorkplaceBridging the Generation Gap in the Workplace
Bridging the Generation Gap in the Workplace
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
ATG Framework,Formhandlers,Pricing
ATG Framework,Formhandlers,PricingATG Framework,Formhandlers,Pricing
ATG Framework,Formhandlers,Pricing
 
Chatty Cathys & Quiet Keiths: Bridging the Communication Gap
Chatty Cathys &  Quiet Keiths:  Bridging the Communication GapChatty Cathys &  Quiet Keiths:  Bridging the Communication Gap
Chatty Cathys & Quiet Keiths: Bridging the Communication Gap
 

Similaire à Bridging the communication Gap & Continuous Delivery

STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
Anna Russo
 
Agile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai ShevchenkoAgile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai Shevchenko
Moldova ICT Summit
 

Similaire à Bridging the communication Gap & Continuous Delivery (20)

Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1Behaviour Driven Development V 0.1
Behaviour Driven Development V 0.1
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and MochaBdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
 
Test & behavior driven development
Test & behavior driven developmentTest & behavior driven development
Test & behavior driven development
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
Dependency Injection in .NET applications
Dependency Injection in .NET applicationsDependency Injection in .NET applications
Dependency Injection in .NET applications
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testing
 
Codeception introduction and use in Yii
Codeception introduction and use in YiiCodeception introduction and use in Yii
Codeception introduction and use in Yii
 
Automated acceptance test
Automated acceptance testAutomated acceptance test
Automated acceptance test
 
tut0000021-hevery
tut0000021-heverytut0000021-hevery
tut0000021-hevery
 
tut0000021-hevery
tut0000021-heverytut0000021-hevery
tut0000021-hevery
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 
Coding Naked 2023
Coding Naked 2023Coding Naked 2023
Coding Naked 2023
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
 
Why test with flex unit
Why test with flex unitWhy test with flex unit
Why test with flex unit
 
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
 
Testing Big in JavaScript
Testing Big in JavaScriptTesting Big in JavaScript
Testing Big in JavaScript
 
Agile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai ShevchenkoAgile methodologies based on BDD and CI by Nikolai Shevchenko
Agile methodologies based on BDD and CI by Nikolai Shevchenko
 
Test driven development
Test driven developmentTest driven development
Test driven development
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
Victor Rentea
 

Dernier (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
"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 ...
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Bridging the communication Gap & Continuous Delivery

  • 1. Bridging the communication Gap & Continuous Delivery Case study of a top retailer in UK Masood Jan Mazataz Ltd
  • 2. Agenda  Communication Gap.  Bridging the Gap.  Simplifying Automated Functional & Unit Testing.  Continuous Integration.  Path to Continuous Delivery.
  • 3. The Communication Gap • The BA/Arch agree with business regarding stories (epics) and creates HLD/LLD. • The Developer reads the LLD and sometimes makes a different set of assumptions to create code. • The Tester reads the requirements and may make a second set of assumptions to create test plans • The Developer finishes the story, does the “Works On My Machine” stuff, and checks in. • The Testers wait for a build in Test Environment, usually couple of hours/days. • If Build was successful tester verifies function against test plans. • Identifies defects raises them. • Developer analyses the defect, debugs to fix it. • The Testers wait for another build.
  • 4. The Result  Late feedback.  Confusion during development and testing.  Change of requirements not clearly propagated.  Surprises.
  • 5. What was needed  Focus on development and delivery of Prioritised, Verifiable Business Stories.  Focus on providing a common vocabulary that bridges the gap between Business and Technology.  Focus on exposing business rules to be reviewed by stake holders.  Focus collaboration between Developers, Testers, Architects, BA’s and the Business.  Make it easy to Automate functional testing.
  • 6. What did we do We behaved ourselves!
  • 7. How did we do that  Have Small Vertical stories of Business Value.  Agree & Document business rules.  Agree & Document the behaviour.  Agree how story would be accepted.  Create executable scenarios for each behaviour.  Given, When and Then.  Develop the behaviour and verify the scenarios.  Show completed scenarios to Truth.  React to feedback. We synched up!
  • 8. The Result  Business and engineering team speak same language.  Quick Feedback.  Requirements changes were easily communicated.  No surprises.
  • 9. What tools we used ?  JBehave (Java)  Selenium for web applications.
  • 10. Why JBehave?  Java, all the teams were aware of it.  Built on JUnit framework.  Scenarios written in text file.  Given , When & Then annotations.  JBehave code generator (custom).  Integrates well on CI.
  • 12. See it in Action !  Simple Login Story
  • 13. Example Story Story Title: Login to the Customer Service Centre (CSC) So That: I can resolve customer issue with an order As: A user I Need: To Login to the CSC Acceptance Criteria: 1. I should be able to login using valid username and password 2. I should not be able to login using invalid username or password
  • 14. Defining Scenarios Scenario 1: Valid Login Given the user is on Login Page When the user types user name service And the user types password service And clicks login button Then the user should be logged in And the user should see a message, Welcome, Service Administrator. Scenario 2: Invalid Login Given the user is on Login Page When the user types user name wrong And the user types password wrong And clicks login button Then the user should not be logged in And the user should see a message, Invalid Username or Password.
  • 15. JBehave Code Generator • Create valid_login.scenario file in eclipse. • Copy login scenario into it and save. • Right click on this file and choose • JBehaveCodeGenerator • Generate Code • This will create two java files • ValidLogin.java • ValidLoginSteps.java
  • 16. ValidLogin.java public class ValidLogin extends Scenario { public ValidLogin () { super(new ValidLoginSteps()); } }
  • 17. ValidLoginSteps.java public class ValidLoginSteps extends Steps { @Given("the user is on the Login Page") public void theUserIsOnTheLoginPage() { throw new RuntimeException("Step not yet implemented"); } @When("the user types username $username") public void theUserTypesUsername(String username) { throw new RuntimeException("Step not yet implemented"); } @When("the user types password $password") public void theUserTypesPassword(String password) { throw new RuntimeException("Step not yet implemented"); } @When("clicks login button") public void clicksLoginButton() { throw new RuntimeException("Step not yet implemented"); } @Then(“the use should be logged in") public void theUserShouldBeLoggedIn() { throw new RuntimeException("Step not yet implemented"); } }
  • 18. Working Example A Happy Path Order Capture
  • 19. JUnit Testing using BDD  Mockito
  • 20. Mockito  Mockito library enables mocks creation, verification and stubbing.  Similar to Jbehave with given, when, then steps..  Enables Behaviour testing of java components i.e Formhandlers, Managers, Repositories.. etc.  Mocks all objects a component uses and verifies if it is using it correctly according to the behaviour.
  • 21. Mockito Example public class RepositoryUpdaterTest { @Mock MutableRepository mockRepository; @Mock MutableRepositoryItem mockRepsitoryItem; @Test public void shouldUpdateRepositoryWithAString() throws Exception { //given String valueToBeCreated ="Test"; RepositoyUpdater repositoyUpdater = new RepositoyUpdater(); repositoyUpdater.setSomeRepository(mockRepository); //when repositoyUpdater.updateRepositoryWithThisString(valueToBeCreated); //Then verify(mockRepository).createItem(valueToBeCreated); } }
  • 22. Continuous Integration A quick feedback
  • 23. What we have  CI Topology  Check in build Pipeline  Release Builds Pipeline  Check-in best practice
  • 35. Check-in Best Practice  CI monitor close vicinity  Checkout when CI is green  Just before checkin see if CI is still green  If Red then wait until green, find out why it is red  Do a get when its green  Build locally again with tests.  Then Checkin  Check for CI building your code.  If Red due to your checkin, fix it ASAP  When CI is green after your checkin, then relax
  • 36. For more information  BDD : http://dannorth.net/introducing-bdd/  Jbehave : http://jbehave.org/  Mockito : http://mockito.googlecode.com/svn/tags/latest/j avadoc/org/mockito/Mockito.html  Jbehave Code generator : http:/www.mazataz.com/resources.html

Notes de l'éditeur

  1. This is a case study of a top retailer in UK which was following Agile but not all the Agile practices. We will discuss how collaboration between business and engineering team improved using BDD and how it was used to generate automated acceptance tests. We will also discuss how continuous integration was implemented which laid foundation for continuous delivery.
  2. This is a case study of a top retailer in UK which was following Agile but not all the Agile practices. We will discuss how collaboration between business and engineering team improved using BDD and how it was used to generate automated acceptance tests. We will also discuss how continuous integration was implemented which laid foundation for continuous delivery.