Big Idea 1 — Creative Development
How programs get built collaboratively: what they're for, how they're designed, and how errors get found and fixed. Each section ends with a short practice set — click "Show answer" to check yourself.
Collaboration
A computing innovation is any creation that includes a program as a core part of how it works. It can take different forms:
- Physical — e.g. a self-driving car.
- Nonphysical software — e.g. picture-editing software.
- Nonphysical concept — e.g. e-commerce.
Programs are rarely built alone. Effective collaboration brings together people with diverse skills, perspectives, and backgrounds, which leads to better, less biased solutions and helps handle larger, more complex projects.
- Diversity reduces bias — a team whose members bring different talents and viewpoints is less likely to build in unconscious assumptions or blind spots.
- Consulting users — talking with potential users during development helps the team understand the program's purpose from multiple angles and build something that reflects real user needs, not just the developers' own assumptions.
- Online collaboration tools — shared documents, code repositories, and comment/feedback features let programmers collaborate remotely and asynchronously.
- Pair programming — two people share one workstation:
- Driver — types the code.
- Navigator — reviews each line, watches for errors, thinks ahead.
- Crowdsourcing — gathering input, content, or solutions from a large group of people (often online) rather than a single team.
- Interpersonal skills that make collaboration effective: clear communication, consensus building (reaching agreement the whole team can support), and conflict resolution.
1. Is e-commerce a physical computing innovation, nonphysical software, or a nonphysical concept?
Show answer
2. In pair programming, what is the difference between the "driver" and the "navigator"?
Show answer
3. Why does consulting potential users during development help a team avoid bias, beyond just having a diverse team?
Show answer
Program Function and Purpose
The purpose of a computing innovation is to solve a problem or to pursue interests through creative expression. Understanding a program's purpose up front makes it easier to develop well.
- A program is a collection of program statements that performs a specific task when run by a computer — also called software.
- A code segment is a smaller collection of program statements that makes up part of a larger program.
- A program needs to work correctly across a variety of inputs and situations, not just the cases a developer happens to test by hand.
- A program's behavior is how it functions while running, and is often described in terms of how a user interacts with it. A program can be described broadly (what it does) or in more detail (what it does and how the statements accomplish it).
- A program is correct if it fulfills its documented purpose across all cases, including edge cases — not just if it runs without crashing.
Inputs — data sent to a computer for a program to process. Input can be tactile, audio, visual, or text-based, and can come from a user or from another program.
- An event is tied to an action and supplies input data to a program — e.g. a key press, a mouse click, or a program starting.
- In event-driven programming, statements run when an event triggers them, rather than executing strictly in sequential order.
- Inputs usually affect the output a program produces.
Outputs — data a program sends to a device, which can also be tactile, audio, visual, or text-based. Output is usually based on the program's input and/or its prior internal state.
Documentation explains a program's purpose, functionality, and development:
- Comments — notes written directly in the code (not executed), explaining what a section does or why.
- External documentation — manuals, README files, or design documents describing the program as a whole.
1. A calculator app runs without errors but gives the wrong answer for negative numbers. Is it "correct"? Why or why not?
Show answer
2. A game reacts the instant a player clicks the mouse, rather than only checking for clicks at fixed points in a fixed sequence. What is this style of programming called, and what triggers the game's code?
Show answer
3. What's the difference between a "program" and a "code segment"?
Show answer
Program Design and Development
Well-designed programs are usually built using deliberate, repeatable processes rather than written all at once — though a development process can also be exploratory rather than strictly ordered.
Four phases are commonly used when developing a program:
- Investigating and reflecting — understanding the problem, its constraints, and the needs of the people who will use the program.
- Designing — planning how the program will meet its requirements.
- Prototyping — building an early, simplified version to test ideas.
- Testing — checking that the program behaves as intended.
- Iterative development — refining and revising a program based on feedback, testing, or reflection throughout the process; this may mean revisiting earlier phases rather than moving through them just once.
- Incremental development — breaking the problem into smaller pieces and building/testing each piece before adding the next.
Investigation helps a team understand a program's constraints and the concerns of its future users. Common investigation methods:
- Collecting data through surveys
- User testing
- Interviews
- Direct observation
- Program requirements describe how a program should function, which may include describing user interactions the program must support.
- A specification is the formal definition of a program's requirements.
- The design phase outlines how to accomplish the specification, and may include: brainstorming; planning and storyboarding; organizing the program into modules and functional components; and creating diagrams of the user-interface layout.
Design tools used before/while coding:
- Algorithms — step-by-step procedures for solving a problem.
- Pseudocode — informal, high-level description of an algorithm, not tied to any specific language.
- Flowcharts/diagrams — visual representations of a program's logic and flow.
- Prototypes — early, simplified versions used to test ideas before full development.
Documentation is a written description of how a code segment, event, procedure, or program functions and how it was developed.
- Comments are documentation written into the program for people to read; they don't affect how the program runs.
- Programs should be documented throughout development, not just at the end — this supports building and maintaining correct programs, whether working alone or collaboratively.
- Not every programming environment supports comments, so other forms of documentation may be needed instead.
- Acknowledging sources: any code segment developed collaboratively or taken from another source must be acknowledged — typically in the documentation, including the origin or original author's name.
1. What is the difference between incremental and iterative development?
Show answer
2. Before writing any code, a team sketches the logic of their program as a series of boxes and arrows. What design tool is this, and what's its purpose?
Show answer
3. A student includes a sorting function copied from an online forum in their project. What must they do to use it appropriately?
Show answer
Identifying and Correcting Errors
Even a well-designed program needs testing and debugging to work reliably across all the situations it might encounter.
| Error Type | Description |
|---|---|
| Syntax error | Violates the rules/grammar of the language (e.g. missing parenthesis); the program won't run. |
| Logic error | The program runs, but produces incorrect results because the algorithm itself is flawed. |
| Runtime error | Occurs while the program is running (e.g. dividing by zero, invalid index). |
| Overflow error | A calculated value is too large for the data type/storage allocated to hold it. |
Testing means running a program with defined inputs to check that it produces the expected outcomes; programmers use the results to revise their algorithm or program. Defined test inputs should cover the different expected outcomes, including values at or just beyond the extremes (minimum and maximum) of the input data — not just typical, middle-of-the-road cases.
Effective ways to find and correct errors:
- Test cases — predefined input/expected-output pairs used to verify correctness.
- Hand tracing — manually stepping through code line by line, tracking variable values, to find where behavior diverges from what's expected.
- Visualizations — visual representations of a program's state or execution that make it easier to spot where something has gone wrong.
- Debuggers — tools that let a programmer pause execution, step through code, and inspect variable values as the program runs.
- Adding extra output statements — inserting print statements at key points to reveal intermediate values while the program runs.
1. A program compiles and runs, but crashes only when the user enters an empty list. What kind of error is this, and what testing practice would have caught it earlier?
Show answer
2. What's the difference between a syntax error and a logic error, in terms of when each is discovered?
Show answer
3. Name three tools or techniques (besides testing itself) that can help locate the source of a bug once you know a program is misbehaving.