CSP BIG IDEA 1

  1. Collaboration

  2. Program Function & Purpose

  3. Program Design & Development

  4. Identifying & Correcting Errors

The exam LOVES making these sound similar, so the goal is understanding the differences.


1. Collaboration

The Core Idea

Collaboration = people working together to build ONE computing artifact.

Not just:

“You do half, I do half.”

Real collaboration includes:

  • planning together

  • reviewing each other’s work

  • testing

  • communicating

  • combining work correctly


What AP CSP Wants You to Know

Benefits of Collaboration

Better quality

Other people catch:

  • bugs

  • confusing design

  • missing features

Bigger projects become possible

Large programs are too much for one person.

Different perspectives

Different people notice different user needs.

Easier debugging

Teammates can help identify logic problems.


Common Collaboration Strategies

Pair Programming

Two people, one computer.

Driver

Types the code.

Navigator

Reviews logic, catches mistakes, thinks ahead.

Then they SWITCH roles.


Modular Design

Break the program into parts/modules.

Example:

  • input system

  • data storage

  • display/output

  • notifications

This helps teammates work separately without conflicts.


Consistent Naming

Everyone agrees on:

  • variable names

  • procedure names

  • formatting

Bad naming causes confusion and bugs.


Frequent Integration

Combine work often.

NOT:

“Let’s merge everything the night before.”

That creates huge conflicts.


Communication Artifacts

These are SUPER important for AP CSP questions.

They include:

  • comments

  • flowcharts

  • pseudocode

  • wireframes

  • design notes

  • change logs

Purpose:
→ help others understand the program.


Academic Honesty

Allowed

  • discussing ideas

  • getting feedback

  • learning from examples

NOT allowed

Submitting someone else’s work as your own.

If you use outside code/media:
→ GIVE CREDIT.


Biggest Collaboration Mistakes

Thinking collaboration only means splitting tasks

Not communicating changes

No documentation/comments

Waiting until the end to combine code


QUICK MEMORY TRICK

Collaboration =

“Shared understanding + coordinated work”

Not just “multiple people coding.”



2. Program Function vs Purpose

This is one of the MOST tested distinctions.

The Difference

Function

What the program DOES.

Think:

  • inputs

  • processing

  • outputs

  • features


Purpose

WHY the program exists.

Think:

  • user

  • problem being solved

  • benefit


Easy Memory Trick

Function = HOW it behaves

Purpose = WHY it matters


Example

Program:
Tracks sleep hours and graphs trends.

Function

  • accepts sleep entries

  • stores data

  • calculates averages

  • displays graphs

Purpose

Help users improve sleep habits.


AP Exam Trap

Students often write:

“The purpose is to store sleep data.”

That’s actually FUNCTION.


Inputs, Processing, Outputs

AP CSP LOVES these.

Input

Information entering the program.

Examples:

  • typing

  • clicks

  • sensor data


Processing

What the program DOES with data.

Examples:

  • calculations

  • sorting

  • filtering

  • decision-making


Output

What the program produces.

Examples:

  • text

  • images

  • sounds

  • scores

  • graphs


Example Breakdown

Vocabulary quiz app:

Input

User answers

Processing

Checks correctness, tracks mistakes

Output

Scores + feedback

Purpose

Help students study vocabulary.


Biggest Mistakes

Confusing purpose with features

Forgetting the intended user

Only describing outputs


QUICK MEMORY TRICK

Function = mechanics

Purpose = mission



3. Program Design & Development

Core Idea

Programs are built ITERATIVELY.

Meaning:

  • build

  • test

  • improve

  • repeat

NOT:

“Write everything perfectly first try.”


The Development Cycle

1. Investigate the Problem

Ask:

  • Who is the user?

  • What problem exists?

  • What constraints exist?


2. Plan & Design

This includes:

  • decomposition

  • algorithms

  • interface sketches

  • data decisions


3. Build Prototype

Create a simple working version FIRST.

AP CSP loves the idea:

“Core features before advanced features.”


4. Test

Check:

  • normal inputs

  • edge cases

  • usability


5. Refine

Improve based on:

  • bugs

  • feedback

  • testing results

Then repeat the cycle.


Decomposition

Huge AP CSP concept.

Definition

Breaking a big problem into smaller manageable parts.

Example:
To-do app:

  • task input

  • storage system

  • display system

  • reminders


Why Decomposition Helps

easier testing
easier collaboration
easier debugging
less overwhelming


Algorithms

An algorithm =
step-by-step instructions.

Before coding, you should plan:

  • logic

  • decisions

  • edge cases


