this post was submitted on 20 Nov 2024
197 points (98.0% liked)

Programmer Humor

32524 readers
478 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] CanadaPlus@lemmy.sdf.org 3 points 1 day ago* (last edited 1 day ago) (12 children)

Depending on what kind of coding you're doing, there might not be an obvious, really atomic unit to test. Most people here seem to do the data-plumbing-for-corporations kind, though.

[–] leisesprecher 3 points 1 day ago (11 children)

Especially then I'd test the shit out of everything? I'm getting paid for writing correct software.

[–] CanadaPlus@lemmy.sdf.org 2 points 1 day ago* (last edited 5 hours ago) (2 children)

At a certain level of detail, tests just become a debugger, right?

I'm thinking of something like an implementation of Strassen's algorithm. It's all arithmetic; you can't really check for macro correctness at a micro point without doing a similar kind of arithmetic yourself, which is basically just writing the same code again. It resembles nothing other than itself.

[–] leisesprecher 1 points 1 day ago (1 children)

And who actually writes tests like that?

I mean, do you think tests do the calculations again? You simply have well defined input and known, static output. That's it.

[–] CanadaPlus@lemmy.sdf.org 2 points 22 hours ago* (last edited 22 hours ago)

Yeah, you definitely run fixed tests on the whole thing. But when it returns indecipherable garbage, you've got to dive in in more detail, and at that point you're just doing breakpoints and watchpoints and looking at walls of floating point values.

I suppose Strassen's is recursive, so you could tackle it that way, but for other numerical-type things there is no such option.

load more comments (8 replies)
load more comments (8 replies)