Skip to content

Creative Development

AP Computer Science Principles · Topic 1

Train
1.1

Collaboration

Syllabus
Enduring UnderstandingLearning ObjectiveEssential Knowledge

CRD-1
Incorporating multiple perspectives through collaboration improves computing innovations as they are developed.

CRD-1.A
Explain how computing innovations are improved through collaboration. [Skill 1.C]

  • CRD-1.A.1 A computing innovation includes a program as an integral part of its function.
  • CRD-1.A.2 A computing innovation can be physical (e.g., self-driving car), nonphysical computing software (e.g., picture editing software), or a nonphysical computing concept (e.g., e-commerce).
  • CRD-1.A.3 Effective collaboration produces a computing innovation that reflects the diversity of talents and perspectives of those who designed it.
  • CRD-1.A.4 Collaboration that includes diverse perspectives helps avoid bias in the development of computing innovations.
  • CRD-1.A.5 Consultation and communication with users are important aspects of the development of computing innovations.
  • CRD-1.A.6 Information gathered from potential users can be used to understand the purpose of a program from diverse perspectives and to develop a program that fully incorporates these perspectives.

CRD-1.B
Explain how computing innovations are developed by groups of people. [Skill 1.C]

  • CRD-1.B.1 Online tools support collaboration by allowing programmers to share and provide feedback on ideas and documents.
  • CRD-1.B.2 Common models such as pair programming exist to facilitate collaboration.

CRD-1.C
Demonstrate effective interpersonal skills during collaboration. [Skill 1.C]

  • CRD-1.C.1 Effective collaborative teams practice interpersonal skills, including but not limited to:
    • communication
    • consensus building
    • conflict resolution
    • negotiation

Source: College Board AP Course and Exam Description

Computing is a collaborative 协作 activity. Working in a team brings more perspectives, catches more errors, and produces better programs than working alone. Good collaboration uses consensus building, clear communication, and each member's strengths. Pair programming 结对编程 – two people at one computer, one typing and one reviewing – is a common practice. On the exam, you should be able to explain how collaboration improved a program (more ideas, fewer bugs, wider testing).

Vocabulary Train
English Chinese Pinyin
collaborative 协作 xié zuò
Pair programming 结对编程 jié duì biān chéng
1.2

Program Function and Purpose

Syllabus
Enduring UnderstandingLearning ObjectiveEssential Knowledge

CRD-2
Developers create and innovate using an iterative design process that is user-focused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking.

CRD-2.A
Describe the purpose of a computing innovation. [Skill 1.A]

  • CRD-2.A.1 The purpose of computing innovations is to solve problems or to pursue interests through creative expression.
  • CRD-2.A.2 An understanding of the purpose of a computing innovation provides developers with an improved ability to develop that computing innovation.

CRD-2.B
Explain how a program or code segment functions. [Skill 4.A]

  • CRD-2.B.1 A program is a collection of program statements that performs a specific task when run by a computer. A program is often referred to as software.
  • CRD-2.B.2 A code segment is a collection of program statements that is part of a program.
  • CRD-2.B.3 A program needs to work for a variety of inputs and situations.
  • CRD-2.B.4 The behavior of a program is how a program functions during execution and is often described by how a user interacts with it.
  • CRD-2.B.5 A program can be described broadly by what it does, or in more detail by both what the program does and how the program statements accomplish this function.

CRD-2.C
Identify input(s) to a program. [Skill 3.A]

  • CRD-2.C.1 Program inputs are data sent to a computer for processing by a program. Input can come in a variety of forms, such as tactile, audio, visual, or text.
  • CRD-2.C.2 An event is associated with an action and supplies input data to a program.
  • CRD-2.C.3 Events can be generated when a key is pressed, a mouse is clicked, a program is started, or any other defined action occurs that affects the flow of execution.
  • CRD-2.C.4 Inputs usually affect the output produced by a program.
  • CRD-2.C.5 In event-driven programming, program statements are executed when triggered rather than through the sequential flow of control.
  • CRD-2.C.6 Input can come from a user or other programs.

