Tests in the Platform
Types of Tests and Tools
The platform includes the following types of tests. For each of them, the most appropriate tool is used.
Unit tests
They are the lowest level tests. The goal of unit tests is to ensure the proper functioning of individual methods and functions of the classes, components or modules in the platform. All these tests are automated and are executed every time the project is compiled.
In the case of Onesait Platform, the following technologies are being used to implement unit tests:
JUnit, Spring Test and Mockito are used to implement the tests
For the automatic execution of the testsm Jenkins is used. Jenkins in turn uses the configuration of the project made with Maven.
Integration tests
The integration tests verify that the different modules or services used by the application work correctly together. For example, they ensure interaction with the database and verify that microservices work well together and as expected. These types of tests are more expensive to run, since they require that several parts of the application be deployed.
The execution of these tests is automated, ensuring that they are executed at least once a day. To do this, the following steps are performed:
Jenkins is used to boot an ephemeral instance of the platform using Docker containers.
Integration tests are implemented with JUnit, Spring Test and Mockito.
The automatic execution of the tests is done with Jenkins. Jenkins uses the configuration made with Maven.
Functional tests
Functional tests focus on the business requirements of the application and verify the outputs of an action without checking the intermediate states. Thus, it is verified that the user of the application obtains the correct answers when performing actions on the platform.
Sometimes, integration tests overlap with functional ones, since both require that several components interact with each other. The difference is that an integration test can simply verify that you can make queries in the database, while a functional test would expect to obtain a specific value from the database, as dictated by the product requirements.
In our case:
We use Katalon Studio to create automated platform scripts through the Control Panel.
We launch these scripts from Jenkins.
Within these tests we can talk about the integral tests, that replicate the behavior of a user with the software in a complete application environment. They also verify that different user flows work as intended, and they can be as simple as loading a web page or logging in, or much more complex, such as checking email notifications, online payments, etc.; and acceptance tests, which are formal tests carried out to verify if a system meets the business requirements.
Performance tests
Performance tests verify system behaviors when under a significant load. These tests are not functional and can have different ways to understand the reliability, stability and availability of the platform. For example, they may be observing response times when executing a large number of requests, or seeing how the system behaves with a significant amount of data.
In our case:
We use JMeter to create automated scripts that stress the platform.
The test data is stored in an Elasticsearch and can be exploited from Kibana:
We launch these scripts from Jenkins.
Smoke tests
Las pruebas de humo son pruebas básicas que sirven para comprobar la funcionalidad básica de la aplicación. Están concebidas para ejecutarse rápido, y su objetivo es ofrecerte la seguridad de que las principales funciones de tu sistema funcionan según lo previsto.
Las pruebas de humo son útiles justo después al realizar una nueva compilación para decidir si puede o no realizar pruebas más costosas, o justo después de una versión para asegurarse de que la aplicación se ejecute correctamente en el entorno recientemente implementado.
Smoke tests are basic tests used to check the basic functionality of the application. They are designed to run fast, and their goal is to offer you the assurance that the main functions of your system work as intended.
Smoke tests are useful just after making a new compilation to decide whether or not you may perform more expensive tests, or just after a version to ensure that the application runs correctly in the newly implemented environment.