Testing

One of the most important phases of development is writing unit tests to check your code.

What are unit tests u ask?

There’s a lot more to unit testing than this. Some developers prefer Test-Driven Development (TDD) where the programmer writes a test before any production code and then writes the code that will make that test pass. For this project, I've used the most traditional way of writing tests, where programmers write unit tests after the production code.

While I was a bit familiar with android unit testing before, writing complete unit tests for the android components like ViewModel, Fragments, Adapters was certainly challenging.

During this testing period, I learned a lot about Junit, Robolectric, and Mockito. With the help of mentors, I made it through the testing with 78% coverage, which in my opinion is quite good for the first try.

Next up, I’ll be working on saving selector state and image preview if time permits.

To be continued …..

--

--

A geek who loves everything.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store