Back to results for “CI/CD”
Flutter › Widget Testing in Flutter

How should a large team properly structure their widget test suite to genuinely balance thorough coverage against considerably reasonable overall test execution time, given that widget tests genuinely run considerably slower than simpler pure unit tests?

Advanced

Answer

A large team maintaining a genuinely extensive widget test suite typically benefits from establishing genuinely clear conventions about precisely which specific kinds of widgets genuinely deserve dedicated widget test coverage, generally prioritizing genuinely complex, frequently reused shared components and genuinely critical user flows over considerably simpler, trivial widgets that a basic unit test on their own underlying logic would already sufficiently cover, and properly running these particular widget tests in parallel across several separate CI runners, combined with genuinely careful attention to avoiding unnecessarily slow pumpAndSettle calls, helps keep an otherwise genuinely large widget test suite's own total overall execution time genuinely reasonable even as it continues steadily growing.
// Prioritizing widget tests for genuinely complex shared components
// and critical user flows over considerably simpler trivial widgets
Real-world example A large team establishes a clear convention that every single shared component within their own internal design system library requires dedicated widget test coverage, while considerably simpler, trivial one off screen specific widgets are instead genuinely covered sufficiently by their underlying unit tested business logic alone.

Common follow-ups: What genuinely specific criteria should determine whether a given widget truly deserves dedicated widget test coverage?;How do you actually properly and correctly parallelize a genuinely large widget test suite to meaningfully reduce its own overall total execution time?