12 Matching Annotations
  1. Last 7 days
    1. How I Review AI-Written Code Without Reading a Single Line

      How I Review AI-Written Code Without Reading a Single Line

      • The Evolution of Test-Driven Development (TDD) [00:01:16]:

        • TDD traditionally served as a discipline to force clear thinking about the problem space (red-green-refactor loop) rather than just acting as a regression safety net.
        • Paired programming with an AI agent mirrors human collaboration, but shifting focus from granular function-level unit tests to high-level system requirements (PRDs) enables fully autonomous software development.
      • Tests as Objective Functions for Autonomous Agents [00:04:00]:

        • Language models without deterministic constraints suffer from early victory declarations, drift, and false completion signals.
        • Executable tests act as rigid objective functions: they provide deterministic stopping criteria, establish unambiguous pass/fail states, and prevent hallucinated progress.
      • Multi-Agent Orchestration & Safeguards Against Cheating [00:06:06]:

        • Work is delegated across specialized agents: an orchestrator, a dedicated tester, a coder, reviewers, and a release agent.
        • Separation of Concerns: The agent authoring tests never writes the implementation code, preventing agents from tautologically writing trivial passing tests or deleting failing assertions to force green runs [00:08:24].
        • Contract Lock-in: The orchestrator translates the PRD into an explicit test plan that requires human sign-off before any implementation begins, validating requirement comprehension early [00:07:02].
      • Behavior-First Testing vs. Low-Level Unit Tests [00:09:37]:

        • Blackbox, behavior-level tests describe end-to-end user scenarios in plain language, acting simultaneously as the specification, the test harness, and the optimization target.
        • Testing observable outcomes rather than internal structure allows autonomous agents to freely refactor and rebuild codebases without triggering false-alarm test failures caused by code movement.
        • Inverting the Test Pyramid [00:11:50]: Coarse end-to-end tests are traditionally avoided due to the human cost of diagnosing failures; however, AI agents possess infinite patience and near-zero cost to dissect, log, and isolate failure points automatically.
      • Automated Visual Verification via Demo Reels [00:13:06]:

        • Green test suites prove assertion criteria passed, but they do not confirm whether the user experience matches human expectations.
        • Critical blackbox tests run end-to-end sessions (e.g., terminal asciinema casts, headless browser recordings, or desktop captures) and automatically compile the execution into concise video demo reels attached to pull requests [00:14:01].
      • The Two-Gate Autonomous Workflow [00:15:35]:

        • Human interaction is constrained to exactly two intervention points:
          • Gate 1 (Upfront): Reviewing and approving the planned test contract derived from the PRD.
          • Gate 2 (At Completion): Watching a short video reel showing the critical end-to-end behavior before authorizing the merge.
        • All intermediate coding, debugging, refactoring, and test execution run completely autonomously in the background.
  2. Dec 2025
    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.

  3. Mar 2024
  4. Dec 2022
  5. Dec 2021
  6. Nov 2020
  7. 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.

  8. Mar 2018
  9. 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.

  10. 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

  11. Sep 2016