Skip to content

About

NATE is a network-aware testing enhancer guided by RL-based curiosity-driven exploration, to empower existing general Android testing approaches to detect network-related faults.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NATE (Network Aware Testing Enhancer)

Overview

1.1 Network Related Faults (NRFs)

Network Related Faults (NRFs) refer to unexpected app behaviors under abnormal network conditions (only faults explicitly confirmed by the developers are called bugs in our context).

1.2 Background

Nowadays, Android apps are becoming much more network-dependent, with increasingly network-related faults being observed, severely undermining user experience. Given that such faults are scattered in modern apps and require complex network patterns to trigger, their detection is challenging.

1.3 Empirical Study

To date, we still lack a general and in-depth understanding of such faults. To fill this gap, we conduct the first empirical study on 154 real-world network-related bugs filtered from 42 diverse representative Android apps to investigate their characteristics, influences, triggering patterns, and origins.

1.4 NATE

While existing Android testing approaches struggle with detecting such faults due to a lack of effective network events and efficient injection, we propose NATE on the basis of our study, a network-aware testing enhancer to empower existing general Android testing approaches to detect network-related faults. Based on curiosity-driven reinforcement learning, NATE conducts network-aware guidance to inject effective network events, enabling testing approaches to explore network-related extra app functionalities and detect network-related faults.


Publication

Please refer to our ASE 2025 paper "NATE: A Network-Aware Testing Enhancer for Network-Related Fault Detection in Android Apps" for more details. The paper will be published soon.


Empirical Study

2.1 The Identified Real-World Network-Related Bugs

Here is the full list of the 154 identified real-world network-related bugs in our empirical study.
APP URL
AmazeFileManager TeamAmaze/AmazeFileManager#1920
AnkiDroid ankidroid/Anki-Android#17551
AnkiDroid ankidroid/Anki-Android#13867
AnkiDroid ankidroid/Anki-Android#13865
AnkiDroid ankidroid/Anki-Android#12899
AnkiDroid ankidroid/Anki-Android#12850
AnkiDroid ankidroid/Anki-Android#12711
AnkiDroid ankidroid/Anki-Android#9961
AnkiDroid ankidroid/Anki-Android#17639
AnkiDroid ankidroid/Anki-Android#12258
AnkiDroid ankidroid/Anki-Android#10000
AnkiDroid ankidroid/Anki-Android#6829
AntennaPod AntennaPod/AntennaPod#7136
AntennaPod AntennaPod/AntennaPod#956
AntennaPod AntennaPod/AntennaPod#2220
AntennaPod AntennaPod/AntennaPod#1942
AntennaPod AntennaPod/AntennaPod#2906
AntennaPod AntennaPod/AntennaPod#3196
AntennaPod AntennaPod/AntennaPod#2953
AntennaPod AntennaPod/AntennaPod#5255
AntennaPod AntennaPod/AntennaPod#4227
AntennaPod AntennaPod/AntennaPod#5936
ConnectBot connectbot/connectbot#439
DuckDuckGo duckduckgo/Android#3801
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1875240
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1891257
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1914416
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1909562
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1926859
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1926853
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1946571
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1945035
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1918628
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1906466
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1906323
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1876061
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1813835
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1810842
Firefox mozilla-mobile/fenix#18040
Firefox mozilla-mobile/fenix#17086
Firefox mozilla-mobile/fenix#9461
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1933077
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1809311
Firefox mozilla-mobile/fenix#18481
Firefox mozilla-mobile/fenix#17762
Firefox mozilla-mobile/fenix#769
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1940448
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1934486
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1933037
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1868469
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1867815
Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1792950
K9Mail thunderbird/thunderbird-android#8242
K9Mail thunderbird/thunderbird-android#7870
K9Mail thunderbird/thunderbird-android#5425
K9Mail thunderbird/thunderbird-android#5366
K9Mail thunderbird/thunderbird-android#4708
Materialistic hidroh/materialistic#775
Materialistic hidroh/materialistic#293
Materialistic hidroh/materialistic#453
Materialistic hidroh/materialistic#448
Materialistic hidroh/materialistic#309
Materialistic hidroh/materialistic#765
NewPipe TeamNewPipe/NewPipe#11573
NewPipe TeamNewPipe/NewPipe#3923
NewPipe TeamNewPipe/NewPipe#4920
NewPipe TeamNewPipe/NewPipe#4432
NewPipe TeamNewPipe/NewPipe#5452
NewPipe TeamNewPipe/NewPipe#5263
NewPipe TeamNewPipe/NewPipe#8898
NewPipe TeamNewPipe/NewPipe#6298
NewPipe TeamNewPipe/NewPipe#11029
NewPipe TeamNewPipe/NewPipe#9358
NewPipe TeamNewPipe/NewPipe#11191
NewPipe TeamNewPipe/NewPipe#1527
NewPipe TeamNewPipe/NewPipe#938
NewPipe TeamNewPipe/NewPipe#2268
NewPipe TeamNewPipe/NewPipe#2171
NewPipe TeamNewPipe/NewPipe#2421
NewPipe TeamNewPipe/NewPipe#2418
NewPipe TeamNewPipe/NewPipe#3725
NewPipe TeamNewPipe/NewPipe#3368
NewPipe TeamNewPipe/NewPipe#2765
RunnerUp jonasoreland/runnerup#931
Signal signalapp/Signal-Android#11898
Signal signalapp/Signal-Android#11202
Signal signalapp/Signal-Android#9814
Signal signalapp/Signal-Android#7819
Signal signalapp/Signal-Android#7733
Signal signalapp/Signal-Android#7638
Signal signalapp/Signal-Android#6644
Signal signalapp/Signal-Android#6447
Signal signalapp/Signal-Android#6003
Signal signalapp/Signal-Android#5353
Signal signalapp/Signal-Android#2639
Signal signalapp/Signal-Android#1264
Signal signalapp/Signal-Android#7647
SuntimesWidget forrestguice/SuntimesWidget#420
Wikipedia wikimedia/apps-android-wikipedia#4102
Wikipedia wikimedia/apps-android-wikipedia#4650
Wikipedia wikimedia/apps-android-wikipedia#4606
Wikipedia wikimedia/apps-android-wikipedia#5221
Wikipedia wikimedia/apps-android-wikipedia#3781
Wikipedia wikimedia/apps-android-wikipedia#2962
Wikipedia wikimedia/apps-android-wikipedia#1991
Wikipedia wikimedia/apps-android-wikipedia#545
WordPress wordpress-mobile/WordPress-Android#21283
WordPress wordpress-mobile/WordPress-Android#21087
WordPress wordpress-mobile/WordPress-Android#20905
WordPress wordpress-mobile/WordPress-Android#20531
WordPress wordpress-mobile/WordPress-Android#19578
WordPress wordpress-mobile/WordPress-Android#19533
WordPress wordpress-mobile/WordPress-Android#19388
WordPress wordpress-mobile/WordPress-Android#18878
WordPress wordpress-mobile/WordPress-Android#17463
WordPress wordpress-mobile/WordPress-Android#17154
WordPress wordpress-mobile/WordPress-Android#16997
WordPress wordpress-mobile/WordPress-Android#16760
WordPress wordpress-mobile/WordPress-Android#15590
WordPress wordpress-mobile/WordPress-Android#14840
WordPress wordpress-mobile/WordPress-Android#13197
WordPress wordpress-mobile/WordPress-Android#11357
WordPress wordpress-mobile/WordPress-Android#10836
WordPress wordpress-mobile/WordPress-Android#10546
WordPress wordpress-mobile/WordPress-Android#10545
WordPress wordpress-mobile/WordPress-Android#10200
WordPress wordpress-mobile/WordPress-Android#10154
WordPress wordpress-mobile/WordPress-Android#10021
WordPress wordpress-mobile/WordPress-Android#9985
WordPress wordpress-mobile/WordPress-Android#9949
WordPress wordpress-mobile/WordPress-Android#9935
WordPress wordpress-mobile/WordPress-Android#9933
WordPress wordpress-mobile/WordPress-Android#9843
WordPress wordpress-mobile/WordPress-Android#9804
WordPress wordpress-mobile/WordPress-Android#9790
WordPress wordpress-mobile/WordPress-Android#9760
WordPress wordpress-mobile/WordPress-Android#9567
WordPress wordpress-mobile/WordPress-Android#9563
WordPress wordpress-mobile/WordPress-Android#9562
WordPress wordpress-mobile/WordPress-Android#9560
WordPress wordpress-mobile/WordPress-Android#9556
WordPress wordpress-mobile/WordPress-Android#8402
WordPress wordpress-mobile/WordPress-Android#4332
WordPress wordpress-mobile/WordPress-Android#3683
WordPress wordpress-mobile/WordPress-Android#2325
WordPress wordpress-mobile/WordPress-Android#2270
WordPress wordpress-mobile/WordPress-Android#1936
WordPress wordpress-mobile/WordPress-Android#1568
WordPress wordpress-mobile/WordPress-Android#1453
WordPress wordpress-mobile/WordPress-Android#1130
WordPress wordpress-mobile/WordPress-Android#1098
WordPress wordpress-mobile/WordPress-Android#1049
WordPress wordpress-mobile/WordPress-Android#736
WordPress wordpress-mobile/WordPress-Android#688

