AP Computer Science Principles / Chapter 1
Creative Development
Cheat sheet
Collaboration
- A computing innovation has a program integral to its function. It can be a physical system, software or a computing concept implemented through programs; hardware is its physical equipment.
- Complementary expertise and consultation with different users can expose design assumptions. Their value comes from using the evidence to improve decisions, rather than from team size alone.
- In pair programming, the driver enters code while the navigator reviews the same developing solution; roles are exchanged. Online tools support sharing and feedback across locations.
- Communication, negotiation and conflict resolution support consensus: a decision the participants can support after considering differing concerns.
Program Function and Purpose
- Purpose identifies the human problem or creative interest. Function describes what the program does; detailed explanations connect statements with behavior. A code segment is part of a complete program.
- Input enters a program from users, sensors or other programs. Output leaves for a device. Audio, visual, text and tactile forms can occur on either side; retained internal values are state.
- An event triggers its associated handler. Startup, a key press and an incoming message are possible events. Defining a handler does not trigger it.
- Assignment replaces a stored value using the current right-hand value. Later changes to one numeric variable do not change a value already copied into a different variable.
Program Design and Development
- Iteration revises an existing solution using feedback, testing or reflection. Incremental work adds independently checked pieces to a whole. A project can combine exploratory and planned activities.
- Investigate users through surveys, interviews, direct observation and user testing. Requirements describe needed behavior; constraints limit solutions; a specification defines the required behavior.
- Brainstorm alternatives. Storyboard the user’s sequence, lay out screen controls, divide responsibilities into modules and plan tests with expected outcomes. A prototype is an early implementation for evaluation.
- Document functions and development decisions as they change. Comments communicate with readers and do not execute; separate linked notes can document environments without comments. Credit collaborative and borrowed segments by author or origin.
Identifying and Correcting Errors
- Syntax errors violate writing rules. Runtime errors arise during execution under the language’s rules. Logic errors produce unintended behavior even when execution completes. Overflow attempts to handle a number outside its representation’s range.
- Compare expected and actual intermediate state. Hand tracing records each step; extra output reveals selected values; a debugger pauses or steps through execution; a visualization makes changes visible.
- A test case includes a defined input and an expected response from the requirements. Check interior values, included endpoints and adjacent invalid values when behavior is specified.
- After a repair, repeat earlier successful tests as well as the failing case. Finite passing tests support those cases without establishing correctness for every possible input and situation.