D3. Test Plan

Objects, resources, and proccesses to test our product.

1. Ideal Test Plan

Unit Testing

  • Unit test frontend via Jest and React Testing Library
  • Input validation components: test inputs that should only allow numeric inputs or text inputs.
  • Calculation functions for nutritional needs formulas and formula mix calculations.
  • Data formatting and parsing
  • State management logic for product selection and formula calculations
  • User account: creation, login/logout/permissions
  • Nutritional Needs Calculator: Handling of edge cases, missing required fields
  • Formula Calculator: Correct nutritional totals calculation, mixing multiple formulas
  • Target test coverage is 80% for critical calculation logic
  • Regression testing suite that runs on every commit
  • Mock Supabase responses for isolated unit tests using Mock Service Worker or Jest

Integration and System Testing (with UI)

  • User Authentication: Flow: Login → access restricted pages → logout → verify access denied; Role-based permissions; Session persistence across page refreshes
  • Admin Panel Integration: Flow: Create/edit/bulk action product → verify in database → verify in frontend table.
  • Error Handling Testing: Invalid API responses, database constraint violations, invalid user input
  • Calculating nutritional needs of formula and comparing to patients DRI

Description of Tools Used

  • Jest 30.0: JavaScript testing framework for unit tests, integration tests, and mocking. Unit tests for frontend logic and calculations. Configuration: 80% coverage threshold.
  • React Native Testing Library: companion to Jest for testing React components. User interaction testing, component rendering, and state changes.
  • Github Actions: CI/CD automation platform. Automated workflow, regression testing on every commit
  • Automate using CI with Github Actions
  • Cypress 15.6.0: E2E testing framework. Visits application in a browser and performs actions via UI as a real user would. Tests complete user journeys.
  • Artillery 2.0.26: Load and stress testing tool. Simulates concurrent users

Description of Types of End Users

  • Daisy Dietician: Daisy is a registered dietician. She will use the Nutrient Needs calculator for pediatric patients, the Formula Look-Up for specific product types and brands, and the Formula Calculator to build custom formula mixes.
  • Alex Admin: Alex is a database administrator and will interact with the frontend to add new formula products with nutritional data to the database and edit existing products. Alex cannot access superuser-only features.
  • Sally Superuser: Sally is the system administrator and will use the frontend to add and edit formulas, review and approve pending formulas, and bulk activate and deactivate multiple formulas at once in the database.

Performance Testing

  • Load testing with Artillery

Acceptance Testing

  • Client and her colleagues will use the complete system in a staging environment. They will check that the features product accurate results and they are able to complete common workflows in a timely manner.
  • E2E testing the website using Cypress 15.6.0.

2. Actual Test Plan

Unit Testing

  • Ensure that core frontend functions and backend connections work correctly
  • Test login/logout, formula add/edit, and critical calculation functions (nutritional needs and formula mix totals, including edge cases).
  • Regression tests run via GitHub Actions on every commit.
  • Manual Testing for any complex calculation edge cases not fully covered by automated tests.

Integration and System Testing (with UI)

  • Validate that the frontend, backend (Supabase), and UI interact properly.
  • Manual testing of critical workflows: login/logout, adding/editing formulas, approving/deactivating formulas, and verifying database updates in Supabase.
  • Limited Cypress E2E tests for 1–2 major flows.

Description of Tools Used

  • Jest 30.0: Unit tests for login and formula functions.
  • React Native Testing Library: Verify core UI component behavior.
  • Github Actions(CI/CD): Automates running of unit tests on each commit.
  • Cypress 15.6.0: Limited E2E tests for 1–2 major user flows.
  • Artillery 2.0.26: Basic load test of backend performance.

Description of Types of End Users

  • Daisy Dietician: Uses nutrient needs calculator and formula lookup.
  • Alex Admin: Adds and edits formulas in the database.
  • Sally Superuser: Approves, activates, and deactivates formulas.

Performance Testing

  • Verify basic system stability under small user load.
  • Conduct a simple Artillery load test with 5–10 concurrent users performing logins and formula lookups, observing response time and system stability.

Acceptance Testing

  • Ensure the system meets client and user expectations.
  • Manual testing by client and team members to confirm feature correctness—including formula operations, nutrient calculations,and data display—and apply minor bug fixes and UI adjustments based on feedback.