Skip to main content
The 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

bugster update

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

bugster update [options]

How It Works

The update command:
  1. Change Analysis: Compares current code against git history or saved state
  2. Impact Assessment: Identifies which tests are affected by code changes
  3. Test Maintenance: Updates, creates, or deletes test specifications as needed
  4. State Saving: Records current state for future incremental updates
  5. 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

--update-only
boolean
Only update existing test specifications. No new test suggestions or deletions will be performed.
--suggest-only
boolean
Only suggest new test specifications for added files. No updates to existing tests or deletions.
--delete-only
boolean
Only delete obsolete test specifications for removed files. No updates or new suggestions.

Comparison Options

--against-default
boolean
Compare against the default branch (main/master) instead of HEAD. Perfect for Pull Request workflows.
--against-last-update
boolean
Compare against the commit from the last update run. Enables incremental updates for active development.
--show-logs
boolean
Show detailed logs during analysis. (Deprecated - use —debug instead)

Examples

Complete Test Maintenance

bugster update
Handles all types of changes: updates, additions, and deletions.

Safe Updates Only

bugster update --update-only
Only modifies existing tests without creating new ones or deleting any.

New Feature Testing

bugster update --suggest-only
Generates tests only for newly added code and features.

Post-refactor Cleanup

bugster update --delete-only
Removes obsolete tests after code refactoring or deletion.

Branch Comparison

bugster update --against-default
Compares against main/master branch to catch all changes in feature branch.

Incremental Updates

bugster update --against-last-update
Only processes changes since the last update run for efficient maintenance.

Workflow Integration

Pre-commit Hook

bugster update --update-only
Ensure tests stay current before committing changes.

PR Automation

bugster update --against-default
Automate test maintenance in GitHub Actions/CI.

Feature Development

bugster update
Complete maintenance after feature development.

Daily Maintenance

bugster update --against-last-update
Regular incremental test maintenance.

Update Scenarios

# After completing feature development
bugster update

# For PR review
bugster update --against-default
Maintains tests throughout feature development lifecycle.
# In GitHub Actions
bugster update --against-default --update-only
Automated test maintenance in CI/CD pipelines.
# After major refactoring
bugster update --delete-only

# Then update remaining tests
bugster update --update-only
Systematic test cleanup after code restructuring.

Validation Workflow

After running update, follow this validation process:
  1. Review Changes: Examine generated test modifications
  2. Run Tests: Execute updated tests with bugster run --only-affected
  3. Validate Coverage: Ensure new features have adequate test coverage
  4. 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.
I