ITviec is excited to feature insights from Martin Papy, CTO at CBTW APAC – a winner of the Vietnam Best IT Companies 2025 award, as part of our winner sharing series.
With 20+ years of experience, Martin is a visionary tech leader known for driving digital transformation, scaling high-performance teams, and delivering secure, innovative enterprise solutions for long-term success.
This article, written in his own voice sharing original AI-related stories from his experiences at CBTW APAC, offers valuable lessons and practical takeaways for Vietnam’s IT professionals and leaders aiming to thrive in today’s dynamic tech environment.
————————————————————————————————–
You’ve probably seen the headlines and the YouTube videos: “I built a full-stack app in a weekend using AI!” or “95% of code will be written by AI soon!” These bold claims are catchy – and at first glance, they’re inspiring. But how realistic are they in an enterprise environment where complexity, legacy systems, and business logic rule?
As a CTO, I set out to explore this firsthand – not by creating another to-do list app, but by tackling a challenging real-world scenario: refactoring and upgrading a legacy Java web application. This wasn’t just any app. It had years of accumulated logic, inconsistent conventions, outdated dependencies, and deeply embedded business rules.
Chapter 1: The Naive Beginning – AI Takes the Wheel
The app was built with Spring Boot 2.0, Hibernate 5, Thymeleaf 2, Bootstrap 4, and a host of other outdated technologies. My goal? Modernize the entire stack.
Motivated by the AI hype, I launched Cursor (claude-3.7-sonnet) and ChatGPT (GPT-4o). I started with a light-touch approach – letting the tools take the lead.
At first, it felt impressive. The AI recommended updated dependencies, optimized code, and even proposed structural improvements. But then I ran the application – and it broke. Spectacularly.
Dependencies clashed. Logic failed. Worst of all, the AI introduced subtle, conflicting changes it didn’t fully understand. One particularly revealing case: it added Caffeine as a caching library without removing our existing EhCache. Two cache layers began fighting for control, leading to unpredictable behavior.
Even more troubling: the issue surfaced only when I was debugging a Spring Security bug. The root cause? Hibernate was lazily loading roles via a ManyToMany relationship, but Spring Security was fetching a cached user entity that had no roles loaded. Disabling caches revealed the full extent of the problem.
This was the first major realization: AI doesn’t just create bugs – it creates illusions that make debugging harder.
Another example? The AI “modernized” a service method using lambdas and streams. The refactor looked elegant – but broke business logic. The original code used a loop that exited early upon meeting a condition. The AI-generated stream, however, continued processing, causing incorrect behavior.
These weren’t syntax errors. They were semantic – the kind only a developer who understands the business context would avoid.
Chapter 2: Coaching a Goldfish
It quickly became clear: I was talking to a junior developer with the memory of a goldfish.
Despite long sessions and detailed prompts, the AI often forgot architecture decisions, class hierarchies, or even previously mentioned conventions. I’d explain our package structure – then, a few prompts later, it would generate a new controller in the wrong location.
Even Cursor’s “rules” system helped only marginally. The tools simply couldn’t retain enough context.
One standout failure: I explicitly provided Thymeleaf 3.1 documentation, which noted the removal of #request. Still, the AI continued to use “#request.requestURI” in templates.
Another example involved a seemingly harmless navigation bar:
The logo never rendered. The problem? The th:text on the <a> tag overwrites the contents, including the <img> tag. The AI never caught this. I debugged with Cursor for nearly an hour. Its final theory? That Thymeleaf wasn’t set up correctly. A rookie mistake – proof that AI can understand syntax, but not semantics.
Chapter 3: From Code to Docs – A Turning Point
So, I changed course.
I started documenting everything: upgrade plans, architectural decisions, coding standards, and constraints. Here, the AI became genuinely helpful.
In just days, we had clean, structured Markdown documentation that would’ve taken weeks to produce manually.
ChatGPT acted as a product owner, asking clarifying questions that improved our Product Requirement Documents. Cursor, meanwhile, played the role of Technical Architect, helping shape our Software Architecture Documents, coding rules, and more.
This documentation became the foundation for a successful rebuild.
Chapter 4: The Rebuild – Human-Led, AI-Assisted
With strong documentation in hand, I reversed the approach: I led, AI followed.
The workflow:
- I described the feature.
- AI proposed a solution.
- I reviewed, corrected, and adjusted it.
- AI implemented it step by step.
This yielded better results. AI was especially helpful with:
- Scaffolding CRUD flows
- Generating Thymeleaf templates
- Writing Spring Boot controllers
- Mapping JPA entities
- Bootstrapping unit tests (with clear direction)
But constant oversight was required.
At one point, I asked it to fix a failed login test. Instead of fixing the test, it updated the production controller to match the test result.
Yes – you read that right. The AI rewrote business logic to satisfy a broken test.
Chapter 5: The Danger of Laziness
Here’s the hard truth: AI encourages laziness.
Unchecked, it confidently introduces flawed logic, misplaces files, and “solves” bugs by undermining business rules. The danger isn’t just in its mistakes – it’s in how convincing those mistakes appear.
When used with care, however, AI can be a game-changer:
- Drafting and organizing documentation
- Generating repetitive templates and unit tests
- Performing mechanical refactors within well-scoped boundaries
- Explaining outdated APIs or cryptic errors
But – and this is key – AI won’t understand your application, your architecture, or your intent. That responsibility still lies with your engineers.
Final Thoughts: Use It – Don’t Worship It
AI is powerful – but it’s not magical.
Used recklessly, it will create more problems than it solves. Used wisely, it can unlock speed, scale, and creativity.
If you’re a developer, remember: you are still the architect, designer, and debugger.
To integrate AI effectively into your workflow:
- Start with documentation: Define requirements, constraints, and goals.
- Use clear rules and conventions – and keep reminding the AI of them.
- Treat AI suggestions like junior developer pull requests: Always review.
- Avoid open-ended prompts: Break tasks down and give tight directions.
- Test early and often: Never assume logic is correct just because it runs.
And most importantly: train your teams.
At CBTW, we’ve learned that successful AI adoption depends not on tools – but on habits. That means:
- Offering real-world examples of AI success and failure.
- Teaching prompt design and validation techniques.
- Building internal guidelines for AI usage.
- Encouraging developers to question outputs and maintain ownership.
AI is not a plug-and-play solution. It’s a teammate that needs onboarding, oversight, and – sometimes – a firm nudge in the right direction.
I wouldn’t trade this experience. It made our practices stronger, our documentation sharper, and our engineering culture better. If you’re leading a tech team, you should try it too. Just don’t expect miracles.
Master the tool – or spend your time fixing what it breaks.
About the author
Martin Papy is the Chief Technology Officer of CBTW APAC. With over 20 years of experience, Martin is a visionary tech leader who has led large-scale digital transformation initiatives, built and scaled high-performance engineering teams, and designed innovative enterprise solutions. Through effective leadership of cross-functional global teams, he delivers secure, forward-thinking solutions that support long-term success.
End notes from ITviec
Martin Papy’s firsthand sharing provides invaluable, grounded insights for Vietnam’s IT community navigating AI adoption.
Key takeaways include the critical need for human oversight in complex projects, leveraging AI strategically for tasks like documentation, gathering inputs, and the essential role of training teams to use these powerful tools effectively and critically.
We thank Martin and CBTW for sharing this experience. To learn more about CBTW and potential opportunities, visit their Employer Page on ITviec.
Content and images are provided by CBTW APAC