Version: 1.0.0 Status: Stable/Development License: MIT
A benchmark framework for fine-grained requirements traceability analysis using Large Language Models (LLMs).
Overview
FineTrace-Bench is an automated tool that analyzes software requirements and source code to establish fine-grained traceability links. It uses LLMs to decompose coarse-grained requirements into fine-grained use cases and map them to specific code implementations.
Features
Automated Requirements Analysis: Decompose high-level requirements into fine-grained use cases
Code-Requirement Mapping: Establish traceability links between requirements and code files
Multi-Dataset Support: Process multiple software projects (eANCI, eTour, iTrust, LibEST)
LLM Integration: Support for Claude and Qwen models via API
Iterative Refinement: Automatic validation and correction of traceability links
CNL-B Format: Generate Controlled Natural Language use case descriptions
Edit the LLM client configuration in qwenLLMClient.py or claude_llm_client.py:
api_base = "https://apis.iflow.cn" # API endpoint
api_key = "your-api-key-here" # Your API key
model_name = "qwen3-max" # Model name
max_tokens = 20000 # Maximum tokens
temperature = 0.1 # Temperature setting
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Contact
For questions, issues, or contributions, please contact:
FineTrace-Bench
Version: 1.0.0
Status: Stable/Development
License: MIT
A benchmark framework for fine-grained requirements traceability analysis using Large Language Models (LLMs).
Overview
FineTrace-Bench is an automated tool that analyzes software requirements and source code to establish fine-grained traceability links. It uses LLMs to decompose coarse-grained requirements into fine-grained use cases and map them to specific code implementations.
Features
Project Structure
Configuration
Edit the LLM client configuration in
qwenLLMClient.pyorclaude_llm_client.py:Update dataset paths in
dataset_manager.py:Usage
Basic Workflow
Run Complete Analysis
Dataset Structure
Each dataset contains:
req/- Requirement documents (text files)code/- Source code files (Java, etc.)links.txt- Ground truth traceability linksall_req_filenames.txt- List of requirement filesall_code_filenames.txt- List of code filesREADME.txt- Dataset-specific informationOutput Files
The tool generates:
{dataset}_analysis_results.json- Complete analysis results{dataset}_structured_data.json- Structured traceability datallm_response_step1.json- Initial LLM responsesllm_response_step2.json- Refined LLM responsesuse_case/*.txt- Individual CNL-B use case filesInstallation
Key Components
DatasetManager
Manages dataset loading, filtering, and validation:
LLM Clients
Support for multiple LLM providers:
qwenLLMClient- Qwen model integrationClaudeLLMClient- Claude model integrationBoth support streaming and non-streaming modes.
Analysis Functions
analyze_requirement_with_retry()- Iterative requirement analysis with validationvalidate_traceability()- Check completeness of traceability linksformat_cnl_use_case()- Generate CNL-B format descriptionsAPI Reference
DatasetManager
load_dataset()- Load requirements and code filesload_gold_standard()- Load ground truth traceability linksfilter_functional_requirements()- Filter functional requirementsload_dataset_structure_data()- Load complete dataset structureLLM Client
generate(prompt)- Synchronous LLM generationquery_llm(prompt, system_prompt)- Asynchronous LLM queryload__Analyzer_prompt()- Load analysis prompt templateUtility Functions
save_to_json(data, file_path)- Save data to JSONsave_to_csv(data, file_path)- Save data to CSVparse_llm_response(response_text)- Parse LLM JSON responsesSupported Datasets
MIT License
Copyright (c) 2026 Shiluoyuan (NUTD)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Contact
For questions, issues, or contributions, please contact: