Login
You're viewing the functional.cafe public feed.
  • Oct 26, 2026, 7:06 PM

    Working on a project at work with some people who are big on unit tests and I can't help but feel they are doing it wrong. Lot of `x = (a, b, c)` in the code and then `assert x == (a, b, c)` in unit tests. Seems silly but I can't explain why

    💬 1🔄 0⭐ 1

Replies

  • Oct 27, 2026, 6:49 PM

    further updates working on this probably-all-slop codebase, a very annoying thing is that every file has a LOT of comments, but they only make sense if you're looking at Every File At Once. Otherwise they include some thing at the top like "This job runs after finalize_other_thing" and i'm like where the fuck is that? not here!!

    it's like, there may be complete documentation here, if only it hadn't been put through a shredder and bits of it sprayed into every file. I can't find anything. Need a red string and corkboard.

    💬 0🔄 0⭐ 2
  • Oct 26, 2026, 8:25 PM

    @greg this is like every llm unit test ever, they love to write those lol

    I feel if you’re just lightly restating the function you’re testing, then that’s not a test that should exist, it‘s just baggage

    💬 1🔄 0⭐ 0
  • Oct 26, 2026, 9:17 PM

    @halcy yeah the codebase is very LLM and it's annoying me a lot. In addition to saying the thing, duplicating it in the test case to make sure basic assignment works, it also restates the same thing in the comment. and then the auto PR bot will get mad that the comment doesn't mention D when I add D to A, B, C in the other two places

    💬 0🔄 0⭐ 0
  • 💬 1🔄 0⭐ 0
  • Oct 27, 2026, 9:43 PM

    @halcy aha yes there's very much a lot of prompt leakage in here. "We intentionally do not do X here" when I wouldn't have considered X, but obviously whoever committed this told it not to!

    💬 1🔄 0⭐ 0
  • Oct 27, 2026, 9:46 PM

    @greg man I know the directive is at some level to Simply Not Read The Code but also like

    ?????? do people not feel embarassed to submit these for review? like as long as there still is review

    💬 0🔄 0⭐ 0