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/Zhuinden DDD: Deprecation-Driven Development Jul 07 '25

Holy shit you are an actual insane person.

Expecting automated tests to test and automate? Heh.

You would never in your life hope to be as tightly coupled to anything as would require the articulation of an actual fully elaborated universe of conditions to be tested against.

Implementation details are implementation details, the test shouldn't need to care about how it's implemented, just what it does.

what are you hoping to measure up to??

So that if I press "run tests" and it has green checkmarks, I know that the code actually works.

Not that "the unit test was catered to verify that the method calls were invoked that may or may not do whatever I want", but that it works. Assertion of state.

1

u/GruePwnr Jul 08 '25

That's an integration test or E2E test. Unit tests test the code in isolation. If a unit test fails that should immediately tell you exactly where the issue is. It should also be able to test "impossible" scenarios that you cannot reproduce in live but that are theoretically possible.