Join Chiu-Ki Chan for an in-depth discussion in this video UI-less on-device test: RecipeStore, part of Effective Android Testing for Mobile Developers.
- [Instructor] The recipe class parses a single recipe…into a Java object.…Let's use that to build a recipe store…with a list of recipes.…I have shown you how to do strict test-driven development,…always writing the test code before the implementation.…However, I often write the implementation first…but write the test immediately afterwards.…This flows better for me,…and I'm going to use that style for the rest of this course.…
Just remember not to write…the implementation and then skip the test.…To create recipe store, right-click on data.model,…New > Java class.…Name it RecipeStore, and change the package to data.local.…Press OK.…Create a constructor…which takes a context and a string directory.…We will need to import the context,…but it'll be annoying to do is every single time.…
So I'm going to turn on auto import.…Go to Preferences…and search for Auto Import.…Click on the box that says Add unambiguous imports…on the fly, and press OK.…And now, Android Studio imported context…automatically for me, and it will do it from now on.…
- 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.