this post was submitted on 23 May 2024
429 points (98.0% liked)

Programmer Humor

18470 readers
1669 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
all 19 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 20 points 1 month ago (1 children)
[โ€“] wreckedcarzz 8 points 1 month ago

Hooray! ๐ŸŒฎ

[โ€“] Clent 15 points 1 month ago (1 children)

Autist ๐Ÿ™‚โ€โ†”๏ธ

Autest ๐Ÿ™‚โ€โ†•๏ธ

[โ€“] [email protected] 8 points 1 month ago (1 children)

Ok, well, if you ever come across a test framework named AuTest, you can blame me, because I'm stealing the shit out of that.

[โ€“] [email protected] 4 points 1 month ago
[โ€“] Thcdenton 10 points 1 month ago* (last edited 1 month ago) (1 children)
Z โ€“ Zero

O โ€“ One

M โ€“ Many (or More complex)

B โ€“ Boundary Behaviors

I โ€“ Interface definition

E โ€“ Exercise Exceptional behavior

S โ€“ Simple Scenarios, Simple Solutions
[โ€“] [email protected] 7 points 1 month ago (1 children)

Use triple backticks instead of one if you are trying to get monospace syntax

[โ€“] Thcdenton 5 points 1 month ago* (last edited 1 month ago) (2 children)

Bless. Also please dont peel my face off for that mistake :p

[โ€“] [email protected] 7 points 1 month ago (1 children)

Sorry, the face scalpers are already on their way. Nothing we can do

[โ€“] [email protected] 3 points 1 month ago

Nah just informed you lol

[โ€“] [email protected] 9 points 1 month ago* (last edited 1 month ago) (1 children)

the autistic overthinking the unit tests

overthinked squared

[โ€“] [email protected] 2 points 1 month ago (1 children)

"What if the test fail?"

*Write a test for the test

[โ€“] [email protected] 1 points 1 month ago* (last edited 1 month ago)

What if the test of the test fails?

Write a test of a test!

[โ€“] [email protected] 8 points 1 month ago

It's strangely satisfying when the "this will probably never happen" test case finds a problem during development.

I had tests for deleting that were like

  • create item a
  • create item b
  • delete item a via the code under test
  • assert item a is gone
  • assert item b is still there

I thought maybe the whole bit with item b was excessive, but sure enough one day I accidentally fucked something up and deleted all the items, and the test pointed it out before the bad code left my local machine.

[โ€“] iAvicenna 4 points 1 month ago (1 children)

what if someone tries to input a cat to this function?

[โ€“] Mertn33 1 points 1 month ago
[โ€“] Beetschnapps 1 points 1 month ago* (last edited 1 month ago)

Think of it as a function you can unleash on othersโ€ฆ