CRD-2.D
Identify output(s) produced by a program. [Skill 3.A]

  • CRD-2.D.1 Program outputs are any data sent from a program to a device. Program output can come in a variety of forms, such as tactile, audio, visual, or text.
  • CRD-2.D.2 Program output is usually based on a program's input or prior state (e.g., internal values).

Source: College Board AP Course and Exam Description

Every program is written for a purpose – it solves a problem or pursues an interest. A program takes input 输入, processes it, and produces output 输出. Inputs can come from a user, a device, a file, or another program; outputs can be visual, audible, textual, or a signal to a device. Being able to state a program's purpose, and describe its inputs and outputs clearly, is a core skill (and part of the Create performance task).

Every program decomposes into input, processing, and output Every program decomposes into input, processing, and output

Every program follows the input-processing-output model Every program follows the input-processing-output model

Explore

Explore the input → processing → output model

Step through the IPO model. Every program takes some input, performs processing on it by following its instructions, then produces output — trace one weather-app example along the pipeline.

Vocabulary Train
English Chinese Pinyin
input 输入 shū rù
output 输出 shū chū
1.3

Program Design and Development

Syllabus
Enduring UnderstandingLearning ObjectiveEssential Knowledge

CRD-2
Developers create and innovate using an iterative design process that is user-focused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking.

CRD-2.E
Develop a program using a development process. [Skill 1.B]

  • CRD-2.E.1 A development process can be ordered and intentional, or exploratory in nature.
  • CRD-2.E.2 There are multiple development processes. The following phases are commonly used when developing a program:
    • investigating and reflecting
    • designing
    • prototyping
    • testing
  • CRD-2.E.3 A development process that is iterative requires refinement and revision based on feedback, testing, or reflection throughout the process. This may require revisiting earlier phases of the process.
  • CRD-2.E.4 A development process that is incremental is one that breaks the problem into smaller pieces and makes sure each piece works before adding it to the whole.

CRD-2.F
Design a program and its user interface. [Skill 1.B]

  • CRD-2.F.1 The design of a program incorporates investigation to determine its requirements.
  • CRD-2.F.2 Investigation in a development process is useful for understanding and identifying the program constraints, as well as the concerns and interests of the people who will use the program.
  • CRD-2.F.3 Some ways investigation can be performed are as follows:
    • collecting data through surveys
    • user testing
    • interviews
    • direct observations
  • CRD-2.F.4 Program requirements describe how a program functions and may include a description of user interactions that a program must provide.
  • CRD-2.F.5 A program's specification defines the requirements for the program.
  • CRD-2.F.6 In a development process, the design phase outlines how to accomplish a given program specification.
  • CRD-2.F.7 The design phase of a program may include:
    • brainstorming
    • planning and storyboarding
    • organizing the program into modules and functional components
    • creation of diagrams that represent the layouts of the user interface
    • development of a testing strategy for the program

CRD-2.G
Describe the purpose of a code segment or program by writing documentation. [Skill 4.A]

  • CRD-2.G.1 Program documentation is a written description of the function of a code segment, event, procedure, or program and how it was developed.
  • CRD-2.G.2 Comments are a form of program documentation written into the program to be read by people and do not affect how a program runs.
  • CRD-2.G.3 Programmers should document a program throughout its development.
  • CRD-2.G.4 Program documentation helps in developing and maintaining correct programs when working individually or in collaborative programming environments.
  • CRD-2.G.5 Not all programming environments support comments, so other methods of documentation may be required.

CRD-2.H
Acknowledge code segments used from other sources. [Skill 1.C]

  • CRD-2.H.1 It is important to acknowledge any code segments that were developed collaboratively or by another source.
  • CRD-2.H.2 Acknowledgement of a code segment(s) written by someone else and used in a program can be in the program documentation. The acknowledgement should include the origin or original author's name.

Source: College Board AP Course and Exam Description

Programs are built through an iterative 迭代 process, not in one straight line: investigate the problem and users, design (often with a diagram or written plan), implement in code, and test – then repeat. A large problem is broken into smaller pieces (decomposition 分解). Comments 注释 and clear naming document the design so others (and your future self) can understand it. Development is incremental – build and test a small piece, then add the next.

The stages of program development, with testing feeding back to fix and refine The stages of program development, with testing feeding back to fix and refine

Software is built by an iterative, incremental development process Software is built by an iterative, incremental development process

