- Published on
How Vibe Coding is Changing Software Design Patterns
How Vibe Coding is Changing Software Design Patterns
by Timothy Coleman - 30/May/2025
This post was: Narrated then 'tidied' by AI
Setting the Scene
I’ve been practising software engineering for over a decade, and lately I’ve been reflecting on how “vibe coding” - letting an AI pair-programme while I steer - reshapes my day-to-day workflow. In particular, it makes test-driven development (TDD) feel less like an optional discipline and more like an essential safety net.
Why AI-First Coding Raises the Stakes
Traditional coding already benefits from TDD, but AI-generated code introduces fresh uncertainty. The finer details can change between prompts, and the agent may take surprising liberties. Case in point: while experimenting with Cursor to handle directory manipulation, the agent deleted a remote directory without warning. The only practical defence was a test suite that stubbed and mocked the file system, catching destructive calls before they reached the real world.
The Friction of Separate Test Files
In classic project layouts, tests live in their own files. That is tidy, but it creates friction when working with an AI assistant:
- Every time I ask the agent to tweak a function, I must remind it to adjust the corresponding tests.
- Context switching between the source file and the test file forces more back-and-forth prompts.
- When the agent refactors aggressively, it may forget the tests altogether unless explicitly told.
A Controversial but Pragmatic Shift
To cut the friction, I’ve started placing tests directly beside their pure functions in the same file. Yes, it breaks with long-standing conventions, but the benefits are tangible:
- Immediate context - the agent sees both the implementation and its expectations in one prompt.
- Faster iteration - I can rerun tests instantly after each AI edit without hunting for the right file.
- Greater safety - destructive side effects surface quickly, reducing the risk of another accidental directory wipe.
Still Keeping Things Decoupled
I was trained on Symfony 2 and the MVC pattern, so I’m adamant about keeping business logic in small, reusable pure functions. The new structure doesn’t compromise that discipline; it simply co-locates the tests for convenience. Good version control and atomic commits remain non-negotiable, especially when AI refactors with a heavy hand.
Looking Ahead: New Paradigms on the Horizon
Just as BEM and MVC emerged from earlier shifts, AI-first development may birth fresh organisational philosophies. Maybe we’ll see hybrid “code-plus-test” modules become the norm, or entirely new folder conventions optimised for agent collaboration. Whatever comes, the goal is the same: make sure the overly enthusiastic junior-level coder - the AI - doesn’t bring down code my clients rely on.
Final Thoughts
Vibe coding is exciting and fast, but it amplifies the cost of errors. Embedding tests alongside pure functions is my current strategy for staying safe without sacrificing speed. It feels controversial - and maybe it is - yet in practice it lets me collaborate with AI confidently while protecting my projects from unintended chaos.