bugster update
command automatically maintains your test specifications by analyzing code changes and updating, creating, or deleting tests accordingly to keep them synchronized with your evolving codebase.
Basic Usage
Command Overview
Analyzes git changes in your codebase and intelligently updates your test suite to reflect modifications, additions, and deletions in your application code.When to Use
- After modifying existing features to keep tests in sync
- In Pull Request workflows to automate test maintenance
- When you’ve added new pages or components
- After deleting or refactoring code sections
Key Features
- Compares against git changes to determine updates needed
- Creates new tests, modifies existing ones, or deletes obsolete tests
- Saves current state for future incremental comparisons
- Works with both staged and unstaged changes
- Intelligent selective updating of relevant test sections
The update command requires a git repository with committed changes for comparison and automatically saves update state after successful runs.
Command Syntax
How It Works
The update command:- Change Analysis: Compares current code against git history or saved state
- Impact Assessment: Identifies which tests are affected by code changes
- Test Maintenance: Updates, creates, or deletes test specifications as needed
- State Saving: Records current state for future incremental updates
- Validation: Ensures test specifications remain valid and executable
Update Types
- Modified Files
- New Files
- Deleted Files
Updates existing test specs when code changes:
- Function signature changes → updated test steps
- UI modifications → adjusted interaction flows
- Logic updates → revised assertion patterns
Scope Options
Only update existing test specifications. No new test suggestions or deletions will be performed.
Only suggest new test specifications for added files. No updates to existing tests or deletions.
Only delete obsolete test specifications for removed files. No updates or new suggestions.
Comparison Options
Compare against the default branch (main/master) instead of HEAD. Perfect for Pull Request workflows.
Compare against the commit from the last update run. Enables incremental updates for active development.
Show detailed logs during analysis. (Deprecated - use —debug instead)
Examples
Complete Test Maintenance
Safe Updates Only
New Feature Testing
Post-refactor Cleanup
Branch Comparison
Incremental Updates
Workflow Integration
Pre-commit Hook
PR Automation
Feature Development
Daily Maintenance
Update Scenarios
Feature Branch Workflow
Feature Branch Workflow
Continuous Integration
Continuous Integration
Refactoring Projects
Refactoring Projects
Validation Workflow
After running update, follow this validation process:- Review Changes: Examine generated test modifications
- Run Tests: Execute updated tests with
bugster run --only-affected
- Validate Coverage: Ensure new features have adequate test coverage
- Commit Updates: Add updated test specifications to version control
Limitations
Cannot use both
--against-default
and --against-last-update
simultaneously. Choose one comparison method per execution.Best Practices
Use
--against-last-update
for incremental updates during active development. Combine with bugster run --only-affected
for complete change validation workflow.Always review generated changes before committing to your repository. The
--against-default
flag is perfect for PR workflows to catch all branch changes comprehensively.