Why is unit testing so important?

Let's have a real-life example. Think of an engineer, creating a new motor or device. The engineer will test the functionality after completing each unit of that motor, rather than testing the whole motor at the end (though he / she will test the whole motor at the end, but will also test it repeatedly and incrementally while building it). The main reason behind this behavior is that if he / she doesn't do that, at the end it would take a lot effort to identify the exact problems (if any). While testing incrementally will allow you to fix any problem right away as soon as it arises. The same applies for software (applications) as well.

You should perform unit tests periodically and repeatedly as you develop ...

Get Reactive Programming in Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.