CSCI 370 Lec 20: Software Testing and Testable Software

Regression Testing

Test-Driven Development (TDD)

Five Stages of Testing

  1. Development Testing:

    • Includes unit testing (TDD), component testing, and system testing.
    • Focuses on finding bugs and defects.
  2. Component Testing:

    • Tests interactions between related groups of objects.
  3. System Testing:

    • Tests the entire system as a whole.
    • Focuses on component interactions and finding defects like crashes or incorrect computations.
  4. Release Testing:

    • Conducted by a separate team to validate that the system meets stakeholder requirements.
    • Types:
      • Alpha Testing: Early testing by a small group of users.
      • Beta Testing: Wider testing by a larger group of users.
      • Acceptance Testing: Final testing by customers to decide if the software is ready for deployment.
  5. User Testing:

    • Performed by end-users in their own environment.

Testing Techniques

Partition Testing

Example:

assertTrue(add(1, 2) == 3);
assertTrue(add(Integer.MAX_VALUE, -1) == Integer.MAX_VALUE - 1);
assertTrue(add(Integer.MAX_VALUE, 1) == Integer.MIN_VALUE); // Overflow test

Guideline-Based Testing

Black-Box vs. White-Box Testing

Testable Software

  1. Methods Should Return a Value:

    • Avoid void methods as they are harder to test.
  2. Predictable Results:

    • Avoid randomness in methods.
  3. Environment Independence:

    • Software should not rely on specific hardware or environments.
    • Example: Self-driving car software can be tested without a physical car.

Continuous Integration and Pipelines


Timeline Description automatically generated