One of the first things developers often do when adopting or evaluating a new language is that they roll it out gradually, starting with unit tests. The advantage of using this approach is that since your tests are not going into production, any issues with the language or bugs in the language library won't impact the real code. It gives the developers a chance to evaluate whether the language is a good fit for their needs, without worrying about the need to rewrite critical parts of their main code base if they decide to reject the new language.
In this chapter, we will introduce a powerful Kotlin testing library known as KotlinTest. This open source library is available on GitHub. By leveraging the powerful features of Kotlin, it provides useful testing features beyond what the typical Java test frameworks, such as JUnit or TestNG, currently offer.
The...