Software requirement changes, code changes, software reuse, and testing are important activities in software engineering that involve the traceability links between software requirements and code. Software requirement documents, design documents, code documents, and test case documents are the intermediate products of software development. The lack of interrelationship between these documents can make it extremely difficult to change and maintain the software. Frequent requirements and code changes are inevitable in software development. Software reuse, change impact analysis, and testing also require the relationship between software requirements and code. Using these traceability links can improve the efficiency and quality of related software activities. Existing methods for constructing these links need to be better automated and accurate. To address these problems, we propose to embed software requirements and source code into feature vectors containing their semantic information based on four neural networks (NBOW, RNN, CNN, and self-attention). Accurate traceability links from requirements to code are established by comparing the similarity between these vectors. We develop a prototype tool RCT based on this method. These four networks’ performances in constructing links are explored on 18 open-source projects. The experimental results show that the self-attention network performs best, with an average value of 0.687 on the 18 projects, which is higher than the other three neural network models and much higher than previous approaches using information retrieval and machine learning.
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.