this post was submitted on 29 Jun 2025
25 points (85.7% liked)

Programming

21332 readers
195 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] karlhungus@lemmy.ca 3 points 4 days ago* (last edited 4 days ago) (1 children)

Almost always use parameterized style tests, always have a name field, I don't use full sentences tho, that seems like too much. Don't believe I've ever seen a test like that either

These toy examples feel like strawmen to me

[–] McMonster@programming.dev 2 points 4 days ago (1 children)

I've seen codebases that had old testValid2 style of test as well as fully fleshed out conversionReturnsNullOnEmptyString style. Working there made me apreciate proper naming. I know different test frameworks in different languages let you name the test separately, but it's a bit of an effort duplication.

[–] karlhungus@lemmy.ca 2 points 4 days ago

Go has an idiom like so https://github.com/hashicorp/vault/blob/8da4386caceb3fdfaa90074bb29c77e8a99c7dad/api/kv_test.go#L27, when i mention name i'm referring to that string.

I get what your saying, we've all worked in terrible code bases, i've also worked in code bases where this kind of article was enforced. What you wound up with was something that was very wordy.