Azure DevOps Test Coverage Analyzer & Generator
A powerful Visual Studio Code extension that leverages Azure OpenAI to automatically generate comprehensive test cases for your Azure DevOps work items. This extension helps quality assurance teams and developers create thorough test coverage by analyzing work item requirements and generating intelligent, context-aware test cases.
Features
� Revolutionary Test Coverage Analysis
- Smart Coverage Assessment: Analyzes existing test cases to calculate comprehensive coverage scores (0-100%)
- Gap Detection: Identifies missing test scenarios and coverage gaps using AI-powered analysis
- Risk Assessment: Automatic risk level evaluation (Low/Medium/High) based on current coverage
- Visual Coverage Dashboard: Interactive webview panel with rich metrics and analytics
- Fallback Analysis: Robust heuristic-based analysis when AI services are unavailable
�🚀 AI-Powered Test Generation
- Utilizes Azure OpenAI models to generate intelligent, context-aware test cases
- Analyzes work item details including title, description, and acceptance criteria
- Generates multiple test case types: functional, negative, edge case, integration, security, performance, and UI/UX tests
- Coverage-Driven Generation: Creates test cases specifically targeting identified coverage gaps
🔗 Seamless Azure DevOps Integration
- Direct integration with Azure DevOps REST API v7.0
- Fetches work item details and creates test cases automatically
- Links generated test cases to source work items with proper relationships
- Supports all work item types: User Stories, Features, Requirements, Bugs, Tasks, and custom types
- Enhanced Work Item Validation: Ensures only valid work items are processed
🎯 Smart Duplicate Detection
- Enhanced duplicate avoidance using comprehensive relationship analysis
- Analyzes existing test case titles, steps, and scenarios
- Prevents creation of redundant test cases
📊 Advanced Analytics & Export Capabilities
- Interactive Coverage Dashboard: Real-time coverage metrics and visual analytics
- Rich Reporting: Detailed breakdown of covered vs missing scenarios
- Educational Guidance: Comprehensive notes about AI limitations and testing best practices
- Export test cases in multiple formats: CSV, Excel (XLSX)
- Rich webview panel with syntax highlighting and interactive elements
🛡️ Robust Error Handling
- Comprehensive error handling with detailed logging
- Graceful fallback mechanisms when AI analysis fails
- Real-time progress indicators
- User-friendly feedback and diagnostic tools
Getting Started
What's New in v0.0.3
🎉 Revolutionary Coverage Analysis - The biggest update yet!
- Smart Analysis Before Generation: Now analyzes existing test coverage before generating new test cases
- Visual Coverage Dashboard: Beautiful, interactive dashboard showing coverage metrics and gaps
- AI-Powered Gap Detection: Identifies exactly what's missing from your test coverage
- Risk Assessment: Automatic evaluation of testing risk levels
- Targeted Test Generation: Creates test cases specifically for identified coverage gaps
- Enhanced Robustness: Fallback analysis when AI services are unavailable
Prerequisites
- Visual Studio Code (version 1.103.0 or higher)
- Azure DevOps Organization with appropriate permissions
- Azure OpenAI Service with a deployed model (e.g., GPT-4)
Installation
- Install the extension from the VS Code marketplace or install the
.vsix
file
- Open VS Code and navigate to the Command Palette (
Ctrl+Shift+P
)
- Run the command:
Azure DevOps: Configure Settings
Configuration
The extension requires the following configuration parameters:
Setting |
Description |
Example |
azureDevOpsUrl |
Azure DevOps organization URL |
https://dev.azure.com/yourorg |
azureDevOpsProject |
Project name |
MyProject |
azureDevOpsPat |
Personal Access Token |
your-pat-token |
azureOpenAiEndpoint |
Azure OpenAI endpoint URL |
https://your-openai.openai.azure.com/ |
azureOpenAiApiKey |
Azure OpenAI API key |
your-api-key |
azureOpenAiDeployment |
Model deployment name |
gpt-4 |
Setting up Azure DevOps Personal Access Token
- Go to your Azure DevOps organization
- Click on your profile → Personal Access Tokens
- Create a new token with the following scopes:
- Work Items: Read & Write
- Test Management: Read & Write
Setting up Azure OpenAI
- Create an Azure OpenAI resource in Azure Portal
- Deploy a model (GPT-4 recommended)
- Get the endpoint URL and API key from the resource
Usage
New Workflow with Coverage Analysis
Configure the Extension
Command Palette → Azure DevOps: Configure Settings
Analyze Test Coverage
Command Palette → Azure DevOps: Analyze Test Coverage
- Enter the work item ID when prompted
- View Coverage Analysis: Review comprehensive coverage dashboard showing:
- Current coverage percentage
- Existing test cases
- Missing scenarios and coverage gaps
- Risk assessment
- Recommendations for improvement
Generate Targeted Test Cases
- After reviewing coverage analysis, click "Generate Test Cases" to create tests targeting specific gaps
- Review AI-generated test cases in the interactive panel with educational guidance
- Choose to create test cases in Azure DevOps or export them
Additional Commands
Azure DevOps: Reset Settings
- Clear all configuration
Azure DevOps: Show Diagnostics
- View extension diagnostics
Key Workflow Benefits
- Intelligence First: Understand existing coverage before generating new tests
- Gap-Focused Generation: Generate tests specifically for identified coverage gaps
- Data-Driven Decisions: Make informed decisions about test case priorities
- Visual Analytics: Rich dashboard provides immediate insights into test coverage health
Pro Tips for Maximum Effectiveness
- Start with Coverage Analysis: Always run coverage analysis first to understand your current testing landscape
- Review Coverage Gaps: Pay attention to the "Missing Scenarios" section for targeted test generation
- Monitor Risk Levels: High-risk work items need immediate attention for additional test coverage
- Use Fallback Analysis: When AI services are unavailable, the extension provides heuristic-based analysis
- Export for Documentation: Use the export features to create comprehensive test documentation
- Iterative Improvement: Run analysis regularly as work items evolve to maintain coverage health
Coverage Analysis Features
Comprehensive Coverage Assessment
The extension provides sophisticated test coverage analysis capabilities:
Coverage Metrics
- Coverage Score: Intelligent 0-100% scoring based on existing test case depth and breadth
- Test Case Count: Total number of existing test cases linked to the work item
- Missing Scenarios: AI-identified gaps in test coverage
- Risk Level: Automatic assessment (Low/Medium/High) based on coverage analysis
Visual Analytics Dashboard
- Interactive Coverage Score: Large, color-coded percentage with contextual styling
- Coverage vs Missing Grid: Side-by-side comparison of covered and missing scenarios
- Existing Test Cases: Detailed list of current test cases with states
- Recommendations: AI-powered suggestions for improving coverage
Intelligent Analysis Types
- AI-Powered Analysis: Uses Azure OpenAI to deeply analyze coverage gaps
- Fallback Heuristic Analysis: Robust backup analysis when AI services are unavailable
- Relationship Analysis: Comprehensive analysis of work item relationships and dependencies
Supported Test Case Types
The extension generates various types of test cases based on work item analysis and coverage gaps:
- Functional Tests: Happy path scenarios and core functionality validation
- Negative Tests: Error handling and invalid input scenarios
- Edge Case Tests: Boundary conditions and limit testing
- Integration Tests: Component interaction and system integration testing
- Security Tests: Security considerations and vulnerability assessment
- Performance Tests: Performance criteria validation and load testing
- UI/UX Tests: User experience and interface validation
- Regression Tests: Ensuring existing functionality remains intact
- Accessibility Tests: Compliance with accessibility standards
- Data Validation Tests: Data integrity and validation scenarios
Build and Development
Prerequisites for Development
- Node.js (22.x or higher)
- npm
Development Setup
Clone the repository
Install dependencies:
npm install
Run linting:
npm run lint
Run tests:
npm test
Build Extension
# Install vsce (Visual Studio Code Extension CLI)
npm install -g vsce
# Package the extension
vsce package
Project Structure
├── extension.js # Main extension entry point
├── package.json # Extension manifest and dependencies
├── utils/
│ ├── azureDevOpsClient.js # Azure DevOps API client
│ ├── azureOpenAIClient.js # Azure OpenAI API client
│ └── testCaseFormatter.js # Test case formatting utilities
├── README.md
├── CHANGELOG.md
└── eslint.config.mjs
Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and ensure they follow the coding standards
- Run tests:
npm test
- Run linting:
npm run lint
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
Development Guidelines
- Follow existing code style and conventions
- Add tests for new functionality
- Update documentation as needed
- Ensure all tests pass before submitting
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have suggestions:
- Check the CHANGELOG.md for recent updates
- Use the
Azure DevOps: Show Diagnostics
command for troubleshooting
- Create an issue in the repository with detailed information
Version History
- v0.0.3 (Current) - Major update with test coverage analysis, enhanced UI, and intelligent gap detection
- v0.0.2 - Enhanced features with marketplace release and improved commands
- v0.0.1 - Initial development version with core test case generation
For detailed version history, see CHANGELOG.md.