Test Driven Android Development

Published Apr 02, 2017Last updated Apr 06, 2017
Test Driven Android Development

I was always wondering about the Test Driven Development. It was stated When I was doing my GSoC 2016 project Mifos Android-Client. I had to write the Unit and Instrumentation Testing of the previous features and new ones that I was going to write.

In starting, I was doing the Google and reading the blogs and Github projects. I found it is good to learn, how can we write the test because TDD comes after you are good in writing the Unit and Instrumentation test. It’s not necessary that you should be expert in writing the test cases, but you should be familiar with Unit and Instrumentation.

Here are steps that I followed during whole summer.

1. Architecture: Application needs an architecture to write the Unit and Instrumentation easily. It can be MVP or MVVP.

2. Learn how to write Unit and Instrumentation test and be familiar.

3. What is TDD, How it works?

4. It’s time to replace your present development structure with TDD.

Now Let me tell you the whole process in stepwise.

1. Architecture: There are lot’s of architecture but I am following two

  • MVP architecture by Google

  • MVP architecture by Ribot.

You can start with anyone but If you don’t have experience with MVP so start with Ribot MVP boilerplate architecture.

2. I can feel the pain If you are writing the test cases first time in your life. Sometime It can take a day to pass the test case.

Here are some good articles that gave me confident and Now I have good understanding regarding the Unit and Instrumentation testing.

You can also read about the Unit and integration testing in MVP architecture by Google and Ribot sample.

3. Now we are familiar with MVP architecture and Testing. Let’s read about the TDD. I found some good blogs that are very helpfull for me.

4. If you have followed the above steps then It’s time to implement TDD in your next project.

Best of Luck 👍

Discover and read more posts from Rajan Maurya
get started