SlideShare a Scribd company logo
1 of 33
Download to read offline
Write tests in the end
               users' lingo




Speaker Name : Nikhil Fernandes,Chirag Doshi
Company Name : Thoughtworks Technologies
What is the #1 thing that goes
wrong in software projects ?
Communication
End user   BA   Dev




                Application




           QA
End user       BA        Dev




                                Application




                      QA
End user
           BA       Dev



                  Application


           QA
    Acceptance Criteria
Title:I want to login to the website




 Role:As a user



Action:I want to login into the website


Outcome:So that I can view exclusive content
Acceptance Criteria:

Scenario:Successful Login

Given:The user is on the login page


When:The user types username sam
AND the user types password 123456
AND the user clicks the login button

Then:The user should be directed to the home page
AND the page should display Welcome Sam message
Acceptance Criteria:

Scenario:Invalid Username

Given:The user is on the login page


When:The user types username wrong
AND the user types password 123456
AND the user clicks the login button


Then:The page should display Authentication failed
message
Imperative v/s Declarative
Acceptance Criteria
Title:Book Submision




Role:As a Librarian



Action:I want to add a new book


Outcome:So that members can borrow this book
Imperative

Acceptance Criteria:

Scenario:Successful Submission

Given:The librarian is on the admin page


When:he/she fills in the name as Programming in Objective-C 
AND fills in author as Stephen G Kochan
AND fill in tags as programming,iphone.

Then:The librarian should see a message...
'Successfully created book'
Declarative

Acceptance Criteria:

Scenario:Successful Submission

Given:The librarian is on the admin page


When:he/she adds a new book to the system


Then:The librarian should see a message...
'Successfully created book'
End user   BA   Dev




                Application




           QA
Three ways to build test
cases in the user's
language
1.Build abstractions in the code
2.Automate your acceptance criteria
3.IDE support for these automated
  acceptance criteria
1.Build abstractions in the
 code
2.Automate your acceptance criteria
3.IDE support for these automated
  acceptance criteria
