Acceptance Testing vs. Unit Testing: A Developers Perspective Owen Rogers Rob Styles

Slides:



Advertisements
Similar presentations
Web 2.0 Programming 1 © Tongji University, Computer Science and Technology. Web Web Programming Technology 2012.
Advertisements

Using T4Eclipse tool to Analyze Eclipse UI For t4eclipse version Ben Xu July 17,2010.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10 Servlets and Java Server Pages.
Copyright © 2002 Pearson Education, Inc. Slide 1.
Service Oriented Architecture Reference Model
Razorfish, Germany Case Study: Audi 2 1. Schematics (wireframes) 2. Jumping Boxes 3. Right vs. Left Navigation.
1 Formal Modeling & Verification of Messaging Framework of Simple Object Access Protocol (SOAP) Manzur Ashraf Faculty,BRAC University.
By Rick Clements Software Testing 101 By Rick Clements
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
XP New Perspectives on Microsoft Office Word 2003 Tutorial 7 1 Microsoft Office Word 2003 Tutorial 7 – Collaborating With Others and Creating Web Pages.
Title Subtitle.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Making the System Operational
Construction process lasts until coding and testing is completed consists of design and implementation reasons for this phase –analysis model is not sufficiently.
1 19-Jan-14 © Copyright: City Boy Salary : Simon Powers : 2014 Brown Bag – Behaviour Driven Development with Specflow Brown Bag – Behaviour Driven Development.
Week 2 The Object-Oriented Approach to Requirements
Configuration management
QA practitioners viewpoint
Campus02.at don't stop thinking about tomorrow DI Anton Scheibelmasser Setubal ICINCO /25 Device integration into automation systems with.
Testing Workflow Purpose
Quality Manual for Interoperability Testing
1 A Test Automation Tool For Java Applets Testing of Web Applications TATJA Program Demonstration Conclusions By Matthew Xuereb.
Service Level Agreement
FitNesse in Fifty Minutes Chris Harbert Resonate 1.
Molecular Biomedical Informatics Web Programming 1.
Component-Based Software Engineering Main issues: assemble systems out of (reusable) components compatibility of components.
IONA Technologies Position Paper Constraints and Capabilities for Web Services
Quality Manual for Interoperability Testing Morten Bruun-Rasmussen Presented by Milan Zoric, ETSI.
Software Processes.
Test Automation: Coded UI Test
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Software processes 2.
Lecture 8: Testing, Verification and Validation
Chapter 10 Software Testing
Acceptance Testing.
Executional Architecture
Implementation Architecture
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 14: Simulations 1.
Enhancing Spotfire with the Power of R
Addition 1’s to 20.
25 seconds left…...
Week 1.
Module 12 WSP quality assurance tool 1. Module 12 WSP quality assurance tool Session structure Introduction About the tool Using the tool Supporting materials.
14-1 © Prentice Hall, 2004 Chapter 14: OOSAD Implementation and Operation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh.
From Model-based to Model-driven Design of User Interfaces.
1 XML Web Services Practical Implementations Bob Steemson Product Architect iSOFT plc.
Alternate Software Development Methodologies
The chapter will address the following questions:
UNIT-V The MVC architecture and Struts Framework.
 1. Introduction  2. Development Life-Cycle  3. Current Component Technologies  4. Component Quality Assurance  5. Advantages and Disadvantages.
LAYING OUT THE FOUNDATIONS. OUTLINE Analyze the project from a technical point of view Analyze and choose the architecture for your application Decide.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Table-Driven Acceptance Testing Mario Aquino Principal Software Engineer Object Computing, Inc.
An Introduction to Software Architecture
Testing in Extreme Programming
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Software Construction Lecture 18 Software Testing.
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
A Practical Guide To Unit Testing John E. Boal TestDrivenDeveloper.com.
TEST-1 6. Testing & Refactoring. TEST-2 How we create classes? We think about what a class must do We focus on its implementation We write fields We write.
Callista Enterprise Test Driven ESB Development Sofia Jonsson
1 Presentation Title Test-driven development (TDD) Overview David Wu.
(1) Test Driven Development Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
Northwest Arkansas.Net User Group Jay Smith Tyson Foods, Inc. Unit Testing nUnit, nUnitAsp, nUnitForms.
Continuous Delivery and Team Foundation Server 2013 Ognjen Bajić Ana Roje Ivančić Ekobit.
Automated Testing with PHPUnit. How do you know your code works?
Advantages OF BDD Testing
An Introduction to Software Architecture
Test Driven Lasse Koskela Chapter 9: Acceptance TDD Explained
Presentation transcript:

Acceptance Testing vs. Unit Testing: A Developers Perspective Owen Rogers Rob Styles

2 What are Acceptance Tests? Tests owned and defined by the customer to verify that a story is complete and correct.

3 Why we use Acceptance Tests: Increase team confidence that the system is correct. Structures communication between customer and developers. Help customer think through requirements. Informs developer estimates. Indicates how to split a story. Concrete definition of story completion (knowing when were done). Early involvement of QA. Automated regression testing for free.

