This document is a procedural guide for designing test cases
and test documentation. To achieve our goal of 100% correct code, you
shall perform both black box and white box testing techniques. Using these
techniques will enable you to design
test cases that validate the correctness of the System/Module with
respect to the requirements specification. The procedure shown here
shall be used in conjunction with the requirements
specification. The group responsible for the module
should design the test cases. Due to
the ten week limit it is necessary to focus on making small steps towards
a larger goal. This will allow future students to build upon
our work. Thus, as the individual programs/modules complete unit
testing, they are integrated to build bigger and bigger pieces.
All reports shall be completed and submitted on-line.
Testing Tools are now available. The Metre-2.3 software testing tool tests for McCabe's cyclomatic complexity and path analysis. A condensed list of command line instructions are displayed at the Testing Tools link. The Metre testing tool shall be used to gather metrics for the system and unit testing.
System Testing
The System Test Plan for Prototype II is the basis of systems testing for prototype II. System test case design starts after the requirements specification is baselined. The test cases generated shall directly reflect the requirements of the functional specification. The system test case designer(s) shall design appropriate test cases to validate the correctness of the system. The black box testing techniques shall primarily be used at the system test level. This technique is a comparison of the actual output with the specified output, regardless of the structure of the code or the code unit under test.
To this end, an Equivalence Partitioning/Boundary Value technique shall be implemented. The four primary types of inputs will be:
The Equivalence Partitioning Technique is a test case selection
technique in which the test designer examines the entire input space
defined for the unit under test and seeks to find sets of input
that are, or should be, processed identically. Included in the input
space are legal situations that have both syntactic and semantic
meaning to the program, and illegal situations that are either
syntactically or semantically meaningless to it. These sets of input are
equivalence classes. Similarly, in the Boundary Value techniques,
the test designer first
identifies the range of expected inputs(e.g. equivelence classes),
then tests the input values inside and outside that range.
For example,
After each successful installation of an approved module/program, a system test will be conducted. The system test cases shall ensure the functional/specification requirements are met. Test data/cases shall be derived from the specifications.
Unit Testing
Unit test case design begins after the high level design is approved by a Peer Technical Review. The unit test cases shall be designed to test the validity of the program's correctness. White box testing will be used to test the modules and procedures that support the modules. The white box testing technique ignores the function of the program under test and will focus only on its code and the structure of that code. To accomplish this, a Statement and Condition technique shall be used. Test case designers shall generate cases that not only cause each condition to take on all possible values at least once, but that cause each such condition to be executed at least once:
The Metre-2.3 software testing tool is available to find the number of paths in a program and to find its cyclomatic complexity. Metre tests both McCabe's cyclomatic complexity and Extended complexity. When the cyclomatic complexity exceeds ten, the opportunity for coding errors increases dramatically. If this situation arises, it shall be required to re-evaluate the structure of the code in question and attempt to decrease its complexity. The extended complexity metric will give you the number of paths in the code. This will assist the designer to develop test cases that encompass all possible paths.
The measurement of cyclomatic complexity by McCabe is designed to indicate a program's testability and maintanability. It is a graph theory cyclomatic number, indicating the number of regions in a graph. As applied to software, it is the number of linearly independent paths comprising the program. As such it can be used to indicate the effort required to test a program. To determine the paths, the program procedure is represented as a strongly connected graph with a unique entry and exit point. The general formula to compute cyclomatic complexity is:
As an example, a simple program might contain two IF-THEN-ELSE
statements. The image to the right is a graphical
representation. Point A represents an entry point and the two paths of the first IF
statement. B and C represent the actions taken in the
IF-THEN-ELSE statement. B is the THEN process and C is the
ELSE process. D is the exit point of the first
IF-THEN-ELSE statement and the entry into the second. E and
F are the processes of the second IF-THEN-ELSE statement.
The second IF-THEN-ELSE statement is completed and the the
program terminates at G.
A node(n) is a point on the graph, e.g. A. An edge(e) is
the path between nodes, e.g. A-B. The disconnected point(p)
is G.
If we
count the edges, nodes, and disconnected parts of the graph,
we see:
The cyclomatic complexity metric is additive. The complexity of several graphs considered as a group is equal to the sum of the individual graphs' complexities.