Join Chiu-Ki Chan for an in-depth discussion in this video Code coverage, part of Effective Android Testing for Mobile Developers.
- [Instructor] Test driven development…is a great way to make sure that…your code is tested thoroughly.…Another way is to look at code coverage.…Code coverage is a tool to measure…how much of your code is covered by tests…broken down into class, method and line.…You can generate a code coverage report…any time during your development process…to evaluate how much of your code is tested.…To generate a code coverage report,…click on the green triangle on the gutter…and choose, coverage.…
Here, we can see that we have 100% coverage…for class and method, but only 86% for lines.…Double click on it and it will open the class in question.…Let's close the other tabs…so that we can see this file better.…Scroll down and on the side,…you can see next to the line numbers…either green or red.…Green means that that particular line…has test coverage and red mean it doesn't.…
We have red in line 40 for instance.…This means that we do not have coverage…when the description is more than one line.…You can also see that in line 44 and 45 is red…
- Why test?
- Local vs. on-device
- Code coverage
- UI testing
- Hermetic environment
- Dependency injection
- Testing with MVP
Skill Level Intermediate
Android App Development: Unit Testingwith James P White2h 58m Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
1. Testing Considerations
2. Test as You Go
3. UI Testing
4. Hermetic Environment
5. Robot Pattern
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.