Lurker News
I saw this LinkedIn post from a Meta engineer and it resonated with me:

https://www.linkedin.com/posts/ali-hamie_im-an-engineer-at-m...
> I'm an engineer at Meta and I never felt this uncomfortable doing my job. I'm writing code these days and it all feels like a black box. This new standard of shipping with AI is moving so fast that if we're going to spend our time checking each line of code, it's going to take forever. That means you can end up with systems you've built where you don't truly understand how all the code works. You understand the high level, but not every detail. And maybe this is becoming the new standard. It goes against every instinct of being a software engineer. I'm used to understanding what I'm building. Now I'm trying to figure out how much I need to understand before I'm comfortable moving forward. Are other engineers feeling this too?
How are you handling this?

Comments (767) 238 threads

Show all comments

Showing thread 5 of 238

ChrisMarshallNY11 replies#
Testing.

Lots and lots of testing. I usually interactively test with the LLM. Now that I'm spending less time, coding, I get to spend more time, testing.
In my experience, I test more, with an LLM, than I did, with my own code. I don't find coding errors, but I do find implementation errors.
On another note: I ran an LLM on a bunch of really mature code that I wrote, and could swear was "perfect," and it found a number of issues.
Nobody's perfect. Trust; but verify.

SimianSci8 replies#
So, in other words, we save time and money when it came to creating stuff, but we've made a whole bunch of new work around verification and testing of said stuff?

What have we gained aside from shifting where time and effort is spent in the design loop?

thevinter#
Better tested software duh
theK#
Isn't this the perfect classical capitalist advertisement? Every number goes up.

- code? up - build budget? Up - developer output? Up - developer oprrational costs? Waaay up!
Why is this Bad? Every one involved profits somehow.

alpha21io#
Shipping features and fixing bugs much, much faster.
onion2k#
we've made a whole bunch of new work around verification and testing of said stuff?

The verification is what we always wanted but never had time for. For 30 years I wrote side project games without extensive testing or a fuzzer or anything because I wanted to spend my time writing the game. Now I can do that and still have the testing I always knew I should be building.

ChrisMarshallNY1 reply#
Engineering will always be difficult.

Right now, we're in a "honeymoon" stage, where non-engineers think that they can somehow, magically produce stuff that is comparable to what experienced and disciplined engineers can do.
That won't last long.
Despite all the caterwaulin', LLMs are just another engineering tool, and good engineers will figure out how to implement them, in ways that absolutely blow away the garbage produced by non-engineers.
It's like that rich, no-talent guy that buys a PRS guitar, and thinks he'll beat the experienced musician that still uses his beat-up old strat, but consistently makes hits.

claytongulick#
I wonder.

In my optimistic days, I think we'll start putting mechanisms in place that will have LLMs help develop cognition, skills and expertise. It'll usher in an era of mastery and wonder.
On my bad days, I despair that the siren song of "good enough" slop will overwhelm even the most disciplined minds, and we're facing the atrophy of civilization.
Will this just end up exaggerating the pereto distribution? Will there end up being this tiny percentage of people that are driven by natural curiosity to do the very hard work of really understanding hard things? Will society even have any sort of reward for those people?

kreneskyp#
I'm largely building tools for myself and my agents. This allows me to battle test internally before releasing code to the wild. It adds some time but largely it's part of my regular work unless something breaks badly. (I also run multiple agent teams simultaneously and do staged rollouts to reduce blast radius of the latter)

This method also helps with the classic problem of being unable to identify essential complexity up front.

VCFundedGenYer#
no time is actually saved with LLMs. You spend more time testing or stepping on rakes finding out what it screwed up.

This is why LLM coding fails.

worstthread#
Are we seriously, no cap, on the techies website, asking what did we gain from more testing?

This truly is the worst thread on HN. Now we're down to explaining 102 topics. Geez guys, what did we gain from evading regression errors? Who knows!

michaelt4 replies#
I find the problem with "lots and lots of testing" as a solution - (assuming by that you mean lots and lots of automated testing) is it invites lots and lots of lines of code - making code reviews even more challenging.

If someone finds it burdensome to review my 50-line AI-generated bug fix, adding 200 lines of tests only gives them more lines to review.

AnotherGoodName2 replies#
Might be a little controversial to say this but automated tests can be reviewed at a lower bar than production code.

