Skip to content

Commit

Permalink
Merge pull request #157 from Arquisoft/131-apartado-de-tests-en-docum…
Browse files Browse the repository at this point in the history
…entación

131 apartado de tests en documentación
  • Loading branch information
CANCI0 authored Apr 28, 2024
2 parents 4e47e2e + b0c4e82 commit 92ebab9
Show file tree
Hide file tree
Showing 103 changed files with 17,210 additions and 80,457 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ services:
- prometheus_data:/prometheus
ports:
- "9090:9090"
depends_on:
depends_on:
- gatewayservice
restart: always

Expand Down
Binary file added docs/images/12-grafana-loadtests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/12-loadtest.png
Binary file not shown.
Binary file added docs/images/12-loadtests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/12-script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 16 additions & 11 deletions docs/src/12_testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ This section details the results of the various types of tests that have been ca

We used Jest to perform unit testing on the application. We have written tests for all the components of the application, mocking the database and external services. All the tests passed successfully. The results of the tests are shown below:

=== Auth service
==== Auth service
image::12-authservice.png[]

=== User service
==== User service
image::12-userservice.png[]

=== Gateway service
==== Gateway service
image::12-gatewayservice.png[]

=== Stats service
==== Stats service
image::12-statsservice.png[]

=== Webapp
==== Webapp
image::12-webapp.png[]

== e2e Testing
=== e2e Testing
We used puppeteer to perform end-to-end testing on the application. We have written tests for login, register, create group, and for the three gamemodes.

image::12-e2e.png[]
Expand All @@ -40,7 +40,7 @@ We used some tools to measure usability levels of the application, along with so

First, we will show the automatic tools results:

===== PageSpeed Insights:
==== PageSpeed Insights:

This tool is used to measure different aspects of a certain page, such as performance, accessibility, best practices and optimisation.
We used this tool on all of our pages, and the results were kind of similar. Below, the results for the Classic and Stats page are shown:
Expand All @@ -52,7 +52,7 @@ image::pagespeed-classic.png[]
As we can see, our pages perform very nicely on every evaluable aspect, except in Best practices, and that's because the tool is giving us a
warning because we don't use HTTPS in our application, which can lead to security issues.

===== Juicy Studio:
==== Juicy Studio:
This tool is used to measure the contrast between background and foreground colors of a web page.
We used this tool on both of out color combinations: dark mode and light mode. The results are shown below:

Expand All @@ -62,7 +62,7 @@ image::juicy-dark.png[]

As we can see, both of our themes use correct and high-contrasted color combinations.

==== Testing with real users:
=== Testing with real users:

We did some testing with 18 people, all of them being friends and family of us, the develpoment team.
We let them try the application, play games, view their stats, create groups, etc., and when they were
Expand Down Expand Up @@ -90,8 +90,13 @@ We should also consider improving our UI, maybe studying design tendencies and t
=== Load Testing
We used Gatling to perform load testing on the application. It consisted of simulating 1000 users accessing the application at the same time, each of one performing 83 requests. The results of the test are shown below:

image::12-loadtest.png[]
image::12-script.png[]
Using this script we inject 2 users per second during 60 seconds in total, and each user performs 83 requests. The test was successful, and the results are shown below:

As we can see in Gatling's report, the application was able to handle a load of 70868 requests. In particular, 81% of the requests were successful in less than 800 milliseconds, 6% in more than 1200 milliseconds and 13% were unsuccessful.
image::12-loadtests.png[]

image::12-grafana-loadtests.png[]

As we can see in Gatling's report, the application was able to handle a load of 9990 requests. In particular, 97% of the requests were successful in less than 800 milliseconds and 3% were unsuccessful.

This shows that the application is able to handle a large number of requests in a short period of time, with a high success rate. We can also be sure that the application is able to handle a large number of users accessing it at the same time in production.
Loading

0 comments on commit 92ebab9

Please sign in to comment.