Stop Vibe Coding Your Unit Tests
Postedabout 2 months agoActiveabout 2 months ago
andy-gallagher.comTechstory
calmpositive
Debate
20/100
Unit TestingSoftware DevelopmentTesting Best Practices
Key topics
Unit Testing
Software Development
Testing Best Practices
The article 'Stop vibe coding your unit tests' discusses the importance of writing rigorous unit tests, and the discussion revolves around the value of comprehensive testing, particularly in exception handling.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
56m
Peak period
1
0-1h
Avg / period
1
Key moments
- 01Story posted
Nov 5, 2025 at 12:07 PM EST
about 2 months ago
Step 01 - 02First comment
Nov 5, 2025 at 1:03 PM EST
56m after posting
Step 02 - 03Peak activity
1 comments in 0-1h
Hottest window of the conversation
Step 03 - 04Latest activity
Nov 5, 2025 at 1:03 PM EST
about 2 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45825216Type: storyLast synced: 11/17/2025, 7:53:46 AM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
In Java I find agents write a lot more tests than I do, particularly agents will write tests that exercise each and every exception handling path. The code might throw an AException or a BException or a CException and I guess it is good to test that case B happens and throws a BException and I guess it means you get better logging but in the end the important thing is that when unhappy case B happens some Exception is thrown. Tests like this are likely to break when you change the implementation and waste some time but these aren't too hard to live with.
For one system I work on though, React tests are already disastrous, we're still running an older version of React where the framework can't really know when the component is done updating itself so adding a test can add seconds to the build multiplied by all the times I'm going to build. I am happy writing tests for functions that are really functions but until we get our React updated (update all our dependencies, many of which are no longer maintained, to use React 17+) I can't really test components so I don't want an agent writing tests or running tests if components are involved. It's not the fault of the AI, it's the fault of test infrastructure that sucks.