forked from Arquisoft/wichat_0
-
Notifications
You must be signed in to change notification settings - Fork 0
docs: 📝 Add testing documentation #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| [[section-testing]] | ||
| == Testing Strategy and results | ||
|
|
||
| ifdef::arc42help[] | ||
| [role="arc42help"] | ||
| **** | ||
| .Contents | ||
| This section describes the project's testing approach and results, and how quality requirements are verified through testing. | ||
|
|
||
| .Motivation | ||
| Testing ensures the system meets its functional and non-functional (quality) requirements, increases maintainability, and reduces risks. | ||
|
|
||
| .Form | ||
| Describe test strategies for different levels (unit, integration, E2E, etc.), tools used, and how testing supports quality attributes like performance, robustness, and usability. | ||
|
|
||
| **** | ||
| endif::arc42help[] | ||
|
|
||
| [cols="1,3"] | ||
| |=== | ||
| |Type of Test | Description | ||
|
|
||
| |Unit Testing | ||
| |Each module (mainly utility and core logic functions) is covered by unit tests using *Jest*. Unit tests ensure that individual components behave as expected in isolation. Code coverage is enforced via sonarQube to remain above *80%*, and code duplication below *3%*. Mocking is used for external dependencies. | ||
|
|
||
| |End-to-End Testing | ||
| |E2E tests are implemented using a BDD approach with *.feature* files and step definitions (*.steps.js*), following the Gherkin syntax. This allows tests to be written in a human-readable form closely aligned with user stories and acceptance criteria. | ||
|
|
||
| Tests are executed using *Jest* as the runner, configured via `jest_config.js`. The `test_environment_setup` script ensures that all required services (e.g., gatewayservice, gameservice, questionservice...) are initialized and cleaned before and after test runs. | ||
|
|
||
| Our E2E workflows include: | ||
|
|
||
| - Signing up and logging in correctly | ||
|
|
||
| - Starting a game and completing a full session | ||
|
|
||
| - Interacting with leaderboards and user statistics | ||
|
|
||
| Tests are automatically run in every new release via a github action, and are kept up to date with each feature release to ensure no regressions. Browser-level interactions are simulated through a headless environment or Puppeteer/Playwright depending on the test scenario. | ||
|
|
||
| |Load Testing | ||
| |As described in the load testing results section, at section 10 quality requirements (as they direcly prove or disprove our quality requirements, that is the best location for them following official arc42 documentation), load testing is conducted using *Gatling* and focused on critical endpoints: login, game creation, game results saving, and user statistics. Results confirm that the application supports *up to 485 concurrent users* with only minor latency. Load test scripts and results are stored in `docs/loadtesting`. | ||
|
|
||
| |Real User Testing | ||
| |Real user feedback was encouraged and requested at some points, recruiting a set of testers with different degrees of software engineering knowledge. All of them were asked to submit their findings, data that was collected and summarized link:https://github.com/Arquisoft/wichat_en1a/wiki/feedback-for-v1.0.9[here]. Almost all of the submissions by the users were solved upon the new release of v2.0.0. | ||
|
|
||
| |=== | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mentioned E2E workflows appear with a strange format. This happens because you are trying to create a list/enummeration inside a table row. Try looking for a better format for this!