Dart: Unit Testing

Dart: Unit Testing

ยท

2 min read

Why we need Testing?

  • In very small app and small feature we do not need testing , like when we install Flutter at that time they provide one template, in this there is small function so we can check by manually.

  • But what if, our code go lengthier and lengthier and there are many big and small function which we have to check it and test it at that time manual testing is not possible.

  • Automated test help ensure that you app perform run perfectly before you publish it, while retaining your feature bug fix velocity.

  • There are total 3 Category of testing.

    1. Unit Test

    2. Widget Test

    3. Integration Test

  • Unit test is only test single function , class and method.

  • Widget test doing the test of single widget. In short team it test UI or Components. Like checking button ,text field ETC.

  • Integration test doing complete app or large part of the code.

Let's see the Table of Test

UnitWidgetIntegration
ConfidenceLowHigherHighest
Maintenance CostLowHigherHighest
DependenciesFewMoreMost
Execution SpeedQuickQuickSlow

Did you find this article valuable?

Support Vinit Mepani (Flutter Developer) by becoming a sponsor. Any amount is appreciated!

ย