home / skills / baz-scm / awesome-reviewers / testing-debugging

testing-debugging skill

/_skills/testing-debugging

This skill helps you improve software reliability by guiding automated testing, debugging workflows, and risk-focused feedback throughout development.

npx playbooks add skill baz-scm/awesome-reviewers --skill testing-debugging

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.7 KB
---
name: testing-debugging
description: Ensuring software correctness and reliability by writing automated tests, using quality assurance tools, and systematically debugging issues.
version: '1.0'
---
# Testing & Debugging

Writing robust software requires verifying that it works as intended. Developers are expected to build automated tests for their code and use debugging skills to quickly isolate issues. Thorough testing (unit tests, integration tests, etc.) gives confidence that changes won’t break existing functionality. It’s far cheaper to catch bugs early with tests or static analysis than in production.

## Examples
- Implementing a suite of unit tests for each new feature, and running them in a CI pipeline on each commit.
- Using a debugger or logging to track down the root cause of a bug, then adding a test to prevent regression.

## Guidelines
- **Automated Testing:** Write tests to cover your code’s behavior – unit tests for individual functions, integration tests for components, etc. Aim for meaningful coverage of critical paths and edge cases. This ensures your code is correct and stays correct as it evolves.
- **Quality Tools:** Employ linters and formatters to catch issues and enforce standards automatically. For example, use ESLint or Prettier so style issues are fixed upfront, freeing code reviews to focus on logic. Use static analysis and security scanners to find flaws early.
- **Systematic Debugging:** When bugs arise, debug methodically. Reproduce issues in a controlled environment, use breakpoints or logging to inspect state, and bisect changes if necessary. Once fixed, add tests for those cases to avoid regressions. A disciplined debugging approach saves time and builds more reliable software.

Overview

This skill helps teams ensure software correctness and reliability by combining automated tests, quality tools, and disciplined debugging. It provides practical patterns for writing unit and integration tests, integrating checks into CI, and isolating defects efficiently. The outcome is fewer regressions, faster troubleshooting, and more confident deployments.

How this skill works

The skill inspects code and development workflows to identify gaps in test coverage, quality tooling, and debugging practices. It recommends tests for critical paths and edge cases, suggests linters/static analyzers to catch issues early, and outlines step-by-step debugging strategies (reproduce, isolate, inspect, fix, and add regression tests). It can be applied to pull requests, feature branches, or CI pipelines to continuously validate changes.

When to use it

  • When adding new features to prevent regressions
  • During pull-request reviews to validate test coverage and tooling
  • When intermittent or hard-to-reproduce bugs appear
  • Before merging changes into main branches or releasing
  • When onboarding new contributors to enforce quality standards

Best practices

  • Write unit tests for individual functions and integration tests for component interactions
  • Integrate tests and linters into CI so failures fail the build early
  • Focus tests on critical paths and realistic edge cases rather than raw coverage numbers
  • Use logging, breakpoints, and bisecting to reproduce and isolate defects methodically
  • After fixing a bug, add a regression test that captures the original failing behavior

Example use cases

  • Add a suite of unit tests for a new API endpoint and run them in CI on every commit
  • Use ESLint and Prettier to enforce style and free code reviews to focus on logic
  • Reproduce a production bug in a local environment, use the debugger to trace state, and add a test to prevent recurrence
  • Run static analysis and security scanners on pull requests to catch vulnerabilities before merge

FAQ

How much test coverage is enough?

Aim for meaningful coverage of critical paths and edge cases; high percentage alone is not a guarantee of quality. Prioritize tests that protect behavior and business logic.

Should every bug get a test?

Yes—when feasible, add a regression test for each fixed bug to prevent it from returning and to document expected behavior.