Unit 1
Creative Development
1.1 Collaboration
• A computing innovation includes a program as an integral part of its
function.
• Effective collaboration produces a computing innovation that reflects
the diversity of talents and perspectives of those who designed it.
• Collaboration with a diverse group helps avoid bias.
• Consultation and communication with users are important aspects of
developing computing innovations.
• Information gathered from users can help understand the purpose of a
computing innovation and help develop a program that incorporates
diverse perspectives.
• Online tools support collaboration.
• Pair programming is a common model of collaboration for
programmers.
• Effective collaborative teams must practice interpersonal skills including
communication, consensus building, conflict resolution, and
negotiation. Incorporating multiple perspectives through
collaboration improves computing innovations as they
are developed.
1.1 Collaboration
Practice Problems
1.1 Collaboration
Practice Problems
1.1 Collaboration
Practice Problems
1.1 Collaboration
Practice Problems
1.2 Program Function and Purpose
• The purpose of computing innovations is to solve problems or to pursue
interests through creative expression.
• An understanding of the purpose of a computing innovation helps
programmers better develop that innovation.
• 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.
• A code segment is a collection of program statements that is part of a
program.
• A program needs to work for a variety of inputs and situations.
• The behavior of a program is how a program functions during execution
and is often describe by how a user interacts with it.
• 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.
1.2 Program Function and Purpose
• 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.
• An event is associated with an action and supplies input data to a
program.
• Events can be generated when a key is pressed, a mouse is clicked, a
program is started, or any other defined action that affects the flow of
execution.
• Inputs usually affect the output produced by a program.
• In event-driven programming, program statements are executed when
triggered rather than through the sequential flow of control.
• Input can come from a user or other programs.
• 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.
• Program output is usually based on a program’s input or prior state
(e.g., internal values).
1.3 Program Design and Development
• A development process can be ordered and intentional, or exploratory
in nature.
• There are multiple development processes. The following phases are
commonly used when developing a program: investing and reflecting,
designing, prototyping, and testing.
• 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.
• 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.
• The design of a program incorporates investigation to determine its
requirements.
• 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.
1.3 Program Design and Development
• Some ways investigation can be performed are as follows: collecting
data through surveys, user testing, interviews, and direct observations.
• Program requirements describe how a program functions and may
include a description of user interactions that a program must provide.
• A program’s specification defines the requirements for the program.
• In a development process, the design phase outlines how to accomplish
a given program specification.
• 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.
• Program documentation is a written description of the function of a
code segment, event, procedure, or program and how it was developed.
1.3 Program Design and Development
• Comments are a form of program documentation written into the
program to be read by people and do not affect how a program runs.
• Programmers should document a program throughout its development.
• Program documentation helps in developing and maintaining correct
programs when working individually or in collaborative programming
environments.
• Not all programming environments support comments, so other
methods of documentation may be required.
• It is important to acknowledge any code segments that were developed
collaboratively or by another source.
• 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.
1.3 Program Design and Development
Practice Problems
1.4 Identifying and Correcting Errors
• Programs can have various errors, including:
Logic errors – This is a mistake in algorithm or the program that causes it to
behave incorrectly or unexpectedly. (incorrect implementation of the
algorithms, program runs but could give false results)
Syntax errors – This is a mistake in the program where rules of the
programming language are not followed. (missing parenthesis, missing semi-
colon, incorrect indentation, misspelling name of function call)
Run-time errors – This is a mistake in the program that occurs during the
execution of the program. Programming languages define their own run-
time errors. (dividing by zero, accessing out-of –bounds index of a list)
Overflow errors – This error occurs when the program attempts to handle a
number that is outside the defined range of values.
• The following are effective ways to find and correct errors:
Test cases
Hand tracing
Visualizations
Debuggers
Adding extra output statement(s)
1.4 Identifying and Correcting Errors
• When testing a program, you must identify program requirements.
• Defined inputs used to test a program should demonstrate different expected
outcomes that are at or just beyond the extremes (minimum and maximum) of
input data.
• Test cases not only test to verify that programs produce the expected outcomes;
they can be used to help programmers revise their algorithms or programs.