简体   繁体   English

如何在 Flutter 中开始测试大型项目?

[英]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).我正在使用 Flutter 框架和 dart 语言构建一个移动应用程序,现在我处于测试阶段,我学习了所有类型的测试(单元测试、增量测试、集成测试),问题是视频和文档中的所有示例太简单了,示例中的应用程序带有 2 个屏幕,最多具有 2 个功能,它并不复杂,在我的情况下,我有一个复杂的应用程序,有 20 多个屏幕和交付应用程序中的所有功能(身份验证、发送 /接收订单、消息、通知、跟踪、个人资料......等)。

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".我的问题是我可以使用什么策略来开始测试我的应用程序以及我应该使用“单元测试”的确切方法类型,因为“集成测试”需要时间并且必须在模拟器中运行我应该使用哪些功能用“集成测试”测试它们。

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.之后可能会围绕复杂场景进行一些集成测试,例如如果我将许多单元测试组合在一起来模拟登录会发生什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM