Skip to content
WilliamsiNFINITE edited this page Jun 24, 2022 · 38 revisions

Welcome to the Testing wiki of VariaMosPLE!

VariaMos is a tool that is continuously and incrementally built through research results into a single tool that allows engineering and simulation of systems and families of systems (Self-Adaptive).

VariaMos can be used in different roles:

Product line designer: The primary function is creating product lines and using the languages to create models. Language developer: The primary function is to create, modify or extend the capability of the languages. Core developer: The primary function is to create, modify or extend the core capabilities.

This wiki shows how to setup the developping environment to be able in particular to run the different tests for the application.

Setup

Clone directory

You can clone this repository with this command :

git clone https://github.com/WilliamsiNFINITE/VariaMosPLE.git

Npm install

To install the dependencies, run the commands :

cd .\VariaMosPLE\
git checkout origin/unit_testing
npm install

Launching Unit Tests with Jest

To run the tests related to modified files since the last commit use the command :

npm test

To run all the tests use the command :

npm test -- --watchAll

To run all the tests with coverage use the command :

npm test -- --watchAll --coverage

To specify a directory in which you want to execute the tests use the option --testMatch 'my_directory'. For example, to use the tests in /src/Addons/ use the command :

npm test -- --testMatch '**/src/Addons/**/?(*.)+(test).[tj]s?(x)'

To see more options, please visit the official documentation on the Jest website.

Launching Mutation Tests with Stryker

To run the mutation tests you can use the command :

stryker run

Mutation testing can take a while depending on the hardware, the number of tests and mutant. With my current configuration, 73 tests and 2600 mutants the running time was 4h.

To reduce the running time, try to run mutation tests on specific directory. For example, to use the mutants in /src/Addons/ use the command :

stryker run --mutate src/Addons/**/*.ts

To see more options, please visit the official documentation on the Stryker website.

Launching E2E Tests with Cypress

To run the end-to-end tests you have to start the application with the command :

npm start

Then open a new terminal in your project repository and use the command :

cypress run

To have a test with headed browser run the command :

cypress run --headed

To prevent the browser from quitting run the command :

cypress run --headed --no-exit

To see more options, please visit the official documentation on the Cypress website.

More

Click to see the configuration used for the mutation tests
 - Windows 10 Famille 64 bits
 - AMD Ryzen 7 5800H (Octo-Core 3.2 GHz / 4.4 GHz Turbo - 16 Threads - Cache 16 Mo)
 - NVIDIA GeForce RTX 3050 Ti Studio 4Go GDDR6
 - 16 Go DDR4

Full configuration

Author

Contact me for any question :

By mail

By Linkedin

Clone this wiki locally