<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/diagnose-a-bug-build-the-feedback-loop-first-bryrxfg6a" -->

---
title: Diagnose a bug: build the feedback loop first | daily.dev
description: A structured six-phase debugging methodology that applies the scientific method to diagnosing software defects. The core insight is that building a reliable...
canonical: https://daily.dev/posts/diagnose-a-bug-build-the-feedback-loop-first-bryrxfg6a
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Diagnose a bug: build the feedback loop first | daily.dev
og:description: A structured six-phase debugging methodology that applies the scientific method to diagnosing software defects. The core insight is that building a reliable...
og:url: https://daily.dev/posts/diagnose-a-bug-build-the-feedback-loop-first-bryrxfg6a
og:image: https://api.daily.dev/og/posts/BRyrxFg6a.png
og:image:alt: Diagnose a bug: build the feedback loop first
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Diagnose a bug: build the feedback loop first

**[RUBYLAND](https://daily.dev/sources/rubyla)** · 6 min read · 0 upvotes · 0 comments

## Summary

A structured six-phase debugging methodology that applies the scientific method to diagnosing software defects. The core insight is that building a reliable feedback loop (phase 1) is the hardest and most critical step — a single command that goes red on the bug and green after the fix. The method defines nine loop types to choose from (failing test, HTTP call, CLI call, headless browser, replay, throwaway harness, fuzz, bisect, differential), with rules for tightening the loop to be fast, deterministic, and unattended. Phases 2–6 (reproduce, hypothesize, instrument, fix, clean up) are described as mechanical once the loop exists. Two strict rules govern hypothesis and experimentation: every cause must be falsifiable, and only one variable changes per probe.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://roberthopman.com/diagnose-a-bug>

## Questions this post answers

### What are the different types of feedback loops I can build when debugging a bug?

Nine loop types are available, ordered by preference: failing test (unit/integration/e2e at the seam closest to the bug), HTTP call via curl, CLI call with fixture input diffed against a snapshot, headless browser with Playwright or Puppeteer, replay of a saved trace, throwaway harness with mocked dependencies, fuzz loop running 1000 random inputs, bisect harness for git bisect, and differential loop comparing two versions or configs.

_Developers tracking down tricky bugs share loop strategies and tooling choices on daily.dev._

### How do I debug a race condition or intermittent bug that only fails sometimes?

Raise the reproduction rate before attempting to diagnose the cause. Run the trigger 100 times, run it in parallel, add load, shrink the timing window, or add sleeps. A bug that appears in 50% of runs is debuggable; one that appears in 1% of runs is not. Get the rate to 50% first — the goal at this stage is the rate, not a clean minimal case.

_Intermittent bug patterns and concurrency debugging techniques surface regularly for developers on daily.dev._

### What are the properties a good debugging feedback loop must have?

A reliable debugging loop must be red-capable (runs the real code path and asserts the exact symptom), deterministic (same verdict on every run), fast (seconds not minutes), and unattended (no human required to run it). A flaky 30-second loop provides little value; a deterministic 2-second loop is described as a superpower.

_Developers building better testing and debugging workflows find relevant techniques on daily.dev._

## Similar posts on daily.dev

- [Before You Fix the Bug, Make Sure You Understand the Problem](https://daily.dev/posts/before-you-fix-the-bug-make-sure-you-understand-the-problem-ifoiqdpal) · Medium · 1 upvotes · 0 comments
- [Why is Debugging Hard? How to Develop an Effective Debugging Mindset](https://daily.dev/posts/why-is-debugging-hard-how-to-develop-an-effective-debugging-mindset-g694j1ppc) · freeCodeCamp · 14 upvotes · 2 comments
- [Epistemology of software](https://daily.dev/posts/epistemology-of-software-bhszdbbab) · ploeh blog · 0 upvotes · 0 comments
- [Make things work, make things right, make things fast](https://daily.dev/posts/make-things-work-make-things-right-make-things-fast-ot16nl2vc) · A Day in the Life Of · 1 upvotes · 1 comments
- [An Introduction to Loop Engineering](https://daily.dev/posts/an-introduction-to-loop-engineering-7ctzwxfxz) · Machine Learning Mastery · 2 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#tdd](https://daily.dev/tags/tdd)

[View this post on daily.dev](https://daily.dev/posts/diagnose-a-bug-build-the-feedback-loop-first-bryrxfg6a)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Diagnose a bug: build the feedback loop first","url":"https://daily.dev/posts/diagnose-a-bug-build-the-feedback-loop-first-bryrxfg6a","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/diagnose-a-bug-build-the-feedback-loop-first-bryrxfg6a"},"datePublished":"2026-08-09T18:57:34.625Z","dateModified":"2026-08-09T18:58:05.274Z","description":"A structured six-phase debugging methodology that applies the scientific method to diagnosing software defects. The core insight is that building a reliable...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/332c27782d0b96ad4c9980b1f2f3c2f0?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/332c27782d0b96ad4c9980b1f2f3c2f0?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"RUBYLAND","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"RUBYLAND","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rubyla","url":"https://daily.dev/sources/rubyla"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/diagnose-a-bug-build-the-feedback-loop-first-bryrxfg6a","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,tdd","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"RUBYLAND","item":"https://daily.dev/sources/rubyla"},{"@type":"ListItem","position":3,"name":"Diagnose a bug: build the feedback loop first"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/diagnose-a-bug-build-the-feedback-loop-first-bryrxfg6a#faq","mainEntity":[{"@type":"Question","name":"What are the different types of feedback loops I can build when debugging a bug?","acceptedAnswer":{"@type":"Answer","text":"Nine loop types are available, ordered by preference: failing test (unit/integration/e2e at the seam closest to the bug), HTTP call via curl, CLI call with fixture input diffed against a snapshot, headless browser with Playwright or Puppeteer, replay of a saved trace, throwaway harness with mocked dependencies, fuzz loop running 1000 random inputs, bisect harness for git bisect, and differential loop comparing two versions or configs. Developers tracking down tricky bugs share loop strategies and tooling choices on daily.dev."}},{"@type":"Question","name":"How do I debug a race condition or intermittent bug that only fails sometimes?","acceptedAnswer":{"@type":"Answer","text":"Raise the reproduction rate before attempting to diagnose the cause. Run the trigger 100 times, run it in parallel, add load, shrink the timing window, or add sleeps. A bug that appears in 50% of runs is debuggable; one that appears in 1% of runs is not. Get the rate to 50% first — the goal at this stage is the rate, not a clean minimal case. Intermittent bug patterns and concurrency debugging techniques surface regularly for developers on daily.dev."}},{"@type":"Question","name":"What are the properties a good debugging feedback loop must have?","acceptedAnswer":{"@type":"Answer","text":"A reliable debugging loop must be red-capable (runs the real code path and asserts the exact symptom), deterministic (same verdict on every run), fast (seconds not minutes), and unattended (no human required to run it). A flaky 30-second loop provides little value; a deterministic 2-second loop is described as a superpower. Developers building better testing and debugging workflows find relevant techniques on daily.dev."}}]}
```

