Data-Driven Testing with Approvals

A Data-Driven test keeps the ‘act’ part of the test the same, and only varies the data in the ‘arrange’ part. The ‘assert’ part of the test usually varies according to the data given, and with an approval testing approach, it becomes easy to update.

Session Outline

Connect

Mark all the statements that are true of Data-Driven testing

Setup for Approval testing

Make sure everyone knows how to:

Encourage them to make a commit whenever they have green tests.

Do: RPB Combat kata

This kata lends itself to data-driven testing, with PlayerCharacters with different starting data. There is a convenient starting point available.

Reflect

There are some retrospective questions in the Kata description. Have people especially consider how readable the test cases are, and whether any would qualify as data-driven tests. If you like, show the sample solution.