11 Matching Annotations
  1. Last 7 days
    1. With TDD, you develop code by incrementally adding a test for a new feature, which fails. Then you write the “simplest code” that passes the new test. You add new tests, refactoring as needed, until you have fully covered everything that the new feature should fulfil, as specified by the tests. But: Where do tests come from? When you write a test, you actually have to “guess first” to imagine what objects to create, exercise and test. How do we write the simplest code that passes? A test that fails gives you a debugger context, but then you have to go somewhere else to add some new classes and methods. What use is a green test? Green tests can be used to detect regressions, but otherwise they don't help you much to create new tests or explore the running system. With Example-Driven Development we try to answer these questions.

      Desde que me lo presentaron, siempre me ha desagradado el Test Driven Design (TDD), pues me parecía absurdamente burocrático y contra flujo. Afortunadamente, gracias al podcast de Book Overflow, encontré un autor reconocido, John Ousterhout, creador de Tcl/Tk y "A Philosophy of software design", que comparte mi opinón respecto a escribir los test antes de escribir el código y dice que en el TDD no se hace diseño, sino que se depura el software hasta su existencia.

      Mi enfoque, que podría llamarse Argumentative Driven Design o ADD es uno en el que el código se desarrolla para mostrar un argumento en favor de una hipótesis, y las pruebas de código se van creando en la medida en que uno necesita inspeccionar y manipular los objetos que dicho código produce.

      En palabras práctica, esto quiere decir que los test y su configuración deberían hacerse cuando uno necesita hacer un "print" (para probar/inspeccionar/manipular un estado/elemento del sistema) y no antes, lo cual aumenta la utilidad, no interrumpe el flujo y responde preguntas similares a las de este apartado, respecto a de dónde provienen las pruebas y qué hacer con los resultados exitosos.

  2. Mar 2024
  3. Dec 2022
  4. Dec 2021
  5. Nov 2020
  6. Apr 2020
    1. It’s still a good idea to keep your code in three different buckets, and keep these buckets isolated from each other:Display/UI ComponentsProgram logic/business rules — the stuff that deals with the problem you’re solving for the user.Side effects (I/O, network, disk, etc.)

      How do I organize my code like this? What's the directory structure look like.

  7. Mar 2018
  8. Oct 2017
    1. Test first development, also known as Test Driven Development (TDD) is a development style in which you write the unit tests before you write the code to test.

      Actually, there's a lot of debate regarding this exact distinction. It's a question of whether Test First Programming is the same as Test Driven Development.

      The answers lie, however, into the intent of approach.

  9. Oct 2016
    1. We shouldn’t actually care what the target/action values on the bar button item are. We should only care about what happens when it is pressed. Everything else is an implementation detail

      "We should only care about what happens when it is pressed"

      We have target and action in the button, so we don't need to test for target and action separately, we can simulate the behavior instead. We shouldnt cae about implementation details

  10. Sep 2016