Block
A group of contiguous computer program statement that are treated as a unit.
Both
See "Condition Both"
Branch
(1). A computer program construct in which one of two or more alternative sets of program statements is selected for execution; or (2). a point in a computer program at which one of two or more alternative sets of program statements is selected for execution; or (3). any of the alternative sets of program statements in (1).
Branch Testing
Testing designed to execute each outcome of each decision point in a computer program.
Class test coverage
Class test coverage is defined as the ratio of the tested classes to the total number of classes. When one function within a class is tested, this class is considered to be tested.
Condition (predicate) coverage
Condition (predicate) coverage is defined as the percentage of both simple and compound conditions that have been tested. It is further defined as follows:
Note: Function entry points are used in calculating condition coverage, because for an executed function with no conditions, its condition coverage should be 1/1 or 100%.
Control Level
Program control is leveled. Level 1 begins from an entry of a program and ends at the end of the program. Each time that the control flow reaches a decision statement and its condition is satisfied, a new control level is begun. This new control level ends upon reaching the end of the executable part of the decision statement.
Cyclomatic complexity
Panorama uses a complexity metric adapted from cyclomatic complexity metrics. The algorithm is as follows:
Empty Segment
(1). If there is no statement between two conjunctive nodes and the second node is a label, we define that there is an empty segment between the two nodes. (2). If the statement preceding the case statement is not an unconditional escape statement, we define that there is an empty segment between the case statement label and the conditional part of the case statement.
False
See "Condition False"
High level logic
The high level logic is the table presentation of all functions or all classes within a program. The high level logic can be displayed with the detailed logic and serves as a table in the diagrams
Invisible Segment
For each decision statement, if there is no executable statement associated with the decision statement when its condition is unsatisfied, we define there should be an invisible segment next to the decision statement (e.g., any if statement lacking an else part has an invisible segment by definition.). For each repetition statement, there are two invisible segments. One of them will be executed when the program control reaches the statement but its condition is never satisfied. The other will be executed if the condition is satisfied at least once, and the program control exits the repetition body normally when the condition is no longer satisfied (vs. exiting directly from the body).
J-Coverage (Condition-Segment Coverage)
J-Coverage metric is defined as the ratio of the number of executed visible and invisible segments plus executed outcomes of conditions to the number of all visible and invisible segments plus all outcomes of conditions in a program or program module.
J-Complexity (Test Complexity)
JC0 (Block Test Complexity): Block Test complexity is defined as the minimal instrumentation points required for recording all block (visible segment) test coverage data.
JC1 (Segment Test Complexity): Segment Test Complexity is defined as the minimal instrumentation points required for recording all segment test coverage data, the value of the Segment Test Complexity is equal to the sum of visible segments (including empty segments) plus invisible segments.
JC2 (Condition-Segment Test Complexity): Condition-Segment test complexity is defined as the minimum instrumentation points required for recording all condition-segment test coverage (J-Coverage) data. The value of JC2 is equal to the sum of all outcomes of conditions in all decision statements plus all visible segments and invisible segments. J-Complexity used alone usually denotes the condition-segment test complexity (JC2).
Node
The condition part of a decision statement, an else clause, a junction such as a label, or an entry or exit point of a program unit is called a node.
Path
A sequence of instructions that may be performed in the execution of a computer program.
Path condition
A set of conditions that must be met in order for a particular program path to be executed.
Path testing
Testing designed to execute all or selected paths through a computer program.
SC0
The Basic Segment Test Coverage (also known as the Block Test Coverage). A set of test cases of a program satisfies SC0 if all nodes and visible segments of the program have been executed at least once.
SC1
The Standard Segment Test Coverage. A set of test cases of a program satisfies SC1 if it satisfies SC0 coverage and all invisible segments of the program have been executed at least once.
SC1+
The Standard Segment Test Coverage. A set of test cases of a program satisfies SC1+ if it satisfies SC1 coverage and all the low end invisible segments of the loops in the program have been executed at least once.
Segment
A sequence of computer program statements between two consecutive branch points is called a segment.
Statement testing
Testing designed to execute each statement of a computer program.
Test coverage
The degree to which a given test or set of tests addresses all specified requirements for a given system or component.
Test coverage in File-scope vs. in Program-scope
To calculate the test coverage results in File-scope, the test coverage of an element (class, block, branch, segment, condition) in a header file will be calculated separately in each source file that includes the header file. That is, a header file included in two source files will be considered as two header files in calculating the test coverage of the header file.
To calculate the test coverage results in Program-scope, an element (class, block, branch, segment, condition) in a header file will be counted as tested if this element is tested in any of the source files that include the header file. That is, a header file included in more than one source file will always be considered as one header file in calculating the test coverage of the header file.
To illustrate the difference of the test coverage results in the file-scope vs. program-scope, consider the following example in calculating the segment test coverage:
Header file a.h contains only one class, class_a, with several in-line functions and altogether 6 segments. a.h is included by two source files, 1.cpp with 10 other segments, and 2.cpp with 20 other segments. After testing, all the original code segments (not from the header file) in 1.cpp and 2.cpp are executed. In addition, 2 segments of class_a are executed in 1.cpp through its instances, 4 segments of the class_a are executed in 2.cpp, and 5 segments of class_a are executed totally in program scope because one segment is executed in both 1.cpp and 2.cpp.
For this example, we have the code segment test coverage as follows:
In file-scope:
1.cpp: 12/16 = 75%
2.cpp: 24/26=92.3%
project: 36/42=85.7%
In program-scope: (10+20+5)/(10+20+6) = 97.2%
Please refer to the attached diagram.
In a similar way, the block test coverage, branch test coverage, condition test coverage in File-scope or Program-scope can be calculated.
Transference
Any link connecting one control level with another, or a goto-like statement with the corresponding label, is called a transference.
True
See "Condition True"
Visible Segment
The maximum possible sequence of non-conditional statements within a control level is called a visible segment. The length of a visible segment between two nodes can be zero (no executable statement(s)).