this post was submitted on 26 Feb 2025
719 points (98.0% liked)

Programmer Humor

20886 readers
1426 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 17 hours ago

Yes, software, and specifically C# unit tests in my case. Positive unit tests check if the code works as expected when given valid inputs. They confirm that the function or module behaves correctly under normal conditions. Negative unit tests check how the code handles invalid or unexpected inputs. They ensure that errors are properly caught, exceptions are handled, and the system doesn’t break when things go wrong.
As for examples, it's just the LLMs I have tried never wrote negative tests that actually worked. If you use Visual Studio, you're probably familiar with those check marks that it has on unit tests. Those become green check marks when the test is valid, red X when it is invalid (isn't correct). The negative tests from LLMs always have red X's. Hope this makes sense.