A GA-Based Approach to Automatic Test Data Generation for Data-Flow Testing of Android Applications
DOI:
https://doi.org/10.64252/0jkjdv47Keywords:
Search-Based Software Testing, Data-Flow Testing, Automatic Test Data Generation, Genetic Algorithms, Android Application Testing.Abstract
Automated test data generation is a critical yet challenging task in software testing, particularly when aiming to satisfy specific adequacy criteria. Within the field of Search-Based Software Testing (SBST), test data generation is commonly formulated as an optimization problem, where metaheuristic techniques such as Genetic Algorithms (GAs) are employed to produce effective test cases. Although GA-based approaches have been applied to data-flow testing in traditional software systems, they do not adequately address the distinctive characteristics of Android applications, including event-driven execution and complex user interface (UI) interactions. To overcome these limitations, this paper proposes a GA-based automated test data generation approach and a supporting tool specifically designed for data-flow testing of Android applications. The proposed method exploits data-flow dependencies within the Application Under Test (AUT) to generate test data that satisfy the all-uses coverage criterion. A key innovation is the chromosome representation, in which each individual is encoded as a sequence of UI control objects (genes) organized into logical activity blocks. To enhance the search process, two specialized genetic operators are introduced: block crossover and control-based mutation. The proposed GA generates new test data by recombining and evolving previously successful test cases, thereby maximizing data-flow coverage. The accompanying tool takes as input an instrumented version of the AUT, a set of definition-use (def-use) pairs to be covered, and information about input controls. As output, it produces a suite of test cases, identifies the def-use pairs covered by each test case, and reports any remaining uncovered pairs. The paper includes a case study that demonstrates the practical application of the proposed approach on real-world Android applications. Experimental results show that the proposed method effectively generates test data satisfying the all-uses criterion while efficiently exposing faults in Android applications. This work represents the first integrated solution that combines GA-based optimization, Android application instrumentation, static analysis, and UI-aware chromosome representations to systematically generate high-quality test cases that maximize data-flow coverage and improve fault detection in Android applications.




