The art of Flutter testing
summary
Tests are framed as tests lock down behavior not proofs of correctness, and chasing 100% coverage is a bad incentive; prefer a cost‑benefit approach. Use Dart tests for fast IO and business logic, widget tests with WidgetTester (use pump to advance one frame, pump vs pumpAndSettle matters), golden tests for pixel diffs (beware the ahem font squares, shadow simplification and cross‑platform golden mismatches), and integration tests that build an APK/IPA and run on device — trade speed for realism and watch CI flakiness.
AI-written summary · about
chapters (22)
- 0:00Flutter testing myths
- 1:05Tests not about correctness
- 3:14Avoiding 100% coverage
- 7:58Testing incentives dangers
- 8:18Flutter testing tools overview
- 11:51Dart tests for logic and IO
- 12:11Widget tests and fake environment
- 13:57Typical widget test structure
- 14:20Pumping frames in tests
- 17:10Pump and settle risks
- 18:53Pump and settle best practices
- 20:37Using finders in tests
- 23:08Verifying widget properties
- 24:54Simulating gestures and input
- 27:43Virtual Flutter configuration
- 31:13Golden tests verify pixels
- 33:17Generating golden screenshots
- 35:41Cross-platform golden challenges
- 36:03Integration tests on devices
- 37:25Running integration tests
- 38:09Choosing test tools
- 40:15Flutter testing recap
related talks
51mAll About Testing Flutter
41mWriting better tests with less work
38mFlipping the Testing Pyramid
32mexpect(isTestingInFlutterEasy, isTrue);
20mGlitter with Flutter
35mHitting a Gold Mine:How to Set the Gold Standard With Golden Tests
41mTesting Mobile Apps with Flutter & Appium - The Tradeoffs
31mBuilding Consistently Fast Flutter Apps