Example Algorithm

Recommendation system:

  1. Ask preferred genre

  2. Filter items

  3. If none found → show message

  4. Otherwise show recommendation

Notice:
The empty-result edge case was planned ahead.


Prototyping

Wireframes/sketches help plan:

  • buttons

  • layouts

  • user flow

AP CSP reminder:
Design is NOT just appearance.

It also includes:

  • algorithms

  • data organization

  • usability


Iterative Development Example

Study timer app:

Version 1

25-minute countdown

Feedback

Users want pause button

Version 2

Add pause feature

Feedback

Users want custom times

Version 3

Add settings

Small improvements over time.


Biggest Mistakes

Adding advanced features before core features work

Treating design as “just visuals”

Not planning algorithms beforehand


QUICK MEMORY TRICK

Development is iterative:

Build → Test → Improve → Repeat



4. Identifying & Correcting Errors

This is debugging/testing.

The 3 Types of Errors

These MUST be memorized.


1. Syntax Errors

Breaking language rules.

Examples:

  • missing parentheses

  • misspelled keywords

Usually:
→ program won’t run.


2. Runtime Errors

Happen DURING execution.

Examples:

  • divide by zero

  • missing list item

Usually:
→ program crashes.


3. Logic Errors

Program runs BUT gives wrong output.

Most difficult type.


Easy Memory Trick

Syntax

“Can’t read it”

Runtime

“Crashes while running”

Logic

“Runs incorrectly”


Testing

Testing ≠ randomly clicking around.

Good testing uses:

Typical Cases

Normal inputs.

Boundary Cases

Edge values:

  • 0

  • maximum

  • minimum

Invalid Cases

Unexpected inputs:

  • blank

  • letters instead of numbers


AP CSP LOVES Edge Cases

Especially:

  • empty lists

  • maximum values

  • one-item lists


Tracing

Tracing =
following variables step-by-step.

Useful for logic errors.

Example table:

Step

Variable

Output

Start

count=0

Loop

count=1

Tracing helps compare:

  • expected behavior
    vs

  • actual behavior


Good Debugging Process

1. Reproduce the bug

Find exact conditions causing it.


2. Compare Expected vs Actual

Be specific.

Example:

“Expected score = 5, actual = 4.”


3. Narrow Location

Use:

  • print statements

  • debugging tools

  • tracing


4. Form Hypothesis

Guess WHY it’s happening.


5. Change ONE Thing

Important.

If you change 5 things:
→ you won’t know what fixed it.


6. Retest

Especially previous test cases.

Fixing one bug can create another.


Example Logic Error

Goal:
Count numbers > 10.

Bug:
Counter resets instead of increments.

The program RUNS.
But output is wrong.

That makes it:

LOGIC ERROR


Example Runtime Error

Average of empty list:

Division by 0 occurs.

That is:

RUNTIME ERROR


Biggest Debugging Mistakes

Only testing normal cases

Random guessing

Changing many things at once

Assuming “runs” means “correct”


SUPER IMPORTANT CONNECTIONS

These topics connect together.

Collaboration helps debugging

Teammates catch logic mistakes.

Purpose affects debugging

“Correct” depends on intended behavior.

Design affects errors

Bad decomposition creates bugs.

Iterative development improves quality

Testing and feedback happen repeatedly.


MINI PRACTICE QUIZ

1.

A program runs but gives incorrect scores.

What type of error?

A. Syntax
B. Runtime
C. Logic

Answer:

C. Logic


2.

Which best describes program purpose?

A. Calculates averages
B. Displays graphs
C. Helps users track fitness progress

Answer:

C

(A and B are functions.)


3.

Why is decomposition useful?

A. Makes problems smaller/manageable
B. Removes need for testing
C. Prevents all bugs

Answer:

A


4.

Which is a boundary test case?

A. Typical user input
B. Maximum allowed value
C. Random guessing

Answer:

B


5.

Which practice BEST supports collaboration?

A. Everyone uses different naming styles
B. Combining code only at the end
C. Shared documentation and regular communication

Answer:

C


LAST-MINUTE MEMORIZATION SHEET

Collaboration

Working together with communication + shared understanding.

Function

What the program DOES.

Purpose

WHY the program exists.

Iterative Development

Build → Test → Improve → Repeat.

Decomposition

Break big problems into smaller parts.

Syntax Error

Program cannot run.

Runtime Error

Crash during execution.

Logic Error

Runs but wrong result.

Edge Case

Unusual/extreme input.

Tracing

Following variables step-by-step.