AP Computer Science Principles · Topic 1.3

Program Design and Development

Follow a study timer from its first sketch to a tested design. Learn how to turn user feedback into a requirement, build one feature at a time and explain your code to another programmer.

Test the study timer

Run a sample case and compare what the prototype returns with the expected behavior.

Expected
25:00 · Running · 0 completed

Develop a program with a process

Topic 1.3 sits in Big Idea 1, Creative Development. It covers developing a program, designing its user interface, documenting what the code does and acknowledging code from other sources.

An ordered process starts with an intentional plan. An exploratory process tries possibilities to learn what works. A single project can use both. A team can agree on a plan for a basic countdown and try two control layouts before it commits to one.

  1. Investigate and reflect. Find out who will use the program, what they need and what constraints matter.
  2. Design. Sketch the interface and plan the program logic and tests.
  3. Prototype. Make a sketch or a small working version to try an idea early.
  4. Test. Compare actual results with expected behavior and use what you learn to revise.

These phases can repeat. A user test can reveal that an assumption was wrong and send you back to investigate or redesign a feature.

Compare iterative and incremental development

Iterative development

Revise an existing version after feedback, testing or reflection. The revision can improve a single feature or a larger part of the program.

  1. Build a version
  2. Test it
  3. Review feedback
  4. Revise and retest

A first version of the study timer works, but users mistake the pause control for a reset. Change its label to Pause, keep the time visible and ask the same users to try the task again.

Incremental development

Break the problem into pieces. Make one piece work and verify it before adding the next piece to the program.

  1. Countdown
  2. Start and pause
  3. Completion alert
  4. Session tracking

Build and test the countdown first. Then add start and pause, an alert when time runs out and a saved session count. Test each addition with the features already in place.

When both apply, name both decisions. Adding a completion alert is an increment. Changing that alert after users test it is an iteration.

Turn user needs into testable requirements

Before coding, investigate the interests and concerns of the people who will use the program. A survey can reveal patterns across a group. An interview can explain why those patterns matter. Direct observation and user testing can show difficulties that users may forget to mention in a survey.

Requirement

A behavior or interaction the program must provide. The timer should pause while keeping the remaining time visible.

Constraint

A limit the design must work within, such as time, available devices or connectivity. The timer needs to work offline.

Specification

The agreed requirements, including conditions and expected behavior that someone else can check.

Design

The plan for meeting the specification, such as a screen layout and separate pieces of code for timing, formatting and storage.

Worked example · Study timer specification

Students want to start a focus session quickly and see how much time is left. Use whole-minute durations from 1 to 60, an offline display in MM:SS format and clear start, pause and resume controls.

RequirementWhat a test should show
Set a valid duration and startStarting a 25-minute session displays 25:00. A duration of zero shows a validation message and leaves the timer idle.
Pause and resumeWhile paused at 01:04, a clock tick leaves the display at 01:04. Countdown resumes when the user selects Resume.
Notify the user when time runs outWhen 00:01 reaches 00:00, signal completion once. Use a visible message alongside the sound alert.
Track completed sessions offlineOne completed session adds one to the count. Refreshing on the same device shows the saved count when browser storage is available.

The format MM:SS describes a visible result. Local browser storage is one implementation choice for keeping the count without a network connection.

Sketch the interface and plan the tests

Brainstorm and storyboard

Sketch what a student sees before starting, during a session, while paused and at completion. Identify the action that moves the program to each next state.

Lay out the controls

Give the duration field a clear label. Keep the time visible while paused and put the next useful action beside it. Try the layout with a user before writing every feature.

Split the work into modules

Give input validation, countdown updates, display formatting and saved sessions separate responsibilities so each piece can be built and tested on its own.

Write a test strategy

Choose representative inputs, values at the limits and values just beyond them. Include changes in state such as pausing and reaching zero. Predict the output before running each test.

Worked example · Predict the next timer state

If a student enters m minutes, the countdown starts at s=60m seconds. For m=25, the timer starts with s=1500 seconds and shows 25:00.

On an active clock tick, the timer updates the remaining seconds with

snext=max(0,s−1).

For a paused timer, snext=s. A session completes only on the transition from 1 second to 0. Run the completion case in the timer test bench, then run the case for a timer that already finished. The second run checks whether the design would count the same session twice.

Keep a record of feedback and a retest. For example, write down that users expected a paused countdown to remain visible. After revising the display, test that a clock tick leaves both the time and the session count unchanged while paused.

Explain the code and credit its sources

Program documentation explains what a program, event or code segment does and how it was developed. Write it throughout the project so teammates and future maintainers can understand design choices, test failures and code changes.

Comments near the code

Explain a rule, an assumption or the reason for a step. Ordinary code comments are for readers and do not change how the program runs.

Documentation beside the code

