r/java • • 11d 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?

106 Upvotes

165 comments sorted by

View all comments

150

u/repeating_bears 11d ago

Adding to what others said:

More tests than any sane human would write, LLM language in README / comments, few git commits, which are massive in size

19

u/raelik777 11d ago

The tests and LLM language are the biggest tipoff. I'm personally guilty of massive commits though, no AI required 🤣 Typically one huge commit followed by a bunch of tiny one-liners where I'm fixing shit I missed.

41

u/CorrectProgrammer 11d ago

Add to that tests no sane human would write.

20

u/DGC_David 11d ago

Lol I have seen some wild shit in tests on the enterprise level.

14

u/fluffytme 11d ago

Yeah same here. We have some legacy apps with many thousands of tests each, all hand written

8

u/shorns_username 10d ago

tests no sane human would write

You overestimate (underestimate?) humanity. Or at least, your definition of "sane" is wishful thinking.

Once saw hundreds (actually probably thousands) of tests that had been written to test every getter/setter in the app.

The code looked like something like:

public void testXxxGetYyy(){
}

Literally a bajillion test methods, to test manipulator methods... with no implementation.

And those'd been there for years before I started working on the project, which many allegedly sane humans had worked on.

9

u/Paxxi 8d ago

That's just how you get your test coverage to the magic number set by management 😂

3

u/DGC_David 10d ago

That's what I'm saying... I once saw a test that checked the Value of a const... I think the og forgot to change but idk what they were saying

5

u/paper-jam-8644 9d ago

Testing a const isn't as stupid as you might think. It prevents a one line typo from becoming a production bug, makes it two changes required to break things in two different files.

20

u/chabala 11d ago edited 11d ago

As someone who still tries to do TDD, it pains me that this is becoming the criterion.

Not that I could convince my peers to write any tests at all without LLMs doing the work for them.

20

u/hazel-blur 11d ago

I have my Agent do TDD. That however often leads to thing like

"Remove that icon"

"Ok, I first write a test asserting the absence of that specific icon..."

3

u/RiceBroad4552 5d ago

TDD was always mostly nonsense. No wonder "AI" picked it up so eagerly.

You can do TDD only when you have a fully worked out spec in hand, which is for "usual commercial development" never.

1

u/chabala 4d ago

There's nothing about TDD that requires the world's most complete spec. It's about testing for your known requirements first: keeping the design testable, deferring choices until they're required, red/green/refactor, writing the minimal code to keep tests satisfied. Nothing stops you from refining the requirements as you go.

9

u/katieglamer 11d ago

Me over here forgetting to commit for 3 weeks

10

u/agentoutlier 11d ago

I confess I use LLMs for writing tests. (mostly) Worse case it is fuzz. It can get especially crazy if you have them do mutation testing which I recommend for some tiny isolated places like a parser (again fuzz).

Also I force them not write tests just to improve coverage and I have them try to write as close to possible permutation based end to end tests where I can overlook what the inputs and outputs are.

4

u/thephotoman 11d ago

Oh, I’ve done more tests than sane humans would write by hand out of malicious compliance before.

4

u/Gwaptiva 11d ago

I am probably not a sane perdon, because unless I prompt Claude explicitly, it doesnt write tests

1

u/Urtehnoes 10d ago

Tests that just say assert true; return true;

Like OK maybe AI has reached human intelligence, because it's making tests my coworkers make!

1

u/RiceBroad4552 5d ago

Massive commits are not a telltale.

It's usual to work locally until you have everything ready, pushing stuff only to some private repo for backup reasons.

The delivered single commit is then usually a long squashed branch. Depending on task it can be pretty large.

0

u/findus_l 11d ago

The few git commit part I have seen before ai and I tell my agents to make small commits because I don't like big ones.

-9

u/emberko 11d ago

One of the things I'm grateful to AI for is that it killed the TDD shit now and forever.

6

u/space-bible 11d ago

It killed TDD?

1

u/repeating_bears 11d ago

TDD as a methodology is to write the tests before the impl, so that you learn what the interface should be, basically. There are not many people prompting an LLM to write the tests before the impl. It all gets done together. (tbf there were not many people doing "true TDD" before AI either)

→ More replies (2)

3

u/Rasutoerikusa 11d ago

? I've seen the opposite where humans write and specify tests, after which llm implements it according to it. At least I've seen a new rise in TDD in the past year

3

u/koflerdavid 11d ago

Now you actually gave me an idea. Most people don't like TDD because writing tests sucks. They prefer to write the implementation. But how about letting the LLM write tests only and thus isolate the slop to the test suite?