Android Testing Fundamentals: A Comprehensive Guide
This course equips you with a deep understanding of testing in Android development. Learn the importance of testing and compare manual vs. automated approaches. Explore various types of automated tests, including local and instrumented tests, while clearing up misconceptions between local and unit tests. Get familiar with popular frameworks such as JUnit, Compose Tests, Espresso, MockK, Robolectric, and Truth. Gain hands-on experience writing, running, and analysing local tests with JUnit4 and Truth, and understand the AAA (Arrange, Act, Assert) structure for effective test writing. Dive into creating Test Doubles and using MockK for unit tests. Evaluate test coverage, get an introduction to Test-Driven Development (TDD), and follow best practices for writing effective tests. By the end, you'll be skilled in various testing strategies, ensuring the reliability and quality of your Android applications.
Codelab Objectives
In this codelab, you’ll explore:
-
What is Testing, and why is it important in Android App development
-
Compare manual and automated testing approaches
-
Learn different types of automated testing in Android
-
Explore local tests and instrumented tests
-
Clarify common misconceptions between local and unit tests
-
Get an overview of popular testing frameworks: JUnit, Compose Tests, Espresso, MockK, Robolectric, and Truth
-
Write, run, and analyse local tests using JUnit4 and Truth
-
Compare Truth assertions with JUnit assertions
-
Apply the AAA (Arrange, Act, Assert) structure in writing tests
-
Learn about different types of Test Doubles: Dummies, Fakes, Stubs, Spies, and Mocks
-
Use MockK to create mocks for unit testing
-
Write, run, and analyse instrumented tests with Compose Tests
-
Evaluate test coverage for your code
-
Gain a brief understanding of Test-Driven Development (TDD)
-
Follow best practices in writing effective tests
Codelab Content
More courses by the instructor