Impact of Program Design
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;
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 caseA user enters their age as
25. - Edge caseA user enters
0,-5, or150. - Edge caseA 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.
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 BenefitHelps students get lunches they prefer, reducing food waste.
- Unintended HarmCould 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:
- BenefitsConvenient transportation for riders, flexible work for drivers.
- HarmsIncreased 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:
- 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 CodeThis 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) CodeThis 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.
Worked examples
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.
- 1ReliabilityHow reliable would this system be?
- What to testWe 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 pointsCould 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.
- What to test
- 2Social & Ethical Impact
- BeneficialIt could save teachers hundreds of hours, allowing them to focus on in-class instruction. It could provide instant feedback to students.
- HarmfulIt 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.
- Beneficial
- 3Legal & 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.
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.
- 1Identify the needPriya wants to use code someone else wrote. This immediately triggers the need to investigate the license.
- 2Search for the licensePriya 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. - 3Analyze 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."
- Scenario A (Open Source)
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.
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 ReliabilityWhat happens if a sensor goes offline? What if the data it sends is corrupted? How would the system react?
- Hint for Social ImpactWho 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?
Practice — 8 questions
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.
- 3.2.A: Explain the social and ethical implications of computing systems.
- 3.2.A.1
- System reliability refers to the program being able to perform its tasks as expected under stated conditions without failure. Programmers should make an effort to maximize system reliability by testing the program with a variety of conditions.
- 3.2.A.2
- The creation of programs has impacts on society, the economy, and culture. These impacts can be both beneficial and harmful. Programs meant to fill a need or solve a problem can have unintended harmful effects beyond their intended use.
- 3.2.A.3
- Legal issues and intellectual property concerns arise when creating programs. Programmers often reuse code written by others and published as open source and free to use. Incorporation of code that is not published as open source requires the programmer to obtain permission and often purchase the code before integrating it into their program.
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;
Read what Saavi narrates
(upbeat, warm intro music fades)
Hey everyone, it's Saavi from Shrutam.
So, imagine you build a cool app to help students at your school trade lunch items. It's a huge success! But then you hear that a student with a serious peanut allergy almost made a trade for something that was cross-contaminated, because your app didn't have any allergy warnings. Suddenly, your helpful app has a really dangerous, unintended side effect.
That's what we're talking about today. Being a programmer isn't just about making things work... it's about thinking through how our code will affect real people in the real world. We have to make sure our programs are reliable, consider their social and ethical impacts, and respect the rules when we use code written by others.
Let's walk through an example of that last point. Imagine a student, let's call her Priya, is building a video game for her computer science project. She finds a fantastic bit of code online—a physics engine that would make her character's jumps look super realistic. Can she use it?
Well, it depends. This is an intellectual property question. The first thing Priya has to do is look for a license. If she finds a file that says something like "MIT License," that's great! That's open-source, and it means she can probably use it freely, as long as she gives credit.
But what if the website says "For non-commercial use only"? Since her project is for school, she's probably okay. But she could never sell that game later.
Here's the most common mistake, and I really want you to hear this: if there's no license at all, you can't use the code. A lot of people think 'no license' means 'free for all,' but legally, it's the opposite. It means the author keeps all the rights, and you have no permission. Priya would have to find a different engine or contact the author to ask.
Thinking through these issues—reliability, impact, and legality—is what separates a coder from a truly professional, responsible software developer. You are all capable of being the latter. Keep up the great work.
(upbeat, warm outro music fades in)
A program can run perfectly with valid inputs but crash, freeze, or produce garbage results when it encounters an unexpected value (like text in a number field). Reliability is about robustness against a *range* of conditions, not just the ideal one.
Actively test your program with invalid data, edge cases (like 0, -1, or very large numbers), and empty inputs to see how it behaves.
Unless a license is explicitly provided that grants you permission, the code is protected by copyright. Using it without permission is a legal and ethical violation.
Always look for a `LICENSE` file or a statement from the author. If you can't find one, assume you cannot use the code and look for an alternative with a clear open-source license (like MIT, Apache 2.0, or GPL).
As the creator, you are responsible for considering the foreseeable impacts of your software, both positive and negative. "I didn't mean for that to happen" is not a valid defense against criticism of a harmful system you designed.
Before and during development, ask "How could this be misused?" and "Who could be harmed by this?" and try to design safeguards.
The AP exam won't ask for your personal philosophy. It will present a scenario and ask you to identify *potential* benefits, *potential* harms, or intellectual property concerns based on the information given. These are analytical skills, not just opinions.
Practice analyzing computing scenarios by creating two columns: "Potential Benefits" and "Potential Harms." This trains you to think in the structured way the exam requires.