Presentation is loading. Please wait.

Presentation is loading. Please wait.

Table-Driven Acceptance Testing Mario Aquino Principal Software Engineer Object Computing, Inc.

Similar presentations


Presentation on theme: "Table-Driven Acceptance Testing Mario Aquino Principal Software Engineer Object Computing, Inc."— Presentation transcript:

1 Table-Driven Acceptance Testing Mario Aquino Principal Software Engineer Object Computing, Inc. mario@ociweb.com

2 Table-Driven Acceptance Testing2 Session Goals… Define the concept of Acceptance Testing (AT) Define the concept of Acceptance Testing (AT) Describe its role in agile software development Describe its role in agile software development Discuss the toolkits that facilitate testing Discuss the toolkits that facilitate testing Demonstrate the writing and execution of a table-driven acceptance test Demonstrate the writing and execution of a table-driven acceptance test

3 Table-Driven Acceptance Testing3 Test Types & Focus Unit tests Unit tests Exercise the public contract of single unit of code, isolated from the larger system Exercise the public contract of single unit of code, isolated from the larger system Integration tests Integration tests Interact with a working system at some level Interact with a working system at some level Utilize “public” interfaces into a system Utilize “public” interfaces into a system Confirm integration between components in a working system Confirm integration between components in a working system

4 Table-Driven Acceptance Testing4 Test Types & Focus (cont.) Acceptance Tests Acceptance Tests Demonstrate the implementation of customer defined system requirements Demonstrate the implementation of customer defined system requirements Confirm that domain/business rules are enforced by the system as defined by the customer Confirm that domain/business rules are enforced by the system as defined by the customer Utilize business language to represent domain concepts Utilize business language to represent domain concepts

5 Table-Driven Acceptance Testing5 Fostering Collaboration The process of writing ATs has goals The process of writing ATs has goals Q & A between the customer and developer Q & A between the customer and developer Transfer of understanding Transfer of understanding Decision making Decision making Examples to satisfy requirements captured Examples to satisfy requirements captured Production of the executable contract to which all are accountable Production of the executable contract to which all are accountable

6 Table-Driven Acceptance Testing6 Objective Gauges of Progress Features are complete when their ATs pass Features are complete when their ATs pass Percentage completion estimates become irrelevant Percentage completion estimates become irrelevant Add ATs to continuous integration process & publish the results Add ATs to continuous integration process & publish the results

7 Table-Driven Acceptance Testing7 Level Playing Field ATs should be in a mutually accessible format ATs should be in a mutually accessible format Easy for customers to write, change, extend Easy for customers to write, change, extend Easy for developers to follow and execute Easy for developers to follow and execute

8 Table-Driven Acceptance Testing8 Fit Framework for Integrated Tests (Fit) Framework for Integrated Tests (Fit) http://fit.c2.com http://fit.c2.com http://fit.c2.com Originally developed by Ward Cunningham Originally developed by Ward Cunningham Uses a table-based approach Uses a table-based approach Test details appear in several varieties of tables Test details appear in several varieties of tables Tests can be written in HTML files Tests can be written in HTML files

9 Table-Driven Acceptance Testing9 How It Works… HTML Test file Fit Test Runnerreferences Fixtures (compiled source files) HTML Test Report parses executes generates

10 Table-Driven Acceptance Testing10 Framework Fixtures fit.ColumnFixture fit.ColumnFixture Calculation-style testing Calculation-style testing fit.RowFixture fit.RowFixture Equality comparison for groups of values Equality comparison for groups of values fit.ActionFixture fit.ActionFixture Workflow-style testing Workflow-style testing

11 Table-Driven Acceptance Testing11 “Calculation” Testing Business rules that depend on multiple conditions Business rules that depend on multiple conditions Varying inputs trigger different business rules Varying inputs trigger different business rules Appointments in a schedule must have start dates/times occurring before the end dates/times Overlapping appointments are not allowed for some events Certain events are only allowed between specific hours of the day ColumnFixture

12 Table-Driven Acceptance Testing12 Groups of Values Testing equality for collections of objects Testing equality for collections of objects Useful for checking values before/after something is done in a test Useful for checking values before/after something is done in a test Simple or complex objects can be used Simple or complex objects can be used Can be domain objects or utility types Can be domain objects or utility types Evaluation is order independent Evaluation is order independent RowFixture

13 Table-Driven Acceptance Testing13 Sequences of Interactions Application accessible via “device” metaphor Application accessible via “device” metaphor Devices responds to 4 keywords: Devices responds to 4 keywords: start Begins use of fixture enter Adds data to system device press Issues command to device check* Reads information from device * triggers comparison ActionFixture

