Next Article in Journal
Hybrid IoT-VIoT System for Real-Time Water-Level Monitoring Using Computer Vision
Previous Article in Journal
Hybrid Knowledge Distillation for Edge-Efficient Video Action Recognition: Improving Lightweight 3D CNNs via Joint Distillation
Previous Article in Special Issue
BlackBoxTestGen: An Automatic Black-Box Test Case Generation Framework
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Article

Heterogeneous Graph Transformer with Multi-View Representation Learning for Flaky Test Detection

1
School of Big Data and Artificial Intelligence, Chizhou University, Chizhou 247100, China
2
BNRist, Tsinghua University, Beijing 100084, China
3
State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications, Beijing 100876, China
*
Author to whom correspondence should be addressed.
Computers 2026, 15(6), 372; https://doi.org/10.3390/computers15060372
Submission received: 9 May 2026 / Revised: 29 May 2026 / Accepted: 3 June 2026 / Published: 7 June 2026
(This article belongs to the Special Issue Advancing Software Engineering with Artificial Intelligence)

Abstract

Continuous Integration pipelines rely on large-scale automated testing to support rapid releases. However, flaky tests exhibit non-deterministic outcomes under an identical code and configuration, substantially increasing rerun costs and hindering fault localization. Existing approaches struggle to uniformly model heterogeneous runtime evidence and its multi-relational structure in CI environments, which limits cross-project generalization and interpretability. To address this gap, this paper presents HgtFlaky, a runtime-evidence-centered multi-view heterogeneous graph learning framework. A Unified Event Model is introduced to normalize heterogeneous CI artifacts into semantically consistent event quadruples, and a heterogeneous execution graph is then constructed to capture testing entities and multiple relation types. Based on the HEG, three complementary views are derived to characterize run-level, test-level, and thread-level flaky behaviors. A heterogeneous graph Transformer is further adopted to jointly encode the multi-view graph instances and learn transferable test-level representations for flaky/non-flaky prediction. Experiments on two benchmark datasets, FlakeFlagger and IDoFT, show that HgtFlaky achieves strong and stable performance. Under 10-fold cross-validation, it obtains an F1-score of 83% on FlakeFlagger and 98% on IDoFT. Under per-project validation on FlakeFlagger, HgtFlaky achieves 78% Precision, 89% Recall, and 81% F1-score, outperforming Flakify by 8 percentage points and FlakeFlagger by 74 percentage points in F1-score.
Keywords: Continuous Integration; runtime evidence; heterogeneous execution graph; Unified Event Model; test flakiness Continuous Integration; runtime evidence; heterogeneous execution graph; Unified Event Model; test flakiness

Share and Cite

MDPI and ACS Style

Dai, P.; Ma, X.; Zhao, Y.; Gong, Y. Heterogeneous Graph Transformer with Multi-View Representation Learning for Flaky Test Detection. Computers 2026, 15, 372. https://doi.org/10.3390/computers15060372

AMA Style

Dai P, Ma X, Zhao Y, Gong Y. Heterogeneous Graph Transformer with Multi-View Representation Learning for Flaky Test Detection. Computers. 2026; 15(6):372. https://doi.org/10.3390/computers15060372

Chicago/Turabian Style

Dai, Peng, Xiaoqin Ma, Yanyang Zhao, and Yunzhan Gong. 2026. "Heterogeneous Graph Transformer with Multi-View Representation Learning for Flaky Test Detection" Computers 15, no. 6: 372. https://doi.org/10.3390/computers15060372

APA Style

Dai, P., Ma, X., Zhao, Y., & Gong, Y. (2026). Heterogeneous Graph Transformer with Multi-View Representation Learning for Flaky Test Detection. Computers, 15(6), 372. https://doi.org/10.3390/computers15060372

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop