Abstract:Android application developers need to quickly and accurately reproduce error reports to ensure application quality. However, existing methods often rely solely on crash information provided in stack traces to generate event sequences, making it challenging to accurately locate the crash page and provide effective guidance for dynamic exploration to trigger crash. To address this issue, this study proposes a component-aware automatic crash reproduction method for Android applications, called CReDroid, which effectively reproduces the crash by leveraging the title and stack trace of crash report. First, CReDroid dynamically explores the application under test to constructs a component transition graph (CTG) by dynamically exploring the application under test, and combines the dynamic exception information of the stack traces with static component interaction information of CTG to accurately locate the target crash component. Second, based on the critical operations in the crash report title and reachable paths in the CTG, CReDroid designs an adaptive strategy that leverages the contextual relationship between the current page's component and the crash component to assign priority scores to GUI widgets. The dynamic exploration process is globally optimized through reinforcement learning to effectively reduce the inaccuracy in the prediction process. We evaluated CReDroid on 74 crash reports and compared its performance with state-of-the-art crash reproduction tools, including CrashTranslator, ReCDroid, and ReproBot, as well as widely-used automated testing tools Monkey and APE. The experimental results show that CReDroid successfully reproduces 57 crash reports, which is 13, 25, 27, 30, and 17 more than CrashTranslator, ReCDroid, ReproBot, Monkey, and APE, respectively. Moreover, for successfully reproduced crashes, CReDroid reduces the average reproduction time by 26.71%, 94.96%, 71.65%, 84.72%, and 88.56% in comparison with CrashTranslator, ReCDroid, ReproBot, Monkey, and APE.