'Unit Testing, Widget Testing and Integration Testing in a flutter?
What is Unit Testing, Widget Testing and Integration Testing in a flutter? Someone can explain to me?
Solution 1:[1]
Yes sure! All these apply to all platforms that support the following testing mechanisms, not just Flutter.
Unit testing This is where you want to test functions using test data as input and then you test the output of the function. So it really is just to make sure specific functions work as expected and return the expected result given an input.
Integration testing This is where you test multiple functions usually hitting a backend at the same time. This is to say you are testing the integration of your application with its backend, whether that backend is local or sitting on a cloud server. An example is testing the entire login/logout flow of your app with a real or mock backend.
Widget testing As its name indicates, this is to test that your graphical user interface (widgets) on the screen behave as expected when the user performs various tasks. Let's say when a user presses a button, you'd expect it to make an API call and return with data. You can put that to test using widget testing.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vandad Nahavandipoor |
