I'm trying to understand unit testing in android / java, why we need where and how to use them.

Questions:

  1. What classes need to be covered with tests?
  2. What is the best (most popular) for unit tests in android?
  • everything is exactly the same as in Java . Since all the "units" are written in java , then their testing is carried out exactly to the point, as for the usual java - Vladyslav Matviienko
  • @metalurgus, this is understandable) but in java I did not use unit tests either ( - researcher
  • Then edit the question so that it is not about Android, but about Java. This will make it accessible to more people. - Vladyslav Matviienko

1 answer 1

There is such a framework for unit tests on an android: Mockito

But to understand the principles of unit testing, it is worth reading at least some number of articles / books. Start with an article in Wikipedia , follow the links in the issue of Google on the corresponding request.

  • one
    Thanks for the answer. Already more or less understood the essence of unit tests and integration :) Well, already already Roylectric, Espresso, JUnit 4) - researcher