AP Computer Science Principles · Unit 1 lecture · Part 11 of 11 · 6 min

Unit 1 wrap-upPut it together

Mr. Thompkins
That's all of Creative Development. It's 10 to 13 percent of the multiple choice, but it's worth more than that, because it's also the language of your Create performance task. Let's connect the pieces.

Look at how the four topics form one story. A team, ideally with diverse perspectives, investigates what users need (1.1 and 1.3). They describe the program's purpose and plan its function: inputs, outputs, events (1.2). They design it in modules and build it incrementally, revising iteratively as feedback comes in (1.3). At every step they test with defined inputs, and when something fails they name the error and track it down (1.4). Then they go around again.

Create task promptUnit 1 idea it usesWhat earns the point
Written response 1Purpose, users, input and output, feedbackA specific user group and a specific feature that meets its need
Written response 2(b)Errors and testingReal calls, the code each one runs, and exact results
Your videoInput, function, outputShows input going in and output coming out
Your code commentsDocumentation, creditCredit any code you did not write (not in the PPR)
Where Unit 1 shows up in the Create task. Written responses 1 and 2(b) lean on this unit.
?Wait, what's the Create task again?
It's Section II of the AP exam, 30 percent of your score. You build a program, record a short video of it running, and make a Personalized Project Reference of your code. On exam day you answer two written-response questions about your own program, with your PPR in front of you.
?Wait, incremental or iterative?
Incremental: build and test one piece at a time, then add it to the whole. Iterative: revise and refine existing work based on feedback, testing or reflection.
Pause and think
Your Create task program works, but one tester says the instructions are confusing, so you rewrite them and test again with a new tester. Which written response could you use this for, and what makes the answer specific?
I thought about it. Show me
Written response 1 (design, function and purpose), which can ask how feedback or testing influenced your design. A specific answer names who gave the feedback, exactly what was confusing, what you changed, and how you retested it. That's iterative development described in your own program.

Traps that cost points

✕ Calling every bug a syntax error.
✓ If it runs and gives a wrong answer, it's a logic error. If it stops partway, it's a run-time error.
✕ Swapping purpose and function.
✓ Purpose is why it exists, for people. Function is what it does: inputs and outputs.
✕ Mixing up incremental and iterative.
✓ Incremental adds tested pieces. Iterative revises existing work after feedback.
✕ Thinking comments change how a program runs.
✓ The computer ignores comments. They are for people.
✕ Testing only "normal" values.
✓ Test just below, at and just above each cutoff, plus unusual inputs like an empty list.
✕ Thinking more people on a team automatically means less bias.
✓ Less bias comes from different perspectives, not just more hands.
✕ Renaming variables to make borrowed code "yours".
✓ Acknowledge the source or author in the documentation.
✕ Calling the output of a sensor reading an output.
✓ Data going into the program is input. Data the program sends to a device is output.

Key terms for Unit 1

Computing innovation
Has a program as an essential partPhysical, nonphysical software, or nonphysical concept
Purpose vs function
Why it exists vs what it doesWritten response 1
Input / output
Data into a program / data out to a deviceTactile, audio, visual, text
Event
An action that supplies input and triggers codeEvent-driven programming
Iterative / incremental
Revise after feedback / add tested piecesDevelopment process questions
Syntax / logic / run-time / overflow
Won't run / wrong result / fails while running / number too bigError classification
Defined inputs
Chosen tests with expected outcomesAt and just beyond each extreme
INPUT(), DISPLAY(x)
Get a value from the user; show a valueExam Reference Sheet

Strategy for Unit 1 questions

  1. For error questions, ask three things in order: did it run, did it finish, was the answer right? That names the error type.
  2. For "best test" questions, pick the inputs on both sides of every cutoff, plus unusual inputs.
  3. For development questions, decide whether something new was added (incremental) or existing work was revised after feedback (iterative).
  4. For collaboration questions, the right answer adds different perspectives or shares work and feedback. It never promises zero errors.
  5. For the Create task, describe your own program with real names, real inputs and exact results. Specific beats general every time.
Mixed practice
A team builds a bus-arrival app. (a) A tester who uses a screen reader can't hear the arrival time. Which Unit 1 idea does this show? (b) The app should warn "Leave now" when the bus is 5 minutes away or less, but it doesn't warn at exactly 5 minutes. Name the error type and give the best three test inputs. (c) The team fixes the warning, then adds a new "favorite stops" feature and tests it on its own before combining. Name that development approach.
  1. (a) Collaboration with diverse perspectives reduces bias: a tester with a different experience found a problem the team couldn't see, so the team can fix it before release.
  2. (b) It runs and finishes, but behaves incorrectly at 5: a logic error, probably < 5 where ≤ 5 was needed. Best tests: 4, 5 and 6 minutes, just below, at and just above the cutoff.
    Why?
    Expected: 4 warns, 5 warns, 6 does not. The 5-minute test reveals the bug.
  3. (c) Building and testing a new piece before adding it to the whole is incremental development. (Fixing the warning after a test was iterative.)

Answer: (a) Diverse perspectives help avoid bias. (b) A logic error; test 4, 5 and 6 minutes. (c) Incremental development.

Stuck? Get a hint
  1. (a) Who found the problem, and why couldn't the team see it?
  2. (b) Did the app run and finish? Where is the cutoff?
  3. (c) Was something new added as a separate tested piece?
Check yourself
A programmer's app crashes whenever a user with no saved photos opens the gallery, because the code divides by the number of photos. Which pair correctly names the error and the best way to have caught it?
  1. ASyntax error; reading the code for missing parentheses
  2. BRun-time error; testing with an unusual input, a user with zero photos
  3. COverflow error; storing the photo count in more bits
  4. DLogic error; testing with a user who has 50 photos
Show the answer

B. Dividing by zero fails during execution, which is a run-time error, and only an unusual input (zero photos) triggers it. A normal test like 50 photos would pass, which is why choice D is the trap.

Check yourself
Which TWO actions are examples of iterative development? I. After user testing, a team redesigns a confusing menu and tests it again. II. A team builds the login screen, tests it, then starts the settings screen. III. Reflecting on a failed test, a developer revisits the design of a procedure and rewrites it. IV. A developer adds comments to every procedure.
  1. AI and III
  2. BI and II
  3. CII and IV
  4. DIII and IV
Show the answer

A. I and III both revise existing work because of feedback, testing or reflection: that is iteration. II adds a new tested piece, which is incremental. IV is documentation.

Mr. Thompkins
That's Unit 1. Take the Unit 1 quiz while it's fresh, and when you miss one, come back to that section and open its recall cards. Next up is Unit 2, where we open the computer up and look at the bits.