r/java • • 5d ago

Telltale signs of Vibecoding in Java?

Someone recently flagged one of my mods as being "obviously vibecoded" (which it wasn't), so I appealed the decision. just out of curiosity, what exactly are the signs people are seeing when accusing code of being vibecoded?

98 Upvotes

161 comments sorted by

View all comments

Show parent comment

1

u/laplongejr 3d ago

No sane human would ever write that many tests for a trivial boolean flag.

I would... along the date of the exact massive impact when the trivial change broke prod in 5 different ways.

1

u/voronaam 2d ago edited 2d ago

The fun part is that covering the codebase with trivial tests is not going to prevent things going wrong in production. But it will make the whole CI/CD pipeline a lot slower - increasing the time it takes to rollout the fix for whatever breaks production.

A developer can write a cross join SQL query (O(n*m)) and cover it will all the tests imaginable - it will blow up in production when a user makes it run against a reasonably sized dataset. If the API server is going down every time a user visits the /reports/ page and it takes 8 hours to get the hotfix the CI/CD pipeline - nobody is going to be happy.

Good unit tests are a blessing. The biggest value they provide is letting the developers refactor the troubled areas in the application with a reasonable certainty that the application's logic is still intact.

Writing a good test suite is a bit of an art - with very few practitioners even among the humans. Most developers do not like writing the tests. Most QA people are either not allowed, not capable or not paid enough to do it. Most managers just want the "line/branch coverage" report to be green against some arbitrary percentage number. With very few codebases out there having a good test suite, very few books written on the subject - what are the chances AI has in its training set anything to teach it about a good test suite?

I can share another anecdote. We recently let AI loose in one of the projects and nobody paid much attention to the tests it was writing. The AI found a flag that was set on just 3 unit tests that were starting a whole application in Docker and testing some APIs (more of an integration test written in a unit test format) - and decided to apply that flag to all the unit tests. Even a small utility method that is basically a packaged regex was tested against a fully launched application. It did not make tests any better, but it made them A LOT slower and the pipelines started to fail with out-of-memory errors. A Java application is usually memory hungry and starting literally hundreds of them in parallel just to test a single bean inside may not be the best idea ;)