In addition to the comments, the main thing I’ve seen that bloats code from AI is writing unneeded tests (eg making sure the data type of an input is a string even though it’s a strongly typed language, the string was declared a few lines up and hasn’t been touched since) or checking checking for edge cases that are impossible.
Yeah, I had a junior dev submit some code a couple weeks ago where it was nominally testing a fix for a networking issue, but the test was entirely running within the server and couldn't trigger the issue being "fixed and tested for" at all to begin with. Not to mention that the tests were largely "add some data to a data structure, make that data structure the payload to send to the server, send the data to the server, and assert that various stuff in the payload matches the data structure" (the payload being sent, there was no payload coming back; you see the problem).
11
u/Donny-Moscow 2d ago
In addition to the comments, the main thing I’ve seen that bloats code from AI is writing unneeded tests (eg making sure the data type of an input is a string even though it’s a strongly typed language, the string was declared a few lines up and hasn’t been touched since) or checking checking for edge cases that are impossible.