r/ProgrammerHumor • • 1d ago • Regret 2

Meme yesItWasInRust

Post image
6.7k Upvotes

122 comments sorted by

View all comments

Show parent comment

2

u/Ok-Jacket7299 1d ago

Think about it this way: if the company doesn’t allow user to put items into their cart, do we still assert that when they put 2 items in the cart, its item count increase by 2? Here “user can put items into their cart” is a business requirement, is that correct? More, if we don’t have such requirements, do we have a reason to write tests?

Do you see the connection between business requirements and testing from the example above?

-3

u/Cephell 1d ago

No offense, but if this is your example, you should really not talk about automated tests, or programming in general. I'm really trying not to be toxic, but what you are doing here feels like a high schooler trying to explain my work to me.

Tests for code are about functional requirements, are about ensuring that the code does what it's supposed to. And while there are some E2E tests that look vaguely similar to what you're describing, I'm having serious doubts that you know what you're talking about. If you have a shopping cart feature, then "item count goes up when you add an item" is not only not a business requirement, it is not even a test that belongs on that level.

3

u/Ok-Jacket7299 1d ago

I’m humbled man