Skip to content

srknskr/trace-guided-android-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trace-Guided Android Test Generation

Research companion for integrating recorded user interactions into search-based Android GUI testing.

This repository documents the trace-guided extensions developed for the M.Sc. thesis “Combining Genetic Algorithms and User Interaction Recordings to Enhance Automated App Testing.” The work connects an Android interaction recorder with the MATE automated Android testing tool, then uses the recorded traces in two complementary ways:

  1. as seeds for genetic-algorithm populations; and
  2. as context-aware mutation material during search.

This is a publication-oriented research companion, not a fork of MATE. It intentionally excludes university/private source code, complete Git history, APKs, raw interaction recordings, cluster configuration, credentials, and machine-specific paths.

Trace-guided testing architecture

Research questions

RQ Question Main finding
RQ1 Can recorded Android interactions be replayed faithfully? The companion AppRecording repository evaluates record/replay similarity over 53 scenarios.
RQ2 How does trace-based population seeding affect branch coverage? The best aggregated seed fraction was 1.0 for MOSA and 0.8 for MIO.
RQ3 How often should replay mutation be selected at a fixed similarity threshold? With tau = 0.5, the best aggregated MIO replay probability was 0.8.
RQ4 Which similarity threshold and replay probability work best together? The global MIO choices were tau = 0.2 and replay probability 0.4.
RQ5 Does the globally tuned trace-guided configuration beat baseline MIO? Median final branch coverage increased in 6 of 7 subject apps.

Contributions

The implementation work introduced the following concepts into the experimental MATE branch:

  • Trace translation: recorded CLICK, LONG_CLICK, SCROLL, and TEXT_INPUT events are converted into MATE primitive actions while retaining element metadata and coordinate fallbacks.
  • Direct JSON replay: one or more recorded scenarios can be replayed as MATE test cases, with coverage and fitness collected after execution.
  • Generation-aware seeding: each generation receives an exact, shuffled quota of seeded individuals. A seed is replayed and then padded with random actions in the same application session.
  • Seed diversification: after the first complete seed cycle, a random prefix of a trace is retained and the remaining action budget is filled by exploration.
  • Replay mutation: mutation can inject a recorded segment when the current screen is sufficiently similar to the segment’s recorded pre-state.
  • Experiment instrumentation: configuration values, generations, fitness evaluations, replay attempts, successful injections, and final coverage are reported consistently for the empirical study.

The implementation map identifies the affected components without redistributing their source. The algorithm descriptions provide implementation-independent pseudocode.

Experimental design

  • Subject apps: 7 Android applications
  • Independent runs: 10 per app and configuration
  • Search budget: 60 minutes per run for RQ2–RQ5
  • Primary outcome: final branch coverage
  • Algorithms: MIO and MOSA for seeding; MIO for replay-mutation tuning
  • Selection rule: maximize the mean of the seven per-app median final coverage values
  • Statistical reporting: two-sided Mann–Whitney U tests and Vargha–Delaney A12 effect sizes

Full methodology and parameter grids are listed in docs/methodology.md.

Parameter tuning

Aggregated MIO tuning results

The tuning results show why trace use should remain complementary to exploration. The strongest aggregate setting is not always the most aggressive setting: MIO seeding peaks at 0.8, the global screen-similarity threshold is permissive at 0.2, and replay mutation peaks at probability 0.4 after that threshold is fixed.

Baseline comparison

RQ5 baseline versus trace-guided MIO

The globally tuned MIO configuration used:

seed_fraction = 0.8
replay_mutation_cosine_tau = 0.2
replay_probability = 0.4

It increased median final branch coverage in 6/7 apps. Statistically significant improvements at alpha = 0.05 were observed for Shopping List, TSCH_BYL, and Activity Diary. Rental Calc produced the largest absolute median gain (+23.46 percentage points), but with high run-to-run variability.

The exact values plotted above are available in data/rq5-medians.csv.

Relationship to the software artifacts

  • AppRecording is the public, sanitized Android recorder artifact and covers the record/replay part of the thesis.
  • MATE is the upstream Android test-generation framework. MATE is maintained independently and licensed under LGPL-3.0.
  • This repository documents the thesis-specific trace-guided integration. It is deliberately independent of both codebases so that the academic contribution can be reviewed without exposing unrelated or private implementation.

Repository contents

assets/                     Original diagrams and result visualizations
data/                       Aggregated values reported in the thesis
docs/algorithms.md          Implementation-independent pseudocode
docs/implementation-map.md Contribution-to-component mapping
docs/methodology.md         Experimental setup and parameter grids
docs/security-and-scope.md  Disclosure and exclusion policy
CITATION.cff                Citation metadata

Citation

If you refer to this work, please cite the thesis:

@mastersthesis{seker2026traceguided,
  author  = {Serkan Şeker},
  title   = {Combining Genetic Algorithms and User Interaction Recordings
             to Enhance Automated App Testing},
  school  = {University of Passau},
  year    = {2026}
}

Disclosure and rights

This repository contains original documentation, aggregate research results, and newly drawn figures. It does not grant access to non-public MATE branch source code or third-party application artifacts. See docs/security-and-scope.md and NOTICE.md.

About

Research companion for trace-guided Android GUI test generation using MATE

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors