Skip to content
academia.sh

Unit 01 of 03

Testing

Unit tests for pure Kotlin layers, mocking dependencies, on-device tests, component-based and classic UI tests, flakiness caused by waiting and concurrency, and static analysis.

Published Updated

Lessons

  1. 01 Unit Tests A unit test pins the number a function in the pure Kotlin layer produces for a set of inputs. The lesson classifies in how many samples a measurement exceeds its budget with four answers: within, minority, majority, all. 15 min read
  2. 02 Mocking Mocking puts a test double in place of a real dependency in a test. The lesson counts how many times a repository goes to the network source in each operation and shows what a test double does and does not let you measure. 15 min read
  3. 03 On-Device Tests An instrumented test runs a real screen on a device or an emulator and pays for each test's setup again. The lesson measures in how many tests the setup work exceeds the budget and what sharing the setup costs. 14 min read
  4. 04 UI Tests A UI test finds a node on a screen, interacts with it, and verifies the result. The lesson measures that looking a node up by its text walks the semantics tree from the start, while looking it up by its test tag finishes in one step. 15 min read
  5. 05 Test Stability A test that sometimes passes and sometimes fails on the same code is flaky. The lesson measures in how many runs a test that waits a fixed number of rounds exceeds its budget against the ready round, and how polling on a condition closes the overrun. 4 min read
  6. 06 Static Analysis Static analysis reads code without running it and lists rule violations. The lesson measures in how many modules the number of violations per module exceeds the budget, and how a baseline file changes the count. 15 min read

Start typing to search.

↑↓ ↵ Esc navigate · open · close