Approval Testing

WHEN

-

WHAT

99 Minute Workshop

WHERE

Online

COST

All our 99-minute workshops are included with a Pro membership.

Learn how approval testing can be more effective than traditional assertion-based test automation

Topics Emily will cover

We'll explore the following topics

Read full session description ->
  • Use a diff tool to evaluate approval test failures and approve new results when appropriate
  • Use the Approvals framework to write test cases for existing code where a Printer already exists
  • Compare Approval testing with assertion-based testing and explain in which situations it has advantages
  • Describe Text-based and Pixel-based approaches
  • Describe the characteristics of Approval Testing

Meet Your Instructor

Emily Bache

Emily Bache

TECHNICAL AGILE COACH

Emily is a long-term proponent of agile development practices like Test-Driven Development, and is one of the pioneers of the professional developer teaching forum called ”Coding Dojo”. Emily is an author with Pluralsight, a contributor to the book “97 things every Java programmer should know”, and a regular conference speaker.

You want to get high regression test coverage for existing code relatively quickly

-

Approval Testing

Emily
99 Minute Workshop
Emily Bache

Approval Testing is an automation technique that can be more effective than traditional assertion-based test automation. For example when:

  • The expected result is hard to calculate in advance, but easy to verify afterwards.
  • The expected result has many aspects and details which are a lot of work to assert individually.
  • You want to get high regression test coverage for existing code relatively quickly.

In this course you will learn about text-based approval testing using the tool “Approvals”. (We’ll use the Java version but it is also available in other languages such as C#, Python and C++).

Takeaways

  • Use a diff tool to evaluate approval test failures and approve new results when appropriate
  • Use the Approvals framework to write test cases for existing code where a Printer already exists
  • Compare Approval testing with assertion-based testing and explain in which situations it has advantages
  • Describe Text-based and Pixel-based approaches
  • Describe the characteristics of Approval Testing

Prerequisites

I'm looking forward to the 99-minute workshop on Approval Testing. Please could you prepare by setting up the code on your local machine. You'll need to use a clone of the git repository (not a download) so that you can easily change branches. This is the repo:

https://github.com/emilybache/SupermarketReceipt-Refactoring-Kata

There are various subfolders for different programming languages. In this workshop, we will be using the Java version, which is in the 'java' subfolder. I suggest you:

1) Ask your IDE to 'open an existing project' and navigate to the 'pom.xml' file specifically.

2) Tell the IDE to 'open as project'. This will have the best chance of setting up all the dependencies correctly. When you've done that, try to run the unit test "SupermarketTest". It should pass if you have everything set up correctly.

As an optional additional step, there are some useful scripts you might want to get. To use them you will need Python3 installed. Clone this repo:

https://github.com/emilybache/ApprovalTools

For convenience, you could put this folder on your $PATH. Otherwise, make a note of the folder where you cloned the repo so you can easily access them.

99 Minute Workshops

Short Digestable Live Online Workshops

Live and Instructor-led

All our 99-Minute Workshops are hosted live and led by an instructor.

Short and Targeted

These workshops are a max of two hours long which means they can easy be fit into your busy week. The short time also means they are targeted on a few learning outcomes.

Learn with Others

Connect and learn with other community members during these live online testing workshops.

Available with Pro Membership

All our 99-Minute Workshops are available with Pro Membership, you can attend as many as you like. We also do the odd free workshop with our partners.

All our 99-minute workshops are included with a Pro membership.

Frequently Asked Questions

Are the Workshops Recorded?

Our 99-minute workshpos are designed to be attended live. If you can’t make the scheduled time, it will stay available to replay in CrowdCast for 7 days. To get the most out of them, we highly recommend you attend them live.