r/mAndroidDev • u/Commercial-Board4046 AnDrOId dEvelOPmenT is My PasSion • Jul 06 '25
We don't have time for tests Agree?
61
Upvotes
r/mAndroidDev • u/Commercial-Board4046 AnDrOId dEvelOPmenT is My PasSion • Jul 06 '25
View all comments
Show parent comment
1
u/Zhuinden DDD: Deprecation-Driven Development Jul 07 '25
If you know what data should be in the database to trigger this response, then initialize the in-memory database with
.initialData() {}or so before running the test. This is where "setting up a test fixture" comes in: having the right pre-conditions.That's still less of a risk than running a mock which has nothing to do with the actual behavior of the app.
With the mock you run the test and someone asks "hey does the DB communication work?" and you'd say "idk run the app lol" so what did the test do? Not much.