425
Unit Tests (sh.itjust.works)
submitted 3 weeks ago by [email protected] to c/[email protected]
all 18 comments
sorted by: hot top controversial new old
[-] [email protected] 20 points 3 weeks ago
[-] wreckedcarzz 8 points 3 weeks ago

Hooray! ๐ŸŒฎ

[-] Clent 14 points 3 weeks ago

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

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

[-] [email protected] 7 points 3 weeks ago

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 3 weeks ago
[-] Thcdenton 10 points 3 weeks ago* (last edited 3 weeks ago)
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] 6 points 3 weeks ago

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

[-] Thcdenton 4 points 3 weeks ago* (last edited 3 weeks ago)

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

[-] [email protected] 6 points 3 weeks ago

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

[-] Thcdenton 4 points 3 weeks ago
[-] [email protected] 3 points 3 weeks ago

Nah just informed you lol

[-] [email protected] 7 points 3 weeks 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.

[-] [email protected] 7 points 3 weeks ago* (last edited 3 weeks ago)

the autistic overthinking the unit tests

overthinked squared

[-] [email protected] 2 points 3 weeks ago

"What if the test fail?"

*Write a test for the test

[-] [email protected] 1 points 3 weeks ago* (last edited 3 weeks ago)

What if the test of the test fails?

Write a test of a test!

[-] iAvicenna 3 points 3 weeks ago

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

[-] Mertn33 1 points 3 weeks ago
this post was submitted on 23 May 2024
425 points (98.0% liked)

Programmer Humor

17958 readers
203 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