Scrum Booster TDD

Mochamad Aulia Akbar Praditomo
Scrum Booster
Published in
3 min readApr 18, 2019

Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. This is opposed to software development that allows the software to be added that is not proven to meet requirements.

We need to use TDD because it’s a really good way to describe and state what widget and functionality we’re trying to build and goes a long way in keeping the code clean. In Flutter itself there are 3 kinds of tests: Unit test, Widget test, and Integration test. Which each one serves their own purposes.

Image result for test driven development
TDD Illustration (source: Google Images)

In the development of Scrum Booster I create some widget testing for checking code coverage, the testing that I do includes something like this:

List of Ceremonies Test

In Flutter there are 3 main kinds of testing: Widget testing, Unit testing, and Integration testing. Until now what I do is mostly Widget testing because I was tasked to create the layout and the rendering of widgets for the app.

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.

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 other 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.

This is all for now, I am looking to learn more about testing and continue working on the coverage of the app.

--

--