bugster generate
command analyzes your codebase with AI and generates intelligent test specifications automatically. This powerful automation tool significantly reduces the manual work required to set up comprehensive test coverage.
Basic Usage
Command Overview
Analyzes your codebase structure, user flows, and components to create intelligent test specifications that cover critical functionality and edge cases.When to Use
- After adding new features or pages to your application
- When you want comprehensive test coverage for specific components
- To create initial test suite for existing projects
- Before major releases to ensure thorough testing
Key Features
- AI-powered analysis of your app structure and user flows
- Generates test specs in
.bugster/tests/
directory - Supports filtering by specific pages/components
- Custom prompts to guide test generation
- Safe to run multiple times - won’t duplicate existing tests
Can take several minutes for large codebases during the initial analysis phase.
Command Syntax
How It Works
The generate command:- Codebase Analysis: Scans your application structure and identifies key components
- AI Processing: Uses AI to understand user flows and critical functionality
- Test Generation: Creates intelligent test scenarios based on the analysis
- File Output: Saves test specifications as YAML files with human-readable steps
- Caching: Stores analysis results for faster subsequent runs
Options
Number of test specs to generate per page. Range: 1-30. Higher values create more comprehensive test scenarios.
Generate specs only for specific page files. Provide comma-separated relative paths to target specific components.
Custom prompt to guide AI test generation with specific instructions and focus areas. Must be used together with
--page
.Show detailed logs during analysis. (Deprecated - use —debug instead)
Examples
Complete Codebase Analysis
Generate Specific Number of Tests
Target Specific Pages
Custom Test Focus with Page Filtering
--prompt
flag requires --page
to be specified.
Page Filtering Strategies
- Single Page
- Multiple Pages
- Component Focus
- Directory Pattern
Output Structure
Generated tests are organized in the.bugster/tests/
directory:
Example Generated Test
Here’s an example of what a generated test specification looks like:Best Practices
Targeted Generation
Use
--page
to focus on recently modified files for efficient test creation.Custom Prompts
Combine
--page
and --prompt
for targeted, customized test generation.Incremental Testing
Run regularly as your codebase evolves - tests won’t be duplicated.
Comprehensive Coverage
Higher
--count
values generate more comprehensive test scenarios.The first run analyzes your entire app structure and caches results for faster subsequent runs. Remember that custom prompts require the
--page
flag to specify which components to target.