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.
![](https://images.hive.blog/DQma1BeKiFDdXBoXRh9zhxFDK8aMX2FBDdbyGw9pmZhXiho/match.jpg)
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.
![](https://images.hive.blog/DQmXwn9T8e36ebKYfhxTajzgh1Y4iySaDVr3aT53pCkk8AP/match1.jpg)
0
0
0.000
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.