For the More Curious: Integration Testing

We said earlier that SoundViewModelTest is a unit test and that your other option was to create an integration test. So: What is an integration test?

In a unit test, the item under test is an individual class. In an integration test, the item under test is a section of your app, with many pieces working together. Both of these tests are important and serve different purposes. Unit tests ensure correct behavior of each class unit and your expectations of how these units will interact with each other. Integration tests verify that the individually tested pieces actually do integrate together properly and function as expected.

Integration tests can be written for non-UI parts of your app, such ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.