I have no shame in accepting vast quantities of ai generated automated tests at review time without really paying attention to them. It’s better to spend more time on the core implementation.

Silhouette3 replies#
I have no shame in accepting vast quantities of ai generated automated tests at review time without really paying attention to them.

I respectfully disagree. IME writing a good test suite is one of the areas where current LLMs perform worst. They certainly like to write plenty of tests but those tests aren't necessarily adding much value and they don't necessarily cover the important functionality.
Given how heavily LLMs and specifically agentic workflows still rely on producing something vaguely correct and then iteratively applying guard rails to reach something that actually works I humbly suggest that trusting a very substandard test suite to be one of those guard rails might be unwise.

Continue this thread — 3 replies

ThrowawayR21 reply#
Accumulating tech debt in the tests will come back to haunt you in the long run when tests become harder to maintain or less reliable as the project evolves.

Continue this thread — 1 reply

rgoulter1 reply#
You want tests to be obvious "at a glance". And then some of the tests should at least indicate it's covering (for the most coverage of the system it reasonably can) the cases we care about.

The name of the test should indicate what it's doing.
For unit tests, these should check only one thing, and the test can be structured into "assemble, act, assert" style tests.
On the implementation side: code which touches state is tricky. -- So, minimize the amount of code which touches state (or rather, shift as much code as you can to stateless code, which is easier to bring under test).

hgomersall1 reply#
So how do you test that gnarly function that outputs a long series of states that interact with each other based on order in non obvious ways? Like, say, a compiler?

Continue this thread — 1 reply

roncesvalles5 replies#
I take the complete opposite approach which is to have zero unit tests now, because LLMs are excellent at both reviewing code to understand what's going on, and also doing manual QA given environment instructions. Lots of unit tests will just bloat the context which ultimately dilutes the quality of the LLM's work and also creates additional work (it has to update the code and the tests each time).

Unit testing imo is pre-LLM. It was mostly to keep the human honest because the human can't possibly read all the code to make sure nothing broke.

nixon_why695 replies#
I'm flabbergasted at this comment.

Are you maintaining a list of all invariants you want QA'd by the LLM after each change? How many tokens does this process take?

Continue this thread — 5 replies

maxnevermind#
> LLMs are excellent at both reviewing code to understand what's going on ...

Have you ever worked on existing code base that has components that makes no sense but must be there?

orthogonal_cube#
> Unit testing imo is pre-LLM. It was mostly to keep the human honest because the human can't possibly read all the code to make sure nothing broke.

What?!
Unit testing was to ensure the code operated according to an intended specification or outcome especially when it deals with a complex support matrix. It extended well beyond the codebase itself! You can have language errors where output behaviors differ between one supported version to another (ex. Java 11 vs Java 17), runtime errors that are specific to operating system quirks (ex. RHEL 8 vs RHEL 9), or workarounds added to your codebase for known bugs in different dependency libraries you support at compile/run time (ex. Net-SNMP 5.2 vs 5.5). It wouldn’t matter if someone read all your code; you would still have the potential for errors caused by the components needed to run your software.
If your project doesn’t have to worry about these types of issues then lucky you and continue on without unit tests for as long as you can.

worstthread#
My name. Your fault.
perlgeek#
I think it really depends on the language and the project.

The more types of potential errors your compiler catches, the fewer unit tests you need. Haskell needs fewer (and potentially different) tests than Perl or Python.
The other thing where unit tests really shine is testing a complex algorithm. If you think of a problem with a very well-defined output (like sorting, searching, some types of computation, graph algorithms, geometry problems etc.), then it's pretty easy to come up with a stable API and thus stable tests. I'm pretty convinced that unit tests give you more bang for the buck than plain-English test plans that you need to spend tokens on to evaluate.

henrymerrilees#
Where it suits the problem, higher leverage testing techniques are now more accessible than ever! E.g., property-based and metamorphic testing. It is now easier than ever to triage failing cases they generate and refine generation to be more useful. Following initial setup, the marginal overhead of additional cases is minimal.
AstroBen1 reply#
How do you test code that you don't understand?

Black-box e2e testing isn't suitable, or practical, for a lot of applications. Unit and integration tests generally require you to understand the code you want tests for, to know what to actually assert
Are you just trusting the AI to do it all?

Continue this thread — 1 reply

Continue this thread — 8 more replies