Scenario Successful Login
Given the user is on the login page
AND the user type username sam
AND the user types password 123456
AND the user clicks the login button
Then the page should display Welcome Sam Message
@Test
public void shouldDisplayWelcomeMessageWhenUserSuccessfullyLogsIn(){

       selenium.click(LOGIN_LINK);
       selenium.waitForElementPresent(LOGIN_BUTTON);
       selenium.type(LOGIN_USERNAME_EDIT_FIELD, ”sam");
       selenium.type(LOGIN_PASSWORD_EDIT_FIELD, “123456");    
       selenium.click(LOGIN_BUTTON);
       selenium.waitForElementPresent("Welcome");
}


@Test
public void shouldDisplayErrorMessageWhenUserTriesLoginWithWrongUsername(){

       selenium.click(LOGIN_LINK);
       selenium.waitForElementPresent(LOGIN_BUTTON);
       selenium.type(LOGIN_USERNAME_EDIT_FIELD, ”wrong");
       selenium.type(LOGIN_PASSWORD_EDIT_FIELD, ”123456");    
       selenium.click(LOGIN_BUTTON);
       selenium.waitForElementPresent("Authentication Failed");
}
@Test
public void shouldDisplayWelcomeMessageWhenUserSuccessfullyLogsIn(){

       new LoginPage()
       .openLoginPage()
       .enterUserName('sam').enterPassword('123456')
       .login().verifySuccessfulLogin();
}


@Test
public void shouldDisplayErrorMessageWhenUserTriesLoginWithWrongUsername(){

       new LoginPage()
       .openLoginPage()
       .enterUserName('wrong').enterPassword('123456').
       login().verifyUserIsNotAuthenticated();
}
public class LoginPage {

private Selenium selenium;

public LoginPage(Selenium selenium) {
        this.selenium = selenium;
}

public LoginPage openLoginPage() {
        selenium.click(LOGIN_LINK);
        selenium.waitForElementPresent(LOGIN_BUTTON);
        return this;
}

public LoginPage enterUserName(String userName){
        selenium.type(LOGIN_USERNAME_EDIT_FIELD, userName);
        return this;
}
public LoginPage enterPassword(String password){
        selenium.type(LOGIN_PASSWORD_EDIT_FIELD, password);
        return this;
}

public LoginPage login(){
        selenium.click(LOGIN_BUTTON);
        return this;
}

public boolean verifyUserIsNotAuthenticated(){
        selenium.waitForElementPresent("Authentication Failed");
        return this;
}

public boolean verifySuccessfulLogin(){
        selenium.waitForElementPresent("Welcome");
        return this;
}

}
1.Build abstractions in the code

2.Automate your
 acceptance criteria
3.IDE support for these automated
  acceptance criteria
Scenario Successful Login
 Given the user is on the login page
 AND the user type username sam
 AND the user types password 123456
 AND the user clicks the login button
 Then the page should display Welcome Sam Message


Given 'the user is on the login page' do
         @browser.open('http://foobar.com/')
end

AND /the user types (w+) (w+)/ do |element,value|
        @browser.type(element, value)
end

AND /the user clicks (w+) button/ do |element|
        @browser.click element
        @browser.wait_for_page_to_load
end

Then /the page should display (.*) Message/ do |expected_textl|
        @browser.is_element_present("css=p['#{expected_text}']").should be_true
end
Scenario Invalid UserName
 Given the user is on the login page
 AND the user type username wrong
 AND the user types password 123456
 AND the user clicks the login button
 Then the page should display 'Authentication Failed' Message


Given 'the user is on the login page' do
         @browser.open('http://foobar.com/')
end

AND /the user types (w+) (w+)/ do |element,value|
        @browser.type(element, value)
end

AND /the user clicks (w+) button/ do |element|
        @browser.click element
        @browser.wait_for_page_to_load
end

Then /the page should display (.*) Message/ do |expected_textl|
        @browser.is_element_present("css=p['#{expected_text}']").should be_true
end
JBehave
Scenario Invalid UserName
 Given the user is on the login page
 AND the user type username wrong
 AND the user types password 123456
 AND the user clicks the login button
 Then the page should display 'Authentication Failed' Message


@Given("the user is on the login page")
public void theUserIsOnTheLoginPage() {
         LoginPage loginPage = new LoginPage();
         loginPage.verifyPresenceOfLoginButton();
}

@When("the user types username $username")
public void theUserTypesUsername(String username) {
         loginPage().typeUsername(username);
}

@When("the user types password $password")
public void theUserTypesPassword(String password) {
         loginPage().typePassword(password);
}
@When("clicks the login button")
public void clicksTheLoginButton() {
         loginPage().login();
}
@Then("the page should display $errorMessage Message")
public void thePageShouldDisplayErrorMessage(String errorMessage) {
         loginPage().verifyPresenceOfErrorMessage(errorMessage);
}
1.Build abstractions in the code
2.Automate your acceptance criteria

3.IDE support for these
 automated acceptance
 criteria
Thank You
chirag@thoughtworks.com

nikhil@thoughtworks.com

More Related Content

What's hot

Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelpauldix
 
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelpauldix
 
Server and domain setup
Server and domain setupServer and domain setup
Server and domain setupkmcintyre3
 
1 ppt-ajax with-j_query
1 ppt-ajax with-j_query1 ppt-ajax with-j_query
1 ppt-ajax with-j_queryFajar Baskoro
 
Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1フ乇丂ひ丂
 

What's hot (10)

Anne bacus evernote
Anne bacus evernoteAnne bacus evernote
Anne bacus evernote
 
Demystifying OAuth2 for PHP
Demystifying OAuth2 for PHPDemystifying OAuth2 for PHP
Demystifying OAuth2 for PHP
 
Geb qa fest2017
Geb qa fest2017Geb qa fest2017
Geb qa fest2017
 
Ajax learning tutorial
Ajax learning tutorialAjax learning tutorial
Ajax learning tutorial
 
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
 
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
 
Server and domain setup
Server and domain setupServer and domain setup
Server and domain setup
 
1 ppt-ajax with-j_query
1 ppt-ajax with-j_query1 ppt-ajax with-j_query
1 ppt-ajax with-j_query
 
Oauth
OauthOauth
Oauth
 
Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1
 

Similar to Write tests in end users' language

Passwords suck, but centralized proprietary services are not the answer
Passwords suck, but centralized proprietary services are not the answerPasswords suck, but centralized proprietary services are not the answer
Passwords suck, but centralized proprietary services are not the answerFrancois Marier
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...Ho Chi Minh City Software Testing Club
 
EWD 3 Training Course Part 10: QEWD Sessions and User Authentication
EWD 3 Training Course Part 10: QEWD Sessions and User AuthenticationEWD 3 Training Course Part 10: QEWD Sessions and User Authentication
EWD 3 Training Course Part 10: QEWD Sessions and User AuthenticationRob Tweed
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Jean-Loup Yu
 
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...Ho Chi Minh City Software Testing Club
 
Continuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumContinuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumXebia IT Architects
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsSeth McLaughlin
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsKonstantin Kudryashov
 
I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)xsist10
 
Transformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoTransformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoRodrigo Urubatan
 
Story-driven Testing
Story-driven TestingStory-driven Testing
Story-driven TestingBrian Hogan
 
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5Rob Tweed
 
Live Identity Services Drilldown - PDC 2008
Live Identity Services Drilldown - PDC 2008Live Identity Services Drilldown - PDC 2008
Live Identity Services Drilldown - PDC 2008Jorgen Thelin
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With CucumberSean Cribbs
 
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)Jean-Michel Garnier
 
I put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo CanadaI put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo Canadaxsist10
 
I put on my mink and wizard behat
I put on my mink and wizard behatI put on my mink and wizard behat
I put on my mink and wizard behatxsist10
 
How React Native Appium and me made each other shine
How React Native Appium and me made each other shineHow React Native Appium and me made each other shine
How React Native Appium and me made each other shineWim Selles
 
Make Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingMake Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingPatrick Reagan
 

Similar to Write tests in end users' language (20)

Passwords suck, but centralized proprietary services are not the answer
Passwords suck, but centralized proprietary services are not the answerPasswords suck, but centralized proprietary services are not the answer
Passwords suck, but centralized proprietary services are not the answer
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
 
EWD 3 Training Course Part 10: QEWD Sessions and User Authentication
EWD 3 Training Course Part 10: QEWD Sessions and User AuthenticationEWD 3 Training Course Part 10: QEWD Sessions and User Authentication
EWD 3 Training Course Part 10: QEWD Sessions and User Authentication
 
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
Green Light for the Apps with Calaba.sh - DroidCon Paris 2014
 
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
[Thong Nguyen & Trong Bui] Behavior Driven Development (BDD) and Automation T...
 
Continuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with seleniumContinuous integration using thucydides(bdd) with selenium
Continuous integration using thucydides(bdd) with selenium
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projects
 
I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)I put on my mink and wizard behat (talk)
I put on my mink and wizard behat (talk)
 
Transformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicaçãoTransformando os pepinos do cliente no código de testes da sua aplicação
Transformando os pepinos do cliente no código de testes da sua aplicação
 
Story-driven Testing
Story-driven TestingStory-driven Testing
Story-driven Testing
 
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
 
Live Identity Services Drilldown - PDC 2008
Live Identity Services Drilldown - PDC 2008Live Identity Services Drilldown - PDC 2008
Live Identity Services Drilldown - PDC 2008
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
 
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)User Acceptance Testing Driven by Humans telling Stories (with RSpec)
User Acceptance Testing Driven by Humans telling Stories (with RSpec)
 
