Test Driven Lasse Koskela Chapter 9: Acceptance TDD Explained

Slides:



Advertisements
Similar presentations
Introduction to Software Testing Chapter 1 Model-Driven Test Design Paul Ammann & Jeff Offutt
Advertisements

Acceptance Testing.
Software Quality Assurance Plan
Introduction to Software Testing Chapter 1 Paul Ammann & Jeff Offutt SUMMARY OF PARTS 1 AND 2 FROM LAST WEEK.
Software Project Management
System Construction and Implementation Objectives:
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Rapid software development.
Introduction to Software Testing Chapter 9.2 Challenges in Testing Software – Software Testability Paul Ammann & Jeff Offutt
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Extreme Programming.
Introduction to Software Testing Chapter 5.5 Input Space Grammars Paul Ammann & Jeff Offutt
Extreme/Agile Programming Prabhaker Mateti. ACK These slides are collected from many authors along with a few of mine. Many thanks to all these authors.
Rapid software development 1. Topics covered Agile methods Extreme programming Rapid application development Software prototyping 2.
Chapter 2 Software processes. Topics covered Software process models Process activities Coping with change.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
CS5103 Software Engineering Lecture 02 More on Software Process Models.
1 Presentation Title Test-driven development (TDD) Overview David Wu.
Requirements Engineering Requirements Engineering in Agile Methods Lecture-28.
Introduction to Software Testing (2nd edition) Chapter 4 Putting Testing First Paul Ammann & Jeff Offutt August.
Introduction to Software Testing Model-Driven Test Design and Coverage testing Paul Ammann & Jeff Offutt Update.
Extreme Software Engineering A Hands-On Approach From Extreme Software Engineering: A Hands-On Approach Daniel H. Steinberg Daniel W. Palmer.
Software Development. The Software Life Cycle Encompasses all activities from initial analysis until obsolescence Analysis of problem or request Analysis.
Coming up: What is Agile? XP Development Dan Fleck 2010 Dan Fleck 2010.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Rapid software development.
AGILE METHODS Curtis Cook CS 569 Spring 2003.
Embedded Systems Software Engineering
CS223: Software Engineering
Software Development.
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Constructing Deploying and Maintaining Enterprise Systems
Appendix B Agile Methodologies
Software & Software Engineering Pertemuan-4 Dosen :Kundang K Juman
CMPE 280 Web UI Design and Development August 29 Class Meeting
Introduction to Visual Basic 2008 Programming
Putting Testing First CS 4501 / 6501 Software Testing
Dr. Rob Hasker SE 3800 Note 3 Ch. 4, 5.
September 20, 2017 Agile Techniques Workshop Susan Futey
Paul Ammann & Jeff Offutt
Behavior Driven Test Development
Verification and Validation
CSC480 Software Engineering
Advantages OF BDD Testing
Johanna Rothman Create Technical Excellence Chapter 9
What do you need to know about XP?
Dilbert Scott Adams Manage It! Your Guide to Modern, Pragmatic Project Management. Johanna Rothman.
Introduction to Software Testing Chapter 2 Model-Driven Test Design
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Chapter 2 Software Processes
Software System Integration
Putting Testing First CS 4501 / 6501 Software Testing
Software Testing and Maintenance Maintenance and Evolution Overview
Introduction to Software Testing (2nd edition) Chapter 4 TDD Example
Databases Software This icon indicates the slide contains activities created in Flash. These activities are not editable. For more detailed instructions,
Introducing ISTQB Agile Foundation Extending the ISTQB Program’s Support Further Presented by Rex Black, CTAL Copyright © 2014 ASTQB 1.
Test Driven Lasse Koskela Chapter 2: Beginning TDD
Quality Assurance in an Agile Development Team Michelle Wu 2018 PNSQC
Course: Module: Lesson # & Name Instructional Material 1 of 32 Lesson Delivery Mode: Lesson Duration: Document Name: 1. Professional Diploma in ERP Systems.
TDD & ATDD 1/15/2019.
Paul Ammann & Jeff Offutt
Software Verification, Validation, and Acceptance Testing
Chapter 3: Agile Software Processes
Systems Construction and Implementation
Coming up: What is Agile?
System Construction and Implementation
Systems Construction and Implementation
Test Driven Lasse Koskela Chapter 9: Acceptance TDD Explained
Appendix B Agile Methodologies
Extreme Programming.
Presentation transcript:

Test Driven Lasse Koskela Chapter 9: Acceptance TDD Explained Paul Ammann & Jeff Offutt SWE 437 George Mason University 2018

Overview 9.1 Introduction to user stories 9.2 Acceptance tests 9.3 Understanding the process 9.4 Acceptance TDD as a team activity 9.5 Benefits of acceptance TDD 9.6 What are we testing, exactly? 9.7 Brief overview of available tools “In the spacecraft business no design can survive the review process without first answering the question—how are we going to test this thing?” —Glen Alleman SWE 437- Software Testing and Maintenance © Ammann & Offutt

9.1 Introduction To User Stories Format of a story Free form Or structured: As a (role) I want (functionality) so that (benefit) Often written on index cards Card, conversation, confirmation (CCC) Power of storytelling User view of what is needed, but not how it is provided A user story represents a requirement, and creates a promise to communicate with the customer later Storytelling reveals meaning without defining it —Hannah Arendt SWE 437- Software Testing and Maintenance © Ammann & Offutt

Example User Stories State what, NOT how Support technician sees customer’s history on-screen at the start of a call Application authenticates with the HTTP proxy server The system prevents user from running multiple instances of the application simultaneously State what, NOT how Enabling value : A user story is valuable because it enables engineers to add functionality SWE 437- Software Testing and Maintenance © Ammann & Offutt

