La cantidad de test no importa si el criterio es correcto ['ESP','ENG']

En el mundo de la programación muchos desarrolladores como yo en sus inicios dejamos de lado la idea de aprender a realizar test para validar los resultados de nuestras funciones, ya sea para el resultado que deben retornar u el comportamiento que deben seguir.
En este caso mostrare que una simple función puede recibir muchos test a pesar de retornar un simple valor, pero esto mismo asegura que el resultado sea el deseado.

In the world of programming, many developers like me initially left aside the idea of ​​learning to perform tests to validate the results of our functions, either for the result they should return or the behavior they should follow. In this case I will show that a simple function can receive many tests despite returning a simple value, but this also ensures that the result is the desired one.
No necesariamente se debe agregar una cantidad infinita de test, sino que cada test debe comprobar algo en específico de la función, en este caso verifica de diversas maneras que el resultado exista y que siempre sea el valor “true”, además verifica como se escribió el valor de retorno también porque al ser interpretado como binario por detrás con la computadora, el valor “true” equivale al 1. Con estos simple ejemplos de test que se verán a continuación se pueden tomar como punto de partida para asegurar que la función siempre retorne el valor esperado y en caso contrario sabremos donde debemos corregir la función.
It is not necessary to add an infinite number of tests, but each test must check something specific about the function, in this case it verifies in various ways that the result exists and that it is always the value “true”, it also verifies how it was written the return value also because when interpreted as binary by the computer, the “true” value is equivalent to 1. With these simple test examples that will be seen below, they can be taken as a starting point to ensure that the function always returns the expected value and if not, we will know where we should correct the function.


0
0
0.000
1 comments
avatar

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. 
 

0
0
0.000