NATE Tool

3.1 Introduction

NATE is a network-aware testing enhancer guided by RL-based curiosity-driven exploration, to empower existing general Android testing approaches to detect network-related faults.

3.2 Requirements

  • Python: Tested on Python 3.11
  • Android: The normal functioning of ADB commands in the command line.

3.3 Integration

Integrating NATE with a general Android testing approach is very straightforward and could be achieved both intrusively and non-intrusively.

3.3.1 Intrusively

To directly integrate NATE with a general Android testing approach:

  1. Create a Python project. (If the approach itself is Python-based, skip this step.)
  2. Put NATE and android_testing_utils under the root directory of your Python project to avoid import issues. (If you put it elsewhere, you need to adjust the imports yourself.)
  3. For each testing step of the general testing approach, call NATE and pass the required App State and Selected App Event.
3.3.2 Non-Intrusively

Very similar to the workflow in 3.3.1. The only difference is that the required App State and Selected App Event by NATE is obtained non-intrusively, rather than passed by direct function calls. For example, by capturing the real-time log stream from the general testing tools, the required step-wise App State and Selected App Event could be extracted in time.

3.4 Usage

Before the test starts, initialize a NATE_MAIN instance from NATE/nate_main.py:

  • device_id: The device ID of the target device (e.g., "emulator-5554")
  • package_name: The package name of the App Under Test (e.g., org.mozilla.fenix.debug)
  • use_pure_random: To randomly inject network events without guidance, enable this option
  • auto_action: Whether the number of actions in each state is known when testing; if not, enable this option
  • netflow_strategy: As the network-related APIs in different Android Versions are different, we need different strategies. Currently, we have implemented:
    • NetFlowStrategy.mAppUidStatsMap Tested on Android 14 Emulators
    • NetFlowStrategy.xt_qtaguid Tested on Android 9 Emulators

NOTING!!! Before starting NATE, it is suggested to try the network monitoring adb commands on your target Android Version in advance. You may need to implement yours for your Android Version.

At each test loop step t+1, call NATE_MAIN.nate_step:

  • raw_app_state: The state identifier on step t
  • selected_action: The app event on step t, if using auto_action, this is the action identifier; if not, this is the action index
  • target_app_state: The state identifier on step t+1, this may be None when an end state is met
  • target_selected_action: The app event on step t+1, if using auto_action, this is the action identifier; if not, this is the action index
  • raw_action_count: If not auto_action, provide the number of actions on step t, else None
  • target_action_count: If not auto_action, provide the number of actions on step t+1, else None

NATE will automatically learn and inject network events when appropriate.

3.5 Outputs

Call NATE_MAIN.persist_history to persist data.

  • NATE/guidance/q_table: The learned Q-Table.
  • NATE/network_injector/injection_record: The injection history.
  • NATE/network_monitor/network_monitor_record: Network monitoring details.

About

NATE is a network-aware testing enhancer guided by RL-based curiosity-driven exploration, to empower existing general Android testing approaches to detect network-related faults.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages