Testing & Quality Assurance - tj0vtj0v/KI-B-4-Software_Engineering GitHub Wiki

This chapter outlines the processes and standards implemented to ensure the software’s quality, correctness, and reliability throughout development. The testing approach includes module and integration tests, executed bottom-up. All tests are designed as black-box tests, aiming for a C0 code coverage of at least 90%.

Testing Procedure

Testing is structured around three core categories:

  1. Equivalence Classes
    Verify that typical, valid inputs within defined ranges produce the expected behavior.

  2. Edge Conditions
    Exercise boundary and special-case values to confirm the system handles extremes and limit scenarios gracefully.

  3. Invalid Input
    Supply out-of-range or incorrectly typed inputs to ensure robust error handling and validation.

Setup and Teardown

  • Before Each Test
    Establish a controlled environment by initializing test data, configuring required resources, and resetting any modified settings. This ensures each test starts from a known, consistent state.

  • After Each Test
    Clean up all artifacts by removing or resetting test data, releasing allocated resources, and restoring configurations. This prevents residual side effects from affecting later tests.

All tests are written using pytest and are executed automatically within the CI pipeline.

Quality Assurance Measures

To uphold high standards of code quality and maintainability, the project employs:

  • Test Coverage
    Enforce a minimum of 90% coverage, aiming for 100% where practical.

  • Automated Testing
    Execute all test suites via pytest in every CI build to detect regressions early.

  • Coverage Monitoring
    Collect metrics with coverage.py and enforce thresholds using GitHub Actions.

  • Code Style & Linting
    Maintain consistency and catch potential issues with flake8.

  • Static Analysis
    Leverage mypy and pylint to identify type mismatches and logic errors at development time.

  • Peer Review
    Require every merge request to undergo thorough review by team members for clarity, correctness, and adherence to standards.

These measures collectively ensure that the project remains robust, maintainable, and free from regressions.