Azure DevOps Test Case 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
🚀 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
🔗 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
🎯 Smart Duplicate Detection
- Enhanced duplicate avoidance using comprehensive relationship analysis
- Analyzes existing test case titles, steps, and scenarios
- Prevents creation of redundant test cases
📊 Export Capabilities
- Export test cases in multiple formats: CSV, Excel (XLSX)
- Rich webview panel with syntax highlighting
- Interactive review interface before creation
🛡️ Robust Error Handling
- Comprehensive error handling with detailed logging
- Real-time progress indicators
- User-friendly feedback and diagnostic tools
Getting Started
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
Configure the Extension
Command Palette → Azure DevOps: Configure Settings
Generate Test Cases
Command Palette → Azure DevOps: Generate Test Cases
- Enter the work item ID when prompted
- Review generated test cases in the interactive panel
- 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
Supported Test Case Types
The extension generates various types of test cases based on work item analysis:
- Functional Tests: Happy path scenarios and core functionality
- Negative Tests: Error handling and invalid input scenarios
- Edge Case Tests: Boundary conditions and limit testing
- Integration Tests: Component interaction testing
- Security Tests: Security considerations and vulnerability testing
- Performance Tests: Performance criteria validation
- UI/UX Tests: User experience and interface validation
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.2 (Current) - Latest stable release with enhanced features
- v0.0.1 - Initial development version
For detailed version history, see CHANGELOG.md.