MOBI BOOT CAMP CORP. logoLearning Buddy
  • SIGN IN
  • Introduction
  • Unit 0: The First Program
  • Unit 1: Using Objects and Methods
  • Unit 2: Selection and Iteration
  • Unit 3: Class Creation
    • Part 1: Basic Concepts
      • Abstraction and Program Design
      • Impact of Program Design
      • Anatomy of a Class
      • Constructors
      • Unit 3 Part 1 Slides
    • Part 2: Methods
  • Unit 4: Data Collections

Unit 3.2: Impact of Program Design

The design and creation of computer programs have broad implications beyond the code itself. Programmers must consider the reliability, ethical impacts, and legal requirements of their work.

System Reliability

System reliability refers to a program being able to perform its tasks as expected under stated conditions without failure.

Program Reliability
  • Reliable software handles both expected and unexpected data gracefully. Programmers achieve reliability through comprehensive testing across normal, edge, and invalid input ranges.
  • Maximizing Reliability: Programmers should make a concerted effort to maximize reliability by testing their programs with a variety of conditions.
  • Examples of Testing Conditions:
    • Normal Inputs: Data the program is expected to handle daily.
    • Boundary/Edge Cases: Minimum and maximum possible values (e.g., testing Integer.MAX_VALUE).
    • Invalid Inputs: Ensuring the program doesn't crash when given data it doesn't expect (e.g., a negative number for an age).

Coding Example: Testing for Reliability Consider a method that processes a withdrawal. To ensure reliability, the programmer must handle more than just a successful transaction.

Task: Designing reliable logic using conditional boundary checks.

public class BankAccount {
    private double balance = 100.0;

    public void withdraw(double amount) {
        // 1. Handling Invalid Inputs (Negative numbers)
        if (amount <= 0) {
            System.out.println("Error: Withdrawal amount must be positive.");
            return;
        }

        // 2. Handling Boundary/Edge Cases (Withdrawing more than the balance)
        if (amount > balance) {
            System.out.println("Error: Insufficient funds.");
            return;
        }

        // 3. Normal Input (Valid withdrawal)
        balance -= amount;
        System.out.println("Withdrawal successful. New balance: $" + balance);
    }
}

By including these checks, the programmer ensures the program performs its task "without failure" even when presented with unexpected or extreme data.

Social and Ethical Impacts

The creation of programs has significant impacts on society, the economy, and culture. These impacts can be both beneficial and harmful.

Algorithmic Bias
  • Bias can be introduced unintentionally when algorithms favor certain data patterns or user groups. Developers must evaluate their design choices to avoid creating systemic unfairness.
  • Unintended Consequences: Programs meant to fill a need or solve a specific problem can have unintended harmful effects beyond their intended use.
    • Example: A navigation app improves travel time (beneficial) but might increase traffic congestion and noise in small residential neighborhoods not designed for high volume (unintended harm).
  • Bias: Data sets or algorithms can reflect the biases of their creators or the historical data they were trained on, leading to unfair outcomes.
    • Example: A video streaming app that only delivers high-quality video to users with the latest, most expensive phone models, unintentionally creating an unfair experience for lower-income users.
  • Impact on the Economy: Automation through software can significantly shift the job market.
    • Example: An automated checkout system in a grocery store increases efficiency for the business (beneficial) but reduces the need for human cashiers (harmful economic impact for workers).

Task: Identifying unintentional bias in hardware-dependent logic.

// Example of an UNINTENTIONAL Bias 
// The programmer thinks they are just "optimizing for high-end hardware"
public void loadContent(User u) {
    if (u.getPhoneModelYear() >= 2024) {
        // High-end users get the premium experience
        renderHighQualityGraphics();
    } else {
        // Older/Cheaper phones get a stripped-down version
        renderBasicTextOnly();
    }
}

Note: While the programmer intended to improve performance, the rule creates a systemic bias against users who cannot afford frequent hardware upgrades.

Legal and Intellectual Property Issues

Legal issues and intellectual property concerns arise when creating and distributing programs.

Intellectual Property
  • Software is protected by law. Respecting IP means using open-source code according to its license and properly attributing or purchasing proprietary work.
  • Open Source: Many programmers reuse code that is published as open source, which is generally free to use, modify, and distribute according to specific license terms (like MIT or Apache).
  • Proprietary Code: Incorporation of code that is not published as open source requires the programmer to obtain explicit permission and often purchase the code before integrating it into their program.

Coding Example: Attributing Open Source Code When reusing code, it is important to include the license or attribution in your comments.

Task: Providing proper attribution for open-source code usage.

/*
 * PATHFINDING LOGIC
 * The logic below was adapted from the OpenSourcePath project.
 * License: MIT (See LICENSE.txt for full details)
 */
public void findOptimalPath() {
    // ... logic adapted from external source ...
}
  • Plagiarism: Using someone else's work without proper attribution or permission is both a legal violation and an ethical breach.

Examples

Scenario: The Responsible Programmer

An essential question for this unit is: How can you be a responsible programmer?

  1. Check Licenses: Always verify if a library is open source or proprietary before using it.
  2. Diverse Testing: Test your code with various inputs to ensure reliability for all users.
  3. Consider Impact: Before releasing a tool, think about how it might be misused or how it might affect different communities.
  4. Protect Data: Use encapsulation (private variables) to protect sensitive user information from being accidentally changed or exposed.
Privacy Policy | Terms & Conditions