Skip to content

Course navigation

For teachersTopic 3.2 · Lesson kit

Impact of Program Design

  • 2 class periods
  • 45 minutes each
  • Objective 3.2.A
  • 6 downloads with keys

Downloads

  • Slides

    Speaker notes on every slide

  • Lesson plan

    2 periods of 45 minutes

  • Worksheet

    Puzzles, about 30 minutes

  • Worksheet key

    Answer key

  • Exit ticket

    End of the last period

  • Exit ticket key

    Answer key

Download all AP CSA teacher filesEvery topic's slides, lesson plan, worksheet, and exit ticket, with keys (.zip)

At a glance

Pacing
2 class periods of 45 minutes
Learning objectives
3.2.A
Essential knowledge
3.2.A.13.2.A.23.2.A.3
Materials
Projector and the Beyond the Screen slide deckWhiteboard and markersSticky notes or scrap paper for the Day 1 closureIDE on the projector (Day 1) and on every computer (Day 2)Printed Beyond the Screen puzzle worksheet (answer key for you) and exit ticket

45 minutes a day

Agenda

Day 145 minutes

  • Warm-up
  • Direct instruction
  • Closure
  • Activity
  1. 0:00–0:055 minWarm-upwho wins, who loses? (slide 2)
  2. 0:05–0:083 minActivityDay 1 goals (slide 3)
  3. 0:08–0:1810 minDirect instructionimpacts on society, the economy, and culture (slides 4–5)
  4. 0:18–0:279 minDirect instructionharm beyond the intended use (slides 6–7)
  5. 0:27–0:325 minActivityDay 1 pause and try — spot the unintended harm (slide 8)
  6. 0:32–0:4210 minDirect instructionsystem reliability and a live crash (slides 9–11)
  7. 0:42–0:453 minClosureinside the promise?

Day 245 minutes

  • Warm-up
  • Direct instruction
  • Guided practice
  • Closure
  • Exit ticket
  • Activity
  1. 0:00–0:044 minWarm-upchoose the test ages
  2. 0:04–0:139 minDirect instructiontypical, boundary, and special cases (slides 12–13)
  3. 0:13–0:207 minGuided practicerun the ticket tests and fix the boundary
  4. 0:20–0:244 minActivityDay 2 pause and try — pick the best test set (slide 14)
  5. 0:24–0:339 minDirect instructionintellectual property and open source (slides 15–17)
  6. 0:33–0:374 minActivityDay 2 pause and try — what must the team do first? (slide 18)
  7. 0:37–0:403 minClosurebefore you ship it (slides 19–20)
  8. 0:40–0:455 minExit ticket

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

  1. 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.
  2. 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.
  3. 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.
  4. 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

  1. 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.
  2. 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.
  3. 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.

  1. Intended use of the points: to encourage students to practice more problems.
  2. An unintended harmful effect: students click through problems with random answers to earn points, so they practice less, not more.
  3. 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

  1. 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.
  2. Live demo. Run PointsPerGameTypical (45 points in 3 games prints Points 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.” Run PointsPerGameCrash: Season report prints, then 0 / 0 throws an ArithmeticException. Run PointsPerGameFixed to show the if guard that prints No games played yet.
  3. The same lesson with a String (slide 11). The badge program calls name.substring(0, 1) on an empty name and throws a StringIndexOutOfBoundsException; the fixed version checks name.length() > 0 first. 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

  1. 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.”
  2. 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.
  3. Only the boundary fails (slide 13). Cover the outputs. Students trace the loop for age < 17 and write the three lines, then reveal: 17: $5 is wrong, because the rule says 17 or under is free. Reveal the age <= 17 column. 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

  1. 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?”
  2. 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.
  3. 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.

  1. The open-source map library: use it for free and follow its license by keeping the authors’ names.
  2. The weather package a company sells: get the company’s permission, and probably pay, before using it.
  3. 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.

Exit ticket

Question 1 · Multiple choice

A hypothetical app shows students which tables in the cafeteria have open seats, so they can find a seat quickly. Which is an unintended harmful effect of the app?

  1. Students spend less time wandering with their trays and have more time to eat.
  2. The app crashes when a table has no open seats at all.
  3. A student sitting alone shows up as “open seats,” so others can see who eats alone, which can embarrass or isolate that student.
  4. The school sees which tables fill up first and adds more tables there.
Check your reasoning

C. It harms a group of people (students who eat alone), and it is unintended: the app was built to save time, not to point anyone out.

  • A is the beneficial impact the app was built for, not a harm.
  • B is a bug in the code. It should be fixed, but a crash is a reliability problem, not an effect of the app on people or society.
  • D is a second benefit: helpful to the school, and harmful to no one.

Question 2 · Multiple choice

A parking garage program says: “Stays of 30 minutes or less are free; longer stays cost $4.” Which set of test values best checks that the program is reliable?

  1. 10, 20, 25
  2. 15, 30, 31, 90
  3. 30, 30, 30
  4. 45, 60, 90
Check your reasoning

B. It has a typical value from each group (15 and 90) and the values on both sides of the boundary (30 and 31), where a < versus <= mistake would show up.

  • A is wrong: all three are typical “free” values; the $4 group and the boundary are never tested.
  • C is wrong: running the same value three times is one test; it checks only one side of the boundary.
  • D is wrong: all three are typical “$4” values, so a mistake at exactly 30 minutes would pass.

Question 3 · Multiple choice

A programmer wants to use two pieces of code: (1) an open-source library whose license asks users to keep the authors’ names, and (2) a function copied from an app that a company sells. What must the programmer do before using each one?

  1. (1) Use it for free while keeping the authors’ names, as the license asks; (2) get the company’s permission, and probably pay, first.
  2. Nothing for either one: both were easy to find and copy, so both are free to use.
  3. Credit the authors in a comment for both; giving credit is enough to use any code.
  4. (1) Use it for free with no conditions, because open source has no rules; (2) get the company’s permission first.
Check your reasoning

A. Open-source code is published for anyone to use, but the user must follow its license, here by keeping the authors’ names. The company’s code is its intellectual property and is not open source, so using it needs the owner’s permission and often a purchase.

  • B confuses easy to copy with allowed to use. Copying the company’s code without permission raises legal issues.
  • C treats credit as permission. Crediting the company does not give the programmer the right to use code it sells.
  • D gets (2) right but ignores the license in (1): open-source code is free to use only by following its license.