I ended up “writing” a computer program, where the “computer” was the entire classroom with the students being my 1s and 0s. My hope was to have them evaluate Conditions (“If this then do that otherwise do something else”) while understanding the Assumptions I had made, and then importantly — predict Exceptions (when an assumption would fail,) and how we could fix them.

As they walked into the classroom, I (mostly with the aid of their teacher) quickly had them get into a circle and remain standing. After introducing myself, I then let them know I had just written a program and needed to test it out — and they were going to be my computer. I had the words Assumptions, Conditions, and Exceptions up on a PowerPoint, and quickly went through their definitions, and then told them the goal of my program: Get everyone to sit down.

The way we’d do this was:

I gave one random student a Wireless Mouse. Every student then got a card with a Condition on it:

Oooh, it’s a computer chip

3. Starting with the student with the Mouse, each person would read out their Condition, announce whether it was true or false, and then take the associated action (moving the Mouse to the left or the right.)

4. Lastly, they would either get a new card from me or sit down.

I then cautioned them to look out for any Assumptions I’d made. I’d purposely made some “bad” assumptions, including one that would cause the program to loop infinitely. It was then a matter of letting the program run and seeing what happened.

Eventually, someone would read a card like this:

Do they even have a dog?

I’d give the students a few seconds to see if they could spot the implicit assumption (i.e. that they even own a dog) — though sometimes I’d pause them and ask them if they could spot it. I’d then ask how we could improve it — there were some creative solutions, but usually we’d land on “If you have a dog and it’s name is Scooter” or “If you have a dog named Scooter.”

To keep the overall exercise fun and engaging, I made the cards about them (“If you have been to Disney World”), about the teacher (“If you are taller than Mrs. _____”) and lastly about me (“If you can guess my age…”)

I also let the children pick whether to move the Mouse 1, 2 or 3 spots because, being that we were up against the clock, I also wanted them to be strategic when they detected the infinite loop.

Usually by the 3rd assumption, each student had a general idea of what to look out for — and in some cases, find some very rare exceptions with my assumptions (“What if someone doesn’t have a last name, like Madonna?”)

Little by little, students would sit down, until finally we landed on the infinite loop. This was the only card that didn’t instruct the student to sit, or get a new card:

Don’t get a new card, don’t sit…

We’d land on this card a few times throughout the program, and the students couldn’t figure out why the one student with this card would not sit or get a new card. As we’d get down to 4 standing students, 3 standing students, to finally 2, they’d realize there’s no way of finishing the program. So we’d quickly “fix” the issue (either adding a “Get a new card.” or “Please sit.”) and we’d finally reach the goal.

I’d then summarize about how and why we make assumptions, the need to be careful with those assumptions, and then very importantly — how to properly handle cases when assumptions fail so our application doesn’t crash. (“Show of hands, who’s had an app crash on them on their phones?”) I then gave them real examples of conditions in programs: “If this button is clicked,” “If the passwords don’t match,” and then cases where bad assumptions were made.