Software Quality Standards - bounswe/bounswe2024group1 GitHub Wiki

General Software Quality Plan

The following are the standards we implement to ensure code quality and adherence to business requirements.

CI/CD Workflow

  • Frontend CI: This workflow is triggered on every push to the frontend directory or changes to the CI configuration file. It ensures code quality by doing the following:

    • Installing dependencies with yarn install --immutable to ensure that an accurate yarn lockfile has been committed
    • Runs the formatter and linter to ensure formatting and linting rules have been followed.
    • Executes unit and integration tests using Vitest to ensure that acceptable code has been committed.
  • Backend CI: This workflow is triggered on every push to the backend directory or changes to the CI configuration file. It does the following:

    • Executes Backend unit tests to ensure that acceptable code has been committed.
  • PR Validation: Ensures that pull requests to the main branch are only allowed from the develop branch. This is a common mistake we experienced during last semester and the start of this semester, this particular CI workflow has saved us multiple times from the same mistake.

Frontend Software Quality Plan and Standards

This document outlines the software quality plan and standards used in the frontend development of our Programming Languages Forum project. It covers our CI/CD processes, testing strategies, linting and formatting standards, and Git hooks setup.

Continuous Integration/Continuous Deployment (CI/CD)

Our CI/CD pipeline is designed to ensure code quality and facilitate smooth deployments. We use GitHub Actions to automate our CI/CD processes. Please refer to

Testing

We use Vitest for unit and integration testing, ensuring our components are robust and reliable.

  • Accessibility Testing: We use vitest-axe to perform accessibility checks, ensuring compliance with WCAG 2.1 Level A standards.

Linting and Formatting

We enforce code quality through linting and formatting tools:

  • ESLint: Used for identifying and fixing problems in JavaScript code.
  • Prettier: Ensures consistent code formatting across the codebase.

Git Hooks

We use Husky and lint-staged to enforce code quality before commits:

  • Husky: Manages Git hooks to run scripts before certain Git actions.
  • Lint-staged: Runs linters on staged files before committing.
"hooks": {
  "pre-commit": "lint-staged && tsc"
}
  • These hooks also run the tests