A design note, short README, annotated diagram or test log may be clearer when you need more context or the programming environment lacks comments.

Worked example · Document the timer's tick function

# A paused timer keeps its time.
def tick(seconds, paused):
    if paused:
        return seconds
    # Keep the counter at zero.
    return max(0, seconds - 1)

A programmer reading the comment can predict that tick(64, True) returns 64, while tick(1, False) returns 0. That tells the programmer how to check pause and the lower boundary without guessing how the function should behave.

Acknowledge code where a reader can identify it

Credit code you used from tutorials, libraries, starter files or other people. Include the origin or author and enough detail for a reader to identify the borrowed part. A comment near the relevant code is a practical place. If that environment lacks comments, use the accompanying documentation.

Record what you developed with a partner and identify the relevant sections. If you use a generative AI tool as a supplementary coding resource under the current Create rules, credit the tool, review the code it helped produce and be ready to explain how it works.

Check your attribution. A useful credit identifies the source and the portion you used, such as a time-formatting helper adapted from a named project's documentation. Keep the author or source name with the credit when you edit the code.

Apply Topic 1.3 to the Create task and exam

For the May 2027 AP CSP exam, students submit program code, a video and a Personalized Project Reference (PPR) through the AP Digital Portfolio. The exam's written responses are completed independently on exam day. A design log is useful preparation for explaining your work.

  • Collaboration is permitted in developing the program code under the Create task rules. Prepare your video and PPR independently.
  • Keep acknowledgments and explanatory comments in the full program-code submission. Use code-only screen captures for the PPR, with comments and course notes removed.
  • When you answer a documentation question, identify a particular segment, describe a specific piece of documentation and explain what another programmer can learn from it.

Practice a written response on documentation

Describe a piece of documentation for the study timer and explain what it helps another programmer understand about the tick function.

Read a sample explanation

A comment above the pause check can explain that a tick while paused returns the existing number of seconds. Another programmer would know that they should call the function with the pause flag set to keep the timer frozen. They could test it by checking that 64 seconds stays 64 after a paused tick.

Practice explaining an iteration and a retest

A tester resets the timer by mistake while trying to pause it. Describe one revision and a test that would verify the new behavior.

Read a sample explanation

Give Pause and Reset clearly different labels and separate the controls. Have a tester pause at 01:04 and wait through a clock tick. Check that the display still shows 01:04 and the completion count stays the same. Then have them resume and check that the countdown continues.

Use the development checklist

Check off each step as you complete it. Reopen the relevant section if you need to revise a requirement or retest a feature.

Look back at four common gaps. Confirm that you investigated user needs, planned expected outputs, documented decisions as you went and recorded sources before moving on.

Practice quiz

Answer the six questions, then check your choices and read the explanations.

1. A developer builds a working app, tests it, gathers feedback, improves it and repeats. Which approach is this?

B is correct. The developer revises the current version based on what testing and user feedback reveal.

2. Which activity belongs to building the program rather than investigating user requirements?

C is correct. Compiling translates or prepares code for execution. Surveys, user tests and interviews provide evidence about needs.

3. What is the purpose of ordinary comments in program code?

A is correct. Comments help another developer understand the code. The programming language treats ordinary comments as documentation.

4. What does a program specification primarily define?

D is correct. The specification identifies required behavior and interactions so the developer can design and test against them.

5. What should a developer do when using a code segment from an online tutorial?

B is correct. Identify the code’s origin or author and the part reused. Code being visible online does not remove the need for credit.

6. Which action is an example of incremental development?

C is correct. Each addition is checked before it is joined by the next feature, making problems easier to isolate.

Frequently asked questions

What is the difference between iterative and incremental development?

Iterative development revises an existing design or implementation using evidence. Incremental development adds a new working piece after verifying earlier pieces. You can use both in a single project.

What does a program specification include?

It defines the required functions, user interactions and expected behavior. Constraints such as offline operation can also shape the requirements.

Why document a program as you build it?

Documentation helps someone understand choices, maintain the code and reproduce a test. Write down what a segment does and why the decision was made while the reasoning is still easy to recall.

How can you investigate user requirements?

Use surveys, interviews, direct observation or user testing to identify needs and constraints. Collect evidence before writing the requirements you plan to implement.

What should be acknowledged in the documentation?

Credit code you reused or developed with others, including the original author or source. Include appropriate credit for AI-assisted code used under the task's rules.

What phases can a development process include?

Common phases include investigating and reflecting, designing, prototyping and testing. A project can return to an earlier phase when it learns something new.

Continue studying AP CSP

Official framework, handouts and exam practice

Try 2026 Written Response 1 after the practice above. It asks how documentation helps another programmer understand a particular code segment. The scoring guidelines show how the response is evaluated.

Lesson by NUM8ERS Institute & Education LLC Dubai.