CTO AI Corner: How to make production-quality code with AI?

Not all AI enhanced development is vibe coding without quality assurance. You can get the performance boost from AI without compromising quality. But how?

The simplest way is for the developer to read and understand all AI-generated code. Reading is still faster than writing, so this is a valid option. But in practice, it's not enough and often leads to more defects. Developers may not catch edge cases they would have thought of while writing the code themselves. AI might also break existing functionality without anyone noticing. That said, reviewing AI code is a skill and improves with experience.

So what else can we do?

Tips for maintaining quality in AI enhanced development

Start with solid tests. At minimum, have good unit test coverage to catch regressions quickly. Even better, try test-driven development with AI. It’s much easier to specify corner cases and use cases this way. If the AI-written code passes well-designed tests, you can trust it more. Maybe still review it, but you won’t need to overthink every line.

Next, use integration and end-to-end tests. Unit tests catch simple bugs, but integration and E2E tests catch complex regressions and protect business-critical flows. AI can help here too, especially with scripting tests, making it easier to scale automation.

Static analyzers are another useful tool. They catch common issues like unused variables, bad formatting, or basic security flaws. They’re cheap and effective for early feedback.

You can go further with AI agents. We have used them as dynamic analyzers in several projects. They catch issues missed by tests and static tools. The key is focus. One agent checking for XSS or privilege escalation works better than one trying to cover the whole OWASP Top Ten.

What about human testing? It’s great if you have testers, but they still need to know what changed. If developers didn’t write the code, can they explain what to test? AI can help track which user-facing features were affected and which UI modules use the changed code. This can make manual testing even more targeted than before.

June 13, 2025
Authors
Tomi Leppälahti
Share

Pohdituttaako AI-​asiat? Jätä viesti ja kartoitetaan yhdessä, miten ja missä hyödyntää tekoälyä.

Kiitos viestistäsi! Olemme pian yhteydessä.
Hupsis! Jotain meni pieleen lomakkeen lähetyksessä.