Android Unit Testing Basics

<p>In mobile application development, we have many trending things which are in progress like MVVM, Jetpack, KMM(Kotlin Multiplatform), etc. Testing is one of the important and preferred things nowadays. Testing has become a crucial factor in development. There are multiple strategies for app testing. In most of the interviews, the knowledge of writing unit test cases has become a must. So in this post let&rsquo;s see what is unit testing and some basics of writing local unit test cases.</p> <p>As everything can&rsquo;t be covered in a single post I will be writing a series on testing. If you want to jump to code please check out the Github repo:&nbsp;<a href="https://github.com/pavan5208/android_unit_tests" rel="noopener ugc nofollow" target="_blank">android_unit_tests</a></p> <h1>Do we need to write Unit Test Cases?</h1> <p>The answer would be yes to most of the cases. As we have faster development cycles running to meet product requirements we are out of this scope in most cases or not adopting it as we haven&rsquo;t started. However, out there many companies are following the approach of writing unit tests for achieving better code quality in order to build great products.</p> <p>Even writing unit tests helps to resolve bugs and on the other hand, writing test cases can also help to resolve issues related to existing code changes of which we might not be aware.</p> <h1>What is Unit Testing?</h1> <p>Unit testing means testing the written code by small parts. We usually write programs that have classes and further the logic in classes is divided into methods. Unit refers to a small piece of code that can be either method, class, or component. The aim of unit tests is to be to verify the logic of individual units.</p> <p><a href="https://betterprogramming.pub/android-unit-testing-basics-3e7075a432a1">Click Here</a></p>