ATDD - Acceptance Test Driven Development
Upcoming SlideShare
Loading in...5
×
 

ATDD - Acceptance Test Driven Development

on

  • 76,857 views

Acceptance test driven development tutorial. This tutorial explains how to take user stories and convert them into working software. Details about Acceptance Criteria and Acceptance tests using ...

Acceptance test driven development tutorial. This tutorial explains how to take user stories and convert them into working software. Details about Acceptance Criteria and Acceptance tests using FitNesse and FitLibrary are described in this presentation. Also Patterns and Anti-Patterns associated with this are described in this presentation.

Statistics

Views

Total Views
76,857
Views on SlideShare
73,594
Embed Views
3,263

Actions

Likes
78
Downloads
2,998
Comments
8

37 Embeds 3,263

http://agilefaqs.com 1255
http://softtests.wordpress.com 465
http://portal.accelrys.net 358
http://nareshjain.com 340
http://oncommit.posterous.com 220
http://www.slideshare.net 187
http://oncommit.tumblr.com 145
http://www.jroller.com 66
http://localhost 49
http://bundlr.com 40
http://tomas.tistory.com 25
http://jroller.com 20
http://www.agilefaqs.com 14
http://kiranusa.wordpress.com 13
http://vidcapp0028.corp.global.level3.com 9
http://user-pc5 7
http://dev.gobundlr.com 7
http://rowlyemmett.blogspot.com 6
http://www.slideshow.com 6
http://gobundlr.com 4
http://inside-mleo.blogspot.com 4
http://ftp.jroller.com 3
http://dev.bundlr.com 3
http://slideshow.com 2
https://twitter.com 2
http://twitter.com 2
https://vuws.uws.edu.au 1
http://bit-asin91sp13-win.pd.local 1
http://beta.jolicloud.co 1
http://www.lmodules.com 1
http://learnweb.l3s.uni-hannover.de 1
http://www.allishealthy.com 1
http://www.techgig.com 1
http://posterous.com 1
http://www.mashme.tv 1
http://web.archive.org 1
http://www.linkedin.com 1
More...

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

15 of 8 Post a comment

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • In the commercial tools section, are you saying that WinRunner, Silk and RFT are suitable and the others are not or are all of them not suitable?
    Are you sure you want to
    Your message goes here
    Processing…
  • wonderful presentation, thanks for sharing this.
    Are you sure you want to
    Your message goes here
    Processing…
  • Awesome presentation!
    Are you sure you want to
    Your message goes here
    Processing…
  • Não consegui realizar o download, poderia me disponibilizar por e-mail?

    thinaregina@gmail.com
    Are you sure you want to
    Your message goes here
    Processing…
  • very nice presentation about Acceptance TDD
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

