From 27a09db07d114460b64dd51ca5d34a3624682b41 Mon Sep 17 00:00:00 2001 From: jorge Date: Sat, 27 Apr 2024 23:19:39 +0200 Subject: [PATCH 1/3] Added the testing part of the documentation, with the load testing --- docs/index.adoc | 8 +++++-- docs/src/12_testing.adoc | 23 +++++++++++++++++++ .../{12_glossary.adoc => 13_glossary.adoc} | 0 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 docs/src/12_testing.adoc rename docs/src/{12_glossary.adoc => 13_glossary.adoc} (100%) diff --git a/docs/index.adoc b/docs/index.adoc index 468be5fd..593c8bb8 100644 --- a/docs/index.adoc +++ b/docs/index.adoc @@ -93,7 +93,11 @@ include::src/10_quality_requirements.adoc[] include::src/11_technical_risks.adoc[] <<<< -// 12. Glossary -include::src/12_glossary.adoc[] +// 12. Testing +include::src/12_testing.adoc[] + +<<<< +// 13. Glossary +include::src/13_glossary.adoc[] diff --git a/docs/src/12_testing.adoc b/docs/src/12_testing.adoc new file mode 100644 index 00000000..a18efd67 --- /dev/null +++ b/docs/src/12_testing.adoc @@ -0,0 +1,23 @@ +ifndef::imagesdir[:imagesdir: ../images] + +[[section-testing]] +== Testing +Here lies a detailed description of some of the test of the application. + +=== Load testing +For load testing two different kind of test were designed. The first ones were based on the pressencce of a high number of users, across a "long" period of time. +On the other hand, the second ones were though with the idea of a big number of users arriving almost simmultaniously. + +The first ones were designed to test the application under "normal" circunstances, while the second ones were designed with an unexpected user peak in mind. + +==== Constant traffic tests +- **600 users playing as guests**: Arriving in batches of 10 users per second over 60 seconds. -> link:https://github.com/Arquisoft/wiq_en1b/files/15139283/600peopleresult.pdf[Result PDF] +- **1200 users playing as guests**: Arriving in batches of 20 users per second over 60 seconds. -> link:https://github.com/Arquisoft/wiq_en1b/files/15139356/1200peopleresult.pdf[Result PDF] +- **20 users playing normally**: Arriving in batches of 2 users per second over 10 seconds. They log in, play and check the results. -> link:https://github.com/Arquisoft/wiq_en1b/files/15139376/login.pdf[Result PDF] + +==== Burst traffic tests +- **2400 users playing as guests**: Arriving in batches of 200 people per second over 12 seconds. -> link:https://github.com/Arquisoft/wiq_en1b/files/15139644/burstguest.pdf[Result PDF] +- **1200 users playing normally**: Arriving in batches of 100 people per second over 12 seconds. They log in, play and check the results. -> link:https://github.com/Arquisoft/wiq_en1b/files/15139645/burstlogin.pdf[Result PDF] + +As we can see, in the first kind of testing, the percentage of successful requests is between 99 and 100%. However things change when moving into the second kind, with a success rate of 91% for the ones playing as a guest and 82% for the ones logging in. +Despite not being such great numbers as the other ones, this still represent a lot of successes under a very stresfull situation for our application. \ No newline at end of file diff --git a/docs/src/12_glossary.adoc b/docs/src/13_glossary.adoc similarity index 100% rename from docs/src/12_glossary.adoc rename to docs/src/13_glossary.adoc From 50710948bcaf08ed98fa4ea793cc64d6df3f67a3 Mon Sep 17 00:00:00 2001 From: jorge Date: Sat, 27 Apr 2024 23:28:43 +0200 Subject: [PATCH 2/3] Added the generator unitary tests --- docs/src/12_testing.adoc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/src/12_testing.adoc b/docs/src/12_testing.adoc index a18efd67..1f89cdda 100644 --- a/docs/src/12_testing.adoc +++ b/docs/src/12_testing.adoc @@ -4,6 +4,17 @@ ifndef::imagesdir[:imagesdir: ../images] == Testing Here lies a detailed description of some of the test of the application. +=== Generator tests +For the generator some unitary tests were developed. There are two different types. + +==== Question tests +This ones are designed to test that the questions work perfectly. This does not test whether the questions are generated properly, for that is the resposability of other tests. +They do not require to access Wikidata, since they are testing the most internal parts of our application. + +==== Generator tests +This tests are designed to test each one of the specific generators (for example, CapitalGenerator, VideogameDeveloperGenerator, DirectorGenerator, etc). As opposed to the question tests, this are focused on the correct access to Wikidata and generation of the questions. +They do require to access Wikidata, since they test how our application generates the questions, which are obtained from Wikidata. + === Load testing For load testing two different kind of test were designed. The first ones were based on the pressencce of a high number of users, across a "long" period of time. On the other hand, the second ones were though with the idea of a big number of users arriving almost simmultaniously. From b54a476a83a3a8ddd76e6e9fd2674ece6a6f4417 Mon Sep 17 00:00:00 2001 From: lauratbg Date: Sun, 28 Apr 2024 00:10:16 +0200 Subject: [PATCH 3/3] Jest and e2e test documented --- docs/src/12_testing.adoc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/src/12_testing.adoc b/docs/src/12_testing.adoc index 1f89cdda..94bfa7af 100644 --- a/docs/src/12_testing.adoc +++ b/docs/src/12_testing.adoc @@ -4,6 +4,17 @@ ifndef::imagesdir[:imagesdir: ../images] == Testing Here lies a detailed description of some of the test of the application. +=== Jest tests +These tests are used to check that all what must be rendered in a component, it is really rendered. +There must be one jest test for each React component. If there is a React component named Login.js, its should be named Login.tests.js. +As many times, to test one component we need others, we must to mock the responses from Gateway, using axios. + +=== End-to-End tests +End-to-End tests are commonly known as e2e tests and are used to simulate the user interaction with the application from start to finish, +validating its overall functionality. +They are composed of two files: the "file.feature" which has written the steps that are specified in the other file "file.steps.js". They +follow the convention of "Given-When-Then" and were done using Puppeter and Cucumber + === Generator tests For the generator some unitary tests were developed. There are two different types.