Explore

Loop through the iterative development process

Development is iterative — you repeat the stages, improving the program a little on each pass. Step around the loop and notice it returns to the start rather than ending after one run.

Vocabulary Train
English Chinese Pinyin
iterative 迭代 dié dài
decomposition 分解 fēn jiě
Comments 注释 zhù shì
1.4

Identifying and Correcting Errors

Syllabus
Enduring UnderstandingLearning ObjectiveEssential Knowledge

CRD-2
Developers create and innovate using an iterative design process that is user-focused, that incorporates implementation/feedback cycles, and that leaves ample room for experimentation and risk-taking.

CRD-2.I
For errors in an algorithm or program:
a. Identify the error. [Skill 4.C]
b. Correct the error. [Skill 4.C]

  • CRD-2.I.1 A logic error is a mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly.
  • CRD-2.I.2 A syntax error is a mistake in the program where the rules of the programming language are not followed.
  • CRD-2.I.3 A run-time error is a mistake in the program that occurs during the execution of a program. Programming languages define their own run-time errors.
  • CRD-2.I.4 An overflow error is an error that occurs when a computer attempts to handle a number that is outside of the defined range of values.
  • CRD-2.I.5 The following are effective ways to find and correct errors:
    • test cases
    • hand tracing
    • visualizations
    • debuggers
    • adding extra output statement(s)

CRD-2.J
Identify inputs and corresponding expected outputs or behaviors that can be used to check the correctness of an algorithm or program. [Skill 4.C]

  • CRD-2.J.1 In the development process, testing uses defined inputs to ensure that an algorithm or program is producing the expected outcomes. Programmers use the results from testing to revise their algorithms or programs.
  • CRD-2.J.2 Defined inputs used to test a program should demonstrate the different expected outcomes that are at or just beyond the extremes (minimum and maximum) of input data.
  • CRD-2.J.3 Program requirements are needed to identify appropriate defined inputs for testing.

Source: College Board AP Course and Exam Description

A bug is an error in a program; debugging 调试 is finding and fixing it. Three kinds:

A trace table records each variable's value as the program runs, to find bugs A trace table records each variable's value as the program runs, to find bugs

  • a syntax error 语法错误 breaks the language's rules, so the program will not run;
  • a runtime error 运行时错误 crashes the program while it runs (e.g. dividing by zero);
  • a logic error 逻辑错误 lets it run but gives the wrong result.

Find bugs by testing with different inputs (including edge cases), adding print statements to see values, and hand-tracing the code. Fixing one bug at a time and re-testing is the reliable method.

Exam skill: be able to name the type of an error and describe a testing strategy that would catch it – a recurring multiple-choice and Create-task theme.

Three kinds of programming error: syntax, logic, and runtime Three kinds of programming error: syntax, logic, and runtime

Worked example. A program meant to print the average of two numbers instead runs avg = a + b / 2. Tracing the order of operations, / runs before +, so it computes $a+\tfrac{b}{2}$ rather than the average. Add parentheses to fix it: avg = (a + b) / 2. Testing with $a=4,\ b=6$ confirms the fix — the buggy line gives $4+3=7$, the corrected line gives $\tfrac{10}{2}=5$. Testing with known inputs is exactly how you find and confirm a logic error.

Explore

Trace the guessing-game logic and spot a logic error

Drag the guess and watch which branch runs. A logic error would send the same guess down the wrong branch — the program still runs, but gives the wrong message. The secret number here is 50.

Vocabulary Train
English Chinese Pinyin
debugging 调试 tiáo shì
syntax error 语法错误 yǔ fǎ cuò wù
runtime error 运行时错误 yùn xíng shí cuò wù
logic error 逻辑错误 luó jí cuò wù
1.4

Exam tips

  • Much of CSP is assessed through the Create and written performance tasks — explain your reasoning clearly, not just your result.
  • Know the benefits of collaboration and how diverse perspectives reduce bias in a program.
  • Use precise vocabulary (iterative development, program requirements) when you describe a design process.
  • Give and take feedback constructively; credit collaborators and sources.
  • Break a large problem into smaller modules that a team can build in parallel.

Log in or create account

IGCSE & A-Level