2

As stated in the docs and other SO questions Android Studio provides a way to run your tests and get the code coverage (class, method and line level).

What framework or tool does it use internally to get the coverage ?

FlyingPumba
  • 1,015
  • 2
  • 15
  • 37

1 Answers1

2

Android Studio is based on IntelliJ, and as such uses IntelliJ's IDEA Code Coverage Runner. This is open source, and can be found here

WoogieNoogie
  • 1,258
  • 1
  • 11
  • 21
  • But I can't find anything specific to Android in that repo, and there is no clue on how AS gets the coverage from the device. – FlyingPumba Mar 29 '18 at 00:53
  • The code coverage does not run based off of the device, or off anything Android specific. The code coverage tool simply runs an analysis of each file that is tested, and which methods are called in the tests. – WoogieNoogie Mar 29 '18 at 01:21
  • I'm not following. `The code coverage tool simply runs an analysis of each file that is tested, and which methods are called in the tests` How does it obtain the data to analyze ? You need Android specific stuff to gather the information regarding which lines/methods were executed. – FlyingPumba Mar 29 '18 at 03:41