• linearchaos@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 year ago

    I love writing tests, It’s all the shit that comes after that that sucks.

    Those first few pushes that all come up green feel like magic. That first red that points out something you missed, you go back and make a quick change and it’s now green and it’s the best thing you’ve ever seen.

    It’s sooner or later, you throw a couple big red bois on a production build that don’t make any sense. You start digging through the code of some guy that only writes comments in haiku and has the impression he gets paid by the number of layers deep he can nest a ternary.

    Sooner or later you figure out it’s just an edge case there’s nothing actually wrong. You’ll need to refactor one of the systems but you still have production to push to fix a critical bug, so you hotwire the test and write it off as P1 tech debt.

    Eventually, you end up with unit tests that aren’t P1 and they fail. If you’re understaffed, or overscoped, sooner or later you just have a bunch of half-assed zombie test sitting around. Unless you can convince production to let you go back and clear up your tech debt it’s just a unit test graveyard. It still has the big bumpers in place so something serious can’t fail. But you never seem to be able to get back to make everything bright new and shiny again.

    • thisisawayoflife@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      That does sound like a nightmare. I’m assuming you mean failed test when you say “red boy”, and that made me wonder about PR practices. I’m used to a very strict review environment and fairly quick review turnaround or requests to go over the code. I’ve heard horror stories about people not getting PRs reviewed for days or weeks or some people just plain refusing to review code. I work on microservices that are all usually less than 10,000 lines though, not something with over a million lines of legacy code.