Skip to content

Software Quality Assurance Plan

Jordan Buchanan edited this page Nov 14, 2024 · 3 revisions

Test Plan

Our Software Quality Assurance (SQA) Plan outlines the strategy for verifying the business logic in the backend through both static and dynamic testing. It defines the unit testing approach to achieve desired test coverage and reports the actual coverage attained. Additionally, the plan includes quality assurance techniques such as integration testing, which ensures seamless backend service integration with the RESTful API.

Key components of our SQA Plan include:

  • Test Coverage Criteria: Aiming for 80% method and line coverage to ensure thorough testing of code paths.
  • Unit Testing Approach: Focused on validating individual business methods within the backend, covering various inputs, outputs, and edge cases.
  • Integration Testing: Designed to ensure that backend components (e.g., services and databases) interact seamlessly at the interface level, verifying that components work together correctly across defined boundaries.

This plan ensures that our code is robust, reliable, and fully integrated, addressing all necessary quality assurance processes throughout development.

Test Coverage Criteria

To achieve reliability and a high standard of code quality, we have set the following test coverage criteria:

  • Statement Coverage: 75%
  • Branch Coverage: 70%

These targets ensure that we test not only the code paths but also a majority of logical decisions within our business methods. We use JaCoCo to monitor and measure these metrics automatically during each build.

Unit Testing Approach

In our unit testing, we utilised JUnit and Mockito to isolate and validate the core backend logic. For example, in the case of the OrderService, we tested service methods by mocking external dependencies like the OrderRepository to simulate data retrieval and persistence without hitting the actual database. The tests were designed to cover both valid and invalid inputs, as well as edge cases such as null values and empty fields. This ensured the service handled all possible scenarios gracefully. Additionally, we applied stubbing to simulate external calls (e.g., mock repository responses) and ensure that the business logic was correctly executed, even when external components were unavailable. We focused on key business flows like order creation, order retrieval, and order validation, verifying that each function adhered to the expected behaviour and failed appropriately when necessary.

Integration Testing Approach

For integration testing, we employed Spring Boot with @SpringBootTest and MockMvc to ensure that our backend services were correctly integrated with the RESTful API. We wrote tests that exercised the full end-to-end flow, from sending HTTP requests (like POST, GET, and PUT) to the API to validating the responses and ensuring that the service layer handled the requests correctly. The tests also involved database interactions, confirming that data was properly persisted and retrieved. Additionally, we tested edge cases like invalid inputs and missing fields to check if appropriate HTTP status codes (e.g., 400 Bad Request, 404 Not Found) were returned. This allowed us to validate not only the internal service logic but also the seamless interaction between the API and the database. For example, we tested how the OrderService handled requests and ensured that it properly interacted with both the API layer and database.

Other Quality Assurance Practices

In addition to the unit and integration testing, we applied other quality assurance practices to ensure code quality and maintainability. Static verification and validation (V&V) tools were used to detect potential code defects early in the development process. These tools helped identify issues related to code formatting, variable naming, and unused imports, ensuring that the code met predefined quality standards.

We also followed coding conventions and best practices, including maintaining clear and concise code, modularizing functionality, and keeping methods focused on a single responsibility. These practices helped ensure that our codebase remained maintainable and understandable for the entire development team.

Furthermore, we conducted peer code reviews using Git to maintain high code quality. All pull requests were reviewed before merging, allowing team members to catch issues early and share feedback. This peer review process promoted collaboration and helped us maintain consistent coding standards across the project.