I put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo CanadaI put on my mink and wizard behat - Confoo Canada
I put on my mink and wizard behat - Confoo Canada
 
I put on my mink and wizard behat
I put on my mink and wizard behatI put on my mink and wizard behat
I put on my mink and wizard behat
 
How React Native Appium and me made each other shine
How React Native Appium and me made each other shineHow React Native Appium and me made each other shine
How React Native Appium and me made each other shine
 
Test automation
Test  automationTest  automation
Test automation
 
Make Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingMake Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance Testing
 

More from IndicThreads

Http2 is here! And why the web needs it
Http2 is here! And why the web needs itHttp2 is here! And why the web needs it
Http2 is here! And why the web needs itIndicThreads
 
Understanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive ApplicationsUnderstanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive ApplicationsIndicThreads
 
Go Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang wayGo Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang wayIndicThreads
 
Building Resilient Microservices
Building Resilient Microservices Building Resilient Microservices
Building Resilient Microservices IndicThreads
 
App using golang indicthreads
App using golang  indicthreadsApp using golang  indicthreads
App using golang indicthreadsIndicThreads
 
Building on quicksand microservices indicthreads
Building on quicksand microservices  indicthreadsBuilding on quicksand microservices  indicthreads
Building on quicksand microservices indicthreadsIndicThreads
 
