Free for students · Ad-free · WCAG 2.1 AA Compliant · Accessibility

Impact of Program Design

Lesson ~10 min read 8 MCQs

In simple terms: In simple terms, program design is about more than just code. It's about making sure our programs are reliable, considering their real-world impact on people, and using others' code legally and ethically.

Why this matters

Imagine you're building a mobile app to help students at your high school trade lunch items. Carlos has a PB&J but wants Maya's pizza slice. Your app is a hit! But then, a student with a severe peanut allergy, Liam, almost trades for something cross-contaminated because your app has no allergy warnings. Suddenly, a helpful tool has a dangerous, unintended consequence.

This is the heart of what we're talking about today. Writing code isn't just about making things work; it's about thinking through all the ways our creations will affect real people. We'll explore how to build reliable programs, anticipate their social impact, and navigate the rules of using code written by others.

Concept overview

flowchart TD
    A[Find third-party code online] --> B{Check for a license};
    B --> C{License found?};
    C -- Yes --> D{Is it a permissive open-source license? e.g., MIT, Apache};
    D -- Yes --> E[Incorporate code, following license terms];
    D -- No --> F{Does it have restrictions? e.g., non-commercial};
    F -- Yes --> G{Can I comply with the restrictions?};
    G -- Yes --> E;
    G -- No --> H[Find an alternative or seek permission];
    C -- No --> I[Default copyright applies: DO NOT USE];
    I --> H;
This is a flowchart diagram explaining the decision process for using third-party code. It starts with finding code online and branches based on whether a license is found and what type of license it is, leading to outcomes like using the code, not using it, or finding an alternative.

Core explanation

As you get deeper into programming, you'll realize that building software is about so much more than just solving a technical puzzle. The programs we create live in the real world and have real-world consequences. The AP exam expects you to think about these bigger-picture issues, which fall into three main categories.

1. System Reliability: Does It Actually Work?

System reliability means a program does what it's supposed to do, without failing, under expected conditions. It sounds simple, but it's a huge challenge.

Think of it like building a car. You wouldn't just test if the engine starts in your garage on a sunny day. You'd need to know if it will start in a Boston winter, if the brakes work going down a steep hill in Seattle, and if the AC can handle a summer in Dallas.

It's the same with software. To maximize reliability, we have to test our programs with a wide variety of inputs and conditions, especially the weird ones we don't expect. These are often called "edge cases."

  • Normal case
    A user enters their age as 25.
  • Edge case
    A user enters 0, -5, or 150.
  • Edge case
    A user enters "twenty-five" or leaves the field blank.

A reliable program handles all of these gracefully. It might show an error message for the negative number, but it definitely shouldn't crash.

Testing for Reliability: Happy Path vs. Edge Cases

2. Social & Ethical Impact: Good Intentions Aren't Enough

Every program we write has the potential to impact society, the economy, and culture. These impacts can be both good and bad, and often, they're completely unintended.

Let's go back to that lunch-swapping app.

  • Intended Benefit
    Helps students get lunches they prefer, reducing food waste.
  • Unintended Harm
    Could expose students with allergies to risk, as we saw with Liam. It could also create social pressure or be used for bullying (e.g., "Nobody wants to trade with Jordan").

Or think about a ride-sharing app:

  • Benefits
    Convenient transportation for riders, flexible work for drivers.
  • Harms
    Increased traffic congestion in cities, questions about fair wages and benefits for drivers, and potential for traditional taxi services to go out of business.

As programmers, we have an ethical obligation to think through these potential consequences. We need to ask ourselves:

App Impact: Intended Benefits vs. Unintended Harms
  • Who benefits from this program?
  • Who might be harmed by it?
  • How could someone misuse this tool?
  • What biases might be built into my code? (For example, a facial recognition system that is less accurate for people with darker skin tones).

You won't have all the answers, but the act of asking these questions is a critical part of responsible program design.

3. Legal & Intellectual Property: "Borrowing" Code

In the professional world, programmers almost never write everything from scratch. We constantly use libraries and frameworks—chunks of pre-written code—to save time and avoid reinventing the wheel. But you can't just copy and paste any code you find online.

This is a legal and ethical issue centered on intellectual property.

Think of it like this:

  • Open-Source Code
    This is like a recipe shared publicly on a cooking blog. The creator wants you to use it, share it, and maybe even suggest improvements. These often come with licenses (like MIT or Apache) that give you broad permission, sometimes with the only requirement being that you give credit to the original author. A lot of code on sites like GitHub is open source.
  • Proprietary (or Commercial) Code
    This is like the secret formula for Coca-Cola or a proprietary spice blend from a famous BBQ joint. It's owned by a person or company. To use it, you must get permission, which usually means buying a license. Using it without permission is like stealing.

