12
1 Agile Methodology based on BDD and CI Created by Nicolai Sevcenco

Agile methodologies based on BDD and CI by Nikolai Shevchenko

  • View
    380

  • Download
    0

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Agile methodologies based on BDD and CI by Nikolai Shevchenko

1

• Agile Methodology based on BDD and CI 

Created by Nicolai Sevcenco

Page 2: Agile methodologies based on BDD and CI by Nikolai Shevchenko

Agile Methodology based on BDD and CI

What is BDD?Behaviour-Driven Development (BDD) is about implementing an application by describing it from the point of view of its stakeholders

2

Reqs

DoneTest

“Golden triangle” between BA requirements, acceptance tests and the “Done” criteria for a feature used by developers

Team effort: BA QA (manual & automation) Developer/ Architect

BA, QA and Dev. teams speak the same language (Gherkin, etc)

Agile Team

Page 3: Agile methodologies based on BDD and CI by Nikolai Shevchenko

3

Page 4: Agile methodologies based on BDD and CI by Nikolai Shevchenko

User Stories

BDD revolves around the concept of a Story, which represents an automatically executable increment of business functionality. At its core a Story comprises of one or more Scenarios, each of which represents a concrete example of the behaviour of the system. Each Scenario comprises of a number of executable steps. These Steps can be of three types:

4

1 Scenario: When a user enters an incorrect password on to Login page, the corresponding error message should be displayed.

2 Given a user tst150005684 !-- comments are here

3 Given an incorrect password "test9033T"

4 When the user enters account to the account text box

5 When the user enters an incorrect password to the password text box

6 When the user clicks the login button

7 Then the "Incorrect password or user name" must be displayed

Page 5: Agile methodologies based on BDD and CI by Nikolai Shevchenko

5

public class LoginPage { // hey I'm POJOprivate String accnt;private String passwd;

@Given("a user $account")public void givenAUser(final String account){ this.accnt = account;}@Given("an incorrect password $pwd")public void givenAnIncorrectPassword(final String pwd){ this.passwd = pwd;}@When("the user enters account to the account text box")public void userEntersAccount() {page.getSeleniumImpl().getDriver().findElement(By.name("USERID")).sendKeys(userId);}@When("the user enters an incorrect password to the password text box")public void userEntersPassword() { page.getSeleniumImpl().getDriver().findElement(By.name("PASSWORD")).sendKeys(password);}@When("the user clicks the login button")public void userClicksLoginButton() { page.getSeleniumImpl().getDriver().findElement(By.id("loginBtn")).click();}@Then("the $errmsg must be displayed")public void checkErrMessage(final String errmsg){Assert.assertTrue(this.loginPageImpl.checkForWrongUserIdOrPasswordMessage());}

Page 6: Agile methodologies based on BDD and CI by Nikolai Shevchenko

How to exclude needless code duplications

an Allias annotation with the new matching step pattern comes into play:

6

@When("the item price is $price")

@Alias("the item price becomes $price") // single alias

public void theItemPriceIs(double price) {

    // ...

}

Page 7: Agile methodologies based on BDD and CI by Nikolai Shevchenko

7

Oracle

Page 8: Agile methodologies based on BDD and CI by Nikolai Shevchenko

Development and QA consideration points

8

BDD can help development team focus on the user’s needs and the expected behavior instead of jumping ahead and getting caught up in implementation details upfront.

Much lower barrier-to-entry for new members as a result of common language (Gherkin, etc) between BA, QA and Dev. teams.

Perceive unit tests more like “change detectors” rather than tests with reliable failures reports. BDD helps to shift expectations towards reusing automated functional/ regression tests and acceptance tests.

Greater ROI: Behavior has a much longer shelf life than implementation and implementation related documentation. Also as the business rules change, BDD captures it better than it being lost in documents and code.

Predictability & Confidence: BDD makes much better predictability and confidence to the team work.

A genuine collaboration between business, QA and development: Automation team produces automated functional/regression and acceptance tests Dev. team re-uses automated tests to leverage unit tests coverage as well as automation

team may use unit tests, produced by developers, to better understand the system/application.

Business justifies priorities by showing concrete value thru the provided stories.

Page 9: Agile methodologies based on BDD and CI by Nikolai Shevchenko

BDD Toolkits

9

Gherkin

JBehave

Selenium + JBehave

HTML

Page 10: Agile methodologies based on BDD and CI by Nikolai Shevchenko

CI - Continues Integration

10

Main principles: Integrates source code and runs test after each commit to the source repository Near-immediate (as quickly as possible) feedback to the “agile” team once detecting

integration errors.

Benefits: Eliminates deferred integration which is very hard to predict how long it will take to do. Having a good test suite can dramatically easier to find and remove bugs. Frequent deployments: are valuable because they allow your users to get new features

more rapidly, to give more rapid feedback on those features, and generally become more collaborative in the development cycle.

Toolkit: Cruise Control Apache Continuum JetBrains Team City Hudson Jenkins

Page 11: Agile methodologies based on BDD and CI by Nikolai Shevchenko

11

Page 12: Agile methodologies based on BDD and CI by Nikolai Shevchenko

This document contains confidential information for use by TD AMERITRADE Holding Corporation and its subsidiaries. 12

Q&Q U E S T I O N SA N S W E R S