Abstract
Software requirements traceability is a critical component of the software engineering process, enabling activities such as requirements validation, compliance verification, and safety assurance. However, the cost and effort of manually creating a complete set of trace links across natural language artifacts such as requirements, design, and test-cases can be prohibitively expensive. Researchers have therefore proposed automated link-generation solutions primarily based on information-retrieval (IR) techniques; however, these solutions have failed to deliver the accuracy needed for full adoption in industrial projects. Improvements can be achieved using deep-learning traceability models; however, their efficacy is impeded by the limited size and availability of project-level artifacts and links to serve as training data. In this paper, we address this problem by proposing and evaluating several deep-learning approaches for text-to-text traceability. Our method, named NLTrace, explores three transfer learning strategies that use datasets mined from open world platforms. Through pretraining Language Models (LMs) and leveraging adjacent tracing tasks, we demonstrate that NLTrace can significantly improve the performance of LM based trace models when training links are available. In such scenarios NLTrace outperforms the best performing classical IR method with an 188% improvement in F2 score and 94.01% in Mean Average Precision (MAP). It also outperforms the general LM based trace model by 7% and 23% for F2 and MAP respectively. In addition, NLTrace can adapt to low-resource tracing scenarios where other LM models can not. The knowledge learned from adjacent tasks enables NLTrace to outperform VSM models by 28% F2 on generation challenges when presented with a small number of training examples.
Introduction: The Traceability Challenge
In software engineering, traceability is the ability to link requirements to design documents, code, and test cases. It is vital for safety-critical systems—such as medical devices or flight controls—to ensure every requirement is met and verified. However, manually creating these links is expensive and error-prone. While Information Retrieval (IR) techniques like Vector Space Models (VSM) have been used to automate this, they often hit a performance "glass ceiling" due to a lack of semantic understanding. Modern Deep Learning (DL) models offer a solution but suffer from a "cold start" problem: most software projects lack the massive amounts of existing trace links required to train high-performing models from scratch.
The NLTrace Framework
To bridge this data gap, we propose NLTrace, a framework that utilizes a "pretrain-then-finetune" paradigm across three distinct transfer learning strategies:
- Domain-Adaptive Pretraining (SE-BERT): A specialized Language Model pretrained on a 372GB corpus of software engineering text mined from millions of GitHub projects.
- Project Domain Adaptation: A pipeline that extracts project-specific terms and uses the Google Search API to find related technical documents, creating a "mini-corpus" to further tune the model to a specific project's jargon.
- Trace Task-Related Adaptation: This novel strategy mines "Autolinks" from GitHub (e.g., issue-to-commit links). By training on millions of these "open-world" links, the model learns the underlying logic of tracing before seeing any project-specific data.
Experimental Design and Datasets
We evaluated NLTrace across four diverse, real-world datasets: PTC (subway signaling), CCHIT (health record regulations), Dronology (UAV coordination), and CM1 (NASA scientific instrument). Our evaluation focused on three primary tracing scenarios: Link Completion, Link Expansion, and Link Generation, which vary in the amount of prior training data available.
Key Results and Insights
NLTrace demonstrates significant performance gains over both classical and general deep learning baselines:
- Superior Accuracy: The Task-CLS variant outperformed the best classical IR method (VSM) with a 188% improvement in F2 score and a 94% improvement in Mean Average Precision (MAP).
- Solving the Cold Start: In "10-shot" scenarios—where only 10 training links are provided—NLTrace outperformed VSM by 28% in F2, proving that transfer learning from GitHub links allows DL models to be practical even for small-scale projects.
- The Power of Social Coding: A key insight is that GitHub's social coding patterns (linking issues to code) serve as an effective proxy for formal requirements tracing, allowing models to learn tracing logic from noisy, high-volume open-world data.
- Domain Specificity: General-purpose models like standard BERT struggle with technical vocabulary. Pretraining on software-specific text (SE-BERT) is essential for the model to understand domain-specific acronyms and concepts.
Conclusion and Future Work
While NLTrace effectively addresses the data scarcity problem, challenges remain regarding scalability. The high-performing Classification models are computationally expensive for massive projects with thousands of artifacts. Future work will explore multi-task learning to better combine knowledge sources and refine negative sampling techniques to further reduce false positives in large-scale tracing tasks.
Summary updated