Before you incorporate any code that you didn't write into your project, you have a responsibility to check its license. Ignoring this can lead to serious legal trouble for you or your employer.

So, while we're learning to write our own classes and methods, it's just as important to learn how to be a good citizen in the wider world of software development. That means building things that are reliable, thinking about their human impact, and respecting the work of others.

Decision Flow for a Reliable Age Input

Worked examples

Example 1

The Automated Essay Grader

Problem: A school district is considering a new program that uses AI to grade student essays for AP English. You are asked to analyze the potential issues related to program design.

Solution Walkthrough: Let's break this down using our three concepts.

  1. 1
    Reliability
    How reliable would this system be?
    • What to test
      We can't just give it a few well-written essays. We need to test it with essays that have creative structures, complex vocabulary, or even common grammatical errors that a human teacher would understand in context.
    • Potential failure points
      Could the AI be biased towards certain sentence structures? Could it fail to understand sarcasm or a nuanced argument? What if it unfairly penalizes students who are English Language Learners and use slightly different phrasing? A system crash is a failure, but so is systematically giving inaccurate grades.
  2. 2
    Social & Ethical Impact
    • Beneficial
      It could save teachers hundreds of hours, allowing them to focus on in-class instruction. It could provide instant feedback to students.
    • Harmful
      It could discourage creativity if students learn to write for the algorithm instead of for clarity and impact. An error in the algorithm could unfairly lower the grades of thousands of students, potentially affecting their college applications. This raises serious equity concerns.
  3. 3
    Legal & IP
    • The company selling the AI grader almost certainly considers its code to be proprietary. The school district would need to purchase a license to use it. The district's programmers could not simply view and modify the grading algorithm themselves.

Where students get it wrong: Many would just focus on the "it saves time" benefit without thinking through the deeper, unintended harms like discouraging creativity or the potential for algorithmic bias to affect student outcomes on a massive scale.

Example 2

Priya's Game Project

Problem: Priya is building a 2D platformer game for her final project in AP CSA. She finds a fantastic physics engine on a programmer's blog that would make her character's jumps look realistic. Can she use it?

Solution Walkthrough: This is a classic intellectual property question.

  1. 1
    Identify the need
    Priya wants to use code someone else wrote. This immediately triggers the need to investigate the license.
  2. 2
    Search for the license
    Priya needs to look for a file named LICENSE, LICENSE.md, or a section on the blog post that says "License." She can't just assume it's free to use.
  3. 3
    Analyze the license
    • Scenario A (Open Source)
      She finds a file that says "Licensed under the MIT License." This is great news! The MIT license is very permissive. It basically says you can do whatever you want with the code (use it, modify it, sell it as part of your project) as long as you include the original copyright and license notice. She can use the code.
    • Scenario B (Proprietary/Restricted)
      The blog post says, "For non-commercial use only." Since her project is for school and not for sale, she can likely use it. However, she could never put this game on an app store and charge for it without getting a different permission from the author.
    • Scenario C (No License)
      This is the trickiest. If there is no license mentioned at all, the default is that all rights are reserved by the author. You cannot use the code. It is not "public domain."

Where students get it wrong: The most common mistake is assuming that "no license" means "free for all." The legal reality is the exact opposite. If you don't see a license giving you permission, you don't have permission. The correct action is to either contact the author to ask for permission or find a different, openly licensed physics engine.

Automated Essay Grader: Technical vs. Ethical Concerns
Decision Flow for Using Third-Party Code

Try it yourself

Practice Problem 1

Your city, Atlanta, wants to implement a system that uses data from public transport cards and traffic sensors to change bus routes in real-time to avoid congestion. Analyze this proposal.

  • Hint for Reliability
    What happens if a sensor goes offline? What if the data it sends is corrupted? How would the system react?
  • Hint for Social Impact
    Who benefits from more efficient bus routes? Is there anyone who might be harmed? (Think about a rider, Marcus, whose less-popular stop might get cut from the route to save time for the majority).

Practice Problem 2

You're building a website for your school's soccer team. You find a cool, animated scoreboard on a web developer's personal portfolio site. There is no LICENSE file. What are your next steps? What are your options if you can't get permission?

  • Hint: What is the default legal status of creative work (including code) when no license is specified? What are the keywords you would use to search for an alternative?
Intellectual Property: Licensed vs. Unlicensed Code