"My repository, where I post anything that I love, I learned and etc."

11 October 2020

Type of Testing (Unit | Widget | Integration | CI)

 Assalamualaikum dan Annyeong chingu!


Hari tu sempat baca an article kat website official for Flutter and I find it quite interesting and the definition given is quite simple and easy to understand.



Unit tests

A unit test tests a single function, method, or class. The goal of a unit test is to verify the correctness of a unit of logic under a variety of conditions. External dependencies of the unit under test are generally mocked out. Unit tests generally don’t read from or write to disk, render to screen, or receive user actions from outside the process running the test. For more information regarding unit tests, you can view the following recipes or run flutter test --help in your terminal.



Widget tests

A widget test (in other UI frameworks referred to as component test) tests a single widget. The goal of a widget test is to verify that the widget’s UI looks and interacts as expected. Testing a widget involves multiple classes and requires a test environment that provides the appropriate widget lifecycle context.

For example, the Widget being tested should be able to receive and respond to user actions and events, perform layout, and instantiate child widgets. A widget test is therefore more comprehensive than a unit test. However, like a unit test, a widget test’s environment is replaced with an implementation much simpler than a full-blown UI system.



Integration tests

An integration test tests a complete app or a large part of an app. The goal of an integration test is to verify that all the widgets and services being tested work together as expected. Furthermore, you can use integration tests to verify your app’s performance.

Generally, an integration test runs on a real device or an OS emulator, such as iOS Simulator or Android Emulator. The app under test is typically isolated from the test driver code to avoid skewing the results.



Continuous integration services

Continuous integration (CI) services allow you to run your tests automatically when pushing new code changes. This provides timely feedback on whether the code changes work as expected and do not introduce bugs.


Sources 


Other Resources for Flutter Testing :

Link1 : Flutter automated testing step by step guide

Link2 : Flutter automated tests get started

Link3 : Flutter driver integration testing flutter app automation

Link4 : Automation Testing of Flutter app with Flutter driver

Link5 : How to automate Flutter app using Flutter driver

Link6 : Running automated Flutter driver test in Android emulator

Link7 : Automation testing in flutter

Link8 : Integration tests codemagic

Link9 : Flutter app testing with appium flutter driver

Link10 : Automate flutter app using appium flutter driver


No comments:

Post a Comment