SlideShare a Scribd company logo
1 of 34
Download to read offline
ATDD example using
FitNesse ,
Selenium
and Java.
ALEKSANDR GRITSEVSKI , KUEHNE+NAGEL IT CENTER, ESTONIA
About the speaker
Aleksandr Gritsevski
Lead Quality Manager
Kuehne+ Nagel IT Center
Estonia
Acceptance Test-driven Development
(ATDD)
 ATDD is Acceptance Test Driven Development.
 In one short sentence: we start with an acceptance test that
describes the functionality we want to implement from users point of
view.
 Acceptance tests ideally should be “black box” tests. They should
talk to the application only through the interfaces it exposes.
Test-driven Development (TDD)
 Test-driven development (TDD) is a software development process
that relies on the repetition of a very short development cycle:
Requirements are turned into very specific test cases, then the
software is improved to pass the new tests, only. This is opposed to
software development that allows software to be added that is not
proven to meet requirements.
Test-driven Development workflow
TDD example
 @Test
public void testGetSum() throws Exception {
assertEquals(15, calculator.getSum(7,8));
}
TDD example
 public class Calculator {
public int getSum(int x, int y) {
return x+y;
}
}
TDD example
 @Test
public void testGetSum() throws Exception {
assertEquals(15, calculator.getSum(7,8));
}
@Test
public void testGetDivide() throws Exception {
assertEquals(20, calculator.getDivide(100,5));
}
TDD example
 public class Calculator {
public int getSum(int x, int y) {
return x+y;
}
public int getDivide(int x, int y) {
return x/y;
}
}
ATDD example
 When one number is used then return value is
that same number
 When two numbers are used then return value is
their sum
ATDD example
 @Test
public final void
whenOneNumberIsUsedThenReturnValueIsThatSameNumber() {
Assert.assertEquals(3, StringCalculator.add("3"));
}
 @Test
public final void
whenTwoNumbersAreUsedThenReturnValueIsTheirSum() {
Assert.assertEquals(3+6, StringCalculator.add("3,6"));
}
ATDD example
Acceptance Criteria
 Given the user has accessed the webapp
 The user tries to add a new pet then Pet Name and Pet Status are
both mandatory fields
 The user has entered Name and Status then he is able to add data
by clicking on the Create button
 The user can see his enters in the List of Pets grid
 The user can delete entries using Delete button in the List of Pets grid
ATDD example
 @Test
public void givenTheUserHasAccessedTheWebapp
() throws Exception {
driver.get("https://qa-petstore.herokuapp.com/");
try {
assertEquals("Petstore - Assignment", driver.getTitle());
} catch (Error e) {
verificationErrors.append(e.toString());
}
}
 @Test
public void
theUserHasEnteredNameAndStatusThenHeIsAbleToAddDataByClickingOnTheCreateButton
() throws Exception {
driver.findElement(By.cssSelector("input.form-control.pet-name")).click();
driver.findElement(By.cssSelector("input.form-control.pet-name")).clear();
driver.findElement(By.cssSelector("input.form-control.pet-name")).sendKeys("Pet Name");
driver.findElement(By.cssSelector("input.form-control.pet-status")).click();
driver.findElement(By.cssSelector("input.form-control.pet-status")).clear();
driver.findElement(By.cssSelector("input.form-control.pet-status")).sendKeys("Pet Status");
driver.findElement(By.id("btn-create")).click();
try {
assertEquals("Pet Name", driver.findElement(By.xpath("//tr[4]/td/span")).getText());
} catch (Error e) {
verificationErrors.append(e.toString());
}
try {
assertEquals("Pet Status",
driver.findElement(By.xpath("//tr[4]/td[2]/span")).getText());
} catch (Error e) {
verificationErrors.append(e.toString());
}
}
Why FitNess ?
 FitNesse is a tool for specifying and verifying application
acceptance criteria (requirements).
 To make it easy for all stakeholders to interact with FitNesse,
requirements can be created and edited through the web browser.
 Specifications can be written in wiki syntax or in a rich text editor, so
no knowledge of the wiki syntax is required.
Why FitNess ?
 Creating tables easily.
 Easily translating tables into calls to the system under test.
 Allowing ease and flexibility in documenting tests.
 Possibility crate acceptance test without dip knowledge in the any
of software languages
Acceptance test example in FitNess
Acceptance Criteria
 Given the user has accessed the webapp
public void startApplication() {
logger.debug("startApplication is called.");
@SuppressWarnings("deprecation")
WebDriver myDriver = handler.initializeDriver(getSettings()
.getSeleniumServer(), String.valueOf(getSettings()
.getSeleniumPort()), getSettings().getBrowserName(), "3000");
logger.debug("setDriver is called next.");
setDriver(myDriver);
if (driver() == null) {
logger.error("The WebDriver seems not to be initialized - further actions
are abandoned");
abandonStorytest();
}
driver().get(getSettings().getApplicationRoot());
}
public void waitForElementPresent(String locator, String timeOut) {
logger.debug("[waitForElementPresent] waits " + timeOut + " for locator:" + locator);
int timeOutInSeconds = (Integer.parseInt(timeOut) / 1000);
Wait<WebDriver> wait = new WebDriverWait(driver(), timeOutInSeconds);
try {
wait.until(visibilityOfElementLocated(locator));
} catch (Exception e) {
throw new SeleniumException("The Element appears not in the certain amount of
time.");
}
}
Acceptance test example in FitNess
Acceptance Criteria
 The user has entered Name and Status then he is able to add data
by clicking on the Create button
public void theUserHasEnteredNameAndStatusThenHeIsAbleToAddDataByClickingOnTheCreateButton (String petName, String PetStatus)
() throws Exception {
driver.findElement(By.cssSelector("input.form-control.pet-name")).click();
driver.findElement(By.cssSelector("input.form-control.pet-name")).clear();
driver.findElement(By.cssSelector("input.form-control.pet-name")).sendKeys(petName);
driver.findElement(By.cssSelector("input.form-control.pet-status")).click();
driver.findElement(By.cssSelector("input.form-control.pet-status")).clear();
driver.findElement(By.cssSelector("input.form-control.pet-status")).sendKeys(petStatus);
driver.findElement(By.id("btn-create")).click();
try {
assertEquals(petName, driver.findElement(By.xpath("//tr[4]/td/span")).getText());
} catch (Error e) {
verificationErrors.append(e.toString());
}
try {
assertEquals(petStatus, driver.findElement(By.xpath("//tr[4]/td[2]/span")).getText());
} catch (Error e) {
verificationErrors.append(e.toString());
}
}
Experience in using FitNess in the
enterprise development
 First expression : This is overhead , Java (WebDriver + Junit) it is
enough
Experience in using FitNess in the
enterprise development
 First expression : This is overhead , Java (WebDriver + Junit) it is enough
 No more test cases and test suits
Experience in using FitNess in the
enterprise development
 First expression : This is overhead , Java (WebDriver + Junit) it is enough
 No more test cases and test suits
 No more steps to reproduce in bug report
Experience in using FitNess in the
enterprise development
 First expression : This is overhead , Java (WebDriver + Junit) it is enough
 No more test cases and test suits
 No more steps to reproduce in bug report
 Business analytics and PO can create automation tests
Experience in using FitNess in the
enterprise development
 First expression : This is overhead , Java (WebDriver + Junit) it is enough
 No more test cases and test suits
 No more steps to reproduce in bug report
 Business analytics and PO can create automation tests
 All story documentation can be in one place
Experience in using FitNess in the
enterprise development
 First expression : This is overhead , Java (WebDriver + Junit) it is enough
 No more test cases and test suits
 No more steps to reproduce in bug report
 Business analytics and PO can create automation tests
 All story documentation can be in one place
 And it is only one place when you can found how your system works
in reality
Experience in using FitNess in the
enterprise development
 First expression : This is overhead , Java (WebDriver + Junit) it is enough
 No more test cases and test suits
 No more steps to reproduce in bug report
 Business analytics and PO can create automation tests
 All story documentation can be in one place
 And it is only one place when you can found how your system works in reality
 Step by step you can switch to ATDD approach
Thanks for you attention
Q&A

More Related Content

What's hot

Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?Paco van Beckhoven
 
Unit Testing in iOS - Ninjava Talk
Unit Testing in iOS - Ninjava TalkUnit Testing in iOS - Ninjava Talk
Unit Testing in iOS - Ninjava TalkLong Weekend LLC
 
Testing for Pragmatic People
Testing for Pragmatic PeopleTesting for Pragmatic People
Testing for Pragmatic Peopledavismr
 
Spring Certification Questions
Spring Certification QuestionsSpring Certification Questions
Spring Certification QuestionsSpringMockExams
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web developmentalice yang
 
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit TutorialJAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit TutorialAnup Singh
 
Why Katalon Studio?
Why Katalon Studio?Why Katalon Studio?
Why Katalon Studio?Knoldus Inc.
 
React.js enlightenment
React.js enlightenmentReact.js enlightenment
React.js enlightenmentArtur Szott
 
Automating to Augment Testing
Automating to Augment TestingAutomating to Augment Testing
Automating to Augment TestingAlan Richardson
 
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...Edureka!
 
FAQ - why does my code throw a null pointer exception - common reason #1 Rede...
FAQ - why does my code throw a null pointer exception - common reason #1 Rede...FAQ - why does my code throw a null pointer exception - common reason #1 Rede...
FAQ - why does my code throw a null pointer exception - common reason #1 Rede...Alan Richardson
 
TDD CrashCourse Part5: Testing Techniques
TDD CrashCourse Part5: Testing TechniquesTDD CrashCourse Part5: Testing Techniques
TDD CrashCourse Part5: Testing TechniquesDavid Rodenas
 
Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Hazem Saleh
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in YiiIlPeach
 
Describe's Full of It's
Describe's Full of It'sDescribe's Full of It's
Describe's Full of It'sJim Lynch
 

What's hot (20)

Unit testing - A&BP CC
Unit testing - A&BP CCUnit testing - A&BP CC
Unit testing - A&BP CC
 
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
 
Unit Testing in iOS - Ninjava Talk
Unit Testing in iOS - Ninjava TalkUnit Testing in iOS - Ninjava Talk
Unit Testing in iOS - Ninjava Talk
 
Testing for Pragmatic People
Testing for Pragmatic PeopleTesting for Pragmatic People
Testing for Pragmatic People
 
Spring Certification Questions
Spring Certification QuestionsSpring Certification Questions
Spring Certification Questions
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
 
Unit Testing in iOS
Unit Testing in iOSUnit Testing in iOS
Unit Testing in iOS
 
Codeception
CodeceptionCodeception
Codeception
 
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit TutorialJAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
JS and patterns
JS and patternsJS and patterns
JS and patterns
 
Why Katalon Studio?
Why Katalon Studio?Why Katalon Studio?
Why Katalon Studio?
 
React.js enlightenment
React.js enlightenmentReact.js enlightenment
React.js enlightenment
 
Automating to Augment Testing
Automating to Augment TestingAutomating to Augment Testing
Automating to Augment Testing
 
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
 
FAQ - why does my code throw a null pointer exception - common reason #1 Rede...
FAQ - why does my code throw a null pointer exception - common reason #1 Rede...FAQ - why does my code throw a null pointer exception - common reason #1 Rede...
FAQ - why does my code throw a null pointer exception - common reason #1 Rede...
 
TDD CrashCourse Part5: Testing Techniques
TDD CrashCourse Part5: Testing TechniquesTDD CrashCourse Part5: Testing Techniques
TDD CrashCourse Part5: Testing Techniques
 
Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013
 
PHP Unit Testing in Yii
PHP Unit Testing in YiiPHP Unit Testing in Yii
PHP Unit Testing in Yii
 
Describe's Full of It's
Describe's Full of It'sDescribe's Full of It's
Describe's Full of It's
 

Similar to 1 aleksandr gritsevski - attd example using

Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptdavejohnson
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETBen Hall
 
Hitchhiker's guide to Functional Testing
Hitchhiker's guide to Functional TestingHitchhiker's guide to Functional Testing
Hitchhiker's guide to Functional TestingWiebe Elsinga
 
Android the Agile way
Android the Agile wayAndroid the Agile way
Android the Agile wayAshwin Raghav
 
The secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutThe secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutDror Helper
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testingpleeps
 
Test & behavior driven development
Test & behavior driven developmentTest & behavior driven development
Test & behavior driven developmentTristan Libersat
 
Security Testing
Security TestingSecurity Testing
Security TestingKiran Kumar
 
Test Drive Development in Ruby On Rails
Test Drive Development in Ruby On RailsTest Drive Development in Ruby On Rails
Test Drive Development in Ruby On RailsNyros Technologies
 
Testing And Drupal
Testing And DrupalTesting And Drupal
Testing And DrupalPeter Arato
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsRapidValue
 
Unit & Automation Testing in Android - Stanislav Gatsev, Melon
Unit & Automation Testing in Android - Stanislav Gatsev, MelonUnit & Automation Testing in Android - Stanislav Gatsev, Melon
Unit & Automation Testing in Android - Stanislav Gatsev, MelonbeITconference
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy codeShriKant Vashishtha
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Ortus Solutions, Corp
 
How to write clean tests
How to write clean testsHow to write clean tests
How to write clean testsDanylenko Max
 

Similar to 1 aleksandr gritsevski - attd example using (20)

Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
 
Agile Android
Agile AndroidAgile Android
Agile Android
 
Hitchhiker's guide to Functional Testing
Hitchhiker's guide to Functional TestingHitchhiker's guide to Functional Testing
Hitchhiker's guide to Functional Testing
 
Android the Agile way
Android the Agile wayAndroid the Agile way
Android the Agile way
 
The secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutThe secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you about
 
Grails unit testing
Grails unit testingGrails unit testing
Grails unit testing
 
Test & behavior driven development
Test & behavior driven developmentTest & behavior driven development
Test & behavior driven development
 
Security Testing
Security TestingSecurity Testing
Security Testing
 
Presentation Unit Testing process
Presentation Unit Testing processPresentation Unit Testing process
Presentation Unit Testing process
 
Php tests tips
Php tests tipsPhp tests tips
Php tests tips
 
Testing
TestingTesting
Testing
 
Test Drive Development in Ruby On Rails
Test Drive Development in Ruby On RailsTest Drive Development in Ruby On Rails
Test Drive Development in Ruby On Rails
 
Testing And Drupal
Testing And DrupalTesting And Drupal
Testing And Drupal
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API Requests
 
Unit & Automation Testing in Android - Stanislav Gatsev, Melon
Unit & Automation Testing in Android - Stanislav Gatsev, MelonUnit & Automation Testing in Android - Stanislav Gatsev, Melon
Unit & Automation Testing in Android - Stanislav Gatsev, Melon
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy code
 
Javascript Unit Testing
Javascript Unit TestingJavascript Unit Testing
Javascript Unit Testing
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018
 
How to write clean tests
How to write clean testsHow to write clean tests
How to write clean tests
 

More from Ievgenii Katsan

8 andrew kalyuzhin - 30 ux-advices, that will make users love you
8   andrew kalyuzhin - 30 ux-advices, that will make users love you8   andrew kalyuzhin - 30 ux-advices, that will make users love you
8 andrew kalyuzhin - 30 ux-advices, that will make users love youIevgenii Katsan
 
5 hans van loenhoud - master-class the 7 skills of highly successful teams
5   hans van loenhoud - master-class the 7 skills of highly successful teams5   hans van loenhoud - master-class the 7 skills of highly successful teams
5 hans van loenhoud - master-class the 7 skills of highly successful teamsIevgenii Katsan
 
4 alexey orlov - life of product in startup and enterprise
4   alexey orlov - life of product in startup and enterprise4   alexey orlov - life of product in startup and enterprise
4 alexey orlov - life of product in startup and enterpriseIevgenii Katsan
 
3 dmitry gomeniuk - how to make data-driven decisions in saa s products
3   dmitry gomeniuk - how to make data-driven decisions in saa s products3   dmitry gomeniuk - how to make data-driven decisions in saa s products
3 dmitry gomeniuk - how to make data-driven decisions in saa s productsIevgenii Katsan
 
7 hans van loenhoud - the problem-goal-solution trinity
7   hans van loenhoud - the problem-goal-solution trinity7   hans van loenhoud - the problem-goal-solution trinity
7 hans van loenhoud - the problem-goal-solution trinityIevgenii Katsan
 
3 denys gobov - change request specification the knowledge base or the task...
3   denys gobov - change request specification the knowledge base or the task...3   denys gobov - change request specification the knowledge base or the task...
3 denys gobov - change request specification the knowledge base or the task...Ievgenii Katsan
 
5 victoria cupet - learn to play business analysis
5   victoria cupet - learn to play business analysis5   victoria cupet - learn to play business analysis
5 victoria cupet - learn to play business analysisIevgenii Katsan
 
5 alina petrenko - key requirements elicitation during the first contact wi...
5   alina petrenko - key requirements elicitation during the first contact wi...5   alina petrenko - key requirements elicitation during the first contact wi...
5 alina petrenko - key requirements elicitation during the first contact wi...Ievgenii Katsan
 
3 karabak kuyavets transformation of business analyst to product owner
3   karabak kuyavets transformation of business analyst to product owner3   karabak kuyavets transformation of business analyst to product owner
3 karabak kuyavets transformation of business analyst to product ownerIevgenii Katsan
 
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...Ievgenii Katsan
 
3 zornitsa nikolova - the product manager between decision making and facil...
3   zornitsa nikolova - the product manager between decision making and facil...3   zornitsa nikolova - the product manager between decision making and facil...
3 zornitsa nikolova - the product manager between decision making and facil...Ievgenii Katsan
 
4 viktoriya gudym - how to effectively manage remote employees
4   viktoriya gudym - how to effectively manage remote employees4   viktoriya gudym - how to effectively manage remote employees
4 viktoriya gudym - how to effectively manage remote employeesIevgenii Katsan
 
9 natali renska - product and outsource development, how to cook 2 meals in...
9   natali renska - product and outsource development, how to cook 2 meals in...9   natali renska - product and outsource development, how to cook 2 meals in...
9 natali renska - product and outsource development, how to cook 2 meals in...Ievgenii Katsan
 
7 denis parkhomenko - from idea to execution how to make a product that cus...
7   denis parkhomenko - from idea to execution how to make a product that cus...7   denis parkhomenko - from idea to execution how to make a product that cus...
7 denis parkhomenko - from idea to execution how to make a product that cus...Ievgenii Katsan
 
6 anton vitiaz - inside the mvp in 3 days
6   anton vitiaz - inside the mvp in 3 days6   anton vitiaz - inside the mvp in 3 days
6 anton vitiaz - inside the mvp in 3 daysIevgenii Katsan
 
5 mariya popova - ideal product management. unicorns in our reality
5   mariya popova - ideal product management. unicorns in our reality5   mariya popova - ideal product management. unicorns in our reality
5 mariya popova - ideal product management. unicorns in our realityIevgenii Katsan
 
2 victor podzubanov - design thinking game
2   victor podzubanov - design thinking game2   victor podzubanov - design thinking game
2 victor podzubanov - design thinking gameIevgenii Katsan
 
3 sergiy potapov - analyst to product owner
3   sergiy potapov - analyst to product owner3   sergiy potapov - analyst to product owner
3 sergiy potapov - analyst to product ownerIevgenii Katsan
 
4 anton parkhomenko - how to make effective user research with no budget at...
4   anton parkhomenko - how to make effective user research with no budget at...4   anton parkhomenko - how to make effective user research with no budget at...
4 anton parkhomenko - how to make effective user research with no budget at...Ievgenii Katsan
 

More from Ievgenii Katsan (20)

8 andrew kalyuzhin - 30 ux-advices, that will make users love you
8   andrew kalyuzhin - 30 ux-advices, that will make users love you8   andrew kalyuzhin - 30 ux-advices, that will make users love you
8 andrew kalyuzhin - 30 ux-advices, that will make users love you
 
5 hans van loenhoud - master-class the 7 skills of highly successful teams
5   hans van loenhoud - master-class the 7 skills of highly successful teams5   hans van loenhoud - master-class the 7 skills of highly successful teams
5 hans van loenhoud - master-class the 7 skills of highly successful teams
 
4 alexey orlov - life of product in startup and enterprise
4   alexey orlov - life of product in startup and enterprise4   alexey orlov - life of product in startup and enterprise
4 alexey orlov - life of product in startup and enterprise
 
3 dmitry gomeniuk - how to make data-driven decisions in saa s products
3   dmitry gomeniuk - how to make data-driven decisions in saa s products3   dmitry gomeniuk - how to make data-driven decisions in saa s products
3 dmitry gomeniuk - how to make data-driven decisions in saa s products
 
7 hans van loenhoud - the problem-goal-solution trinity
7   hans van loenhoud - the problem-goal-solution trinity7   hans van loenhoud - the problem-goal-solution trinity
7 hans van loenhoud - the problem-goal-solution trinity
 
1 hans van loenhoud -
1   hans van loenhoud - 1   hans van loenhoud -
1 hans van loenhoud -
 
3 denys gobov - change request specification the knowledge base or the task...
3   denys gobov - change request specification the knowledge base or the task...3   denys gobov - change request specification the knowledge base or the task...
3 denys gobov - change request specification the knowledge base or the task...
 
5 victoria cupet - learn to play business analysis
5   victoria cupet - learn to play business analysis5   victoria cupet - learn to play business analysis
5 victoria cupet - learn to play business analysis
 
5 alina petrenko - key requirements elicitation during the first contact wi...
5   alina petrenko - key requirements elicitation during the first contact wi...5   alina petrenko - key requirements elicitation during the first contact wi...
5 alina petrenko - key requirements elicitation during the first contact wi...
 
3 karabak kuyavets transformation of business analyst to product owner
3   karabak kuyavets transformation of business analyst to product owner3   karabak kuyavets transformation of business analyst to product owner
3 karabak kuyavets transformation of business analyst to product owner
 
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...4   andrii melnykov - stakeholder management for pd ms and b-as and why it is...
4 andrii melnykov - stakeholder management for pd ms and b-as and why it is...
 
3 zornitsa nikolova - the product manager between decision making and facil...
3   zornitsa nikolova - the product manager between decision making and facil...3   zornitsa nikolova - the product manager between decision making and facil...
3 zornitsa nikolova - the product manager between decision making and facil...
 
4 viktoriya gudym - how to effectively manage remote employees
4   viktoriya gudym - how to effectively manage remote employees4   viktoriya gudym - how to effectively manage remote employees
4 viktoriya gudym - how to effectively manage remote employees
 
9 natali renska - product and outsource development, how to cook 2 meals in...
9   natali renska - product and outsource development, how to cook 2 meals in...9   natali renska - product and outsource development, how to cook 2 meals in...
9 natali renska - product and outsource development, how to cook 2 meals in...
 
7 denis parkhomenko - from idea to execution how to make a product that cus...
7   denis parkhomenko - from idea to execution how to make a product that cus...7   denis parkhomenko - from idea to execution how to make a product that cus...
7 denis parkhomenko - from idea to execution how to make a product that cus...
 
6 anton vitiaz - inside the mvp in 3 days
6   anton vitiaz - inside the mvp in 3 days6   anton vitiaz - inside the mvp in 3 days
6 anton vitiaz - inside the mvp in 3 days
 
5 mariya popova - ideal product management. unicorns in our reality
5   mariya popova - ideal product management. unicorns in our reality5   mariya popova - ideal product management. unicorns in our reality
5 mariya popova - ideal product management. unicorns in our reality
 
2 victor podzubanov - design thinking game
2   victor podzubanov - design thinking game2   victor podzubanov - design thinking game
2 victor podzubanov - design thinking game
 
3 sergiy potapov - analyst to product owner
3   sergiy potapov - analyst to product owner3   sergiy potapov - analyst to product owner
3 sergiy potapov - analyst to product owner
 
4 anton parkhomenko - how to make effective user research with no budget at...
4   anton parkhomenko - how to make effective user research with no budget at...4   anton parkhomenko - how to make effective user research with no budget at...
4 anton parkhomenko - how to make effective user research with no budget at...
 

Recently uploaded

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 MountPuma Security, LLC
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
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 MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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 interpreternaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 

Recently uploaded (20)

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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 

1 aleksandr gritsevski - attd example using

  • 1. ATDD example using FitNesse , Selenium and Java. ALEKSANDR GRITSEVSKI , KUEHNE+NAGEL IT CENTER, ESTONIA
  • 2. About the speaker Aleksandr Gritsevski Lead Quality Manager Kuehne+ Nagel IT Center Estonia
  • 3. Acceptance Test-driven Development (ATDD)  ATDD is Acceptance Test Driven Development.  In one short sentence: we start with an acceptance test that describes the functionality we want to implement from users point of view.  Acceptance tests ideally should be “black box” tests. They should talk to the application only through the interfaces it exposes.
  • 4. Test-driven Development (TDD)  Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: Requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. This is opposed to software development that allows software to be added that is not proven to meet requirements.
  • 6. TDD example  @Test public void testGetSum() throws Exception { assertEquals(15, calculator.getSum(7,8)); }
  • 7. TDD example  public class Calculator { public int getSum(int x, int y) { return x+y; } }
  • 8. TDD example  @Test public void testGetSum() throws Exception { assertEquals(15, calculator.getSum(7,8)); } @Test public void testGetDivide() throws Exception { assertEquals(20, calculator.getDivide(100,5)); }
  • 9. TDD example  public class Calculator { public int getSum(int x, int y) { return x+y; } public int getDivide(int x, int y) { return x/y; } }
  • 10. ATDD example  When one number is used then return value is that same number  When two numbers are used then return value is their sum
  • 11. ATDD example  @Test public final void whenOneNumberIsUsedThenReturnValueIsThatSameNumber() { Assert.assertEquals(3, StringCalculator.add("3")); }  @Test public final void whenTwoNumbersAreUsedThenReturnValueIsTheirSum() { Assert.assertEquals(3+6, StringCalculator.add("3,6")); }
  • 12. ATDD example Acceptance Criteria  Given the user has accessed the webapp  The user tries to add a new pet then Pet Name and Pet Status are both mandatory fields  The user has entered Name and Status then he is able to add data by clicking on the Create button  The user can see his enters in the List of Pets grid  The user can delete entries using Delete button in the List of Pets grid
  • 14.  @Test public void givenTheUserHasAccessedTheWebapp () throws Exception { driver.get("https://qa-petstore.herokuapp.com/"); try { assertEquals("Petstore - Assignment", driver.getTitle()); } catch (Error e) { verificationErrors.append(e.toString()); } }
  • 15.  @Test public void theUserHasEnteredNameAndStatusThenHeIsAbleToAddDataByClickingOnTheCreateButton () throws Exception { driver.findElement(By.cssSelector("input.form-control.pet-name")).click(); driver.findElement(By.cssSelector("input.form-control.pet-name")).clear(); driver.findElement(By.cssSelector("input.form-control.pet-name")).sendKeys("Pet Name"); driver.findElement(By.cssSelector("input.form-control.pet-status")).click(); driver.findElement(By.cssSelector("input.form-control.pet-status")).clear(); driver.findElement(By.cssSelector("input.form-control.pet-status")).sendKeys("Pet Status"); driver.findElement(By.id("btn-create")).click();
  • 16. try { assertEquals("Pet Name", driver.findElement(By.xpath("//tr[4]/td/span")).getText()); } catch (Error e) { verificationErrors.append(e.toString()); } try { assertEquals("Pet Status", driver.findElement(By.xpath("//tr[4]/td[2]/span")).getText()); } catch (Error e) { verificationErrors.append(e.toString()); } }
  • 17. Why FitNess ?  FitNesse is a tool for specifying and verifying application acceptance criteria (requirements).  To make it easy for all stakeholders to interact with FitNesse, requirements can be created and edited through the web browser.  Specifications can be written in wiki syntax or in a rich text editor, so no knowledge of the wiki syntax is required.
  • 18. Why FitNess ?  Creating tables easily.  Easily translating tables into calls to the system under test.  Allowing ease and flexibility in documenting tests.  Possibility crate acceptance test without dip knowledge in the any of software languages
  • 19. Acceptance test example in FitNess Acceptance Criteria  Given the user has accessed the webapp
  • 20.
  • 21. public void startApplication() { logger.debug("startApplication is called."); @SuppressWarnings("deprecation") WebDriver myDriver = handler.initializeDriver(getSettings() .getSeleniumServer(), String.valueOf(getSettings() .getSeleniumPort()), getSettings().getBrowserName(), "3000"); logger.debug("setDriver is called next."); setDriver(myDriver); if (driver() == null) { logger.error("The WebDriver seems not to be initialized - further actions are abandoned"); abandonStorytest(); } driver().get(getSettings().getApplicationRoot()); }
  • 22. public void waitForElementPresent(String locator, String timeOut) { logger.debug("[waitForElementPresent] waits " + timeOut + " for locator:" + locator); int timeOutInSeconds = (Integer.parseInt(timeOut) / 1000); Wait<WebDriver> wait = new WebDriverWait(driver(), timeOutInSeconds); try { wait.until(visibilityOfElementLocated(locator)); } catch (Exception e) { throw new SeleniumException("The Element appears not in the certain amount of time."); } }
  • 23. Acceptance test example in FitNess Acceptance Criteria  The user has entered Name and Status then he is able to add data by clicking on the Create button
  • 24. public void theUserHasEnteredNameAndStatusThenHeIsAbleToAddDataByClickingOnTheCreateButton (String petName, String PetStatus) () throws Exception { driver.findElement(By.cssSelector("input.form-control.pet-name")).click(); driver.findElement(By.cssSelector("input.form-control.pet-name")).clear(); driver.findElement(By.cssSelector("input.form-control.pet-name")).sendKeys(petName); driver.findElement(By.cssSelector("input.form-control.pet-status")).click(); driver.findElement(By.cssSelector("input.form-control.pet-status")).clear(); driver.findElement(By.cssSelector("input.form-control.pet-status")).sendKeys(petStatus); driver.findElement(By.id("btn-create")).click(); try { assertEquals(petName, driver.findElement(By.xpath("//tr[4]/td/span")).getText()); } catch (Error e) { verificationErrors.append(e.toString()); } try { assertEquals(petStatus, driver.findElement(By.xpath("//tr[4]/td[2]/span")).getText()); } catch (Error e) { verificationErrors.append(e.toString()); } }
  • 25.
  • 26. Experience in using FitNess in the enterprise development  First expression : This is overhead , Java (WebDriver + Junit) it is enough
  • 27. Experience in using FitNess in the enterprise development  First expression : This is overhead , Java (WebDriver + Junit) it is enough  No more test cases and test suits
  • 28. Experience in using FitNess in the enterprise development  First expression : This is overhead , Java (WebDriver + Junit) it is enough  No more test cases and test suits  No more steps to reproduce in bug report
  • 29. Experience in using FitNess in the enterprise development  First expression : This is overhead , Java (WebDriver + Junit) it is enough  No more test cases and test suits  No more steps to reproduce in bug report  Business analytics and PO can create automation tests
  • 30. Experience in using FitNess in the enterprise development  First expression : This is overhead , Java (WebDriver + Junit) it is enough  No more test cases and test suits  No more steps to reproduce in bug report  Business analytics and PO can create automation tests  All story documentation can be in one place
  • 31. Experience in using FitNess in the enterprise development  First expression : This is overhead , Java (WebDriver + Junit) it is enough  No more test cases and test suits  No more steps to reproduce in bug report  Business analytics and PO can create automation tests  All story documentation can be in one place  And it is only one place when you can found how your system works in reality
  • 32. Experience in using FitNess in the enterprise development  First expression : This is overhead , Java (WebDriver + Junit) it is enough  No more test cases and test suits  No more steps to reproduce in bug report  Business analytics and PO can create automation tests  All story documentation can be in one place  And it is only one place when you can found how your system works in reality  Step by step you can switch to ATDD approach
  • 33. Thanks for you attention
  • 34. Q&A