{'fraction_non_alphanumeric': 0.019064124783362217, 'fraction_numerical': 0.0025996533795493936, 'mean_word_length': 5.2771739130434785, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Learning Resource Management Specifications in Smartphones

Over the past few years we have observed a phenomenal growth of smartphones. Smartphones are equipped with various hardware and software resources such as Bluetooth, camera and gravity sensors. If these resources are not managed appropriately, it may cause severe problems such as battery drains and system crashes. However, the specifications of resource management are usually implicit. In this paper, we investigate the problem of mining resource management specifications from off-the-shelf apps. Our key insight is that if a set of operations to a resource are frequently performed in a specific order, it must contain the specifications of how to manage the resource. We design a tool named Automatic Resource Specification Miner (ARSM), to automatically extract resource management specifications in smartphones. In our experiments, ARSM can mine tens of rules from 100 top rated Android apps within six hours. Our work is orthogonal to existing studies on diagnosing smartphone apps. With the resource management specifications discovered, ARSM can help them pinpoint more bugs in apps.