# Hypothesis Testing

Applies the scientific method to debugging by helping users form specific, testable...

- Repository: https://github.com/rohitg00/skillkit (1568 stars)
- Category: Design
- License: Apache-2.0
- Last updated: 2026-06-02
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add rohitg00/skillkit --skill hypothesis-testing -g -a claude-code -y`
Codex: `npx skills add rohitg00/skillkit --skill hypothesis-testing -g -a codex -y`
Cursor: `npx skills add rohitg00/skillkit --skill hypothesis-testing -g -a cursor -y`
Gemini CLI: `npx skills add rohitg00/skillkit --skill hypothesis-testing -g -a gemini-cli -y`

## Description

Applies the scientific method to debugging by helping users form specific, testable hypotheses, design targeted experiments, and systematically confirm or reject theories to find root causes. Use when a user says their code isn't working, they're getting an error, something broke, they want to troubleshoot a bug, or they're trying to figure out what's causing an issue. Concrete actions include isolating failing components, forming and testing hypotheses, analyzing error messages, tracing execution paths, and interpreting test results to narrow down root causes.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Hypothesis-Driven Debugging

You are applying the scientific method to debugging. Form clear hypotheses, design tests that can definitively confirm or reject them, and systematically narrow down to the truth.

## Core Principle

**Every debugging action should test a specific hypothesis. Random changes are not debugging.**

## The Scientific Debugging Method

### 1. Observe - Gather Facts

Before forming hypotheses, collect observations:

- What exactly happens? (specific symptoms)
- When does it happen? (timing, frequency)
- Where does it happen? (environment, component)
- What changed recently? (code, config, data)

**Write down observations objectively:**
```
Observations:
- API returns 500 error on POST /orders
- Happens only when cart has > 10 items
- Started after deployment on 2024-01-15
- Works fine in staging environment
- Error logs show "connection refused" to inventory service
```

### 2. Hypothesize - Form Testable Theories

**Examples (bad → good):**
- ~~"Something is wrong with the network"~~ → "The inventory service connection pool is exhausted when processing orders with >10 items"
- ~~"There might be a race condition"~~ → "The order processing timeout (5s) is insufficient for large orders"

### 3. Predict - Define Expected Results

For each hypothesis, define what you expect to observe if it is true versus false:

```
Hypothesis: Connection pool exhausted for large orders

If TRUE:
- Active connections should hit max (20) during large orders
- Small orders should still work during this time
- Increasing pool size should fix the issue

If FALSE:
- Connection count stays well below max
- Small orders also fail during the issue
- Pool size change has no effect
```

### 4. Test - Experiment Systematically

Design tests that definitively confirm or reject:

```
Test Plan for Connection Pool Hypothesis:

1. Add connection pool monitoring
   - Log active connections before/after each request
   - Expected if true: Count reaches 20 during failures

The rest: https://github.com/rohitg00/skillkit/blob/HEAD/packages/core/src/methodology/packs/debugging/hypothesis-testing/SKILL.md
