Terms from Chapter Five: Conditions, Logical
Expressions, & Selection Control Structures.
Flow of control
The order in which the computer executes statements in a program.
Control structure
A statement used to alter the normally sequential flow of control.
Selection statement (if, if-else, switch in C++)
An instruction for choosing between alternative actions.
switch statement (C++)
A selection control structure that allows us to list any number of alternatives.
Logical (Boolean) expression
An expression which evaluates to true or false.
Boolean variable (sometimes called a "flag")
A variable whose value is true or false.
Relational operator
An operator which tests the relationship between two values. (<,>,==,!=,<=,>=
in C++)
Logical operator
An operator which takes logical expressions as operands. (AND, OR, NOT)
Precedence rules
Rules which govern which operators (among arithmetic, logical, relational,
assignment) have higher priority than which others.
Block (aka Compound Statement)
A sequence of one or more statements which the compiler treats like a single
statement. (In C++, a set of instructions embraced by { and } represent
a block.)
Nested if statement
An if statement in which the if clause contains an if statement.
Dangling else
An else which follows a nested if-then and may be attached to the nested
if by the compiler.
PreCondition
A condition which must be met in order for a module to execute correctly.
PostCondition
A condition that should be true after a module has executed if the module's
pre-conditions have been met.
Programming-by-contract
Assuring the user of a subroutine that it will meet its post-conditions
if its pre-conditions have been met at the time the subroutine is invoked.
Top-down testing
Testing the high level design of a program to ensure its correctness by
stubbing lower level subroutines to "fake" their functionality.
Stub (a "dummy" subroutine)
A subroutine whose functionality is being faked (often by writing out a
statement of what the subroutine is supposed to have accomplished) for
the purposes of top-down testing.
Bottom-up testing
Testing a low level subroutine by writing and executing a driver to test
its functionality.
Driver
A program whose sole purpose is to test the functionality of a subroutine.