How to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingHow to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingIndicThreads
 
Iot secure connected devices indicthreads
Iot secure connected devices indicthreadsIot secure connected devices indicthreads
Iot secure connected devices indicthreadsIndicThreads
 
Real world IoT for enterprises
Real world IoT for enterprisesReal world IoT for enterprises
Real world IoT for enterprisesIndicThreads
 
IoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreadsIoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreadsIndicThreads
 
Functional Programming Past Present Future
Functional Programming Past Present FutureFunctional Programming Past Present Future
Functional Programming Past Present FutureIndicThreads
 
Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams IndicThreads
 
Building & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fameBuilding & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fameIndicThreads
 
Internet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads ConferenceInternet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads ConferenceIndicThreads
 
Cars and Computers: Building a Java Carputer
 Cars and Computers: Building a Java Carputer Cars and Computers: Building a Java Carputer
Cars and Computers: Building a Java CarputerIndicThreads
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache SparkIndicThreads
 
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
 Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & DockerIndicThreads
 
Speed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedbackSpeed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedbackIndicThreads
 
Unraveling OpenStack Clouds
 Unraveling OpenStack Clouds Unraveling OpenStack Clouds
Unraveling OpenStack CloudsIndicThreads
 
Digital Transformation of the Enterprise. What IT leaders need to know!
Digital Transformation of the Enterprise. What IT  leaders need to know!Digital Transformation of the Enterprise. What IT  leaders need to know!
Digital Transformation of the Enterprise. What IT leaders need to know!IndicThreads
 

More from IndicThreads (20)

Http2 is here! And why the web needs it
Http2 is here! And why the web needs itHttp2 is here! And why the web needs it
Http2 is here! And why the web needs it
 
Understanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive ApplicationsUnderstanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
 
Go Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang wayGo Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang way
 
Building Resilient Microservices
Building Resilient Microservices Building Resilient Microservices
Building Resilient Microservices
 
App using golang indicthreads
App using golang  indicthreadsApp using golang  indicthreads
App using golang indicthreads
 
Building on quicksand microservices indicthreads
Building on quicksand microservices  indicthreadsBuilding on quicksand microservices  indicthreads
Building on quicksand microservices indicthreads
 
How to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingHow to Think in RxJava Before Reacting
How to Think in RxJava Before Reacting
 
Iot secure connected devices indicthreads
Iot secure connected devices indicthreadsIot secure connected devices indicthreads
Iot secure connected devices indicthreads
 
