Testing and the importance of its planning

Anderson Ariza, development analyst

It is very common for developers to think that their code is error-free since they wrote it themselves. Somewhere in the process, they tested two or three cases that did not fail, but in reality, these small tests are not enough to ensure the correct operation of the solution, since most of them analyze the so-called “happy path”, the option in which everything happens correctly, so it is necessary to resort to formal development tests.

These tests are divided into four types, mentioned below, from the simplest to the most complex, respectively: unit, integration, system, and situation. The complexity of implementing such tests depends on the situation, the type of development, the methodology, and the available resources.

For example, starting unit testing on a development that has been running for three months would last approximately one person’s full time for a couple of weeks. Besides, it could generate delay when the need to change code arises, due to an unhandled failure, which, after all, is extra time and money. Hence the importance of defining in time, what tests will be carried out on the solutions.

Next, I will explain two types of tests that have a lesser degree of difficulty but that, when carried out, will give a high degree of certainty of the operation of software development. They are unit tests and integration tests.

UNIT TESTS

The purpose of this type of testing is to ensure that each component of the system works in isolation, that is, that operations are performed properly, that it receives only the types of parameters defined, that it responds correctly and that it fails when it should fail.

The purpose of this type of testing is to ensure that each component of the system works in isolation, that is, that operations are performed properly, that it receives only the types of parameters defined, that it responds correctly and that it fails when it should fail.

It is important to spend enough time validating the largest number of successful and failed execution cases to have more certainty of the code to test. These tests are limited to specific code blocks, therefore, their coding is simple, but given the need to perform it on many of these blocks, in “large” developments it takes a long time.

The recommendation is to do them immediately on the new code made so as not to accumulate technical debts that in the future may affect delivery times.

To know a little more about unit tests visit: http://softwaretestingfundamentals.com/unit-testing/

INTEGRATION TESTING

Its purpose is to ensure that the previously tested components, in isolation, work well with each other, that is, that they interact correctly in the sending and receiving of requests, validating that they are executed and that the responses generated are appropriate. Again success and error cases are validated to make sure that contingency methods work.

Its execution takes a little more time since it is necessary to lift the application context, since the integration tests also validate calls to the requests to the databases, using as a starting point the Endpoints defined in the rest of the services, therefore, it is important to integrate the security management implemented in the development into the tests.

To know more about integration tests visit: http://softwaretestingfundamentals.com/integration-testing/

Although unit and integration tests are not all that must be carried out on a system to ensure its operation, they are a good start since these will give you a solid base that will allow you to be certain of the development carried out. It is important to start planning how and when your development will start.