Overview
Topic 3.2 steps back from writing code to ask what code does once people depend on it. It has one learning objective, 3.2.A: explain the social and ethical implications of computing systems. Day 1 covers the impacts of programs on society, the economy, and culture, including unintended harmful effects (3.2.A.2), and introduces system reliability (3.2.A.1). Day 2 makes reliability practical through testing with a variety of conditions (3.2.A.1), then turns to intellectual property, open source, and permission (3.2.A.3).
Most of this topic is discussion, not code. Keep the discussion concrete: every answer should name a specific group of people and a specific effect on them. “It is convenient” or “it could be bad” is not yet an answer. The Java that does appear uses only Units 1 and 2 (if statements, loops, String methods, Scanner); there is nothing new to learn about syntax.
Teacher note
The slides are the Beyond the Screen deck (20 slides); slide numbers below refer to it. Day 1 uses slides 1–11 and Day 2 slides 12–20. The Beyond the Screen puzzle worksheet (10 questions, about 35 minutes) is homework split across the two days: questions 1, 2, 3, and 5 after Day 1; questions 4 and 6–10 after Day 2.
Every app, company, and person in the deck and worksheet is made up. Keep your own examples made up too, or general (“a map app”), so the discussion stays on design choices rather than on opinions about real brands.
Demonstrations come from the topic’s examples/ folder (.snippet.java files hold only the statements for main): PointsPerGameTypical, PointsPerGameCrash, and PointsPerGameFixed (Day 1); TicketPriceTests and TicketPriceFixed (Day 2). Have them open in the IDE before class so each demo is one click.
Day 1 · Warm-up: Who wins, who loses?
Show slide 2: a study app rewards a “streak” for every day in a row you open it. Partners talk for two minutes, then each student writes one idea in each box: who it might help, and who it might harm and how. Collect a few answers on the board in two columns.
Likely answers: it helps students build a daily study habit; it can harm students who lose a streak because they had no internet at home that night, students who open the app at midnight just to keep the streak (and lose sleep), or students who feel anxious about breaking it. Do not sort them into areas yet; you will come back to the board in a moment.
Day 1 goals
Read the five goals on slide 3. Goals 1–3 are today’s; goals 4 and 5 (choosing test cases, and deciding when code can be reused) are Day 2’s.
Day 1 · Direct instruction: Impacts on society, the economy, and culture
- Programs affect people (slide 4). Until now, a wrong program only affected the person who ran it. A released program can affect thousands of people at once, including people who never use it. An impact is any effect a program has on people beyond the screen.
- Three areas (3.2.A.2, slide 5). Define them with one question each: society (how people live, learn, stay safe, and treat each other), economy (money, jobs, businesses, costs), and culture (shared habits, language, art, traditions). Every impact can be beneficial, harmful, or both.
- QuickCart (slide 5). Cover the Harms column. Read the Helps column, then ask, “Who might be worse off because QuickCart exists?” Take answers, then reveal the column. Point out that each harm lands on a different group from the benefit in the same row: hurried shoppers gain, cashiers lose hours.
- Back to the warm-up. Ask the class to label each idea on the board with an area. A lost streak because of no internet at home is a social harm; lost sleep is social; a company selling paper planners losing customers would be economic; a whole school talking about streaks is cultural.
Misconception: My program helps people, so it has no harmful impacts
Students stop after listing the benefits, because the benefits are why the program was written. A benefit for one group does not cancel a harm for another. Make “Who might be worse off because this exists?” the second question every time; the covered Harms column on slide 5 practices exactly this.
Day 1 · Direct instruction: Harm beyond the intended use
- Intended use and unintended effects (3.2.A.2, slide 6). A program is written to fill a need or solve a problem: its intended use. An unintended effect is a result its designers did not plan. When it hurts someone, it is an unintended harmful effect, and it can happen even when everyone meant well.
- RunMap (slide 6). Reveal the table one row at a time. Before rows 3 and 4, ask, “If most runs start at the runner’s front door, what can anyone who sees the map work out?” No line of code is wrong; the harm comes from what the program does in the hands of someone with a different goal.
- Stops too early vs. thinks it through (slide 7). Read both quotes. Ask, “What design change does the second team make?” (Hide the start and end of every map.) Responsible design means asking “How could someone misuse this?” before release, and fixing harms once you learn about them.
Misconception: If I did not mean for it to happen, it is not my program's impact
Students think only intended effects count. The runner whose home is revealed is harmed whether or not the designers meant it. Use slide 7: the effect is still the program’s impact, and the programmer’s job is to look for it and respond. Note that this is different from a bug; RunMap does exactly what its code says.
Day 1 pause and try: spot the unintended harm
Slide 8: a homework app gives 1 point per problem answered, right or wrong. Students answer the three questions alone, then compare with a partner.
- Intended use of the points: to encourage students to practice more problems.
- An unintended harmful effect: students click through problems with random answers to earn points, so they practice less, not more.
- Who is harmed: those students (they learn less), and also students who work carefully and rank lower, and teachers who read the points as evidence of practice.
Accept any harm that names who is hurt and comes from using the points beyond their purpose.
Day 1 · Direct instruction: System reliability and a live crash
- Reliability (3.2.A.1, slides 9–10). System reliability means the program performs its tasks as expected, under its stated conditions, without failure. The stated conditions are what the program promises to handle. Read BusBuzz’s promise at the top of slide 10, then cover the two right columns and go row by row: “Is this inside the promise? Is it a reliability failure?” The new stop is inside the promise (“every stop in the city”), so crashing on it is a failure; another city and 3 a.m. are outside the promise, so missing times there break nothing.
- Live demo. Run
PointsPerGameTypical(45 points in 3 games printsPoints per game: 15). Say the app promises a report “for every player on the roster,” then ask, “What player is on the roster but might break this?” Someone usually says “a new player.” RunPointsPerGameCrash:Season reportprints, then0 / 0throws anArithmeticException. RunPointsPerGameFixedto show theifguard that printsNo games played yet. - The same lesson with a
String(slide 11). The badge program callsname.substring(0, 1)on an empty name and throws aStringIndexOutOfBoundsException; the fixed version checksname.length() > 0first. The bottom line of the slide is the takeaway: “It worked when I ran it” is not reliability.
Misconception: It worked when I ran it, so it is reliable
Running a program once, with the first values that come to mind, tests only the typical case. The season report worked for 45 points in 3 games and crashed for a brand-new player. Reliability is about every situation the program promises to handle, not the one you happened to try. Day 2’s testing work is the fix; preview it now.
Teacher note
Exception messages can be worded slightly differently between Java versions. If the IDE’s message does not match slide 11 word for word, say so; the name of the exception is what matters.
Day 1 · Closure: Inside the promise?
Ask one question aloud and take three quick answers: “A calculator app promises to add and subtract whole numbers. It cannot draw graphs. Is it unreliable?” (No: drawing graphs is not one of its stated tasks. It would be unreliable if it gave a wrong sum.)
Day 1 · Independent practice: Independent practice
Puzzle worksheet questions 1, 2, 3, and 5 are homework, about 15 minutes: sorting ScootGo’s effects by area and help or harm, PetPal’s intended use and an unintended harm, the StepUp division by zero, and the two truths and a lie about stated conditions. Ask students to do the Think First prompt on page 1 before question 1.
Day 2 · Warm-up: Choose the test ages
Write the rule on the board: a theater charges $6 for children 12 and under, $10 for ages 13 to 64, and $7 for ages 65 and over. Students write four ages they would test, without seeing any code. Collect a few sets. Most will be like 8, 30, 70 plus one more; note whether anyone chose 12, 13, 64, or 65. Leave the sets on the board for the guided practice.
Day 2 · Direct instruction: Typical, boundary, and special cases
- Testing, reviewed (3.2.A.1). Testing means running a program with chosen data and comparing the actual result to the expected outcome. The question today is which data to choose; the CED’s phrase is testing “with a variety of conditions.”
- Three kinds of test case (slide 12). For the teen rate (ages 13 to 17): typical values from each group (8, 15, 40), boundary values at and next to each place the rule changes (12, 13, 17, 18), and special values that might need their own handling (0). Ask, “Why is 12 a test if the teen rate starts at 13?” Testing both sides shows the rule changes in exactly the right place.
- Only the boundary fails (slide 13). Cover the outputs. Students trace the loop for
age < 17and write the three lines, then reveal:17: $5is wrong, because the rule says 17 or under is free. Reveal theage <= 17column. A<versus<=mistake (Topic 2.2) changes the result only at the boundary, so only a boundary test can find it.
Misconception: Testing many values that are all alike
Students test 5, 6, 7, 8, and 9 and feel thorough. Those are one test repeated. Use slide 12’s last line: one typical value per group, the values on each side of every boundary, and any special case such as zero test far more with fewer runs. Point at warm-up sets on the board that missed the boundaries.
Day 2 · Guided practice: Run the ticket tests and fix the boundary
Students open TicketPriceTests in the IDE. Before running it, they write the expected price for each test age (8, 30, 70, 12) from the warm-up rule. Then they run it and compare: three typical tests pass, and Age 12: $10 fails (expected $6). Ask pairs to find the line (line 12, age < 12) and fix it to age <= 12, then add 13, 64, and 65 to the test string and change the loop to run seven times. Compare with TicketPriceFixed on the projector: every result matches the rule, and 64 and 65 show the second rule was already right.
Teacher note
If computers are not available, run this as a whole-class demo: show the code, have students fill in an expected and actual column on paper, and make the fix on the projector. The Scanner reads its test ages from a string instead of the keyboard; it works the same way as typed input, which students saw in Topic 1.4.
Day 2 pause and try: pick the best test set
Slide 14: free shipping on orders of 5 or more items. Students pick a set and label each value, then vote by holding up fingers.
B (2, 4, 5, 9) is best: 2 and 9 are typical, 4 and 5 are the boundary. A tests only the “no free shipping” group. C is one test run three times. D tests only the free-shipping group and misses the boundary, so a > versus >= mistake would pass.
Day 2 · Direct instruction: Intellectual property and open source
- Code is intellectual property (3.2.A.3, slides 15–16). Intellectual property is something a person creates with their mind: a song, a story, an invention, a program. Its creator has rights over who may copy, use, or sell it. Using someone else’s code therefore raises legal issues. Slide 16 sets up the key contrast: the question is never “Could I get the code?” but “Did the owner give permission?”
- Two legal routes (slide 17). Open source code is published so anyone may use it for free; it comes with a license, and following the license (for example, keeping the authors’ names) is part of using it legally. Code that is not open source needs the owner’s permission, and often a purchase, before it goes into a program.
- Connect to Topic 3.1. Reusing code is how programmers manage complexity, so professionals reuse other people’s code all the time. The point is not “never reuse code” but “reuse it the right way.”
Misconception: If it is online, it is free to use
Students assume anything they find with a search is fair game. Being easy to find is not the same as being offered for use. Compare it to a song you can hear online: you still cannot put it on your own album. Teach the habit of looking for the owner’s statement (a license) before copying anything.
Misconception: Open source means no rules at all
Open-source code is free to use, but it still has an owner and a license. Students sometimes delete the author’s name or ignore the license’s conditions. Point to the license line on slide 17: following it is what makes the use legal.
Day 2 pause and try: what must the team do first?
Slide 18: a student team building a hiking app finds three pieces of code. Students write what the team must do for each, then share.
- The open-source map library: use it for free and follow its license by keeping the authors’ names.
- The weather package a company sells: get the company’s permission, and probably pay, before using it.
- A copy of that package a classmate shared: the same as item 2. Getting the code from a friend does not give permission; the company still owns it.
Item 3 is the one students get wrong. Ask, “Did the owner give permission?” and let slide 16’s question settle it.
Day 2 · Independent practice: Independent practice
Puzzle worksheet questions 4 and 6–10 are homework, about 20 minutes: labeling CakeBox test values, the FlixRent tester table, the ReviewIt one-token fix, the open-source face-off, can I use it?, and who am I? Question 7 combines both days: the crash is a reliability failure, and only a special-case test (0 reviews) finds it.
Day 2 · Closure: Before you ship it
Slide 19 lists the vocabulary; read it quickly or leave it up during the exit ticket. Slide 20: students pick an app they use and complete the slide’s sentence starter with a partner, filling in who the app could harm and how, and which test they would run and why. Take one or two answers if time allows.
Day 2 · Exit ticket: Exit ticket
Give the exit ticket (about five minutes). Question 1 checks impacts and unintended harm (3.2.A.2), question 2 choosing test cases for reliability (3.2.A.1), and question 3 open source and permission (3.2.A.3). Score each question separately and re-teach the weakest idea briefly before Topic 3.3; question 2 is the one that matters most for code, since boundary testing returns in every unit that follows.