14 Table-Driven Acceptance Testing14 Using Domain Types ATs should express concepts using business language ATs should express concepts using business language Domain types can be used directly Domain types can be used directly Fixtures translate strings in test tables to concrete domain types Fixtures translate strings in test tables to concrete domain types Parsing delegates can be registered as well Parsing delegates can be registered as well

15 Table-Driven Acceptance Testing15 FitLibrary Adds new fixtures, utilities and keywords to Fit Adds new fixtures, utilities and keywords to Fit DoFixture – “flow” style testing DoFixture – “flow” style testing SetUpFixture – convenient test setup SetUpFixture – convenient test setup FolderRunner – batch test execution FolderRunner – batch test execution setUp() & tearDown() setUp() & tearDown() SetUp & TearDown SetUp & TearDown Keywords: reject, not (and others) Keywords: reject, not (and others) Tests can be written in MS Excel spreadsheets Tests can be written in MS Excel spreadsheets

16 Table-Driven Acceptance Testing16 “Flow”-style Testing A single fixture (DoFixture) organizes the test A single fixture (DoFixture) organizes the test Testing conditions setup Testing conditions setup Supporting fixtures share common resources Supporting fixtures share common resources Parsing delegates for domain types Parsing delegates for domain types References to the system under test References to the system under test

17 Table-Driven Acceptance Testing17 “Flow”-style Testing (cont.) MyGrandUnifyingFixture AddMoviesAddCustomers CalculateLateFees ViewActiveRentals CheckOutMovies Subclasses fitlibrary.SetUpFixture Subclasses fitlibrary.DoFixture fitlibrary.DoFixture fit.RowFixture fit.ColumnFixture

18 Table-Driven Acceptance Testing18 SetUpFixture

19 Table-Driven Acceptance Testing19 DoFixture

20 Table-Driven Acceptance Testing20 RowFixture

21 Table-Driven Acceptance Testing21 ColumnFixture

22 Table-Driven Acceptance Testing22 Batch Test Execution fitlibrary.runner.FolderRunner fitlibrary.runner.FolderRunner Specify folder where tests are located Specify folder where tests are located Specify output folder Specify output folder Prints a “pretty” report Prints a “pretty” report

23 Table-Driven Acceptance Testing23 Keywords Fit supplies the error keyword Fit supplies the error keyword Use when an exception is expected (only in ColumnFixture and ActionFixture) Use when an exception is expected (only in ColumnFixture and ActionFixture) FitLibrary adds several more for DoFixture FitLibrary adds several more for DoFixture reject & not reject & not Behave identically Behave identically Cause cell evaluation to be reversed Cause cell evaluation to be reversed ensure ensure Behaves the opposite of reject & not Behaves the opposite of reject & not

24 Table-Driven Acceptance Testing24 The big demo…

25 Table-Driven Acceptance Testing25 Patterns and Practices Testing the system via API Testing the system via API True domain objects interaction True domain objects interaction Unit-style testing of the whole system Unit-style testing of the whole system Testing the system via UI Testing the system via UI Test how the real users would Test how the real users would Need UI driver Need UI driver

26 Table-Driven Acceptance Testing26 But What About??? FitNesse FitNesse Fit/FitLibrary testing via a wiki-server Fit/FitLibrary testing via a wiki-server Adds suites similar to JUnit tests suites Adds suites similar to JUnit tests suites Other features Other features Variable substitution / Security / SetUp & TearDown Variable substitution / Security / SetUp & TearDown Debugging Debugging FitLibrary steals System.out & System.error  FitLibrary steals System.out & System.error  Use log file output (log4j) Use log file output (log4j) Launch tests with JPDA active Launch tests with JPDA active

27 Table-Driven Acceptance Testing27 Questions???

28 Table-Driven Acceptance Testing28 References Fit Website: http://fit.c2.com Fit Website: http://fit.c2.comhttp://fit.c2.com FitLibrary: http://fitlibrary.sourceforge.net/ FitLibrary: http://fitlibrary.sourceforge.net/http://fitlibrary.sourceforge.net/ FitNesse: http://fitnesse.org FitNesse: http://fitnesse.orghttp://fitnesse.org Fit article: Fit article: http://www.ociweb.com/jnb/jnbDec2005.html http://www.ociweb.com/jnb/jnbDec2005.html http://www.ociweb.com/jnb/jnbDec2005.html


Download ppt "Table-Driven Acceptance Testing Mario Aquino Principal Software Engineer Object Computing, Inc."

Similar presentations


Ads by Google