Bridging the communication Gap & Continuous Delivery
-
Upload
masoodjan -
Category
Technology
-
view
3.443 -
download
0
description
Transcript of Bridging the communication Gap & Continuous Delivery
![Page 1: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/1.jpg)
Bridging the communication Gap & Continuous Delivery
Case study of a top retailer in UK
Masood Jan
Mazataz Ltd
![Page 2: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/2.jpg)
Agenda
Communication Gap. Bridging the Gap. Simplifying Automated Functional
& Unit Testing. Continuous Integration. Path to Continuous Delivery.
![Page 3: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/3.jpg)
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.
![Page 4: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/4.jpg)
The Result
Late feedback. Confusion during development and
testing. Change of requirements not clearly
propagated. Surprises.
![Page 5: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/5.jpg)
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.
![Page 6: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/6.jpg)
What did we do
We behaved ourselves!
![Page 7: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/7.jpg)
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!
![Page 8: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/8.jpg)
The Result
Business and engineering team speak same language.
Quick Feedback. Requirements changes were easily
communicated. No surprises.
![Page 9: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/9.jpg)
What tools we used ?
JBehave (Java) Selenium for web applications.
![Page 10: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/10.jpg)
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.
![Page 11: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/11.jpg)
The JBehave Framework
![Page 12: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/12.jpg)
See it in Action !
Simple Login Story
![Page 13: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/13.jpg)
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
![Page 14: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/14.jpg)
Defining ScenariosScenario 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 buttonThen 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 buttonThen the user should not be logged in And the user should see a message, Invalid Username or Password.
![Page 15: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/15.jpg)
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
![Page 16: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/16.jpg)
ValidLogin.java
public class ValidLogin extends Scenario {
public ValidLogin () {
super(new ValidLoginSteps());
}
}
![Page 17: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/17.jpg)
ValidLoginSteps.javapublic 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"); } }
![Page 18: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/18.jpg)
Working Example
A Happy Path Order Capture
![Page 19: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/19.jpg)
JUnit Testing using BDD
Mockito
![Page 20: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/20.jpg)
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.
![Page 21: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/21.jpg)
Mockito Examplepublic class RepositoryUpdaterTest {
@Mock MutableRepository mockRepository;@Mock MutableRepositoryItem mockRepsitoryItem;
@Testpublic void shouldUpdateRepositoryWithAString() throws Exception {
//givenString valueToBeCreated ="Test";RepositoyUpdater repositoyUpdater = new
RepositoyUpdater();repositoyUpdater.setSomeRepository(mockRepository);
//when repositoyUpdater.updateRepositoryWithThisString(valueToBeCreated);
//Thenverify(mockRepository).createItem(valueToBeCreated);
}
}
![Page 22: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/22.jpg)
Continuous IntegrationA quick feedback
![Page 23: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/23.jpg)
What we have
CI Topology Check in build Pipeline Release Builds Pipeline Check-in best practice
![Page 24: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/24.jpg)
The CI
![Page 25: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/25.jpg)
Check-in Builds Pipeline
![Page 26: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/26.jpg)
Check-in Builds
![Page 27: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/27.jpg)
Static Code Analysis
![Page 28: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/28.jpg)
Sonar Report
![Page 29: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/29.jpg)
Release Build Pipeline
![Page 30: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/30.jpg)
Release Builds
![Page 31: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/31.jpg)
Deployment Pipeline
![Page 32: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/32.jpg)
Automated Database Change Process
Using DBDeploy
![Page 33: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/33.jpg)
Acceptance Tests
![Page 34: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/34.jpg)
The Status
![Page 35: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/35.jpg)
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
![Page 36: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/36.jpg)
For more information
BDD : http://dannorth.net/introducing-bdd/ Jbehave : http://jbehave.org/ Mockito :
http://mockito.googlecode.com/svn/tags/latest/javadoc/org/mockito/Mockito.html
Jbehave Code generator :
http:/www.mazataz.com/resources.html
![Page 37: Bridging the communication Gap & Continuous Delivery](https://reader035.fdocuments.us/reader035/viewer/2022081518/546c373baf7959d3168b5f52/html5/thumbnails/37.jpg)
Questions?