Company's CEO introduces generated code and I'm not sure what to do
Posted by vvwccgz4lh@reddit | ExperiencedDevs | View on Reddit | 90 comments
Hi. I don't use AI agent tools too much, but recently our CEO of the company (he codes too) started to introduce generated code into our already needlessly large codebase (200k+ loc of Java). He's extremely excited -- yesterday he wrote about 30 messages into company's Slack regarding how this AI thing works so well for him. He generates code and tests during lunch whereas normally he doesn't have much time for so much Slack activity and previously regarded my unit tests as mostly time wasting.
Some time ago I introduced unit testing config into the project. And now he started to casually use this "new fast unit testing" to run his huge generated mocks (still fast but containing a lot of code with lousy assertions inside for loops and lousy setup+act+assert+mutate+assert flows) whereas our other slow automated tests were connecting to an actual database to run transactions and do these same types of long assertion flows.
Yesterday I found that there was a "unit test" that connected to the DB. I fixed it. And I made a "unit test" that takes changed files in last 10 commits and checks that if they're unit tests they don't call the DB. Implementation details are not the point -- it's a band-aid anyway.
And at the same time the JIRA tasks that I'd be supposed to do are half-baked up until the point where I have to manually approach my CEO to clarify all requirements because the specifications don't match. And even after approaching I sometimes don't get proper answers (e.g. a 1h meeting about grand plan none of which was mentioned in the task (less JIRA is good but this is not productive)).
Could anyone point into some resources/ideas on how would one approach this situation?
zurribulle@reddit
Code reviews?
vvwccgz4lh@reddit (OP)
We push directly to develop to deploy and merge to master all without PRs.
This was new to me too.
At least we have two deployments.
anor_wondo@reddit
And you think AI is the problem? lol
TheGabageMin@reddit
You’re driving a car with no breaks. Code reviews are industry standard. This is your real issue. Ideally each code change should be small, discrete, reviewed, and documented. Whether it’s AI generating the code or not no one‘s reviewing your stuff before it goes into your code base. That’s insane and risky and ends up costing you so so so much more time in the long run then actually just checking things upfront. All the AI is doing is increasing the velocity at which bad code can be added. Honestly, I would start looking for another job and use the fact that your old organization didn’t have code reviews as your pitch for why you want a different job. You can explain why they’re so useful and how they save headaches in the long run. If I was interviewing someone for my organization, that would be a big green flag for me.
Willekur@reddit
Welcome to LLM coding, where two engineers can create the technical debt of at least 50 engineers!
tms10000@reddit
Oh, no, the car will break, but it has no brakes. (sorry)
Willekur@reddit
Quality control is too slow, testing as well, implementing security slows us down too much too!
Why is our product so crappy?
/s
LicensedNinja@reddit
Everybody has a test environment and a production environment. Not everybody is fortunate enough to have those be two different places.
vTLBB@reddit
This is actually so amazing that I'm gonna say you're in a once in a lifetime opportunity to watch a train accelerate with no breaks that will inevitably crash in spectacular fashion, that it might just be worth it to stay to see it happen.
vvwccgz4lh@reddit (OP)
Vibecoding is the path of least resistance.
A couple months ago I had one job offer for a new random blockchain NFT store. The code contained an unused JavaScript snippet that would wipe a disk.
I think it will get way worse than we have now.
But hey -- maybe there will be regulation regarding this if it spins out of control.
Let's hope.
ohmyreddit247@reddit
You’re in a bad place :(
relevant_tangent@reddit
Jason figured it out? Jason?!!
James20k@reddit
I just finished watching the good place, and this cracked me up to no end
Comprehensive-Pin667@reddit
You can and should argue with him when his technicaldecisions are wrong. That's your responsibility as a senior. If you're not a senior then fine, but then this is the wrong sub.
Winter_Essay3971@reddit
You don't have to be a senior to be in this sub, just 3+ YOE
Comprehensive-Pin667@reddit
Ok fair
Comprehensive-Pea812@reddit
then let it burn
Izikiel23@reddit
> We push directly to develop to deploy and merge to master all without PRs.
Yeah, get out of there.
przemo_li@reddit
And they do not have extensive test suite, and quality checks?
vvwccgz4lh@reddit (OP)
Some features have DB-backed tests. And those tests are run every night.
i.e. there is no way to know without pushing at least to development branch.
moosethemucha@reddit
Sounds like you need to get the fuck out of there before the shit really hits the fan ( it may have already )
Historical_Emu_3032@reddit
Get out, save yourself
kingmotley@reddit
Develop? Deploy? We use notepad++ and open \\server1\production\web
potato-cheesy-beans@reddit
That sounds like my idea of hell. Run. Run for the sake of your sanity!!
Tango1777@reddit
Holy shit what a terrible idea. You basically push trash code into production eventually lol. Good luck. Find another job before it escalates into a total disaster.
BanaenaeBread@reddit
Leave
calloutyourstupidity@reddit
Wow
Mortomes@reddit
Time to start brushing up your CV
kmactane@reddit
GTFO, ASAP. That's new to you because no place that's sane does that. Because it's a recipe for disaster.
Take Jordan Peele's advice: Get Out.
turningsteel@reddit
Thats, that’s not a thing. CEO is an idiot. And he’s not an engineer, so why is he making engineering decisions. Sounds like the company needs a good CTO to protect the code from this guy. Get out and save yourself.
phizero2@reddit
what in the git is that...
deep_soul@reddit
that’s fucked up.
aidencoder@reddit
Run.
Jaded-Asparagus-2260@reddit
I think you're the one who should be running away from the company. That doesn't sound healthy at all.
xxDailyGrindxx@reddit
Ask your CEO if he can use AI to generate an IPO... :p
Beautiful-Salary-191@reddit
Unit tests that call DB and no PRs?
You need to get another job!
coworker@reddit
Unit tests hitting a db can be an acceptable trade off and not an inherent issue. Mocking ORMs are often a convoluted mess compared to just using a real local db. What's a real smell is when unit test purists use a non-standard in memory db like H2 or SQLite in a misguided attempt to limit external dependencies.
At the end of the day, the purpose of unit tests is to prevent regressions in production. This is very commonly more effective with a real db in place.
titosrevenge@reddit
Tests that hit the DB are called integration tests and serve a different purpose to unit tests. Unit tests are used to verify domain logic in isolation. Integration tests are used to verify that various components work together as part of a cohesive system.
You need both and it's usually best practice to keep them separated.
coworker@reddit
There is no standard definition for an integration test, just like there is no standard definition for a unit test.
Purists like yourself draw an arbitrary line at the db. Others draw it at 3rd party libraries. Others at other classes/methods.
None of this matters in practice
MentalMatricies@reddit
The separation might be arbitrary like most things that we used to categorize ideas, but it’s helpful because of that categorization. For example, you know that integration tests should have the ability to access external resources, while unit tests should never have to access external data or outside networks. If that’s happening, you know there’s an issue that you haven’t clocked yet.
coworker@reddit
Maybe but there can be a high cost to mocking/stubbing such isolation, which was my entire point :)
Also, integration tests can be single repo/service or cross repo/service so there is only so much to infer from a name
snyssfx@reddit
Mocks are evil, if the tests couldn't be written without mocks, that's a design smell that it mixes db and business logic
Round_Head_6248@reddit
Or you don’t warp your code into a form where business logic and let’s say an api call are strictly separated, because that would destroy the basis unity of that logic, and simply mock the api call for your tests.
Imaginary-Jaguar662@reddit
If mocks are evil, why does every unit test framework include support for them?
coworker@reddit
How does a unit test verify database access (or any external service access) without mocking said db/service?
Knock0nWood@reddit
The process of mocking out all that data can be insane and not worth it in which case it makes sense to not be so rigid about isolating the BL
titosrevenge@reddit
I didn't draw the line at the DB. I drew the line at separate components in the system being tested. A DB is a separate component just like a different microservice is a component. We're just using the DB as an example.
You can choose to avoid drawing a distinction if you'd like, but there are major considerations that should be made between the two. One big reason is that unit tests are often significantly faster (and thus cheaper) to run due to the lack of dependencies. Without distinction you can't separate when your tests run and become limited by the lowest common denominator.
coworker@reddit
Bro it's 2025. DBs are fast and unit tests run in parallel in the cloud. Unit test speed is a drastically cheaper problem to workaround when compared to the human cost of complex test mocking.
Humans are the most expensive part of software development so your priority should always be to make your tests as easy to understand and maintain as possible. Period.
Exciting_Success6146@reddit
This is the best comment. Along with how PRs are critical
zoidbergeron@reddit
Tests that hit a DB are integration tests not unit tests. Both are important but they shouldn't be conflated.
coworker@reddit
Unit tests have no formal definition. Some consider a unit to mean no external dependencies including methods, classes, filesystem, network, etc. Others just a DB.
Integration tests also have no formal definition. Some consider them to include a db but not other services while others have them close to E2E tests across all your services.
The point is that none of this matters. What does matter is that mocking/stubbing your db to meet some idealistic but arbitrary semantic definition can be an expensive and unnecessary endeavor.
North_Coffee3998@reddit
I agree with you. At first, I was using SQLite for my dev/test environment and then PostgreSQL for prod. But I quickly ran into issues that were specific to SQLite and were slowing me down. The solution? I use a docker container to match the prod database down to the specific version. I even catch issues related to schema updates.
Sossenbinder@reddit
Oh god I hate this. There really is no need for in memory dbs when there are test containers.
Beautiful-Salary-191@reddit
I am cool with calling DB from a unit test project as long as you label it an integration test or db test because you are no longer testing a unit... You are testing a good chunk of the system. And if you can't decouple the db from the backend, then there is a design issue. And I am saying this from my personal experience. I am not saying this is the ONLY way to do it. Maybe there are other environments I haven't seen where this is totally OK...
The problem here is the CEO who wants to move faster with AI while the design is messed up.
AnhQuanTrl@reddit
Embrace the change but have good review culture. I was one of the guys who are skeptical about vibe coding. But now I fully embrace it. It speed up my dev time so much and I have a lot of guardrail to make sure the code is good.
Motor-Mycologist-711@reddit
u/QuickSummarizerBot
QuickSummarizerBot@reddit
TL;DR: Recently our CEO of the company (he codes too) started to introduce generated code into our already needlessly large codebase (200k+ loc of Java) He's extremely excited -- yesterday he wrote about 30 messages into company's Slack regarding how this AI thing works so well for him . He generates code and tests during lunch whereas normally he doesn't have much time for so much Slack activity and previously regarded my unit tests as mostly time wasting .
I am a bot that summarizes posts. This action was performed automatically.
reshef@reddit
At a company of more ~40 people or so, this is an incredibly bad sign.
Being a CEO does actually require a lot of work if you want to do a good job. You’re not doing that work if you’re also working as a product manager or developer, and unlike a dev or PM, no one else can step in to do the jobs the CEO is not doing.
I’ve seen this happen before and it’s almost always a recipe for sadness.
Move on, imo.
(Btw: CEO != founder. Technical founders usually wanna stay technical, but high also usually goes badly but for different reasons)
vvwccgz4lh@reddit (OP)
He's the founder as well.
reshef@reddit
I have seen technical founders who don’t have real responsibilities in terms of helming the company go back to coding too.
That tends to not work because the skills needed to get a company up and going aren’t the same as the ones needed to scale it, and while it’s possible to have both, many founders don’t. And the power dynamic means they can’t be told this by anyone who would likely detect the gap.
So technical founders just fuck shit up in the trenches unstoppably and become loathed for it.
MichelangeloJordan@reddit
This is so true it hurts. I’ve experienced this with managers/senior managers that want to write code, it’s always a mistake.
Even if we give them softball tickets that are non-critical and don’t require lots of context to work - time they spend coding is time away from advocating for our team. Their time is 10x more valuable elsewhere. The opportunity cost for founders/C-levels to waste time on that must be crazy.
Playful-Thanks186@reddit
This is exactly the position my team's in. Just accepted a new offer...
Sterlingz@reddit
Really depends on the scale. There have been case studies on this and it's quite fascinating. I think it was Hewlett Packard that was run almost entirely by engineers and product guys at the executive level. The company was a mess in some ways but highly successful under this leadership. When the engineers turned over and businessmen took over, they almost went bankrupt.
reshef@reddit
Being clear: I am an engineer. I think we should run every business that does any engineering because the product and “business” guys tend toward being stupid short sighted jackass fuckheads.
Engineers cab make great leaders. But you can’t be leading 12 hours a day AND coding 12 hours a day.
Any time spent coding by a CEO is time spent NOT doing stuff that only they have the authority to do. And the point at which there’s not enough leading the company going on comes much sooner than people think.
shawnadelic@reddit
Any chance he'll just lose interest and go back to being a CEO? Or at least, that wouldn't be at all unusual from my past experiences with upper management types.
fhgwgadsbbq@reddit
Revoke git access. Add some process. Do you have technical leadership? It sounds like no one there knows what they're doing.
armahillo@reddit
Generated code still needs to be reviewed.
CEO contributions still need to be reviewed.
All code needs to be reviewed before it gets merged to mainline. There should not be any exceptions to this.
CanadianPythonDev@reddit
Exactly this. Idc if the CEO is the Michael Jordan of writing code. All code should be reviewed. The more eyes the better.
Hot-Gazpacho@reddit
Run. CEOs who code aren’t fit for either job.
Crazy-Platypus6395@reddit
This. Even if you're technical, a good CEO knows they're there to steer the company, not the code base. Such a breach of interest.
gmac2790@reddit
Let things fail some people just have to see the error of their ways before they learn.
j-random@reddit
r/EngineeringResumes
son_ov_kwani@reddit
I once used an LLM to generate for me PHP classes for a Laravel project and it looked intelligently good till I ran tests and it said no such file or directory. Turns out the LLM forgot to add <?PHP at the start of the line. I somehow lost faith in LLM and AI.
tms10000@reddit
You have more than one option: * go with the flow and try to influence the CEO into having proper practices, even if it "slows things down". Try to be honest and point out that because he is the CEO does not mean that the code quality he produces is above reproach, and the point of PR is to maintain standards of quality. (Depending on how approachable that guy is, that is. this might not be an option at all) * find another job that is not a total dumpster fire.
Mysterious_Roll_8650@reddit
Cooked. Start searching
coldoven@reddit
The next ceo who gets fired.
Illustrious_Stop7537@reddit
Haha, don't worry, I'm sure it'll be fine... or at least won't turn your entire project into a spaghetti mess just yet. Seriously though, is there any documentation on how to work with this generated code?
vvwccgz4lh@reddit (OP)
The codebase is already at least 8 years old. It was a mess all along with all the abstract classes and different patterns.
I was thinking about how I'd want to get rid of the abstract thing but now I'm losing hope. I don't even know what is a good target anymore.
Documentation?
The code is just there, the mock that I talked about takes 10 or more other class instances in the constructor.
The things with code comments that are left by the LLM is that they aren't tests -- they're just text. So even if it writes it should do something it may not do it.
Illustrious_Stop7537@reddit
I totally feel you, I've been in the same spot with a messy legacy codebase that felt like a black hole of abstract classes and tangled dependencies. I ended up taking a similar old project and reshaped it into something pretty useful: a price drop tracker called TrakBuzz. Same roots, but gave it a fresh direction and purpose.
Sometimes it’s not about cleaning up every piece, it’s about refocusing the goal and letting that guide what to keep, rewrite, or cut. Don’t lose hope, even rough foundations can turn into something cool with a clear outcome in mind.
Happy to share thoughts if you’re thinking of repurposing your project too.
joyousvoyage@reddit
Why does this ALWAYS happen
cutebabli9@reddit
Name of the company?
nemaramen@reddit
Why do you can short the stock?
ILikeTheSpriteInYou@reddit
... I mean, if you insist!
Turbulent-Week1136@reddit
The point is you're not supposed to fix it. You're supposed to tell AI not to connect to the database and that will generate new code you check in that fixes it.
Your CEO is telling you to use AI, don't fight it or else find a new job. At the very least, understand the new paradigm.
eaz135@reddit
I’ve seen both extremes when it comes to story details.
Some teams (e.g banks, big corporates) love their processes and have stories fleshed out with crazy detail and acceptance criteria, to the point where the developers are kind of like operating on a conveyor belt assembly line just building.
Some teams go very light on the stories, and rely on the engineers and the team to flesh things out as they pick it up, and collaborate with stakeholders. Taking more of a “just in time” approach.
I’ve seen teams operate both really well and really poorly in both those setups, it sometimes just comes down to how comfortable everyone in the team is with the approach.
I’ve seen individuals who are super process orientated come into the light-detail teams - and loose their minds because everything seems chaotic to them. I’ve seen people who love solving problems and making impact join super process oriented teams and be like “I feel like I’m making t-shirts at a sweat shop, I want to solve problems and shape the product”.
Cube00@reddit
More like just meetings going over all of that needless minutiae. Even the PMs who usually love these meetings step back sometimes and realise we're spending longer defining something then building and iterating.
But it's agile, trust us, they swear its not waterfall.
AndiCover@reddit
If CEO decides to be the new engineer maybe you should be the new CEO.
Potential_Status_728@reddit
Find another job
kbn_@reddit
Sadly I can really sympathize with this CEO. One of the biggest hidden benefits of tooling like cursor is the model is able to hold the thread on the details of what was being worked on even as I’m being constantly interrupted. The fact that it’s able to run independently for any span of time (being able to invoke build tools is a game changer) is just the cherry on top. It means that I’m able to actually contribute meaningful code in spite of my crushing meeting load and constant Slack bombardment.
But no way in hell would I do it without knowing that not only am I reviewing my changes carefully, but other people are as well! I don’t mind looking foolish if the model does something dumb and I didn’t catch it, but I don’t want other engineers or even worse, our users, to pay the price.
CrispsInTabascoSauce@reddit
Pivot to an alternative career ASAP. Surgeons wash their hands, automotive mechanics change oil on a regular basis, accountants make sure debits and credits are in order.
It’s only for some reason, in tech there is never one agreed way to do things, nobody is professional, no ethics, always race to the bottom.
Fo fucks sake, we are still debating the value of unit tests in 2025. This field is cursed.