Abstract
Traceability is a cornerstone of modern software development, ensuring system reliability and facilitating software maintenance. While unsupervised techniques leveraging Information Retrieval (IR) and Machine Learning (ML) methods have been widely used for predicting trace links, their effectiveness remains underexplored. In particular, these techniques often assume traceability patterns are present within textual data—a premise that may not hold universally. Moreover, standard evaluation metrics such as precision, recall, accuracy, or F1 measure can misrepresent the model performance when underlying data distributions are not properly analyzed. Given that automated traceability techniques tend to struggle to establish links, we need further insight into the information limits related to traceability artifacts. In this paper, we propose an approach, TraceXplainer, for using information theory metrics to evaluate and better understand the performance (limits) of unsupervised traceability techniques. Specifically, we introduce self-information, cross-entropy, and mutual information (MI) as metrics to measure the informativeness and reliability of traceability links. Through a comprehensive replication and analysis of well-studied datasets and techniques, we investigate the effectiveness of unsupervised techniques that predict traceability links using IR/ML. This application of TraceXplainer illustrates an imbalance in typical traceability datasets where the source code has on average 1.48 more information bits (i.e., entropy) than the linked documentation. Additionally, we demonstrate that an average MI of 4.81 bits, loss of 1.75, and noise of 0.28 bits signify that there are information-theoretic limits on the effectiveness of unsupervised traceability techniques. We hope these findings spur additional research on understanding the limits and progress of traceability research.
Introduction
Software traceability—the ability to link high-level requirements to low-level source code—is essential for system reliability and maintenance. Despite the proliferation of unsupervised Information Retrieval (IR) and Machine Learning (ML) models designed to automate this process, these tools often struggle to produce reliable results. This paper argues that the bottleneck may not be the algorithms themselves, but rather the underlying data. By introducing TraceXplainer, we utilize information theory to quantify the "information gap" between documentation and code, revealing fundamental ceilings on model performance.
The TraceXplainer Framework
TraceXplainer is a data-centric framework that applies information-theoretic metrics to evaluate software artifacts. Rather than relying solely on traditional performance metrics, it measures the inherent informativeness and shared content between artifacts using the following metrics:
- Entropy ($H$): Measures the amount of information (in bits) within an artifact. High entropy indicates descriptive, diverse content.
- Mutual Information ($I(X:Y)$): Quantifies the shared information between a source (e.g., requirement) and a target (e.g., code).
- Information Loss ($H(X|Y)$): Captures information present in the source but missing from the target.
- Information Noise ($H(Y|X)$): Captures implementation details in the code not mentioned in the requirements.
Empirical Evaluation and Results
We evaluated TraceXplainer across seven diverse testbeds, including industrial projects like Cisco’s libEST and open-source datasets like itrust and etour. We compared these metrics against standard unsupervised representations, specifically word2vec (using Word Mover’s Distance) and doc2vec (using Cosine distance).
Our results indicate that unsupervised models generally exhibit low effectiveness. Across most datasets, performance was near-random, with ROC scores often hovering around 0.50. However, a clear trend emerged: word-level embeddings (word2vec) consistently outperformed paragraph-level embeddings (doc2vec) in capturing semantic relationships for traceability tasks.
Key Insights: The Complexity Gap
TraceXplainer revealed a significant "Complexity Gap" in software artifacts. On average, source code contains 1.48 more information bits (entropy) than the requirements it implements. This imbalance suggests that the simple language of requirements often lacks the necessary information to map directly to complex code structures.
Furthermore, the study found that the "Loss" of information (averaging 1.75 bits) represents a hard theoretical limit. If the required information is not present in the text, no unsupervised IR model, regardless of its sophistication, can successfully establish the link. We also observed that high "Noise" values (0.28 bits) often signal undocumented implementation details, which can serve as a red flag for system maintainability.
Conclusion and Future Work
The findings suggest that the effectiveness of unsupervised traceability is constrained by the quality and balance of the data itself. While current metrics may underestimate shared information due to the "Copy vs. Transformation" problem—where code uses different vocabulary than requirements—TraceXplainer provides a necessary audit for dataset reliability. Future research will focus on using these metrics to assist developers in writing more traceable documentation and exploring whether Large Language Models (LLMs) can bridge the information gaps identified in this study.
Summary updated