Error & Defect Detection


LDRA Testbed provides extensive error and defect detection facilities. When detected, such faults in the code can be removed, thus reducing the risk of software failure and improving quality.

What are the benefits?

  • Increases efficiency by identifying and eliminating unnecessary and unused code
  • Enables lower maintenance of systems as anomalies, errors and defects are identified
  • Provides better understanding of the system
  • Monitors adherence to quality standards
  • Determines and documents system complexity

What defects are detected?

Unreachable code. There is no path to the code. In general the code can be removed with consequent gains in efficiency, maintainability, readability and reduced system complexity.

Dead statements. These statements do not affect any outputs, even though they are reachable. Such statements can, in general, be removed from the code with consequent gains in quality, efficiency and maintainability.

Infeasible paths. These are paths that cannot be executed by any input data. This is usually caused by contradictory conditions existing on that path. LDRA Testbed identifies many of these infeasible paths. The code can be rewritten, removing the paths, with consequent gains in code efficiency, compactness and quality.

Uninitialised variables. These variables are used before they are given a value. Such errors are very common and their removal usually results in significant increases in reliability.

Unused variables. These often result from maintenance processes or errors. LDRA Testbed highlights them for removal, resulting in more compact code.

Unused labels. These are often present after maintenance processes or due to an error. Again they can be safely removed.

Logic errors. Executing every statement, branch and LCSAJ will reveal most logic errors.

Condition errors. LDRA Testbed highlights the options in complex conditional expressions, which have not been tested. When all the options have been tested the possibility of residual errors is small.

Variables used only once. All occurrences of variables used only once are listed. These may be variables that are initialised and never referenced, or variables that are referenced without being initialised. In general they can be removed.

Variables with unused values. Variables whose values are never acted upon arise from poor coding practice or errors.

Incorrect variable dependencies. LDRA Testbed indicates the dependency of each output variable on the input variables. This enables programmers to detect incorrect dependencies.

Programming standards. A wide class of programming standards are checked and violations reported. Many of these standards violations may be due to errors.

Errors in structure. Poor structuring frequently arises from control flow errors. LDRA Testbed highlights these areas for re-structuring.

Procedure parameter faults. LDRA Testbed reports cases where input parameters are not used within the procedure, and where the parameters are assigned a value on some paths but not all.

Values returned by functions. LDRA Testbed detects any paths through a function body which fail to return a value, and reports upon such defects.

Multiple procedure entry or exit points. These frequently arise from careless programming and can give rise to errors, particularly during maintenance.

Global variable misuse. For example, variables passed as parameters to a procedure and then used within that procedure.

Undefined pre-processor variables. These are flagged in languages with pre-processor facilities.