A Visual Studio Code extension that bridges the gap between requirements and test cases for your Python projects. This extension helps you ensure that all requirements are properly tested and that test cases are traceable back to specific requirements.
Features
AI-Powered Analysis: Leverages AI models like GPT-4o-mini to analyze the relationship between requirements and test cases
Change-Based Reviews: Focus only on changed files to optimize performance
Interactive UI: Dedicated sidebar with intuitive controls for managing alignment
Multiple AI Models: Support for different AI models including GPT-4, GPT-4o, GPT-3.5-turbo, DeepSeek-r1, and DeepSeek-v3
Requirements
Visual Studio Code version 1.98.0 or higher
Python 3.8 or higher installed on your system
Internet connection for API communication with AI providers
Installation
Install the extension from the VS Code Marketplace
Configure your API key in the extension settings
Open the Requirement Test Align panel from the activity bar
Extension Settings
This extension contributes the following settings:
requirementTestAlign.openaiApiKey: OpenAI API Key for accessing AI models
requirementTestAlign.openaiApiHost: Custom OpenAI API host (optional)
requirementTestAlign.model: AI model to use (gpt-4o-mini, gpt-4, gpt-4o, gpt-3.5-turbo, deepseek-r1, deepseek-v3)
requirementTestAlign.reviewType: Type of review to perform (full, changed, costOptimized)
requirementTestAlign.reviewLanguage: Language for generated content (default: English)
requirementTestAlign.provider: AI provider to use (currently supports openai)
requirementTestAlign.org: Organization ID for OpenAI (optional)
requirementTestAlign.testAffected: Generate test cases for affected files only
requirementTestAlign.debug: Enable debug logging
requirementTestAlign.pythonPath: Path to the Python executable
How to Use
Open your Python project in VS Code
Click the Requirement Test Align icon in the activity bar
Configure your settings, especially the API key
Click "Generate Review" to analyze the relationship between requirements and test cases
Review the results and make necessary adjustments to your code
Workflow
The extension works by:
Analyzing your Python project structure
Identifying requirements in comments, docstrings, and separate requirement files
Finding test cases in test files
Using AI to determine if requirements are properly tested
Generating a report highlighting gaps and recommendations
Commands
requirement-test-align.openPanel: Open the Requirement Test Align panel
Supported File Types
Python (.py) files for code analysis
pytest and unittest test files
Known Issues
Large projects may require more processing time
API rate limits may apply depending on your OpenAI subscription
Release Notes
0.0.1
Initial release
Support for basic requirement-test alignment analysis
Integration with OpenAI models
Custom sidebar UI for interacting with the extension
Privacy and Data Usage
This extension processes your code locally and sends relevant snippets to the configured AI provider for analysis. No code is stored by the extension itself, but standard API provider data retention policies apply. Please review your AI provider's privacy policy for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.