ATDD - Acceptance Test Driven Development ATDD - Acceptance Test Driven Development Presentation Transcript

  • Acceptance TestDriven Development Naresh Jain naresh@agilefaqs.com http://blogs.agilefaqs.com Licensed Under Creative Commons by Naresh Jain 1
  • Warmup Scenarios Licensed Under Creative Commons by Naresh Jain 2
  • Warmup ScenariosPick one scenario and in relation to your scenario,what are the specific observable results that willtell you that the activity has been successfullycompleted? Licensed Under Creative Commons by Naresh Jain 2
  • Warmup ScenariosPick one scenario and in relation to your scenario,what are the specific observable results that willtell you that the activity has been successfullycompleted?Going out for Movie (THX sound and Digital projection) Licensed Under Creative Commons by Naresh Jain 2
  • Warmup ScenariosPick one scenario and in relation to your scenario,what are the specific observable results that willtell you that the activity has been successfullycompleted?Going out for Movie (THX sound and Digital projection)Going out for meal (one veg.) Licensed Under Creative Commons by Naresh Jain 2
  • Warmup ScenariosPick one scenario and in relation to your scenario,what are the specific observable results that willtell you that the activity has been successfullycompleted?Going out for Movie (THX sound and Digital projection)Going out for meal (one veg.)Going shopping ($50) Licensed Under Creative Commons by Naresh Jain 2
  • Warmup ScenariosPick one scenario and in relation to your scenario,what are the specific observable results that willtell you that the activity has been successfullycompleted?Going out for Movie (THX sound and Digital projection)Going out for meal (one veg.)Going shopping ($50) [10 Minutes] Licensed Under Creative Commons by Naresh Jain 2
  • Warmup ScenariosPick one scenario and in relation to your scenario,what are the specific observable results that willtell you that the activity has been successfullycompleted?Going out for Movie (THX sound and Digital projection)Going out for meal (one veg.)Going shopping ($50) [10 Minutes]Present back to the group your findings. [3 minutes per group] Licensed Under Creative Commons by Naresh Jain 2
  • What is a Story?Story is a smallest piece of functionality that add business value Story Title - Actor Action Context As a .. <user who requires this feature> I want .. <do something> So that... <user goal/business justification> Ron Jeffries’ 3 Cs - Card, Conversation and Confirmation 3
  • Story ExampleTitle: Keen Reader subscribes to a blogAs a keen reader of your blogI want to subscribe to your blogSo that I can stay up-to-date with the new posts 4
  • Another Story ExampleTitle: Social Networking Enthusiast uploads profile pictureAs a Social Networking EnthusiastI want to upload my profile pictureSo my friends can see how I look and recognize me 5
  • What makes a good Story? 6
  • What makes a good Story?Stories should follow the INVEST principle: 6
  • What makes a good Story?Stories should follow the INVEST principle:Independent 6
  • What makes a good Story?Stories should follow the INVEST principle:IndependentNegotiable 6
  • What makes a good Story?Stories should follow the INVEST principle:IndependentNegotiableValuable 6
  • What makes a good Story?Stories should follow the INVEST principle:IndependentNegotiableValuableEstimate-able 6
  • What makes a good Story?Stories should follow the INVEST principle:IndependentNegotiableValuableEstimate-ableSmall 6
  • What makes a good Story?Stories should follow the INVEST principle:IndependentNegotiableValuableEstimate-ableSmallTestable 6
  • Stories are fundamental unit of activity 7
  • Stories are fundamental unit of activityBusiness Goals 7
  • Stories are fundamental unit of activityBusiness Goals Inception 7
  • Stories are fundamental unit of activityBusiness Goals Product Backlog Inception As a ____, I want to be able to ____ so that ____ Might have an initial estimate (perhaps for both analysis and development), and an expression of technical and business confidence that this is real and achievable 7
  • Stories are fundamental unit of activityBusiness Goals Product Backlog Inception Release planning As a ____, I want to be able to ____ so that ____ Might have an initial estimate (perhaps for both analysis and development), and an expression of technical and business confidence that this is real and achievable 7
  • Stories are fundamental unit of activityBusiness Goals Product Backlog Release Backlog Inception Release planning As a ____, I want to As a ____, I want to be able to ____ so be able to ____ so that ____ that ____ I will know this is done when _______ Might have an initial estimate (perhaps for both analysis and development), and an expression of technical and business confidence that this is real and achievable More detailed estimate, and a specific acceptance test – low confidence stories might be “spiked” or prototyped 7
  • Stories are fundamental unit of activityBusiness Goals Product Backlog Release Backlog Inception Release planning Sprint planning As a ____, I want to As a ____, I want to be able to ____ so be able to ____ so that ____ that ____ I will know this is done when _______ Might have an initial estimate (perhaps for both analysis and development), and an expression of technical and business confidence that this is real and achievable More detailed estimate, and a specific acceptance test – low confidence stories might be “spiked” or prototyped 7
  • Stories are fundamental unit of activityBusiness Goals Product Backlog Release Backlog Sprint Backlog Inception Release planning Sprint planning As a ____, I want to As a ____, I want to As a ____, I want to be able to ____ so be able to ____ so be able to ____ so that ____ that ____ that ____ Possible automation of the acceptance test I will know this is done I will know this is done when _______ when _______ Might have an initial estimate (perhaps for both analysis and development), and an Development team expression of technical and breaks out the detail To do this I must: business confidence that this of work needed to 1) _____ is real and achievable More detailed estimate, and a pass test 2) _____ specific acceptance test – low confidence stories might be “spiked” or prototyped 7
  • Acceptance CriteriaIs a set of conditions that the Story must meet for it to beaccepted as completeIs typically provided by the customer or product owner. Is not a replacement for conversation. Is the results of the conversation Acceptance Criteria are NOT tests 8
  • Writing Acceptance CriteriaAcceptance Criteria should contain: ACTOR VERB – DESCRIBING A BEHAVIOR OBSERVABLE RESULTTo accommodate pre-conditions Acceptance Criteria can be expressed as Given [Precondition] When [Actor + Action] Then [Observable Result] 9
  • ExampleSocial Networking Enthusiast uploads profile picture 10
  • Example Social Networking Enthusiast uploads profile pictureGiven the user has a valid facebook account and a digital picture on her computer,When she uploads a picture in facebook,Then her the picture should be visible to all her friends in her network. 10
  • Example Social Networking Enthusiast uploads profile pictureGiven the user has a valid facebook account and a digital picture on her computer,When she uploads a picture in facebook,Then her the picture should be visible to all her friends in her network.Given an user is trying to find a friend on facebook,When the user searches for a person using their name,Then their profile picture should be displayed along with other details. 10
  • Example Social Networking Enthusiast uploads profile pictureGiven the user has a valid facebook account and a digital picture on her computer,When she uploads a picture in facebook,Then her the picture should be visible to all her friends in her network.Given an user is trying to find a friend on facebook,When the user searches for a person using their name,Then their profile picture should be displayed along with other details.As owner of facebook,I want users to upload authentic, personal profile picture,So facebooks reputation remains intact and facebook stays out of legal hassles. 10
  • Acceptance Criteria & Tests: Definition Acceptance Tests Licensed Under Creative Commons by Naresh Jain 11
  • Acceptance Criteria & Tests: Definition Acceptance TestsAcceptance Criteria Licensed Under Creative Commons by Naresh Jain 11
  • Acceptance Criteria & Tests: Definition Acceptance Tests Acceptance Criteria+ Licensed Under Creative Commons by Naresh Jain 11
  • Acceptance Criteria & Tests: Definition Acceptance Tests Acceptance Criteria+ Examples (data + scenarios) Licensed Under Creative Commons by Naresh Jain 11
  • Acceptance Criteria & Tests: Definition Acceptance Tests Acceptance Criteria+ Examples (data + scenarios) Acceptance Tests Licensed Under Creative Commons by Naresh Jain 11
  • TasksTeam members further break down each story into tasks that need to be completed to meet the acceptance criteria for the story. 12
  • Tasks Team members further break down each story into tasks that need to be completed to meet the acceptance criteria for the story.To accomplish this story: we start off with a simple upload and image display 12
  • Tasks Team members further break down each story into tasks that need to be completed to meet the acceptance criteria for the story.To accomplish this story: we start off with a simple upload and image display restrict user to only upload certain image types (gif, jpg and png) 12
  • Tasks Team members further break down each story into tasks that need to be completed to meet the acceptance criteria for the story.To accomplish this story: we start off with a simple upload and image display restrict user to only upload certain image types (gif, jpg and png) figure out where to store the image. (performant and fault-tolarent) 12
  • Tasks Team members further break down each story into tasks that need to be completed to meet the acceptance criteria for the story.To accomplish this story: we start off with a simple upload and image display restrict user to only upload certain image types (gif, jpg and png) figure out where to store the image. (performant and fault-tolarent) scale down (size, resolution, etc.) of the image 12
  • Tasks Team members further break down each story into tasks that need to be completed to meet the acceptance criteria for the story.To accomplish this story: we start off with a simple upload and image display restrict user to only upload certain image types (gif, jpg and png) figure out where to store the image. (performant and fault-tolarent) scale down (size, resolution, etc.) of the image and so on... 12
  • DemoRoman Numerals to Decimal Conversion Example Licensed Under Creative Commons by Naresh Jain 13
  • DemoReal World Domain Forwarding Server Licensed Under Creative Commons by Naresh Jain 14
  • Thinking in Tables Licensed Under Creative Commons by Naresh Jain 15
  • Thinking in TablesOnly Tables Execute Ignored Executed Licensed Under Creative Commons by Naresh Jain 16
  • Thinking in Tables Foundational Table Structure Name of FixtureInteraction with Application Table structure depends on type of Fixture Licensed Under Creative Commons by Naresh Jain 17
  • Thinking in Tables 3 Foundation FixturesColumn FixtureRow FixtureAction Fixture Licensed Under Creative Commons by Naresh Jain 18
  • Thinking in Tables Column FixtureLicensed Under Creative Commons by Naresh Jain 19
  • Thinking in Tables Row Fixture Analogous to comparing against rows in a database tableLicensed Under Creative Commons by Naresh Jain 20
  • Thinking in Tables Action Fixture Think GUI window Counter Window Counter:public class CountFixture extends Fixture { private int counter = 0; Counter: 6 public void count() { Count counter++; } public int counter() { return counter; }} Licensed Under Creative Commons by Naresh Jain 21
  • FitLibraryExtension to FITWritten by Rick MugridgeAdds some handy Fixtures Licensed Under Creative Commons by Naresh Jain 22
  • FitLibrary FitLibrary FixturesArrayFixture for ordered listsSetFixture for unordered listsSetUpFixtureSupports Graphics Tree structures Nested Tables Licensed Under Creative Commons by Naresh Jain 23
  • FitLibraryDoFixture• Broken tables• Highly readable• Flexibility Licensed Under Creative Commons by Naresh Jain 24
  • Tools FITFramework for Integrated TestsCreated by Ward CunninghamOpen SourceThe most accepted solution for agile acceptance testing Licensed Under Creative Commons by Naresh Jain 25
  • Tools FitNesseEnvironment build around FITMakes everything easierCreated by Object Mentor, Inc.Open Source Licensed Under Creative Commons by Naresh Jain 26
  • FIT FitNesse - Stand alone web server - Is a wiki- Tests written in HTML - Tests written in wiki text- Tests are executed on the command line - Tests are executed from within the wiki- Tables are executed - Translates tests into HTML- Non-table markup is ignored - Uses FIT to execute tests- Tables map to Fixtures - Supports test suites- Fixtures are code that is aware of the - Supports variables in testssystem - Supports test refactoring- Supplies foundational Fixtures - Written in Java- Implementations ported to many - Supports FIT implementations in anylanguages language Licensed Under Creative Commons by Naresh Jain 27
  • Acceptance Criteria and Tests:A Critical Piece of Agile Licensed Under Creative Commons by Naresh Jain 28
  • Acceptance Criteria & Tests: A Critical Piece of Agile Traditional Approach1 May 1 Jul 1 Sep 1 Nov Analysis Design Implementation ERD DFD DD ST Licensed Under Creative Commons by Naresh Jain 29
  • Key Questions Business FacingAre we building the right product?Are we building the product right? Technology/Implementation Facing Licensed Under Creative Commons by Naresh Jain 30
  • Brian Marick’s Test Categorization Business FacingSupports Programming Critique product Technology/Implementation Facing Licensed Under Creative Commons by Naresh Jain 31
  • It Helps to Think of Tests this way... Business FacingDrives Development Critique product Technology/Implementation Facing Licensed Under Creative Commons by Naresh Jain 32
  • It Helps to Think of Tests this way... Business FacingDrives Development Critique product Unit Testing Technology/Implementation Facing Licensed Under Creative Commons by Naresh Jain 32
  • It Helps to Think of Tests this way... Business Facing Acceptance TestingDrives Development Critique product Low-fi prototypes Unit Testing Technology/Implementation Facing Licensed Under Creative Commons by Naresh Jain 32
  • It Helps to Think of Tests this way... Business Facing Acceptance Testing Exploratory TestingDrives Development Critique product Low-fi prototypes UI and Usability Testing Unit Testing Technology/Implementation Facing Licensed Under Creative Commons by Naresh Jain 32
  • It Helps to Think of Tests this way... Business Facing Acceptance Testing Exploratory TestingDrives Development Critique product Low-fi prototypes UI and Usability Testing Performance Testing Unit Testing System Tests Technology/Implementation Facing Licensed Under Creative Commons by Naresh Jain 32
  • Avatars of TDD Business FacingDrives Development Critique product Inside Out Outside In Technology/Implementation Facing Licensed Under Creative Commons by Naresh Jain 33
  • Test Driven DevelopmentTDD Rhythm - Test, Code, Refactor Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a TestTDD Rhythm - Test, Code, Refactor Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Run the TestTDD Rhythm - Test, Code, Refactor Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Pass Run the TestTDD Rhythm - Test, Code, Refactor Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Pass Run the Test FailTDD Rhythm - Test, Code, Refactor Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Pass Run the Test FailTDD Rhythm - Test, Code, Refactor Make a little change Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Pass Run the Test FailTDD Rhythm - Test, Code, Refactor Make a little change Run the Test Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Pass Run the Test FailTDD Rhythm - Test, Code, Refactor Make a little change Fail Run the Test Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Pass Run the Test FailTDD Rhythm - Test, Code, Refactor Make a little change Fail Run the Test Pass Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Pass Run the Test FailTDD Rhythm - Test, Code, Refactor Make a little change Fail Run the Test Pass Refactor Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Pass Run the Test FailTDD Rhythm - Test, Code, Refactor Make a little change Fail Run the Test Pass Refactor Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Pass Run the Test FailTDD Rhythm - Test, Code, Refactor Make a little change Fail Run the Test Pass Refactor Licensed Under Creative Commons by Naresh Jain 34
  • Test Driven Development Add a Test Pass Run the Test FailTDD Rhythm - Test, Code, Refactor Make a little change Fail Run the Test Pass Refactor Licensed Under Creative Commons by Naresh Jain 34
  • Acceptance Test Driven Development Licensed Under Creative Commons by Naresh Jain 35
  • Acceptance Test Driven DevelopmentStory Licensed Under Creative Commons by Naresh Jain 35
  • Acceptance Test Driven Development Acceptance CriteriaStory Licensed Under Creative Commons by Naresh Jain 35
  • Acceptance Test Driven Development Iteration Acceptance CriteriaStory Licensed Under Creative Commons by Naresh Jain 35
  • Acceptance Test Driven Development Iteration Automated Acceptance Acceptance Criteria TestsStory Licensed Under Creative Commons by Naresh Jain 35
  • Acceptance Test Driven Development Iteration Automated Acceptance Acceptance Criteria TestsStory Automated Unit Test Licensed Under Creative Commons by Naresh Jain 35
  • Acceptance Test Driven Development Iteration Automated Acceptance Acceptance Criteria TestsStory Automated Unit Test Automated Acceptance Tests Licensed Under Creative Commons by Naresh Jain 35
  • Acceptance Test Driven Development Iteration Automated Acceptance Acceptance Criteria TestsStory Automated Unit Test Automated Acceptance Tests Exploratory Testing Licensed Under Creative Commons by Naresh Jain 35
  • Acceptance Test Driven Development Iteration Automated Acceptance Acceptance Criteria TestsStory Automated Unit Test Automated Acceptance Tests Acceptance Exploratory Criteria Testing Licensed Under Creative Commons by Naresh Jain 35
  • Acceptance Test Driven Development Iteration Automated Acceptance Acceptance Criteria TestsStory Automated Unit Test Automated UI Tests Automated Acceptance Tests Acceptance Exploratory Criteria Testing Licensed Under Creative Commons by Naresh Jain 35
  • Acceptance Test Driven Development Iteration Automated P Acceptance E Acceptance R Criteria Tests F O Automated RStory M T Unit Test Automated E E UI Tests N S C T E S Automated Acceptance Tests Acceptance Exploratory Criteria Testing Licensed Under Creative Commons by Naresh Jain 35
  • Mike Cohn’s Testing Pyramid Licensed Under Creative Commons by Naresh Jain 36
  • Mike Cohn’s Testing Pyramid GUI Tests Licensed Under Creative Commons by Naresh Jain 36
  • Mike Cohn’s Testing Pyramid Small in Number GUI Tools: Selenium, Sahi, Watir, Abbot, Frankenstein Tests Licensed Under Creative Commons by Naresh Jain 36
  • Mike Cohn’s Testing Pyramid Small in Number GUI Tools: Selenium, Sahi, Watir, Abbot, Frankenstein Tests Acceptance Tests Licensed Under Creative Commons by Naresh Jain 36
  • Mike Cohn’s Testing Pyramid Small in Number GUI Tools: Selenium, Sahi, Watir, Abbot, Frankenstein Tests At least one per story Acceptance Tools: Fit, FitNesse, RSpec, JBehave Tests Licensed Under Creative Commons by Naresh Jain 36
  • Mike Cohn’s Testing Pyramid Small in Number GUI Tools: Selenium, Sahi, Watir, Abbot, Frankenstein Tests At least one per story Acceptance Tools: Fit, FitNesse, RSpec, JBehave Tests Unit Tests Licensed Under Creative Commons by Naresh Jain 36
  • Mike Cohn’s Testing Pyramid Small in Number GUI Tools: Selenium, Sahi, Watir, Abbot, Frankenstein Tests At least one per story Acceptance Tools: Fit, FitNesse, RSpec, JBehave Tests At least one per class or module Unit Tests Tools: xUnit, TestNG Licensed Under Creative Commons by Naresh Jain 36
  • Acceptance Tests: A Critical Piece of Agile Criteria for DONEEvery story must have at least one Acceptance TestA story is not DONE until it passes it’s Acceptance Tests Licensed Under Creative Commons by Naresh Jain 37
  • Acceptance Tests: A Critical Piece of AgileManual Acceptance Tests Licensed Under Creative Commons by Naresh Jain 38
  • Acceptance Tests: A Critical Piece of AgileManual Acceptance Tests Manual Acceptance Tests Licensed Under Creative Commons by Naresh Jain 38
  • Acceptance Tests: A Critical Piece of AgileManual Acceptance Tests Manual Acceptance Tests Licensed Under Creative Commons by Naresh Jain 38
  • Why Acceptance Tests?Criteria for CompletionGreat Collaboration toolSource of FeedbackReal data to measure progress Licensed Under Creative Commons by Naresh Jain 39
  • Data From Acceptance Tests Total ATs Failing ATs Passing ATs9072543618 0 1 2 3 4 5 6 7 8 9 10 Licensed Under Creative Commons by Naresh Jain 40
  • Acceptance Tests Are Automated Licensed Under Creative Commons by Naresh Jain 41
  • Acceptance Tests: A Critical Piece of Agile The ButtonHow often would you pressit?When would you press it?Who would press it? Testers, Developers, Managers, Customers, Spectators, etc. Licensed Under Creative Commons by Naresh Jain 42
  • Licensed Under Creative Commons by Naresh Jain 43
  • Criteria for DONELicensed Under Creative Commons by Naresh Jain 43
  • Criteria for DONE+ Licensed Under Creative Commons by Naresh Jain 43
  • Criteria for DONE+ Automated Licensed Under Creative Commons by Naresh Jain 43
  • Criteria for DONE+ AutomatedExecutable Specification Licensed Under Creative Commons by Naresh Jain 43
  • Acceptance Tests: A Critical Piece of Agile Executable SpecificationA new paradigm for testingPuts quality firstRemoves ambiguity from requirements Licensed Under Creative Commons by Naresh Jain 44
  • Who WritesAcceptance Tests? Licensed Under Creative Commons by Naresh Jain 45
  • Who Writes Acceptance Tests? The CustomerThe Customer Role Stake holder Business Analyst Quality Assurance Product Owner Developer Licensed Under Creative Commons by Naresh Jain 46
  • Who Writes Acceptance Tests? Tests Get TechnicalThe “Customer” may need technical help to write testsDevelopers and QAs are technicalPair test authoring Licensed Under Creative Commons by Naresh Jain 47
  • Who Writes Acceptance Tests? Business Rules Get FuzzySometimes developers need help understanding testsCustomers know business rulesPair test implementation Licensed Under Creative Commons by Naresh Jain 48
  • Exercise #1Licensed Under Creative Commons by Naresh Jain 49
  • Exercise #1 The Login TestWrite a test plan, in plain text, for the businessrules of logging in.Web applicationUser credentials are stored in relationaldatabaseSuccessful login redirects to “Welcome” page Licensed Under Creative Commons by Naresh Jain 50
  • Writing GoodAcceptance Tests Licensed Under Creative Commons by Naresh Jain 51
  • Writing Good Acceptance Tests Login Test Possibilities1. Direct browser to URL for login page Licensed Under Creative Commons by Naresh Jain 52
  • Writing Good Acceptance Tests Login Test Possibilities1. Direct browser to URL for login page Licensed Under Creative Commons by Naresh Jain 52
  • Writing Good Acceptance Tests Login Test Possibilities1. Direct browser to URL for login page1. Enter the username ‘wallace’ Licensed Under Creative Commons by Naresh Jain 52
  • Writing Good Acceptance Tests Login Test Possibilities1. Direct browser to URL for login page1. Enter the username ‘wallace’ Licensed Under Creative Commons by Naresh Jain 52
  • Writing Good Acceptance Tests Login Test Possibilities1. Direct browser to URL for login page1. Enter the username ‘wallace’Build a Testable Environment First Licensed Under Creative Commons by Naresh Jain 52
  • Writing Good Acceptance Tests Login Test Possibilities1. Add some users to the system Licensed Under Creative Commons by Naresh Jain 53
  • Writing Good Acceptance Tests Login Test Possibilities1. Add some users to the system Licensed Under Creative Commons by Naresh Jain 53
  • Writing Good Acceptance Tests Login Test Possibilities1. Add some users to the system3. Enter a value into the username field Licensed Under Creative Commons by Naresh Jain 53
  • Writing Good Acceptance Tests Login Test Possibilities1. Add some users to the system3. Enter a value into the username field Licensed Under Creative Commons by Naresh Jain 53
  • Writing Good Acceptance Tests Login Test Possibilities1. Add some users to the system3. Enter a value into the username field Be Specific Licensed Under Creative Commons by Naresh Jain 53
  • Writing Good Acceptance Tests Tests are ExamplesUse concrete examplesSpecify concrete behaviorNo ambiguity allowed Licensed Under Creative Commons by Naresh Jain 54
  • Writing Good Acceptance Tests Login Test Possibilities1. Insert into User table values (’wallace’,‘ilikecheeze’) Licensed Under Creative Commons by Naresh Jain 55
  • Writing Good Acceptance Tests Login Test Possibilities1. Insert into User table values (’wallace’,‘ilikecheeze’) Licensed Under Creative Commons by Naresh Jain 55
  • Writing Good Acceptance Tests Login Test Possibilities1. Insert into User table values (’wallace’,‘ilikecheeze’)2. Open a browser to the URL http://localhost/myapp Licensed Under Creative Commons by Naresh Jain 55
  • Writing Good Acceptance Tests Login Test Possibilities1. Insert into User table values (’wallace’,‘ilikecheeze’)2. Open a browser to the URL http://localhost/myapp Licensed Under Creative Commons by Naresh Jain 55
  • Writing Good Acceptance Tests Login Test Possibilities1. Insert into User table values (’wallace’,‘ilikecheeze’)2. Open a browser to the URL http://localhost/myappAvoid Implementation Details Licensed Under Creative Commons by Naresh Jain 55
  • Good Acceptable Criteria and Tests Licensed Under Creative Commons by Naresh Jain 56
  • Good Acceptable Criteria and Tests S - SPECIFIC - Explicitly defined and definite Licensed Under Creative Commons by Naresh Jain 56
  • Good Acceptable Criteria and Tests S - SPECIFIC - Explicitly defined and definite M - MEASURABLE - Possible to observe and quantify Licensed Under Creative Commons by Naresh Jain 56
  • Good Acceptable Criteria and Tests S - SPECIFIC - Explicitly defined and definite M - MEASURABLE - Possible to observe and quantify A - ACHIEVABLE - Capable of existing or taking place Licensed Under Creative Commons by Naresh Jain 56
  • Good Acceptable Criteria and Tests S - SPECIFIC - Explicitly defined and definite M - MEASURABLE - Possible to observe and quantify A - ACHIEVABLE - Capable of existing or taking place R - RELEVANT - Having a connection with the story Licensed Under Creative Commons by Naresh Jain 56
  • Good Acceptable Criteria and Tests S - SPECIFIC - Explicitly defined and definite M - MEASURABLE - Possible to observe and quantify A - ACHIEVABLE - Capable of existing or taking place R - RELEVANT - Having a connection with the story T - TIME-BOUND – When will the outcome be observed Licensed Under Creative Commons by Naresh Jain 56
  • Writing Good Acceptance TestsAvoid Implementation Details Acceptance Tests View UI Model and Presenter Business Tier Data Store Licensed Under Creative Commons by Naresh Jain 57
  • Writing Good Acceptance Tests Login Test: Possible SolutionAdd user to system: (’wallace’, ‘ilikecheeze’)Process login with username ‘wallace’ and password ‘blah’Check login failedProcess login with username ‘wallace’ and password ‘ilikecheeze’Check login succeeded Licensed Under Creative Commons by Naresh Jain 58
  • ToolsLicensed Under Creative Commons by Naresh Jain 59
  • Tools Commercial Tools WinRunner TestPartner EggPlant Silk QTP TestComplete RFT Squish WindowTesterAre not suitable for Acceptance Testing in an Agile environment Licensed Under Creative Commons by Naresh Jain 60
  • Tools Open Source Options FIT Sahi Frankenstein FitNesse Watir Cucumber Selenium Abbot RSpec/JBehaveAmong the few tools that support Test Driven Development Licensed Under Creative Commons by Naresh Jain 61
  • WikiLicensed Under Creative Commons by Naresh Jain 62
  • Wiki What is it?A collaborative web siteEditable by anyCreated by Ward CunninghamEvery project should have onehttp://c2.com/wikihttp://en.wikipedia.com Licensed Under Creative Commons by Naresh Jain 63
  • Wiki Creating TestsUse Wiki syntax to create a page with test tablesLabel the page as a Test Page Use a page name of the form Test… Turn on the Test propertyMake sure your Fixtures are in the classpath Use !path widgetMechanics !path values are concatenated Java command to start FitServer is executed Testable HTML is passed to FitServer FitServer runs the tests Results are passed back to FitNesse Licensed Under Creative Commons by Naresh Jain 64
  • Wiki Creating Suites There are 2 ways to make SuitesSet the Suite property Create a page with the Suite property Created test pages inside this page When the suite is executed, all child test pages will be included in the suite executionUse the !see widget !see <name of test page> All “included” tests pages will be included in the suite execution Run a Suite by clicking the Suite button Licensed Under Creative Commons by Naresh Jain 65
  • Hands-on SessionConference Proposal Submission PortalSome sample Stories Should be able to submit new proposal Should be able to list all submitted proposal Submitting proposal with same title should display appropriate error message Should be able to delete submitted proposal based on the title Should be able to delete submitted proposal based on the title Should be able to search proposals by title Should be able to search proposals by ID Should be able to find all proposal by an authors name Licensed Under Creative Commons by Naresh Jain 66
  • BreakLicensed Under Creative Commons by Naresh Jain 67
  • PatternsLicensed Under Creative Commons by Naresh Jain 68
  • Patterns Organizing TestsAllowing customers to add new tests without breaking the build Licensed Under Creative Commons by Naresh Jain 69
  • Patterns Version ControlKeeping the acceptance test in version control with the code. Licensed Under Creative Commons by Naresh Jain 70
  • Patterns Cross-Functional PairingUsing FitNesse based acceptance tests for collaboration between cross-functional team members. Licensed Under Creative Commons by Naresh Jain 71
  • Patterns ATDDAcceptance Test Driven Development Licensed Under Creative Commons by Naresh Jain 72
  • Patterns CSTTCleanup, Setup, Test, Teardown Licensed Under Creative Commons by Naresh Jain 73
  • Patterns Independent TestsTests shouldn’t depend on each other.Tests leave the system in the same state it started in. Licensed Under Creative Commons by Naresh Jain 74
  • Patterns Dynamic StubbingAvoiding complications of external systems. Licensed Under Creative Commons by Naresh Jain 75
  • Patterns Non-Production Setup/TeardownUsing non-production light weigh code for setup and teardown.Helps test only what you want to test. Licensed Under Creative Commons by Naresh Jain 76
  • Patterns Suite LevelsCreating different levels of suites depending on the depth/level offeedback desired.Smoke, Current Iteration/Sprint, Regression Licensed Under Creative Commons by Naresh Jain 77
  • Patterns DRYUsing !include to avoid repeating yourself. Licensed Under Creative Commons by Naresh Jain 78
  • Patterns Make it RealWrite ATs as close as possible to the real environment. Licensed Under Creative Commons by Naresh Jain 79
  • Patterns Fixture EvolutionAllow Fixture implementation to evolve over time.Treat fixtures as first class citizens. Licensed Under Creative Commons by Naresh Jain 80
  • Patterns At Least One Test/StoryEvery story should have at least one acceptance testAvoid long/multipurpose tests. Licensed Under Creative Commons by Naresh Jain 81
  • Anti-PatternsLicensed Under Creative Commons by Naresh Jain 82
  • Anti-Patterns Developer ATsDevelopers writing acceptance tests by themselves, for themselves. Licensed Under Creative Commons by Naresh Jain 83
  • Anti-Patterns Unit TestingDon’t write ATs at the unit testing level Unit tests are implementation specific ATs are NOT implementation specific Licensed Under Creative Commons by Naresh Jain 84
  • Anti-Patterns QA Testing ToolHard to write tests up front.Perhaps only on large projects. Licensed Under Creative Commons by Naresh Jain 85
  • Anti-Patterns Silver BulletTrying to use FitNesse for all types of Acceptance Tests UI testing XML testing Licensed Under Creative Commons by Naresh Jain 86
  • Anti-Patterns Test AfterWriting tests after the code is already written. Licensed Under Creative Commons by Naresh Jain 87
  • Anti-Patterns Hidden Test DataHiding test data in the fixtures. Licensed Under Creative Commons by Naresh Jain 88
  • Anti-Patterns Implementation Dependent ATsMaking test pages (tables) dependent on implementation details anddata structures. Licensed Under Creative Commons by Naresh Jain 89
  • Anti-Patterns Logging in Your FixturesPutting log statements or print statements in the fixture code.Fixtures are probably too complicated. Licensed Under Creative Commons by Naresh Jain 90
  • ReferencePortions of this presentation is adopted from Micah Martin’sIntroduction to Automated Acceptance Tests PresentationKent Beck, Test Driven Development By Example."Agile Testing Directions" - Brian Marickhttp://www.opensourcetesting.org/ Licensed Under Creative Commons by Naresh Jain 91
  • The End Questions? naresh@agilefaqs.com http://blogs.agilefaqs.comLicensed Under Creative Commons by Naresh Jain 92