Real world IoT for enterprises
Real world IoT for enterprisesReal world IoT for enterprises
Real world IoT for enterprises
 
IoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreadsIoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreads
 
Functional Programming Past Present Future
Functional Programming Past Present FutureFunctional Programming Past Present Future
Functional Programming Past Present Future
 
Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams
 
Building & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fameBuilding & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fame
 
Internet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads ConferenceInternet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads Conference
 
Cars and Computers: Building a Java Carputer
 Cars and Computers: Building a Java Carputer Cars and Computers: Building a Java Carputer
Cars and Computers: Building a Java Carputer
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache Spark
 
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
 Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
 
Speed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedbackSpeed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedback
 
Unraveling OpenStack Clouds
 Unraveling OpenStack Clouds Unraveling OpenStack Clouds
Unraveling OpenStack Clouds
 
Digital Transformation of the Enterprise. What IT leaders need to know!
Digital Transformation of the Enterprise. What IT  leaders need to know!Digital Transformation of the Enterprise. What IT  leaders need to know!
Digital Transformation of the Enterprise. What IT leaders need to know!
 

Recently uploaded

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

Write tests in end users' language

  • 1. Write tests in the end users' lingo Speaker Name : Nikhil Fernandes,Chirag Doshi Company Name : Thoughtworks Technologies
  • 2. What is the #1 thing that goes wrong in software projects ?
  • 4. End user BA Dev Application QA
  • 5. End user BA Dev Application QA End user BA Dev Application QA
  • 7. Title:I want to login to the website Role:As a user Action:I want to login into the website Outcome:So that I can view exclusive content
  • 8. Acceptance Criteria: Scenario:Successful Login Given:The user is on the login page When:The user types username sam AND the user types password 123456 AND the user clicks the login button Then:The user should be directed to the home page AND the page should display Welcome Sam message
  • 9. Acceptance Criteria: Scenario:Invalid Username Given:The user is on the login page When:The user types username wrong AND the user types password 123456 AND the user clicks the login button Then:The page should display Authentication failed message
  • 11. Title:Book Submision Role:As a Librarian Action:I want to add a new book Outcome:So that members can borrow this book
  • 12. Imperative Acceptance Criteria: Scenario:Successful Submission Given:The librarian is on the admin page When:he/she fills in the name as Programming in Objective-C  AND fills in author as Stephen G Kochan AND fill in tags as programming,iphone. Then:The librarian should see a message... 'Successfully created book'
  • 13. Declarative Acceptance Criteria: Scenario:Successful Submission Given:The librarian is on the admin page When:he/she adds a new book to the system Then:The librarian should see a message... 'Successfully created book'
  • 14. End user BA Dev Application QA
  • 15. Three ways to build test cases in the user's language
  • 16. 1.Build abstractions in the code 2.Automate your acceptance criteria 3.IDE support for these automated acceptance criteria
  • 17. 1.Build abstractions in the code 2.Automate your acceptance criteria 3.IDE support for these automated acceptance criteria
  • 18. Scenario Successful Login Given the user is on the login page AND the user type username sam AND the user types password 123456 AND the user clicks the login button Then the page should display Welcome Sam Message
  • 19. @Test public void shouldDisplayWelcomeMessageWhenUserSuccessfullyLogsIn(){ selenium.click(LOGIN_LINK); selenium.waitForElementPresent(LOGIN_BUTTON); selenium.type(LOGIN_USERNAME_EDIT_FIELD, ”sam"); selenium.type(LOGIN_PASSWORD_EDIT_FIELD, “123456");     selenium.click(LOGIN_BUTTON); selenium.waitForElementPresent("Welcome"); } @Test public void shouldDisplayErrorMessageWhenUserTriesLoginWithWrongUsername(){ selenium.click(LOGIN_LINK); selenium.waitForElementPresent(LOGIN_BUTTON); selenium.type(LOGIN_USERNAME_EDIT_FIELD, ”wrong"); selenium.type(LOGIN_PASSWORD_EDIT_FIELD, ”123456");     selenium.click(LOGIN_BUTTON); selenium.waitForElementPresent("Authentication Failed"); }
  • 20. @Test public void shouldDisplayWelcomeMessageWhenUserSuccessfullyLogsIn(){ new LoginPage() .openLoginPage() .enterUserName('sam').enterPassword('123456') .login().verifySuccessfulLogin(); } @Test public void shouldDisplayErrorMessageWhenUserTriesLoginWithWrongUsername(){ new LoginPage() .openLoginPage() .enterUserName('wrong').enterPassword('123456'). login().verifyUserIsNotAuthenticated(); }
  • 21. public class LoginPage { private Selenium selenium; public LoginPage(Selenium selenium) { this.selenium = selenium; } public LoginPage openLoginPage() { selenium.click(LOGIN_LINK); selenium.waitForElementPresent(LOGIN_BUTTON); return this; } public LoginPage enterUserName(String userName){ selenium.type(LOGIN_USERNAME_EDIT_FIELD, userName); return this; }
  • 22. public LoginPage enterPassword(String password){ selenium.type(LOGIN_PASSWORD_EDIT_FIELD, password); return this; } public LoginPage login(){ selenium.click(LOGIN_BUTTON); return this; } public boolean verifyUserIsNotAuthenticated(){ selenium.waitForElementPresent("Authentication Failed"); return this; } public boolean verifySuccessfulLogin(){ selenium.waitForElementPresent("Welcome"); return this; } }
  • 23. 1.Build abstractions in the code 2.Automate your acceptance criteria 3.IDE support for these automated acceptance criteria
  • 24.
  • 25. Scenario Successful Login Given the user is on the login page AND the user type username sam AND the user types password 123456 AND the user clicks the login button Then the page should display Welcome Sam Message Given 'the user is on the login page' do @browser.open('http://foobar.com/') end AND /the user types (w+) (w+)/ do |element,value| @browser.type(element, value) end AND /the user clicks (w+) button/ do |element| @browser.click element @browser.wait_for_page_to_load end Then /the page should display (.*) Message/ do |expected_textl| @browser.is_element_present("css=p['#{expected_text}']").should be_true end
  • 26. Scenario Invalid UserName Given the user is on the login page AND the user type username wrong AND the user types password 123456 AND the user clicks the login button Then the page should display 'Authentication Failed' Message Given 'the user is on the login page' do @browser.open('http://foobar.com/') end AND /the user types (w+) (w+)/ do |element,value| @browser.type(element, value) end AND /the user clicks (w+) button/ do |element| @browser.click element @browser.wait_for_page_to_load end Then /the page should display (.*) Message/ do |expected_textl| @browser.is_element_present("css=p['#{expected_text}']").should be_true end
  • 28. Scenario Invalid UserName Given the user is on the login page AND the user type username wrong AND the user types password 123456 AND the user clicks the login button Then the page should display 'Authentication Failed' Message @Given("the user is on the login page") public void theUserIsOnTheLoginPage() { LoginPage loginPage = new LoginPage(); loginPage.verifyPresenceOfLoginButton(); } @When("the user types username $username") public void theUserTypesUsername(String username) { loginPage().typeUsername(username); } @When("the user types password $password") public void theUserTypesPassword(String password) { loginPage().typePassword(password); }
  • 29. @When("clicks the login button") public void clicksTheLoginButton() { loginPage().login(); } @Then("the page should display $errorMessage Message") public void thePageShouldDisplayErrorMessage(String errorMessage) { loginPage().verifyPresenceOfErrorMessage(errorMessage); }
  • 30. 1.Build abstractions in the code 2.Automate your acceptance criteria 3.IDE support for these automated acceptance criteria
  • 31.
  • 32.