Family edition
Football Play Lab: Test Cases, One Play Against Three Defenses
In Football Play Lab your child tests one flag football play, written in Python, against three defenses, and learns how to find the case that breaks it.
What you need
- A computer or Chromebook with a current browser.
- The link: mytekdev.com/try/footballplaylab?lesson=test-cases-one-play-against-three-defenses&ref=fam-footballplaylab-4. No account, no email and nothing to install.
Before you start: try it once yourself
Open mytekdev.com/try/footballplaylab?lesson=test-cases-one-play-against-three-defenses&ref=fam-footballplaylab-4. A short guide opens over Level 12, Test cases, in the Python tab on X's program. The field fills the middle, seen from high behind the offense: the child's five players in team colors with flag belts, the five defenders in gray. Each player has a chip, C, Q, X, Y and Z, and each chip opens that player's own program in the Blocks and Python tabs. The box on the field says the level's goal and, after each play, what happened and why, with the seconds and the yards. The panel at the bottom right says the time since the snap, where the ball is, and how open the target receiver is.
- The starter. X: me.out(10). Z: me.slant(3). Q: me.drop(3), me.wait(0.6), me.throw_to("X"). C and Y run 20 yards straight. Round 1 is man, round 2 Cover 1, round 3 two deep; each wants 5 yards or more.
- The two fixes. X's me.out(8): 10.8, 10.8, and a touchdown against two deep. Or Q reads before the throw: if me.deep() >= 2: me.throw_to("Z") else: me.throw_to("X"); 12.4, 12.4, and Z's touchdown. Card twelve in the box is a version of the read with yards after the catch.
- The Practice field. Levels, Practice field. Its box has a picker for the coverage (man, Cover 1, two deep) and the rushers (0, 1, 2). The programs stay as they are.
- Speed. Each play runs in real time. Slower and Speed up, under the field, change the speed; the play button starts the level again from the beginning, with the programs as they are now. The play is the same on every run and every computer, so every child who makes the same change sees the same numbers.
- Numbers to expect. The starter: 12.4, 12.4, knocked away at 3.1 s. With the read, on the Practice field, all nine cases pass at a wait of 0.6. The wait changed: 1.2 still gains about 12.7 against man and Cover 1 and is incomplete against two deep; 1.6 is incomplete against man and Cover 1 and intercepted against two deep; 2.0 is a sack, 8 yards lost, whenever a rusher comes, incomplete against man and Cover 1 with no rusher, and intercepted against two deep with none.
The ideas, in plain words
A play, like a program, is built against the cases its designer imagined. Coaches test a play against each defense it will see, and a play that beats only one is a guess. Two deep puts a safety over each sideline, so a deep out to the sideline runs toward a defender who is already there. Nobody is ever hit: a defender who reaches the ball carrier pulls a flag from its belt, and the play is over there. The field and rules are modeled on the IFAF flag football rules for 5 on 5; the app is not affiliated with or endorsed by IFAF or any league.
The two fixes trade differently. out(8) is one change and simple, but gains less against man and Cover 1. The read keeps the longer gain where it works and changes receivers where it does not, at the cost of more code and one more thing that can go wrong. Choosing between them, and saying why, is the design decision the lesson asks for.
Teams at every level study plays with video and data, and the people who do it include coaches, video coordinators, data analysts and the software engineers who build their tools. In software, the same habit is called testing: unit tests, test matrices and regression tests.
Do it together
- Open mytekdev.com/try/footballplaylab?lesson=test-cases-one-play-against-three-defenses&ref=fam-footballplaylab-4 together. Press play and watch all three rounds.
You'll know it worked when: Man and Cover 1 gain 12.4 yards each; two deep knocks the ball away at 3.1 seconds.
- Open Python, change me.out(10) to me.out(8), go back to Simulator and press play.
You'll know it worked when: All three pass: 10.8, 10.8, then a touchdown.
- Put me.out(10) back. Click the Q chip and change the last line to: if me.deep() >= 2: me.throw_to("Z") else: me.throw_to("X"), on four lines with the throws indented.
If you get stuck: Each throw_to goes on its own line, four spaces in, under the if and under the else.
You'll know it worked when: All three pass: X for 12.4 twice, then Z's slant scores against two deep.
- Open Levels, pick Practice field, and run the play against each coverage with 0, 1 and 2 rushers.
You'll know it worked when: All nine cases pass.
- Change the wait of 0.6 to 2 and run the cases with rushers again.
You'll know it worked when: Every case with a rusher is a sack, 8 yards lost: holding the ball breaks the play.
Talk about it
Ask these while you work together. A child who has understood it can answer them without help:
- Which case failed, and what in the box tells you why?
- Why does out(8) pass against two deep when out(10) does not?
- What does me.deep() return against each defense, and when is it read?
- Which fix would you keep, and what does it cost?
- What case did the level not test that broke your play?
For younger and older kids
Younger: For a younger child, stop after the change to out(8), and talk about why one defense was enough to fail.
Older: For an older child, write a fix that still passes all nine cases with a wait of 1.2.
Keep going
- Write a third fix that passes all nine cases with the quarterback waiting 1.2 seconds.
- Go on to Level 13, the drive: four downs to cross midfield and four more to score, against a defense that changes every play.
- Save both fixes in Team, Playbook, and call each one in the drive. Which scores in fewer plays?
Bring it into other subjects
- Math: three coverages, three rusher counts, four waits. How many cases is that, and how long would they take at 10 seconds each?
- Physical education: run one play against two different defenses in the gym. What did the defense change?
- Careers: look up what a software tester or quality engineer does.
- Computer science: write the nine cases as a list of pairs, and a loop that would run each one.
For your records
Ready to copy into an hour log, a portfolio or a transcript.
| Lesson | Football Play Lab: Test Cases, One Play Against Three Defenses |
|---|---|
| Subjects | Computer science |
| Time | 45 minutes |
| What we did | Tested a simulated flag football play written in Python against three defenses, fixed the failing case two ways, compared the fixes, and ran a nine-case test matrix to find what still broke it. |
| Skills practiced | Testing; Python; Design tradeoffs |
Football Play Lab: Test Cases, One Play Against Three Defenses
Activity sheet (optional)
Name: ______________________________ Date: ______________
Open the app: scan the QR code, or go to mytekdev.com/try/footballplaylab?lesson=test-cases-one-play-against-three-defenses
Essential question: How do you know a program works, and not only on the case you tried?
Warm-up: A calculator gets 2 + 2 right. What would you try before you trusted it? ________________________
- Vocabulary. Test case, test matrix, edge case, two deep, tradeoff, regression: write each in your own words.
- The starter. Man: ______. Cover 1: ______. Two deep: ______.
- Two fixes. out(8): man ______ Cover 1 ______ two deep ______. The read: man ______ Cover 1 ______ two deep ______.
- My test matrix. Pass or fail. Man with 0, 1, 2 rushers: ____ ____ ____. Cover 1: ____ ____ ____. Two deep: ____ ____ ____.
- Slower quarterback. Wait 1.2: ________. Wait 1.6: ________. Wait 2.0: ________.
1. Which fix would you keep, and what does it cost?
2. Name a case the level did not test that broke your play, and say what happened.
Quick check
Name: ______________________________
1. A play passes against man and Cover 1 and fails against two deep. It is: (A) ready (B) ready for two of three cases (C) broken in every case
2. Three coverages with 0, 1 or 2 rushers make: (A) 3 cases (B) 6 cases (C) 9 cases
3. A friend says their program works because it ran once without an error. Use what you learned today to answer.
Answers
| Question | Answer | Why |
|---|---|---|
| 1 | B | Tests show it works on the cases tried; one case still fails. |
| 2 | C | 3 x 3 = 9. |
| 3 | Open answer | One run is one case. Choose cases that could break it, edge cases included, run them all, and fix what fails without breaking what passed. |
If your state or umbrella school asks, this lesson covers CSTA 2017 3B-AP-21, CSTA 2017 3A-AP-15, CSTA 2017 2-AP-17.