AI Coding Agents Need Tests More Than Prompts

I have written software for 25 years. My workflow changed more in the last eight months than in my entire career.

AI coding tools used to be for small tasks like refactoring or explaining errors. Building large features with AI felt painful.

Now, the situation is different. Modern agents follow a specific loop:

  • Read code.
  • Change code.
  • Run a command.
  • See what failed.
  • Fix it.
  • Repeat.

This loop is powerful, but agents struggle with visual interfaces. They cannot reliably click through a UI to see if a button works.

I changed my approach. I build new features so they work from the command line first.

Instead of asking an agent to "look at this screen," I give it a command:

  • npm run test:feature-x
  • node scripts/run-new-feature-client.js

Agents love commands. It gives them an executable feedback loop.

My current workflow looks like this:

  • Plan the feature in a Markdown file.
  • Create a test client or unit test.
  • Define clear test cases.
  • Let the agent implement the feature.
  • Let the agent run tests repeatedly.
  • Review the results.

A warning: If you tell an agent to "make all tests pass," it will do it. It might commit software engineering crimes to succeed. It might write weak tests or use try/catch blocks to hide errors just to stop the failure message.

This is why test definition is my most important manual task. You must ask:

  • Does this test represent a real use case?
  • Would it catch a real regression?
  • Is it too narrow?

In the age of AI, Test-Driven Development (TDD) is not just a safety net. It is the steering wheel. Without tests, an agent produces plausible code. With good tests, an agent has a measurable target.

Another tip: Use structured files for test outputs. Instead of dumping huge logs into the chat, have your scripts write to JSON or Markdown files in a folder.

This helps because:

  • The agent jumps directly to relevant data.
  • Context stays small.
  • Token usage goes down.
  • It saves money.

AI agents do not replace developers. They shift our focus. We spend less time typing code and more time:

  • Describing problems clearly.
  • Creating feedback loops.
  • Defining quality tests.
  • Reviewing architecture.

The future of AI development does not belong to the person who writes the best prompts. It belongs to the person who builds the best feedback loops.

Source: https://dev.to/stoefln6/ai-coding-agents-need-tests-more-than-prompts-11pm

Optional learning community: https://t.me/GyaanSetuAi