this post was submitted on 19 Jan 2024
123 points (93.0% liked)

Programmer Humor

32562 readers
414 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
all 23 comments
sorted by: hot top controversial new old
[–] NotSteve_@lemmy.ca 27 points 10 months ago

There's teams of people on the right at my company and while they're able to build just about anything they're asked to in wicked time, one look at their codebase makes you want to quit and become a farmer.

Unfortunately I've had to do work in their repos before and I would ALWAYS prefer working with someone who aims for 100% test coverage

[–] sirdorius@programming.dev 25 points 10 months ago

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

(╯°□°)╯︵ ┻━┻

[–] nxdefiant@startrek.website 20 points 10 months ago* (last edited 10 months ago) (2 children)

.000001 Galaxy brain guy:

100% test coverage has been failing for months, the codebase is more debt than tech - send it, nothing matters anymore.

[–] thetreesaysbark@sh.itjust.works 14 points 10 months ago

More debt than tech. I'm going to use this one haha

[–] akariii@lemmy.blahaj.zone 2 points 10 months ago

can you send me the bibtex format to quote this when doing my presentation?

[–] sebsch@discuss.tchncs.de 19 points 10 months ago* (last edited 10 months ago)

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@sh.itjust.works 15 points 10 months ago (1 children)

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

[–] SkyNTP@lemmy.ml 7 points 10 months ago* (last edited 10 months ago)

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.

[–] conditional_soup@lemm.ee 11 points 10 months ago (3 children)

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

[–] CalcProgrammer1@lemmy.ml 9 points 10 months ago

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.

[–] xmunk@sh.itjust.works 2 points 10 months ago

I'm in the middle but happy to be there - shit will occasionally break but we have coverage of all the important stuff... And it's good coverage - coverage percentage is a bullshit metric that provides a false sense of security because it's by line.

[–] OpenStars@startrek.website 2 points 10 months ago

I'm in this meme and I don't like it. I float around depending on what thought crosses the mind of the person above me most recently, so I've long since decided to stop caring about such "minor details" :-(.

[–] toastal@lemmy.ml 8 points 10 months ago* (last edited 10 months ago)

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.

[–] MonkderZweite@feddit.ch 7 points 10 months ago (2 children)

And how to test the unit tests?

[–] xmunk@sh.itjust.works 5 points 10 months ago

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.

[–] Artyom@lemm.ee 5 points 10 months ago

Who watches the Watchmen?

[–] Treeniks@lemmy.ml 1 points 10 months ago (1 children)

just do everything in Isabelle and prove correctness, ezpz no tests required

[–] QuazarOmega@lemy.lol 2 points 10 months ago (1 children)
[–] Treeniks@lemmy.ml 2 points 10 months ago (1 children)
[–] QuazarOmega@lemy.lol 1 points 10 months ago

~~Blockier than I remember~~
So that's it, I read its overview, looks really powerful! Also goes way over my head

[–] CanadaPlus 1 points 10 months ago

What's the hood guy's logic here?