Intro to Approvals

This learning hour is also published here on GitHub, which may be a more up-to-date version of it.

You can find an implementation of this learning hour here.

For remote sessions I recommend a shared gitpod workspace, and work directly from the markdown files.

Audience

Goals

In this Learning Hour, we focus on building simple code from scratch only.

Agenda

(My first attempt took 1h 17m.)

Connect

Ask -

How do you usually structure tests?

How is a single test structured?

How are multiple tests structured for a single module?

Concept - Approval Tests Intro Explanation

See this explanation frame.

Concept - Demo

Demo: build the same code twice

  1. The first time - with micro asserts
  2. The second time - using approvals

I chose FizzBuzz as the kata, with a starting position from the intro to approvals learning hour git repo.

Concrete #1 - Build with Micro-Asserts

Prepare a starting position of the kata - the same kata you used for the Demo.

Provide clear, step-by-step instructions - a checklist. (I learned this method from Llewellyn Falco)

If learners are familiar with ensemble work, have them rotate after each completed step.

Emphasize that they should take their time, no need to complete all steps.

Stop and go to the next exercise when they get the point.

Example snippet of such a checklist:

The full checklist is here.

Concrete #2 - Build with Approvals

Same as previous exercise, now with approvals.

See example checklist here.

Conclusion

Ask -

“how did that feel?”

And gather people’s thoughts.