Software Engineering
Home Planning Requirements Writing Hazard Analysis Requirement Analysis Config Control Software Design Software Testing Software Standards Basic Logic

Software Testing - Black Box Methods

Which Method to Choose?

No one method can find all types of defects, so be sure to use all methods when designing tests. Some methods are better at finding certain types of errors than other methods. Using all methods will ensure the best possible test coverage.

Path Analysis, Requirement Based

This method tests each of the basis paths in a program. Flow chart the decision logic of a process or requirement, and test each decision option. The flow chart is based on the logic that is evident in the written software requirement. Path analysis is well suited to finding logic errors, but is poor at finding mathematical errors (like mis-coding an equation). Advantages of path testing are:

  • Powerful: a relatively small number of tests finds most of the defects.
  • Objective: different people using the technique will agree on the number of tests required.
  • Defines equivalence tests fairly easily.
  • Easy to apply if specifications include flowcharts, decision tables or some equivalent decision-based form.

Functional Analysis

Functional Analysis creates tests based on these questions:

  • What major functions must the system provide?
  • What outputs must be produced in order to fulfill these functions?
  • What input data is required in order to produce the outputs required for each function?

Transaction Flows

Identify inputs to a system, predict the end results and test to verify that these results do in fact occur. This method is best at finding mathematical errors.

Define Equivalence Classes

An "equivalence class" is defined as the class of all inputs that are expected to produce the same output. For each input, identify the range of values over which system behavior will be the same. Test one representative value within each range and assume that its result correctly predicts the results for all other values in that same range. This method is used primarily to eliminate redundant tests.

Boundary Testing

Test at the boundaries of a range as well as somewhere in the center. This is also used to test loop termination conditions. This method is well suited to finding off-by-one errors. Integer boundaries are easy to test, but with floating point numbers it becomes less precise. Because of round off errors, the best way to do a boundary test on a floating point value is to allow a fractional error and test for a "greater than" or "less than" condition. NEVER test for an Equal condition when using floating point numbers!

Exception Handling and Error Messages

Identify error messages and exceptions and the conditions that will trigger them. There are many different uses of the term "exception," especially to a C++ programmer. For testing purposes, the definition is:

A error condition that occurs naturally, in the absence of a system failure or software defect. For example, a printer running out of paper creates an error condition, even though there has been no failure and there is no defect.

Stress Testing

Identify the limits of the system and test what happens when pushed to and beyond the limits.

Event Partitioning

In event driven systems, or in systems with more than one input, freeze or stabilize selected variables and isolate various events from each other, providing a simpler set of initial tests. The advantage of event partitioning is that the test results are clearly caused by a single, repeatable event.

Negative Testing (Fault Insertion).

Testing the performance under various error conditions, such as missing files, invalid values. Whether or not such faults can occur is not relevant - assume that they have occurred and perform the test. NOTE: Most Type I errors are caused by a failure to perform negative testing.