samedi 30 avril 2016

Android Testing Frameworks clarification

Trying to learn instrumentation testing scenarios. While going over the relevant documentation for the ActivityInstrumentationTestCase2, i learned that we can use the ActivityInstrumentationTestCase2 in conjunction with Espresso to write so called "functional" tests. Or at least that is what i understood from the relevant documentation.

However i ran into something called a ActivityUnitTestCase and a ServiceTestCase, which i had never heard of before. Trying to figure that out led me down a wild goose chase and now i am terribly lost here with so many verbiages to the whole Android testing paradigm.

  1. Considering from a high level that Android testing broadly falls into two buckets: Unit testing and functional testing. Out of the following, which falls under which.

    JUnit, JUnit4, TestCase, AndroidTestCase, ActivityInstrumentationTestCase2, ServiceTestCase, ApplicationTestCase, AndroidTestRunner, AndroidJUnitRunner, AndroidJUnit4

  2. What should be used when?

  3. Do any of them relate to the actual Unit testing (by which i mean POJO testing). I ask this because i have noticed some tutorial links in which the sample test case extends JUnit4/TestCase and is still termed a unit test whereas one of the links below does not extend anything at all and still works as a simple POJO test case. Which raises the question what exactly is the difference between a JUnit4 and simple POJO test class.

References that i have checked so far:

http://ift.tt/1NK22Ad

http://ift.tt/1Eog6IQ

Android Test Frameworks

Robolectric vs Android Test Framework

http://ift.tt/INXpW7

Any ideas, tips much appreciated. Thanks!

Aucun commentaire:

Enregistrer un commentaire