uds-se / droidmate

DroidMate-2: A Platform for Android Test Generation
http://www.boxmate.org/
GNU General Public License v3.0
28 stars 14 forks source link

ISSUE-1: DM2 stops working while recording a test case #1

Closed mmilella94 closed 5 years ago

mmilella94 commented 5 years ago

I am using DM2 to perform capture and replay of automatically generated test cases.

When executing DM2 to record test cases for SyncMyPix (com.nloko.android.syncmypix, downloaded from https://m.allfreeapk.com/syncmypix,4559/syncmypix,0.15.2.html) the recording stops abruptly after 92 seconds regardless the settings. To be precise, what happens here might be related to the exploration strategy taken by DM2. When SyncMyPix is started there is a pop-up with a few links that redirect you in the browser. Usually during test case recording DM2 clicks just on these links and not the OK button, which would instead enable DM2 to use the rest of the application. After clicking two links and the "donate" button DM2 simply ends the testing without exploring the rest of the application (but without throwing any exception). The sequence of links being clicked vary from one execution to another.

I configured DM2 to use the action limit (500 actions) and no time limit (0). Also, to overcome this error i have tried to unbound the action limit (0) and to set the time limit to 4000000 but the test still blocks after 90 secs.

Setup: Android 7.1.1 NEXUS 9 API 25 emulator with Android Studio version 3.2.1 All the Apk has been instrumented

Thank you

natanieljr commented 5 years ago

Hi,

Thanks for the feedback.

You can disable the "cannotExplore" selector in order to explore more actions.

It's currently an optimization decision. What happens is that, if DM2 cannot explore the app for a few actions, it assumes there's nothing to explore (or the app cannot be run) and stops.

If you disable this selector DM2 will attempt to reset the exploration more times and do the 500 actions.

We're thinking of removing this selector from the default set, but we welcome any other suggestion you may have.

The selector is here: https://github.com/uds-se/droidmate/blob/master/project/pcComponents/core/src/main/kotlin/org/droidmate/exploration/StrategySelector.kt

mmilella94 commented 5 years ago

Hi, Thank you for the swift answer to my problem, i think that it could be a nice idea to disable this selector in the default settings because someone that does not know this setting and face the same problem, could mistakenly think of it as a bug in the program.