doom_and_gloom ,
@doom_and_gloom@lemmy.ml avatar

Prod involves black magic. You can't unit test that. Might as well push it.

sebsch ,

You need unit tests for maintenance and refactoring.

Yes it may work, but now is the moment you still understand your code. Write that fucking docs and put in basic unit tests now.

xmunk ,

100% code coverage is a bullshit metric that nobody should aim for.

SkyNTP ,

We should strive for a wide range of test cases. Real testing is done when the software is tested against a wide range of user inputs. Code coverage is no indicator of response to cases.

Unit tests are a fantastic way of implementing test cases. I am of the opinion that most bug PRs should start with a unit test, if nothing else, a persistent reminder that: hey BTW, your user is going to input this garbage, so any logic you implement ALSO has to be resilient against that garbage.

sirdorius ,

100% code coverage, integration tests passing. Deploys to prod. NullPointerException at 3am

(╯°□°)╯︵ ┻━┻

MonkderZweite ,

And how to test the unit tests?

Artyom ,

Who watches the Watchmen?

xmunk ,

At my organization we have unit tests about our unit testing framework... I could never be assed to write these myself but I'm fine not needlessly deleting the work other people wrote. It does feel incredibly silly though.

toastal ,

There’s nothing to test when your data structure can’t represent an invalid state. So many tests are being basic stuff like checking nil & empty lists; basic ADTs can design you out of that whole host of invalid states. Further, if your language only allows side effects at the edges of the application & data types are immutable, you are way less likely to need all these mock utils or get unexpected changes to your data.

conditional_soup ,

I'm in this meme, and I don't like it (I'm on the left, aspiring to be in the middle)

CalcProgrammer1 ,
@CalcProgrammer1@lemmy.ml avatar

I'm in the middle and I don't always like it. 100% coverage is mandatory for the industry I work in though. I get that module testing is important but it can be such a chore to work on. I got pulled in to help write tests for another project this month and that is somewhere between watching grass grow and watching paint dry in terms of level of excitement.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • programmerhumor@lemmy.ml
  • test
  • worldmews
  • mews
  • All magazines