Skip to content

Testing Strategies

Arda edited this page Dec 3, 2024 · 6 revisions

General Testing Plan

The general test plan for the project includes the following testing strategies:

  1. Unit Testing: Individual components will be tested in isolation as they are being developed to ensure they function as expected. Mock data will be used to simulate external dependencies where necessary.

  2. Integration Testing: The interaction between different modules and components will be tested to verify their proper integration and ensure data flows correctly across the system with mock data. This testing will be implemented as two features that interact with each other is developed.

  3. Mock Data: Mock data will be used during testing to simulate real-world inputs and edge cases, ensuring the application performs as expected under various scenarios.

  4. Regression Testing: After each change to the main branch, existing features will be re-tested to ensure new modifications don’t negatively affect the system.

  5. End-to-End Testing: Complete workflows will be tested from start to finish in the last weekend of the last Customer Demo to ensure the product functions as a whole in real-life usage scenarios.

  6. Performance Testing: The system's and external API's responsiveness and stability will be evaluated under load to ensure scalability and reliability.

This strategy aims to ensure comprehensive coverage and quality assurance at all levels of the development cycle.

Backend

Unit tests are widely used for almost every endopoint we have implemented. For most of the endpoints, we write the unit test after the implementation of that endpoint, which is a very straightforward method. On the other hand, for a few endpoints we have tried to write the tests before the implementation, resulting in test driven implementation. Both methods have been helpful in testing and developing safe endpoints.

The tests can be found under ./backend/core/tests

image

Integration tests are a crucial step in our testing strategy. While unit tests focus on individual components or functions, integration tests verify that multiple components work together as expected. For our endpoints, integration tests ensure seamless interaction between various modules of the backend and, where applicable, the database or external services.

UAT (User Acceptance Tests) are the final step for the testing phase for each endpoint. After the implementation and integration of each endpoint, we have tested if they serve their purpose as expected. We approach as a user to test the application if everything works as intended.

Frontend

Unit tests are only effective in areas without dependencies on external systems. Since most frontend functionality is tightly coupled with either the server or browser APIs, we focused on testing vanilla TypeScript utilities, such as relative date calculations, number differences, pluralization, and similar isolated functions.

We have chosen Vitest as our testing framework because it is versatile and built on top of our module bundler, Vite. Its clear and intuitive API, combined with its seamless integration with our existing tools, makes it a great choice.

The tests can be found under ./client/src/tests

CleanShot 2024-11-27 at 19.42.02@2x

Mobile

As stated in the frontend section; the unit tests are only effective in areas without dependencies on external systems and since most mobile functionality is tightly coupled with either the server or browser APIs, we focused on testing vanilla TypeScript utilities, namely a function combining the different types of hints fetched from the backend.

The tests can be found under ./mobile/app/tests

Here is a sample test result from the CLI using Vitest:

Screenshot 2024-11-27 at 21.25.31

BOUNSWE2024 - G11

Logo Turquiz App

⏳ Status

DONE

🧑🏼‍💻 Team

📝 Diagrams

📆 Lab Reports

📆 Meeting Notes

📍 Milestones

📎 Planning

📚 User Scenarios / Stories

📚 Resources

🔎 Research

🗂️ Templates

Clone this wiki locally