Hacker News new | past | comments | ask | show | jobs | submit
Read his first point bro
AI will write tests to the level of depth that you ask it to.

Try:

    - Clearly identify the invariant being tested focus on exercising the invariant
    - High volume, low signal tests increase CI and build times
    - Avoid low signal tests; raw coverage is not the objective
    - Avoid write-then-read tests when risk is low (no transformations, no business logic in application code on write or read path)
    - Use explicit test execution [Explicit] when test code is used to exercise code in local environments only and should not run in CI
What's useful is to have a second agent that reviews the tests impartially and trim the ones that are low signal.

You also need to understand why agents write high volume, low value tests: because other ways of exercising the code (e.g. Playwright, E2E, curl) are even more expensive and not as consistent. So you have some recourse here by: 1) giving agents another way to exercise the code (e.g. provide it a REPL to your code) or 2) tell it to write some unit tests as explicit only (does not run in CI).

For our tests, we also added a small helper library[0] that cleans up tests to make them easier to read (smaller context for both humans and agents) as well as to write. Agents write average code by default. Your job as an engineer in this age is to help agents write good code.

[0] https://github.com/zeeq-ai/zeeq-biome

loading story #50447002