Recall & Review
beginner
What is a fake in repository testing?
A fake is a simple implementation of a repository or data source used in tests to simulate real behavior without accessing real databases or network. It helps test logic in isolation.
Click to reveal answer
intermediate
Why use fakes instead of mocks in repository testing?
Fakes provide a working implementation with simple logic, making tests more realistic and easier to maintain compared to mocks, which only simulate behavior and require setup for each test.
Click to reveal answer
beginner
How does a fake repository improve test reliability?
By using a fake repository, tests run quickly and consistently without relying on external systems like databases or network, reducing flakiness and making debugging easier.
Click to reveal answer
intermediate
What is a key difference between a fake and a stub?
A fake has a working implementation with simple logic, while a stub only returns fixed data without any logic.
Click to reveal answer
beginner
In Kotlin, how might you implement a fake repository for testing?
Create a class implementing the repository interface with in-memory data structures to store and return data, simulating real repository behavior without external dependencies.Click to reveal answer
What is the main purpose of using a fake repository in tests?
✗ Incorrect
Fakes simulate data access without relying on real databases or network, making tests faster and more reliable.
Which of these is true about a fake repository?
✗ Incorrect
A fake repository uses simple logic and in-memory data to simulate real repository behavior.
Why might you prefer a fake over a mock in repository testing?
✗ Incorrect
Fakes have simple working logic, making tests closer to real scenarios compared to mocks which only simulate calls.
What is a common data storage method inside a fake repository?
✗ Incorrect
Fakes often use in-memory collections to store and retrieve data quickly during tests.
Which statement about repository testing with fakes is false?
✗ Incorrect
Fakes do not connect to real databases; they simulate data access in memory.
Explain how a fake repository works and why it is useful in testing Android apps.
Think about how you can test data logic without using a real database or network.
You got /5 concepts.
Describe the difference between a fake, a mock, and a stub in repository testing.
Focus on how each one behaves and what they provide in tests.
You got /5 concepts.