Automating Acceptance Tests using FIT - Part 3
Seema Pradhan
Certified SAFe PO/PM|Certified Software Architect|IREB Certified|Certified SAFe 4 Agilist|M.Tech (Computer Science)|IATD 'Train the Trainer'
In Part1 and Part2 of article "Automating Acceptance Tests using FIT" , you saw the use of ColumnFixture and ActionFixture tables to test calculations and sequence of actions respectively. In case you missed them, here are the links:
Part 1 : https://www.dhirubhai.net/posts/seema-pradhan-164081a5_specificationbyexample-executablespecification-activity-6692489318600208384-qmYy
Part2: https://www.dhirubhai.net/posts/seema-pradhan-164081a5_atdd-acceptancetest-agiletest-activity-6694272779333832704-nIQi
In this article, you will see another fixture called "RowFixture". This fixture enables you to check the system state by querying it. Usually, we would query the system after having performed some actions - through ActionFixture. Let's get started to see what I mean.
Recall the user story that we took in our last example. I am reproducing it here for your reference:
"As a library member, I would like to issue books so that I can read them in a place and time convenient to me."
In Part2, we simulated a sequence of actions by the user - Search for a book and issue the book. Let's say after multiple issues, you want to check that the number of copies available for issue are correctly updated. This means, you are querying the system for the information that you need - such as book name, book author and number of available copies. Therefore you need a RowFixture table. The table should have those columns that you want to check the values of. Here is how the table looks like:
The first row has the name of a RowFixture class - IssuedBooksList - Similar to the one we had for ColumnFixture class. The second row is a column header that has the columns you want to query the system for - Here these are "Book Title", "Book Author" and "No. of available copies". The remaining rows are the values for these columns that you want to compare with the ones returned by the system.
That was a brief about using FIT RowFixture to automate acceptance tests. In the next article, we will see how we can combine multiple fixtures to test workflows.
Now is your turn. Assume that 3 customers registered to become members of online library. Registration details include name, address and phone. You want to check that the members are stored properly by querying the system. How would your Rowfixture table look like? Send your answer to [email protected].
References:
- Test Driven Practical TDD and Acceptance TDD for Java Developers-Manning (2007) - Lasse Koskela
- FIT Software Framework for Integrated Testing - Rick Mugridge, Ward Cunningham
- Bridging the communication gap - Gojko Adzic
Any questions? Do leave your comments below.