TL;DR:
LLMs are great, but they’re not your safety net. Please, for the love of all things holy, test your code.
We’re in the golden age of vibe coding. LLMs scaffold our code, fix our syntax, and fill in the blanks. We’re thinking more about architecture and less about syntax—and that’s great.
But in all this abstraction, we sometimes skip something essential: testing.
LLMs Sound Right — Until They’re Not
AI doesn’t run your code. It doesn't know if that method exists, if that call will throw an error, or if that edge case breaks everything. It’s bluffing with confidence.
You can’t vibe your way through correctness. You need tests to know your code behaves the way you think it does.
Why Testing Still Matters
- 🛡 Confidence to refactor without fear
- 🧠 Clarity around what your code is supposed to do
- 🔄 Continuity when you revisit the code 6 months later
- 🤝 Collaboration with teammates who now understand the logic
Writing Useful Test Cases
A mentor once told me:
“Start at the center—your happy case. Then go left, right, and fall off the line.”
Say your function expects a positive integer. Start with 42
.
Then try:
-
0
,-1
,Infinity
,-Infinity
- A string (
"hello"
), a float (3.14
), ornull
Now take it further:
- What if the parameters are
undefined
? - What if the database call fails?
- What if the API returns malformed or missing data?
- What if a field you depend on is
null
?
The real world is messy. Your tests should be ready for that.
Final Thought
As we stop writing every line ourselves, we need to start questioning every line more. AI will get you to “working”—but testing gets you to “works when it matters.”
AI bluffs. Don’t let it bluff you into a broken release.