SV

7-Software Testing + Evolution

Software Testing Overview

  • Purpose of Testing:
    • Show that a program does what it is supposed to do.
    • Discover defects before software deployment.
    • Testing reveals presence of errors, not absence.
    • Essential for building confidence in software correctness.

Types of Testing

  • Validation Testing:
    • Ensures software meets requirements.
    • Confirms system is fit for purpose.
  • Defect Testing:
    • Aims to discover faults in software behaviors that deviate from specifications.

Static Validation Techniques

  • Code Reviews:
    • Informal or formal; time-consuming but effective for defect removal.
  • Static Analysis:
    • Analyzes code without execution to find defects.
    • Tools often language-specific; used throughout development.

Review Process Phases

  • Pre-review Activities: Planning and preparation.
  • Review Meeting: Walkthrough by the author with the review team.
  • Post-review Activities: Address issues raised during the meeting.

Inspection Checklists

  • Designed to catch common errors based on programming specifics:
    • Data faults: variable initialization, constant naming, etc.
    • Control faults: loop termination, condition correctness, etc.

Dynamic Testing Process

  • Involves multiple stages:
    • Unit Testing: Tests individual objects/methods.
    • Component Testing: Tests groups of related objects.
    • System Testing: Tests complete systems.
    • Regression Testing: Ensures new changes don't break existing features.

Test-Driven Development (TDD)

  • Approach where tests are written before coding.
  • Promotes incremental development and ensures code passes tests before moving forward.

Software Evolution

  • Software change is necessary due to user requirements and environment changes.
  • Evolution vs. Maintenance:
    • Evolution involves implementing new features.
    • Maintenance focuses on bug fixes and minor adjustments.

Legacy Systems Challenges

  • Often rely on outdated technology.
  • Difficult to change due to lack of documentation and consistent style.

Maintenance Costs

  • Maintenance often exceeds development costs.
  • Higher complexity leads to increased costs, especially in tightly coupled systems.

Reengineering vs. Refactoring

  • Reengineering: Restructuring or rewriting to improve maintainability without changing functionality.
  • Refactoring: Continuous small improvements to prevent degradation of the software structure.