TL;DR
The new framework LLMVue combines static analysis with large language models (specifically GPT-4o) to automatically extract accurate Page Transition Graphs (PTGs) directly from Vue.js source code. This graph then guides automated GUI testing tools, significantly boosting test coverage and exploration efficiency compared to traditional random testing.
What Problem Does This Paper Address?
Automated Graphical User Interface (GUI) testing often relies on Model-Based Testing (MBT), which uses a blueprint called a Page Transition Graph (PTG) to navigate an application systematically. While MBT works well for traditional multi-page websites, modern Single-Page Applications (SPAs) built on frameworks like Vue.js complicate this approach.
In Vue.js, the navigation logic is highly fragmented. It is scattered across router configurations, Single-File Components (SFCs), embedded JavaScript scripts, and third-party UI library abstractions (like Element UI). Furthermore, conditional rendering directives (such as v-if) mean that certain navigation paths are only visible under specific runtime states or user roles. Traditional static analysis tools and dynamic web crawlers struggle to map these complex, state-dependent transitions accurately, often leading to incomplete or broken test sequences.
Methods
To bridge this gap, the authors developed LLMVue, a three-stage pipeline that blends deterministic code analysis with the semantic reasoning capabilities of LLMs:
- Stage I: Static Graph Extraction: The framework uses Abstract Syntax Trees (ASTs) to parse the Vue router configuration and component templates. Prioritizing high recall (not missing any potential paths), it generates an initial, admittedly noisy candidate graph ($G_1$).
- Stage II: LLM-Based Semantic Refinement: LLMVue feeds the source code and the candidate edges into GPT-4o. Operating in an "enhancement-only" mode, the LLM enriches generic UI selectors with precise text constraints (e.g., appending
:has-text('Book Management')) and extracts visibility guard conditions. A built-in validation loop ensures the LLM doesn't hallucinate or delete valid edges, falling back to the original static data if validation fails. - Stage III: Graph Normalization: A final deterministic post-processing step cleans up the graph. It filters out structural artifacts, resolves conditional branch inconsistencies, removes redundant self-loops, and deduplicates selectors to output a clean, executable PTG ($G_3$).
The final PTG is plugged into a testing engine powered by Playwright to drive systematic, automated GUI exploration.
Datasets
The framework was evaluated on a dataset of 10 open-source Vue.js projects curated from GitHub, ranging from simple library systems to complex examination and management portals. The projects varied in size from 10 to 29 Single-File Components and up to roughly 10,000 lines of code (LOC).
To evaluate accuracy, the authors established a high-quality baseline by collaborating with experienced Vue.js practitioners to manually construct ground-truth navigation graphs for all ten projects using a strict, rule-based protocol.
Key Insights and Ideas
- The Hybrid Sweet Spot: Pure static analysis misses semantic nuances (like user-visible text labels inside abstract UI components), while pure LLM generation is prone to hallucination. Combining high-recall static parsing with an "enhancement-only" LLM refinement step balances completeness and correctness.
- Context-Aware Edge Splitting: Conflating distinct actions that lead to the same URL path (e.g., two role-dependent buttons that both point to
/book) ruins test efficiency. By keeping these edges distinct based on their unique UI selectors and guard conditions, LLMVue prevents the test engine from wasting time clicking invisible elements. - Delayed Gratification in Code Coverage: PTG guidance prioritizes structural exploration (discovering new pages) early in the test cycle. As a result, statement coverage gains might look modest on short time budgets but widen dramatically over longer testing windows as deeper intra-page interactions accumulate.
Key Results
The authors evaluated LLMVue on two fronts: graph quality and testing effectiveness.
- High-Fidelity Graphs: Across all 10 benchmark projects, LLMVue achieved an average precision of 94.57% and a recall of 88.79% (yielding an overall F1-score of 91.25%). The low average Graph Edit Distance (GED) of 16 confirmed that the generated models were structurally very close to the expert ground truth.
- Superior Exploration Efficiency: When compared against a budget-matched random exploration baseline, LLMVue-guided testing executed up to 66.8% more valid user actions and accelerated route-level discovery.
- Better Code Coverage: LLMVue consistently achieved higher statement coverage as the testing time budget increased, showing a clear advantage in unlocking deeply nested application states that random testing could not reach.
Limitations and Future Work
Despite its success, LLMVue faces a few notable challenges:
- Complex Routing Gaps: Asynchronous callback chains (like confirmation dialogs) and deeply nested routing conditions still occasionally cause false negatives (missed edges).
- Intra-Page Blind Spots: PTGs excel at page-to-page transitions but do not inherently capture complex widget-level interactions (like form validation or table sorting) that do not trigger a route change.
Future Directions: The authors plan to close the loop by feeding runtime execution traces back into the LLM to refine the PTG dynamically. They also aim to explore role-aware multi-context subgraphs and hybrid exploration policies that combine structural navigation with systematic, coverage-driven intra-page widget exploration.
Summary updated