Software Quality Assurance: Testing Methodologies

Software Program Testing Essentials

  • Testing aims to demonstrate that a program functions as intended and to uncover defects before deployment.
  • Software testing involves executing a program with artificial data.
  • Results are checked for errors, anomalies, or insights into the program’s non-functional attributes.
  • Testing can reveal the presence of errors, not their absence.
  • It is a crucial part of the broader verification and validation (V&V) process, which also incorporates static validation techniques.

Validation and Defect Testing

  • The first goal leads to validation testing:
    • The system is expected to perform correctly using a set of test cases that reflect its expected use.
  • The second goal leads to defect testing:
    • Test cases are designed specifically to expose defects. These test cases can be deliberately obscure and do not necessarily reflect normal system usage.

Verification vs. Validation

Verification:
“Are we building the product right?”
Ensures the software conforms to its specification.
Validation:
“Are we building the right product?”
Ensures the software fulfills the user’s actual requirements.

Software Inspections and Testing

  • Software Inspections: Concerned with the analysis of the static system representation to discover problems (static verification).
    • May be supplemented by tool-based document and code analysis.
    • (Further details discussed in Chapter 15.)
  • Software Testing: Concerned with exercising and observing product behavior (dynamic verification).
    • The system is executed with test data, and its operational behavior is observed.

Complementary Verification Techniques

  • Inspections and testing are complementary, not opposing, verification techniques.
  • Both should be utilized during the Verification and Validation (V&V) process.
  • Inspections can verify conformance with a specification but cannot confirm adherence to the customer’s actual requirements.
  • Inspections are unable to check non-functional characteristics (e.g., performance, usability).

Development Testing Stages

Development testing encompasses all testing activities performed by the system development team, including:

  • Unit Testing: Individual program units or object classes are tested. Focuses on the functionality of objects or methods.
  • Component Testing: Several individual units are integrated to create composite components. Focuses on testing component interfaces.
  • System Testing: Some or all components are integrated, and the system is tested as a whole. Focuses on testing component interactions.

General Testing Guidelines

  • Choose inputs that force the system to generate all error messages.
  • Design inputs that cause input buffers to overflow.
  • Repeat the same input or series of inputs numerous times.
  • Force invalid outputs to be generated.
  • Force computation results to be too large or too small.

Component Testing Focus

  • Software components are often composite, comprising several interacting objects.
    • For example, in a weather station system, the reconfiguration component includes objects that handle each aspect of the reconfiguration.
  • Functionality of these objects is accessed through the defined component interface.
  • Testing composite components should therefore focus on demonstrating that the component interface behaves according to its specification.
    • It is assumed that unit tests on the individual objects within the component have been completed.

Interface Testing Objectives and Types

  • Objectives are to detect faults stemming from interface errors or invalid assumptions about interfaces.
  • Common Interface Types:
    • Parameter Interfaces: Data passed from one method or procedure to another.
    • Shared Memory Interfaces: A block of memory is shared between procedures or functions.
    • Procedural Interfaces: A sub-system encapsulates a set of procedures to be called by other sub-systems.
    • Message Passing Interfaces: Sub-systems request services from other sub-systems.

Common Interface Errors

  • Interface Misuse: A calling component makes an error in its use of the called component’s interface (e.g., parameters in the wrong order).
  • Interface Misunderstanding: A calling component embeds incorrect assumptions about the behavior of the called component.
  • Timing Errors: The called and calling components operate at different speeds, leading to access of out-of-date information.

System and Component Integration Testing

  • During system testing, reusable components (separately developed) and off-the-shelf systems may be integrated with newly developed components. The complete system is then tested.
  • Components developed by different team members or sub-teams may be integrated at this stage. System testing is a collective, rather than an individual, process.
    • In some organizations, system testing may involve a separate testing team with no direct involvement from designers and programmers.