There is a Run with Coverage button in Android Studio (Check attached image) , but it's always disabled, how can I enabled it?
To calculate the code coverage percentage, simply use the following formula: Code Coverage Percentage = (Number of lines of code executed by a testing algorithm/Total number of lines of code in a system component) * 100.
Run test with coverageIt will display what percentage of the code has been covered by the test. You can see the the coverage result on class, methods or line basis.
You need to run a "junit" run configuration, like this one
Only apply when you pass your unit tests
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With