Search code examples
flutterunit-testingdarttestingintegration-testing

How to start testing a large project in Flutter?


I'm building a mobile app with flutter framework and dart language, now I'm in the testing phase and I learned all types of tests (unit test, incremental test, integration test), the problem is that all examples in videos and documentation are too simple, the app in examples came with 2 screens and with a max of 2 features and it's not that complex, in my case I have a complex app with more than 20 screens and all features in a delivery app (authentication, send /receive order, messages, notification, tracking, profile ....etc).

I tried to apply my knowledge but the app is complicated all screens are related to each other and I can't test each one separately.

My question is what is the strategy I can use to start testing my app and what exactly the type of methods I should use "unit test" with it, also since "integration test" take time and must run in an emulator which features should I test them with "integration test".


Solution

  • I suggest to start implementing unit test around service, bloc, repository. Then start test view widget where there is some logic.

    After that maybe some integration test around complexe scenario like what happen if I combine many unit test together to simulate a login.