5 Matching Annotations
  1. Sep 2025
  2. Jul 2025
    1. Writing a new test requires more effort than examining anexisting one, mostly because you don’t write tests in a vacuum: you have to take intoaccount the underlying code. And so although I focus on unit tests, I also devote a sig-nificant portion of this book to discussing code design.

      Los tests están fuertemente unidos al diseño del código.

      Un buen "test" es un buén diseño de código

      Es como algo permeable. En el sentido que sale

    2. This is not to say that coverage metrics should take into account code paths inexternal libraries (they shouldn’t), but rather to show you that you can’t rely onthose metrics to see how good or bad your unit tests are.

      Cuando estas haciendo un test, tambien hay que tomar en consideración que por mas que testeemos librerias o modulos externos, hay ciertos hidden cases que no están en ocnsideración.

      Por ejemplo, un metodo .parse() que tienen ciertos paths que no se ven externamente. Por ejemplo, edge cases tipo: que pasa si lega un null, un string, vacio o un string muy largo

    3. igure 1.4 The branch metric is calculated as the ratio of thenumber of code branches exercised by the test suite and thetotal number of branches in the production code base

      Prompt: Que es el branch coverage y cómo se calcula?

    4. In software, entropy manifests in the form of code that tends to deteriorate. Eachtime you change something in a code base, the amount of disorder in it, or entropy,increases. If left without proper care, such as constant cleaning and refactoring, thesystem becomes increasingly complex and disorganized.

      Al pirncipio uno piensa que hacer test no es necesario, pero a medida que el sistema va creciendo los tests son una especie de safety net para los cambios introducidos en el sistema