9.2 Acceptance Tests Create tests based on user stories Properties of user stories Owned by customer Written together with customer, developer, and tester Focus on the what, not the how Expressed in language of the problem domain—user’s vocabulary Concise, precise, and unambiguous In-class discussion: Consider the 3 user stories on previous slide (pg 326) Discuss whether and how they satisfy these properties SWE 437- Software Testing and Maintenance © Ammann & Offutt

Acceptance Tests—Example Tests Support technician sees customer’s history on-screen at the start of a call Fig. 9.1 Simulate a call with Fred’s account number and verify that Fred’s info can be read from the screen Verify that the system displays a valid error message for a non-existing account number Omit the account number in the incoming call completely and verify that the system displays the text “no account number provided” on the screen Fig. 9.2 SWE 437- Software Testing and Maintenance © Ammann & Offutt

Acceptance Tests—What vs. How Go to the “new transaction” screen, fill in the required details, and save the entry; verify that the transaction shows up on the list Select the “delete” checkbox for the newly created entry, click “delete all marked transactions,” and verify that they’re gone Create multiple transactions, check several of them and delete; verify that all selected transactions were indeed deleted In-class discussion: What is wrong with these tests? Fig. 9.3 Too much HOW for users Trimmed to focus on WHAT Try creating a new transaction Try deleting a transaction Try deleting multiple transactions Fig. 9.4 SWE 437- Software Testing and Maintenance © Ammann & Offutt

Acceptance Tests—What vs. How Support technician sees customer’s history on-screen at the start of a call Simulate a call with Fred’s account number and verify that Fred’s info can be read from the screen Verify that the system displays a valid error message for a non-existing account number Omit the account number in the incoming call completely and verify that the system displays the text “no account number provided” on the screen Fig. 9.1 Too detailed Fig. 9.2 Trimmed version of tests in fig. 9.2 Valid account number Non-existing account number No account number provided Fig. 9.5 SWE 437- Software Testing and Maintenance © Ammann & Offutt

9.3 Understanding the Process The acceptance TDD cycle Pick a story Write tests for the story Automate the tests Implement the functionality Pick a user story Write tests Implement functionality Automate tests A process with feedback SWE 437- Software Testing and Maintenance © Ammann & Offutt

A-TDD Process Step 1 The acceptance TDD cycle Most important Pick a story Write tests for the story Automate the tests Implement the functionality Most important Business value Technical risk Amount of programming SWE 437- Software Testing and Maintenance © Ammann & Offutt

A-TDD Process Step 2 The acceptance TDD cycle Involve the customer Pick a story Write tests for the story Automate the tests Implement the functionality Involve the customer Iterate Keep abstract as long as possible Get ahead of refactoring SWE 437- Software Testing and Maintenance © Ammann & Offutt

A-TDD Process Step 3 The acceptance TDD cycle Pick a story Write tests for the story Automate the tests Implement the functionality Start with a table format Translate to implementation Postpone use of tools—tools steal focus from the topic SWE 437- Software Testing and Maintenance © Ammann & Offutt

A-TDD Process Step 4 The acceptance TDD cycle Pick a story Write tests for the story Automate the tests Implement the functionality Each A-TDD test leads to multiple small tests SWE 437- Software Testing and Maintenance © Ammann & Offutt

Acceptance Tests in Agile Methods User story Acceptance test fails TDD test Add functionality Customer must approve acceptance test passing Refactor Refactor Acceptance test passes Introduction to Software Testing, Edition 2 (Ch 4) © Ammann & Offutt

9.4 Acceptance Testing as a Team Activity Defining the customer role Representative of end users Possibly several people Characteristics of customer role Shared interest in success Authority to make decisions Ability to understand implications Ability to explain domain Key is to verify against target domain SWE 437- Software Testing and Maintenance © Ammann & Offutt

Acceptance Testing Team Who writes tests with the customer? Tester ? Developer ? Requirements expert ? Everybody ? How many testers do we need? One or two developers per tester Tester is a role, not a job title All developers should be testers More contributors is better SWE 437- Software Testing and Maintenance © Ammann & Offutt

9.5 Benefits of Acceptance Testing Definition of “done” Customer must agree it’s done Knowing where we are Knowing when to stop Test criteria satisfied Cooperative work Trust and commitment Specification by example This is a big one! Filling the gap Unit tests are not the same as acceptance tests Both unit and acceptance tests needed SWE 437- Software Testing and Maintenance © Ammann & Offutt

9.6 What Are We Testing, Exactly? Should we test against the UI? Do whatever is easier long term UIs are often in the way Good tools can automate tests through or around the UI Performance might matter Should we stub our system? Sufficiently close to the real thing Sometimes stubs are necessary Should we test business logic directly? Of course—it’s what the customer cares about Tests are like votes—they need to run early and often SWE 437- Software Testing and Maintenance © Ammann & Offutt

Expected Benefits of TDD Program always works as expected Correct relative to current tests Decisions are made when needed Rather than weeks or months early Decisions are more likely to be correct End result is more reliable Future modifications Are cheaper Are easier Are less frequent SWE 437- Software Testing and Maintenance © Ammann & Offutt

Summary: TDD & System Readiness Amount of system available and (appears to) work well System testing Steady state; deployment Lots of problems & rework System tests start passing TDD System integration Lots of early effort; nothing works Time SWE 437- Software Testing and Maintenance © Ammann & Offutt