4 Why other people dont: Customer participation. Management buy-in. QA support. More tests for developers to implement. No common framework.

5 ATs and UTs are the same though, right? Both can and should be written first, before implementation. Both should be automated by containing assertions for validating expected results. Both typically use fixture setup and teardown code to run before and after the execution of the tests. Both can be implemented using an xUnit framework.

6 Difference: ATs are written by the customer. UTs only need to be read and understood by other developers. ATs must be defined in a language familiar to the customer. ATs require a customer meta-language: Generic enough to capture requirements Abstract enough to be maintainable Simple enough to be easily understood

7 Example Acceptance Tests. fit.ActionFixture starteg.Page enterlocationhttp://google.com checktitleGoogle enterlinkJobs checktitleAbout Google enterlinkPress enterlinkReview checktitleGoogle Press Room FIT Acceptance Test:FAT Acceptance Test: Request: Check title: Google Click link: Jobs Check title: About Google Click link: Press Click link: Review Check title: Google Press Room

8 Difference: Customers dont use an IDE. UTs are implemented in the language of development using an IDE. ATs should be defined using a tool accessible to the customer (Excel, web page, wiki). ATs must be retrieved from the tool and parsed. Ideally, the customer should be able to run the ATs from this environment.

9 Interacting with customer tool. Excel Wiki AT Framework Extract Test (.html) Extract Test (.csv) Execute TestWrite Test

10 Difference: ATs are not directly executable. UTs invoke code-under-test directly. AT definition is abstracted from its implementation. ATs specify what needs to be done, but not how to do it. ATs require an implementation layer to invoke the application. AT definitions must be interpreted – parsed and mapped onto corresponding implementation. Tests must be definable and executable prior to implementation.

11 Test Definition / Test Implementation Request: Check title: Google Click link: Jobs Check title: About Google Click link: Press Click link: Review Check title: Google Press Room Interpreter public void Request(string url) { } public void CheckTitle(string title) { } public void ClickLink(string link) { } Test: Verify Google LinksClass: WebPageFixtureAT Framework

12 Difference: ATs test through the same interface. UTs test at level of a single unit (class). ATs test at level of user/client interaction. All tests go through a common gateway (Http, Soap, UI controls or application façade) Considerable opportunity for reuse across test implementations. ATs need a framework in the technology of the interface it drives: Web, GUI, Web Service, Messaging etc.

13 Testing through the application gateway. Application Gateway ApplicationDefinitionImplementation Application Gateway Test Client Acceptance Test Interpreter ATD AT impl ATD

14 Difference: ATs test the Users Experience. UTs should test all application logic in detail. ATs encourage the customer to consider the all aspects of user experience. ATs should test: Interaction & Flow Performance Error Handling Security ATs dont test: Usability Look & Feel

15 Difference: ATs are end-to-end. UTs test single unit in isolation. ATs test interaction of all layers in the system. ATs require external systems to be operating correctly.

16 Difference: ATs are process-driven. Each UT typically tests a single public method. ATs consist of a sequence of steps simulating a client interacting with the system. ATs may test the same steps repeatedly in different variations with different data. Considerable overlap across different ATs. Single point of failure will break multiple ATs.

17 Difference: ATs have serious side-effects. For UTs, setup and teardown code should be common only to a single fixture. ATs interact extensively with external systems and the environment. ATs typically require separate setup and teardown per test as different tests will have different side-effects. Setup and teardown routines are commonly shared across tests and even across stories.

18 Difference: ATs suffer concurrency issues. UTs should be largely independent of their environment. ATs require that the environment is setup as expected by the tests. Problems can result from different users running ATs concurrently. Ensure sufficient variation in the data used for each test to prevent collisions.

19 Difference: Failing ATs dont break the build. UTs must pass when checked in – failure breaks the build. ATs may be written at the start of a story and may not pass until the very end of the iteration. We mark ATs as [Ignore] until they have been fully implemented.

20 Difference: ATs dont go quietly UTs are designed to run silently, with all verification encoded in the assertions. Customer requires visual feedback to give reassurance that test does what is expected. ATs need to provide step-by-step visibility of the contents and results of running the tests.

21 Difference: ATs are useful outside of dev environment. UTs are primarily useful to developers for ensuring the code does what was intended of it. ATs on the other hand can provide a good assessment of the overall health of the system. This makes them useful for assuring deployments to testing environments are sound. To do this usually requires environmental parameters to be extracted to a configurable location.

22 Difference: ATs mock out systems, not units. Introducing mocks for dependencies in UTs helps to decouple the code. We often have the same needs in ATs to mock third party interfaces that are not always available. Mocking is very hard because the AT is outside of the application context so a specific interface for the system being mocked has to be created. Mocking is still important to maintain customers trust in the solution. Introduce mocks to help simulate failure conditions.

Implementation Mock Application Interface Unit Test Fixture Setup Teardown Unit Implementation impl UT Acceptance Test Definition AT impl ATD AT impl ATD AT impl ATD setup teardown setup teardown setup teardown Acceptance Test Client