![]() ![]() It is important to have a development architecture that supports testing and uses minimal mocking or no mocking at all. One of the major reasons behind the failure of the unit test automation is an architecture of the app that does not support unit testing. On search of a perfect unit test tools like JUnit, Robolectric, Android instrumentation, we often overlook app development architecture adaptability for unit testing. Maintaining the test code with many mocks takes a lot of effort. Testing the methods in this setup is not easy, you need to have too many dependencies that need to be mocked. When you try to accomplish more than one tasks in a single class, often the Activity or Fragment grows to be a massive class and its methods are intertwined and do everything, everywhere. UI Specific activities like rendering, painting, responding to user events and creation of fragments.Data manipulation and decoration of the retrieved data according to UI needs.Data retrieval from data sources like API, the local database or the content provider.Typical fragment class do the below tasks Writing an android app that has good unit test code coverage is not easy, as the Android code has a massive activity or fragment class that manages more than one function or tasks. When you finish this blog series, I promise, you will learn how to unit test your mobile app, piece by piece. This blog is about my journey of finding the right mobile app unit testing framework and how I arrived at Kotlin Clean Code For Android, a design pattern, it is an improvisation of Android Clean Code. Test Driven Development in Android using Kotlin ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |