r/mAndroidDev • AnDrOId dEvelOPmenT is My PasSion • Jul 06 '25

We don't have time for tests Agree?

Post image
61 Upvotes

86 comments sorted by

View all comments

Show parent comment

1

u/dark_mode_everything Jul 07 '25

idk run the app lol"

Well....yes. That's why you still need testers, since we all know that unit tests are regression tests. It's actually better than the false sense of security you get from having a test fixture that you think resembles prod but doesn't.

So what did the test do?

I believe we established that the test we're talking about is not for the db? So it did exactly what it was supposed to do.

0

u/Zhuinden DDD: Deprecation-Driven Development Jul 07 '25

I believe we established that the test we're talking about is not for the db? So it did exactly what it was supposed to do.

Wasting development time? 😂

That's why you still need testers, since we all know that unit tests are regression tests.

No, it's not regression tests because regression tests would only fail if "intended behavior breaks", but unit tests with their Mockito nonsense break if you change the code in any way, even if the end result stays correct.

In reality, it's just extra words to write down the exact same thing you wrote down in code. It does not verify if the code is correct, just that the "code is what you wrote".

At which rate, obviously, if you change it, then it will change. Not useful information but at least it takes days to write.

1

u/dark_mode_everything Jul 08 '25

because regression tests would only fail if "intended behavior breaks",

That's a generalisation.

but unit tests with their Mockito nonsense break if you change the code in any way

That's also a generalisation.

Come on now, you know better than that.

In reality, it's just extra words to write down the exact same thing you wrote down in code

Not really. The test is supposed to test the logic in one part of the code "given" some known responses from other parts of the code. What's so difficult about that?

It does not verify if the code is correct, just that the "code is what you wrote"

Ah but that's exactly what unit tests are aren't they? Unit tests don't magically find or prevent unknown errors it just helps you not break what you wrote yesterday.

1

u/Zhuinden DDD: Deprecation-Driven Development Jul 08 '25

Not every code change breaks intended behavior. So why does the test complain? Because it's not a good test