@shaykec/bridge 0.4.24 → 0.4.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/journeys/ai-engineer.yaml +34 -0
  2. package/journeys/backend-developer.yaml +36 -0
  3. package/journeys/business-analyst.yaml +37 -0
  4. package/journeys/devops-engineer.yaml +37 -0
  5. package/journeys/engineering-manager.yaml +44 -0
  6. package/journeys/frontend-developer.yaml +41 -0
  7. package/journeys/fullstack-developer.yaml +49 -0
  8. package/journeys/mobile-developer.yaml +42 -0
  9. package/journeys/product-manager.yaml +35 -0
  10. package/journeys/qa-engineer.yaml +37 -0
  11. package/journeys/ux-designer.yaml +43 -0
  12. package/modules/README.md +52 -0
  13. package/modules/accessibility-fundamentals/content.md +126 -0
  14. package/modules/accessibility-fundamentals/exercises.md +88 -0
  15. package/modules/accessibility-fundamentals/module.yaml +43 -0
  16. package/modules/accessibility-fundamentals/quick-ref.md +71 -0
  17. package/modules/accessibility-fundamentals/quiz.md +100 -0
  18. package/modules/accessibility-fundamentals/resources.md +29 -0
  19. package/modules/accessibility-fundamentals/walkthrough.md +80 -0
  20. package/modules/adr-writing/content.md +121 -0
  21. package/modules/adr-writing/exercises.md +81 -0
  22. package/modules/adr-writing/module.yaml +41 -0
  23. package/modules/adr-writing/quick-ref.md +57 -0
  24. package/modules/adr-writing/quiz.md +73 -0
  25. package/modules/adr-writing/resources.md +29 -0
  26. package/modules/adr-writing/walkthrough.md +64 -0
  27. package/modules/ai-agents/content.md +120 -0
  28. package/modules/ai-agents/exercises.md +82 -0
  29. package/modules/ai-agents/module.yaml +42 -0
  30. package/modules/ai-agents/quick-ref.md +60 -0
  31. package/modules/ai-agents/quiz.md +103 -0
  32. package/modules/ai-agents/resources.md +30 -0
  33. package/modules/ai-agents/walkthrough.md +85 -0
  34. package/modules/ai-assisted-research/content.md +136 -0
  35. package/modules/ai-assisted-research/exercises.md +80 -0
  36. package/modules/ai-assisted-research/module.yaml +42 -0
  37. package/modules/ai-assisted-research/quick-ref.md +67 -0
  38. package/modules/ai-assisted-research/quiz.md +73 -0
  39. package/modules/ai-assisted-research/resources.md +33 -0
  40. package/modules/ai-assisted-research/walkthrough.md +85 -0
  41. package/modules/ai-pair-programming/content.md +105 -0
  42. package/modules/ai-pair-programming/exercises.md +98 -0
  43. package/modules/ai-pair-programming/module.yaml +39 -0
  44. package/modules/ai-pair-programming/quick-ref.md +58 -0
  45. package/modules/ai-pair-programming/quiz.md +73 -0
  46. package/modules/ai-pair-programming/resources.md +34 -0
  47. package/modules/ai-pair-programming/walkthrough.md +117 -0
  48. package/modules/ai-test-generation/content.md +125 -0
  49. package/modules/ai-test-generation/exercises.md +98 -0
  50. package/modules/ai-test-generation/module.yaml +39 -0
  51. package/modules/ai-test-generation/quick-ref.md +65 -0
  52. package/modules/ai-test-generation/quiz.md +74 -0
  53. package/modules/ai-test-generation/resources.md +41 -0
  54. package/modules/ai-test-generation/walkthrough.md +100 -0
  55. package/modules/api-design/content.md +189 -0
  56. package/modules/api-design/exercises.md +84 -0
  57. package/modules/api-design/game.yaml +113 -0
  58. package/modules/api-design/module.yaml +45 -0
  59. package/modules/api-design/quick-ref.md +73 -0
  60. package/modules/api-design/quiz.md +100 -0
  61. package/modules/api-design/resources.md +55 -0
  62. package/modules/api-design/walkthrough.md +88 -0
  63. package/modules/clean-code/content.md +136 -0
  64. package/modules/clean-code/exercises.md +137 -0
  65. package/modules/clean-code/game.yaml +172 -0
  66. package/modules/clean-code/module.yaml +44 -0
  67. package/modules/clean-code/quick-ref.md +44 -0
  68. package/modules/clean-code/quiz.md +105 -0
  69. package/modules/clean-code/resources.md +40 -0
  70. package/modules/clean-code/walkthrough.md +78 -0
  71. package/modules/clean-code/workshop.yaml +149 -0
  72. package/modules/code-review/content.md +130 -0
  73. package/modules/code-review/exercises.md +95 -0
  74. package/modules/code-review/game.yaml +83 -0
  75. package/modules/code-review/module.yaml +42 -0
  76. package/modules/code-review/quick-ref.md +77 -0
  77. package/modules/code-review/quiz.md +105 -0
  78. package/modules/code-review/resources.md +40 -0
  79. package/modules/code-review/walkthrough.md +106 -0
  80. package/modules/daily-workflow/content.md +81 -0
  81. package/modules/daily-workflow/exercises.md +50 -0
  82. package/modules/daily-workflow/module.yaml +33 -0
  83. package/modules/daily-workflow/quick-ref.md +37 -0
  84. package/modules/daily-workflow/quiz.md +65 -0
  85. package/modules/daily-workflow/resources.md +38 -0
  86. package/modules/daily-workflow/walkthrough.md +83 -0
  87. package/modules/debugging-systematically/content.md +139 -0
  88. package/modules/debugging-systematically/exercises.md +91 -0
  89. package/modules/debugging-systematically/module.yaml +46 -0
  90. package/modules/debugging-systematically/quick-ref.md +59 -0
  91. package/modules/debugging-systematically/quiz.md +105 -0
  92. package/modules/debugging-systematically/resources.md +42 -0
  93. package/modules/debugging-systematically/walkthrough.md +84 -0
  94. package/modules/debugging-systematically/workshop.yaml +127 -0
  95. package/modules/demo-test/content.md +68 -0
  96. package/modules/demo-test/exercises.md +28 -0
  97. package/modules/demo-test/game.yaml +171 -0
  98. package/modules/demo-test/module.yaml +41 -0
  99. package/modules/demo-test/quick-ref.md +54 -0
  100. package/modules/demo-test/quiz.md +74 -0
  101. package/modules/demo-test/resources.md +21 -0
  102. package/modules/demo-test/walkthrough.md +122 -0
  103. package/modules/demo-test/workshop.yaml +31 -0
  104. package/modules/design-critique/content.md +93 -0
  105. package/modules/design-critique/exercises.md +71 -0
  106. package/modules/design-critique/module.yaml +41 -0
  107. package/modules/design-critique/quick-ref.md +63 -0
  108. package/modules/design-critique/quiz.md +73 -0
  109. package/modules/design-critique/resources.md +27 -0
  110. package/modules/design-critique/walkthrough.md +68 -0
  111. package/modules/design-patterns/content.md +335 -0
  112. package/modules/design-patterns/exercises.md +82 -0
  113. package/modules/design-patterns/game.yaml +55 -0
  114. package/modules/design-patterns/module.yaml +45 -0
  115. package/modules/design-patterns/quick-ref.md +44 -0
  116. package/modules/design-patterns/quiz.md +101 -0
  117. package/modules/design-patterns/resources.md +40 -0
  118. package/modules/design-patterns/walkthrough.md +64 -0
  119. package/modules/exploratory-testing/content.md +133 -0
  120. package/modules/exploratory-testing/exercises.md +88 -0
  121. package/modules/exploratory-testing/module.yaml +41 -0
  122. package/modules/exploratory-testing/quick-ref.md +68 -0
  123. package/modules/exploratory-testing/quiz.md +75 -0
  124. package/modules/exploratory-testing/resources.md +39 -0
  125. package/modules/exploratory-testing/walkthrough.md +87 -0
  126. package/modules/git/content.md +128 -0
  127. package/modules/git/exercises.md +53 -0
  128. package/modules/git/game.yaml +190 -0
  129. package/modules/git/module.yaml +44 -0
  130. package/modules/git/quick-ref.md +67 -0
  131. package/modules/git/quiz.md +89 -0
  132. package/modules/git/resources.md +49 -0
  133. package/modules/git/walkthrough.md +92 -0
  134. package/modules/git/workshop.yaml +145 -0
  135. package/modules/hiring-interviews/content.md +130 -0
  136. package/modules/hiring-interviews/exercises.md +88 -0
  137. package/modules/hiring-interviews/module.yaml +41 -0
  138. package/modules/hiring-interviews/quick-ref.md +68 -0
  139. package/modules/hiring-interviews/quiz.md +73 -0
  140. package/modules/hiring-interviews/resources.md +36 -0
  141. package/modules/hiring-interviews/walkthrough.md +75 -0
  142. package/modules/hooks/content.md +97 -0
  143. package/modules/hooks/exercises.md +69 -0
  144. package/modules/hooks/module.yaml +39 -0
  145. package/modules/hooks/quick-ref.md +93 -0
  146. package/modules/hooks/quiz.md +81 -0
  147. package/modules/hooks/resources.md +34 -0
  148. package/modules/hooks/walkthrough.md +105 -0
  149. package/modules/hooks/workshop.yaml +64 -0
  150. package/modules/incident-response/content.md +124 -0
  151. package/modules/incident-response/exercises.md +82 -0
  152. package/modules/incident-response/game.yaml +132 -0
  153. package/modules/incident-response/module.yaml +45 -0
  154. package/modules/incident-response/quick-ref.md +53 -0
  155. package/modules/incident-response/quiz.md +103 -0
  156. package/modules/incident-response/resources.md +40 -0
  157. package/modules/incident-response/walkthrough.md +82 -0
  158. package/modules/llm-fundamentals/content.md +114 -0
  159. package/modules/llm-fundamentals/exercises.md +83 -0
  160. package/modules/llm-fundamentals/module.yaml +42 -0
  161. package/modules/llm-fundamentals/quick-ref.md +64 -0
  162. package/modules/llm-fundamentals/quiz.md +103 -0
  163. package/modules/llm-fundamentals/resources.md +30 -0
  164. package/modules/llm-fundamentals/walkthrough.md +91 -0
  165. package/modules/one-on-ones/content.md +133 -0
  166. package/modules/one-on-ones/exercises.md +81 -0
  167. package/modules/one-on-ones/module.yaml +44 -0
  168. package/modules/one-on-ones/quick-ref.md +67 -0
  169. package/modules/one-on-ones/quiz.md +73 -0
  170. package/modules/one-on-ones/resources.md +37 -0
  171. package/modules/one-on-ones/walkthrough.md +69 -0
  172. package/modules/package.json +9 -0
  173. package/modules/prioritization-frameworks/content.md +130 -0
  174. package/modules/prioritization-frameworks/exercises.md +93 -0
  175. package/modules/prioritization-frameworks/module.yaml +41 -0
  176. package/modules/prioritization-frameworks/quick-ref.md +77 -0
  177. package/modules/prioritization-frameworks/quiz.md +73 -0
  178. package/modules/prioritization-frameworks/resources.md +32 -0
  179. package/modules/prioritization-frameworks/walkthrough.md +69 -0
  180. package/modules/prompt-engineering/content.md +123 -0
  181. package/modules/prompt-engineering/exercises.md +82 -0
  182. package/modules/prompt-engineering/game.yaml +101 -0
  183. package/modules/prompt-engineering/module.yaml +45 -0
  184. package/modules/prompt-engineering/quick-ref.md +65 -0
  185. package/modules/prompt-engineering/quiz.md +105 -0
  186. package/modules/prompt-engineering/resources.md +36 -0
  187. package/modules/prompt-engineering/walkthrough.md +81 -0
  188. package/modules/rag-fundamentals/content.md +111 -0
  189. package/modules/rag-fundamentals/exercises.md +80 -0
  190. package/modules/rag-fundamentals/module.yaml +45 -0
  191. package/modules/rag-fundamentals/quick-ref.md +58 -0
  192. package/modules/rag-fundamentals/quiz.md +75 -0
  193. package/modules/rag-fundamentals/resources.md +34 -0
  194. package/modules/rag-fundamentals/walkthrough.md +75 -0
  195. package/modules/react-fundamentals/content.md +140 -0
  196. package/modules/react-fundamentals/exercises.md +81 -0
  197. package/modules/react-fundamentals/game.yaml +145 -0
  198. package/modules/react-fundamentals/module.yaml +45 -0
  199. package/modules/react-fundamentals/quick-ref.md +62 -0
  200. package/modules/react-fundamentals/quiz.md +106 -0
  201. package/modules/react-fundamentals/resources.md +42 -0
  202. package/modules/react-fundamentals/walkthrough.md +89 -0
  203. package/modules/react-fundamentals/workshop.yaml +112 -0
  204. package/modules/react-native-fundamentals/content.md +141 -0
  205. package/modules/react-native-fundamentals/exercises.md +79 -0
  206. package/modules/react-native-fundamentals/module.yaml +42 -0
  207. package/modules/react-native-fundamentals/quick-ref.md +60 -0
  208. package/modules/react-native-fundamentals/quiz.md +61 -0
  209. package/modules/react-native-fundamentals/resources.md +24 -0
  210. package/modules/react-native-fundamentals/walkthrough.md +84 -0
  211. package/modules/registry.yaml +1650 -0
  212. package/modules/risk-management/content.md +162 -0
  213. package/modules/risk-management/exercises.md +86 -0
  214. package/modules/risk-management/module.yaml +41 -0
  215. package/modules/risk-management/quick-ref.md +82 -0
  216. package/modules/risk-management/quiz.md +73 -0
  217. package/modules/risk-management/resources.md +40 -0
  218. package/modules/risk-management/walkthrough.md +67 -0
  219. package/modules/running-effective-standups/content.md +119 -0
  220. package/modules/running-effective-standups/exercises.md +79 -0
  221. package/modules/running-effective-standups/module.yaml +40 -0
  222. package/modules/running-effective-standups/quick-ref.md +61 -0
  223. package/modules/running-effective-standups/quiz.md +73 -0
  224. package/modules/running-effective-standups/resources.md +36 -0
  225. package/modules/running-effective-standups/walkthrough.md +76 -0
  226. package/modules/solid-principles/content.md +154 -0
  227. package/modules/solid-principles/exercises.md +107 -0
  228. package/modules/solid-principles/module.yaml +42 -0
  229. package/modules/solid-principles/quick-ref.md +50 -0
  230. package/modules/solid-principles/quiz.md +102 -0
  231. package/modules/solid-principles/resources.md +39 -0
  232. package/modules/solid-principles/walkthrough.md +84 -0
  233. package/modules/sprint-planning/content.md +142 -0
  234. package/modules/sprint-planning/exercises.md +79 -0
  235. package/modules/sprint-planning/game.yaml +84 -0
  236. package/modules/sprint-planning/module.yaml +44 -0
  237. package/modules/sprint-planning/quick-ref.md +76 -0
  238. package/modules/sprint-planning/quiz.md +102 -0
  239. package/modules/sprint-planning/resources.md +39 -0
  240. package/modules/sprint-planning/walkthrough.md +75 -0
  241. package/modules/sql-fundamentals/content.md +160 -0
  242. package/modules/sql-fundamentals/exercises.md +87 -0
  243. package/modules/sql-fundamentals/game.yaml +105 -0
  244. package/modules/sql-fundamentals/module.yaml +45 -0
  245. package/modules/sql-fundamentals/quick-ref.md +53 -0
  246. package/modules/sql-fundamentals/quiz.md +103 -0
  247. package/modules/sql-fundamentals/resources.md +42 -0
  248. package/modules/sql-fundamentals/walkthrough.md +92 -0
  249. package/modules/sql-fundamentals/workshop.yaml +109 -0
  250. package/modules/stakeholder-communication/content.md +186 -0
  251. package/modules/stakeholder-communication/exercises.md +87 -0
  252. package/modules/stakeholder-communication/module.yaml +38 -0
  253. package/modules/stakeholder-communication/quick-ref.md +89 -0
  254. package/modules/stakeholder-communication/quiz.md +73 -0
  255. package/modules/stakeholder-communication/resources.md +41 -0
  256. package/modules/stakeholder-communication/walkthrough.md +74 -0
  257. package/modules/system-design/content.md +149 -0
  258. package/modules/system-design/exercises.md +83 -0
  259. package/modules/system-design/game.yaml +95 -0
  260. package/modules/system-design/module.yaml +46 -0
  261. package/modules/system-design/quick-ref.md +59 -0
  262. package/modules/system-design/quiz.md +102 -0
  263. package/modules/system-design/resources.md +46 -0
  264. package/modules/system-design/walkthrough.md +90 -0
  265. package/modules/team-topologies/content.md +166 -0
  266. package/modules/team-topologies/exercises.md +85 -0
  267. package/modules/team-topologies/module.yaml +41 -0
  268. package/modules/team-topologies/quick-ref.md +61 -0
  269. package/modules/team-topologies/quiz.md +101 -0
  270. package/modules/team-topologies/resources.md +37 -0
  271. package/modules/team-topologies/walkthrough.md +76 -0
  272. package/modules/technical-debt/content.md +111 -0
  273. package/modules/technical-debt/exercises.md +92 -0
  274. package/modules/technical-debt/module.yaml +39 -0
  275. package/modules/technical-debt/quick-ref.md +60 -0
  276. package/modules/technical-debt/quiz.md +73 -0
  277. package/modules/technical-debt/resources.md +25 -0
  278. package/modules/technical-debt/walkthrough.md +94 -0
  279. package/modules/technical-mentoring/content.md +128 -0
  280. package/modules/technical-mentoring/exercises.md +84 -0
  281. package/modules/technical-mentoring/module.yaml +41 -0
  282. package/modules/technical-mentoring/quick-ref.md +74 -0
  283. package/modules/technical-mentoring/quiz.md +73 -0
  284. package/modules/technical-mentoring/resources.md +33 -0
  285. package/modules/technical-mentoring/walkthrough.md +65 -0
  286. package/modules/test-strategy/content.md +136 -0
  287. package/modules/test-strategy/exercises.md +84 -0
  288. package/modules/test-strategy/game.yaml +99 -0
  289. package/modules/test-strategy/module.yaml +45 -0
  290. package/modules/test-strategy/quick-ref.md +66 -0
  291. package/modules/test-strategy/quiz.md +99 -0
  292. package/modules/test-strategy/resources.md +60 -0
  293. package/modules/test-strategy/walkthrough.md +97 -0
  294. package/modules/test-strategy/workshop.yaml +96 -0
  295. package/modules/typescript-fundamentals/content.md +127 -0
  296. package/modules/typescript-fundamentals/exercises.md +79 -0
  297. package/modules/typescript-fundamentals/game.yaml +111 -0
  298. package/modules/typescript-fundamentals/module.yaml +45 -0
  299. package/modules/typescript-fundamentals/quick-ref.md +55 -0
  300. package/modules/typescript-fundamentals/quiz.md +104 -0
  301. package/modules/typescript-fundamentals/resources.md +42 -0
  302. package/modules/typescript-fundamentals/walkthrough.md +71 -0
  303. package/modules/typescript-fundamentals/workshop.yaml +146 -0
  304. package/modules/user-story-mapping/content.md +123 -0
  305. package/modules/user-story-mapping/exercises.md +87 -0
  306. package/modules/user-story-mapping/module.yaml +41 -0
  307. package/modules/user-story-mapping/quick-ref.md +64 -0
  308. package/modules/user-story-mapping/quiz.md +73 -0
  309. package/modules/user-story-mapping/resources.md +29 -0
  310. package/modules/user-story-mapping/walkthrough.md +86 -0
  311. package/modules/writing-prds/content.md +133 -0
  312. package/modules/writing-prds/exercises.md +93 -0
  313. package/modules/writing-prds/game.yaml +83 -0
  314. package/modules/writing-prds/module.yaml +44 -0
  315. package/modules/writing-prds/quick-ref.md +77 -0
  316. package/modules/writing-prds/quiz.md +103 -0
  317. package/modules/writing-prds/resources.md +30 -0
  318. package/modules/writing-prds/walkthrough.md +87 -0
  319. package/package.json +5 -3
  320. package/src/server.js +17 -7
@@ -0,0 +1,139 @@
1
+ # Systematic Debugging — From Symptom to Root Cause
2
+
3
+ <!-- hint:slides topic="Systematic debugging: observe-hypothesize-test loop, binary search, reading stack traces, and cause vs symptom" slides="5" -->
4
+
5
+ ## The Scientific Method Applied
6
+
7
+ Debugging is hypothesis-driven. You observe, hypothesize, test, and conclude — then repeat until you find the root cause.
8
+
9
+ ```
10
+ Observe → Hypothesize → Test → Conclude → (repeat if needed)
11
+ ```
12
+
13
+ ```mermaid
14
+ flowchart LR
15
+ A[Observe] --> B[Hypothesize]
16
+ B --> C[Predict]
17
+ C --> D[Test]
18
+ D --> E[Analyze]
19
+ E --> F{Found?}
20
+ F -->|No| B
21
+ F -->|Yes| G[Fix]
22
+ ```
23
+
24
+ ## Reproduce First
25
+
26
+ Before changing anything, **reproduce the bug consistently**. If you can't reproduce it, you can't verify your fix.
27
+
28
+ - Note exact steps, inputs, and environment
29
+ - Check timing (does it only happen under load?)
30
+ - Capture logs, screenshots, or error messages
31
+
32
+ ## Binary Search for the Cause
33
+
34
+ Narrow the problem space efficiently:
35
+
36
+ 1. **Halve the input** — Does it fail with half the data? Which half?
37
+ 2. **Disable features** — Does it fail with feature X off?
38
+ 3. **Bisect history** — Which commit introduced it? (`git bisect`)
39
+
40
+ ```javascript
41
+ // Instead of reading 1000 lines, binary search:
42
+ // 1. Comment out half the code — still fails?
43
+ // 2. Narrow to the half that matters
44
+ // 3. Repeat until you isolate the culprit
45
+ ```
46
+
47
+ ## Rubber Duck Debugging
48
+
49
+ Explain the problem out loud (or to a rubber duck, colleague, or AI). Often the act of explaining reveals the bug before you finish.
50
+
51
+ "Why would this fail when… oh. I see. The loop starts at 1 but the array is 0-indexed."
52
+
53
+ ## Reading Stack Traces
54
+
55
+ Stack traces show the **call path** when the error occurred:
56
+
57
+ ```
58
+ Error: Cannot read property 'id' of undefined
59
+ at UserCard (./src/UserCard.jsx:15:22)
60
+ at UserList (./src/UserList.jsx:8:14)
61
+ at App (./src/App.jsx:12:10)
62
+ ```
63
+
64
+ Read **bottom to top**: `App` rendered `UserList`, which rendered `UserCard`, where line 15 accessed `.id` on `undefined`. The bug is likely in `UserCard` (wrong prop) or `UserList` (passing undefined).
65
+
66
+ ## Debugger Tools
67
+
68
+ ### Breakpoints
69
+ Pause execution at a line. Inspect variables, step through.
70
+
71
+ ```javascript
72
+ function calculateTotal(items) {
73
+ let total = 0;
74
+ for (const item of items) {
75
+ total += item.price * item.quantity; // Breakpoint here
76
+ }
77
+ return total;
78
+ }
79
+ ```
80
+
81
+ ### Watches
82
+ Monitor expressions (e.g., `item.price`, `total`) as you step.
83
+
84
+ ### Call Stack
85
+ See how you got here. Click frames to jump to caller context.
86
+
87
+ ### Conditional Breakpoints
88
+ Break only when a condition holds (e.g., `item.id === 42`).
89
+
90
+ ## Logging Strategies
91
+
92
+ | Strategy | Use When |
93
+ |----------|----------|
94
+ | `console.log` | Quick inspection; remove after |
95
+ | Structured logging | Production; levels (debug, info, warn, error) |
96
+ | Correlation IDs | Tracing a request across services |
97
+ | Minimal repro | Log only inputs and outputs around the fault |
98
+
99
+ ```javascript
100
+ // Good: log enough to understand flow
101
+ console.log('calculateTotal input:', { items, count: items.length });
102
+ const total = calculateTotal(items);
103
+ console.log('calculateTotal output:', total);
104
+ ```
105
+
106
+ ## Common Pitfalls
107
+
108
+ | Pitfall | Problem |
109
+ |---------|---------|
110
+ | Fixing symptoms not causes | Patch hides the bug; it returns elsewhere |
111
+ | Assuming without testing | "It must be X" — verify |
112
+ | Changing multiple things | Can't tell what fixed it |
113
+ | Not reproducing first | "Fixed" but bug was intermittent |
114
+ | Giving up too soon | Systematic search almost always finds it |
115
+
116
+ ## Debugging Process Flow
117
+
118
+ ```mermaid
119
+ flowchart TD
120
+ A[Observe: Symptom] --> B[Reproduce consistently]
121
+ B --> C[Form hypothesis]
122
+ C --> D[Design test]
123
+ D --> E{Test confirms?}
124
+ E -->|Yes| F[Identify root cause]
125
+ E -->|No| C
126
+ F --> G[Fix cause, not symptom]
127
+ G --> H[Verify fix with repro steps]
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Key Takeaways
133
+
134
+ 1. **Reproduce first** — no fix without a reliable repro
135
+ 2. **Hypothesize and test** — don't guess randomly
136
+ 3. **Binary search** — halve the problem space
137
+ 4. **Use the debugger** — breakpoints, watches, call stack
138
+ 5. **Fix the cause** — not the symptom
139
+ 6. **Rubber duck** — explaining often reveals the answer
@@ -0,0 +1,91 @@
1
+ # Systematic Debugging Exercises
2
+
3
+ ## Exercise 1: Write a Reproduction Recipe
4
+
5
+ **Task:** A user reports: "Sometimes the export fails." Write a reproduction recipe that would help you (or a teammate) reliably reproduce the issue. Include: steps, inputs, environment, and what "fails" means.
6
+
7
+ **Validation:**
8
+ - [ ] Steps are ordered and specific
9
+ - [ ] Inputs are concrete (e.g., "export 50+ items")
10
+ - [ ] Environment noted (browser, OS, data state)
11
+ - [ ] "Fails" is defined (error message, wrong output, hang)
12
+
13
+ **Hints:**
14
+ 1. "Sometimes" suggests timing or data-dependent — capture those
15
+ 2. "Export" — what format? What data?
16
+ 3. Ask: when does it work vs fail?
17
+
18
+ ---
19
+
20
+ ## Exercise 2: Interpret a Stack Trace
21
+
22
+ **Task:** Given this stack trace:
23
+
24
+ ```
25
+ RangeError: Invalid array length
26
+ at Array.fill (native)
27
+ at createGrid (grid.js:5:12)
28
+ at initGame (game.js:22:8)
29
+ ```
30
+
31
+ Identify: (a) where it failed, (b) the likely cause, (c) one line of code you'd inspect first.
32
+
33
+ **Validation:**
34
+ - [ ] Failure at grid.js:5, in createGrid
35
+ - [ ] Array.fill with invalid length — probably negative or NaN
36
+ - [ ] Would check the argument passed to createGrid (likely width/height)
37
+
38
+ **Hints:**
39
+ 1. Array.fill(length) fails if length is negative or non-integer
40
+ 2. createGrid probably receives dimensions
41
+ 3. initGame calls createGrid — what does it pass?
42
+
43
+ ---
44
+
45
+ ## Exercise 3: Binary Search the Bug
46
+
47
+ **Task:** A function processItems(items) fails when items has 10,000 elements but works with 100. Describe how you'd binary search to find the threshold (e.g., does 5,000 work? 7,500?).
48
+
49
+ **Validation:**
50
+ - [ ] Describes halving: try 5000, then 2500 or 7500 based on result
51
+ - [ ] Continues until threshold is found
52
+ - [ ] Understands this finds "when" it breaks, not necessarily "why"
53
+
54
+ **Hints:**
55
+ 1. Test 5000 — pass or fail?
56
+ 2. If fail, try 2500; if pass, try 7500
57
+ 3. Repeat until you narrow to the boundary
58
+
59
+ ---
60
+
61
+ ## Exercise 4: Hypothesize and Test
62
+
63
+ **Task:** Bug: "Form validation fails for emails with a '+' character." Write two hypotheses and a test for each.
64
+
65
+ **Validation:**
66
+ - [ ] Hypothesis 1 is specific (e.g., regex doesn't allow +)
67
+ - [ ] Hypothesis 2 is different (e.g., encoding strips +)
68
+ - [ ] Each test is concrete (e.g., input "a+b@c.com", expect pass)
69
+
70
+ **Hints:**
71
+ 1. Validation could be regex, built-in validator, or backend
72
+ 2. + is valid in email local part; some regexes exclude it
73
+ 3. URL encoding could alter + if passed in query string
74
+
75
+ ---
76
+
77
+ ## Exercise 5: Cause vs Symptom
78
+
79
+ **Task:** Bug: "Dashboard shows 0 for today's revenue when there are sales." Proposed fix: "If revenue is 0, display '—' instead."
80
+
81
+ Explain why this might be a symptom fix. What would you investigate before or in addition to this change?
82
+
83
+ **Validation:**
84
+ - [ ] Identifies that 0 might be wrong (data/aggregation bug)
85
+ - [ ] Suggests investigating: API response, date range, aggregation logic
86
+ - [ ] Understands display fix can hide a data bug
87
+
88
+ **Hints:**
89
+ 1. Is the data actually 0, or is it a bug in calculation?
90
+ 2. Check API, database query, timezone
91
+ 3. Display fix is OK for UX, but root cause may need fixing too
@@ -0,0 +1,46 @@
1
+ slug: debugging-systematically
2
+ title: "Systematic Debugging — From Symptom to Root Cause"
3
+ version: 1.0.0
4
+ description: "Apply the scientific method to debugging: reproduce, hypothesize, test, and conclude."
5
+ category: developer-skills
6
+ tags: [debugging, troubleshooting, problem-solving, developer-tools, root-cause]
7
+ difficulty: beginner
8
+
9
+ xp:
10
+ read: 10
11
+ walkthrough: 30
12
+ exercise: 20
13
+ quiz: 15
14
+ quiz-perfect-bonus: 10
15
+ game: 25
16
+ game-perfect-bonus: 15
17
+
18
+ time:
19
+ quick: 5
20
+ read: 15
21
+ guided: 40
22
+
23
+ prerequisites: []
24
+ related: [code-review, test-strategy]
25
+
26
+ triggers:
27
+ - "How do I debug effectively?"
28
+ - "How do I find the root cause of a bug?"
29
+ - "What's a systematic approach to debugging?"
30
+ - "How do I use breakpoints and debugger tools?"
31
+
32
+ visuals:
33
+ diagrams: [diagram-flow, diagram-mermaid]
34
+ quiz-types: [quiz-drag-order, quiz-timed-choice]
35
+ game-types: [scenario, speed-round]
36
+ playground: javascript
37
+ web-embeds: true
38
+ slides: true
39
+
40
+ sources:
41
+ - url: "https://www.nickjanetakis.com/blog/debugging-9-rules-from-david-j-agans"
42
+ label: "Debugging — 9 Rules (David Agans summary)"
43
+ type: docs
44
+ - url: "https://www.amazon.com/Debugging-David-J-Agans/dp/0814474578"
45
+ label: "Debugging by David Agans (book)"
46
+ type: book
@@ -0,0 +1,59 @@
1
+ # Systematic Debugging Quick Reference
2
+
3
+ ## The Loop
4
+
5
+ ```
6
+ Observe → Reproduce → Hypothesize → Test → Conclude → (repeat)
7
+ ```
8
+
9
+ ## Reproduce First
10
+
11
+ | Do | Don't |
12
+ |----|-------|
13
+ | Get exact steps, inputs, environment | Assume you know the repro |
14
+ | Capture logs, errors, screenshots | Fix before reproducing |
15
+ | Note when it works vs fails | Dismiss "sometimes" as unfixable |
16
+
17
+ ## Binary Search
18
+
19
+ | Target | How |
20
+ |--------|-----|
21
+ | Input/data | Halve the input; which half fails? |
22
+ | Code | Comment out half; narrow to failing half |
23
+ | History | `git bisect` to find introducing commit |
24
+
25
+ ## Stack Traces
26
+
27
+ | Read | Bottom → Top |
28
+ |------|---------------|
29
+ | Bottom | Entry point (e.g., event handler) |
30
+ | Top | Where it actually failed |
31
+ | Middle | Call path from entry to failure |
32
+
33
+ ## Debugger Basics
34
+
35
+ | Feature | Use |
36
+ |---------|-----|
37
+ | Breakpoint | Pause at a line |
38
+ | Step over | Run line, stay in current function |
39
+ | Step into | Enter function call |
40
+ | Watches | Monitor expression values |
41
+ | Call stack | See path to current line |
42
+
43
+ ## Common Pitfalls
44
+
45
+ | Pitfall | Fix |
46
+ |---------|-----|
47
+ | Fix symptom not cause | Find root cause; fix that |
48
+ | Assume without testing | Verify each hypothesis |
49
+ | Change many things at once | One change, one test |
50
+ | No repro | Get one before coding |
51
+ | Give up | Binary search; be systematic |
52
+
53
+ ## Logging
54
+
55
+ | When | What to log |
56
+ |------|-------------|
57
+ | Quick debug | Inputs and outputs around the fault |
58
+ | Production | Structured; levels; correlation IDs |
59
+ | Minimal repro | Only what's needed to trace the flow |
@@ -0,0 +1,105 @@
1
+ # Systematic Debugging Quiz
2
+
3
+ ## Question 1
4
+
5
+ What is the first step in systematic debugging?
6
+
7
+ A) Fix the most likely cause
8
+ B) Reproduce the bug consistently
9
+ C) Add more logging
10
+ D) Ask someone else
11
+
12
+ <!-- ANSWER: B -->
13
+ <!-- EXPLANATION: Without a reliable reproduction, you can't verify that your fix works. Reproducing first ensures you understand the problem and can test hypotheses. -->
14
+
15
+ ## Question 2
16
+
17
+ You see: `TypeError: Cannot read property 'name' of undefined at Profile.jsx:18`. Where should you look first?
18
+
19
+ A) Line 18 of Profile.jsx — what is undefined?
20
+ B) The file that imports Profile.jsx
21
+ C) The backend API only
22
+ D) The browser console for more errors
23
+
24
+ <!-- ANSWER: A -->
25
+ <!-- EXPLANATION: The stack trace points to Profile.jsx:18. Something there is undefined when `.name` is accessed. Check what variable or prop is undefined at that line. -->
26
+
27
+ ## Question 3
28
+
29
+ What does "binary search" mean in debugging?
30
+
31
+ A) Search for the word "binary" in the code
32
+ B) Halve the problem space (input, code, or history) to isolate the cause
33
+ C) Use a binary file editor
34
+ D) Restart the program repeatedly
35
+
36
+ <!-- ANSWER: B -->
37
+ <!-- EXPLANATION: Binary search in debugging means repeatedly halving — e.g., comment out half the code, test with half the data, or use git bisect to find the introducing commit. -->
38
+
39
+ ## Question 4
40
+
41
+ Why is "rubber duck" debugging effective?
42
+
43
+ A) Ducks are good listeners
44
+ B) Explaining the problem out loud often reveals the bug before you finish
45
+ C) It's faster than using a debugger
46
+ D) It only works for simple bugs
47
+
48
+ <!-- ANSWER: B -->
49
+ <!-- EXPLANATION: The act of explaining forces you to articulate assumptions and logic. Often you spot the flaw while formulating the explanation. It works for bugs of any complexity. -->
50
+
51
+ ## Question 5
52
+
53
+ What's wrong with adding a quick fix that hides the symptom?
54
+
55
+ A) Nothing — if it works, ship it
56
+ B) The root cause may cause other bugs; you also can't verify the fix
57
+ C) Quick fixes are always wrong
58
+ D) It makes the code harder to read
59
+
60
+ <!-- ANSWER: B -->
61
+ <!-- EXPLANATION: Symptom fixes (e.g., fallbacks) can hide the real bug, which may surface elsewhere. Without a repro, you can't verify the fix. Find and fix the cause when possible. -->
62
+
63
+ ## Question 6
64
+
65
+ Drag these debugging steps into the correct order:
66
+
67
+ <!-- VISUAL: quiz-drag-order -->
68
+
69
+ A) Reproduce → Hypothesize → Test → Conclude → Fix
70
+ B) Fix → Test → Hypothesize → Reproduce
71
+ C) Hypothesize → Fix → Reproduce → Test
72
+ D) Test → Conclude → Reproduce → Hypothesize
73
+
74
+ <!-- ANSWER: A -->
75
+ <!-- EXPLANATION: Reproduce first to understand the problem. Form a hypothesis. Design and run a test. Conclude (confirm or reject). Fix the root cause. The cycle repeats if the hypothesis was wrong. -->
76
+
77
+ ## Question 7
78
+
79
+ <!-- VISUAL: quiz-drag-order -->
80
+
81
+ Put these debugging steps in the correct order:
82
+
83
+ A) Conclude (confirm or reject hypothesis)
84
+ B) Reproduce the bug consistently
85
+ C) Fix the root cause
86
+ D) Hypothesize the cause
87
+ E) Test the hypothesis
88
+
89
+ <!-- ANSWER: B,D,E,A,C -->
90
+ <!-- EXPLANATION: First reproduce to understand the problem, then form a hypothesis, design and run a test, conclude based on the result, and finally fix the root cause. The cycle repeats if the hypothesis was wrong. -->
91
+
92
+ ## Question 8
93
+
94
+ <!-- VISUAL: quiz-drag-order -->
95
+
96
+ Put these hypothesis-testing steps in the correct flow:
97
+
98
+ A) Observe the result
99
+ B) Form a falsifiable hypothesis
100
+ C) Design a test that would disprove it
101
+ D) If disproved, form a new hypothesis
102
+ E) If confirmed, fix the root cause
103
+
104
+ <!-- ANSWER: B,C,A,D,E -->
105
+ <!-- EXPLANATION: Form a falsifiable hypothesis, design a test that could disprove it, run the test and observe, then either form a new hypothesis if disproved or fix the root cause if confirmed. This scientific approach isolates the cause efficiently. -->
@@ -0,0 +1,42 @@
1
+ # Systematic Debugging — Resources
2
+
3
+ ## Videos
4
+
5
+ - [Debugging: The #1 Skill Most Developers Lack](https://www.youtube.com/watch?v=7jPXOLdYXpg) — Fun Fun Function, ~25 min. Practical debugging mindset and tools.
6
+ - [Debugging with Chrome DevTools](https://developer.chrome.com/docs/devtools/) — Google. Breakpoints, step-through, profiling.
7
+ - [JavaScript Debugging Crash Course](https://www.youtube.com/watch?v=H0XScE08k8U) — Traversy Media. Console, debugger, common patterns.
8
+
9
+ ## Articles and Readings
10
+
11
+ - [Debugging — David J. Agans (Book Summary)](https://www.nickjanetakis.com/blog/debugging-9-rules-from-david-j-agans) — Nick Janetakis. The 9 rules: understand the system, make it fail, quit thinking and look, divide and conquer, change one thing at a time, keep an audit trail, check the plug, get a fresh view, and if you didn't fix it, it isn't fixed.
12
+ - [Chrome DevTools JavaScript Debugging](https://developer.chrome.com/docs/devtools/javascript/) — Breakpoints, stepping, watch expressions.
13
+ - [JavaScript Debugging Guide (MDN)](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_browser_developer_tools#javascript_console) — Console and debugger usage.
14
+ - [Git Bisect](https://git-scm.com/docs/git-bisect) — Binary search through commit history to find the bug-introducing commit.
15
+
16
+ ## Books
17
+
18
+ - **Debugging: The 9 Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems** by David J. Agans — Classic framework: understand the system, make it fail, quit thinking and look, divide and conquer, and more.
19
+ - **Why Programs Fail** by Andreas Zeller — Systematic debugging, delta debugging, and automated fault localization.
20
+
21
+ ## Tools and Playgrounds
22
+
23
+ - [Chrome DevTools](https://developer.chrome.com/docs/devtools/) — Breakpoints, step-through, network, profiling. Essential for web debugging.
24
+ - [VS Code Debugger](https://code.visualstudio.com/docs/editor/debugging) — Node.js and browser debugging from the editor.
25
+ - [Git Bisect](https://git-scm.com/docs/git-bisect) — Find the commit that introduced a bug via binary search.
26
+
27
+ ## Podcasts
28
+
29
+ - [Software Engineering Radio — Debugging Episodes](https://www.se-radio.net/) — Technical discussions on debugging strategies and tooling.
30
+ - [Changelog — Debugging Stories](https://changelog.com/podcast) — Real-world war stories from developers tracking down hard bugs.
31
+ - [CoRecursive — Debugging Tales](https://corecursive.com/) — Long-form stories about memorable bugs and how they were found.
32
+
33
+ ## Interactive and Visual
34
+
35
+ - [Chrome DevTools — What's New](https://developer.chrome.com/blog/) — Latest debugging features with visual walkthroughs.
36
+ - [Replay.io](https://www.replay.io/) — Time-travel debugger for JavaScript — record, replay, and inspect any point in execution.
37
+ - [Python Tutor](https://pythontutor.com/) — Visualize code execution step-by-step (supports JS, Python, Java, C++).
38
+
39
+ ## Courses
40
+
41
+ - [Google — Chrome DevTools (free)](https://developer.chrome.com/docs/devtools/overview/) — Comprehensive guides and tutorials on browser debugging.
42
+ - [freeCodeCamp — Debugging Course](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/#debugging) — Free interactive debugging exercises in JavaScript.
@@ -0,0 +1,84 @@
1
+ # Systematic Debugging Walkthrough — Learn by Doing
2
+
3
+ ## Step 1: Reproduce Before You Fix
4
+
5
+ You hear "the app crashes when I click Submit." You haven't seen it yourself.
6
+
7
+ **Task:** Before writing any code, what would you do? List at least 3 concrete steps to get a reliable reproduction.
8
+
9
+ **Question:** Why is "it crashes sometimes" harder to debug than "it crashes when I click Submit with an empty email field"? What changes when you have a precise repro?
10
+
11
+ **Checkpoint:** The user should list: get exact steps, environment (browser, data), try to reproduce themselves, capture error/logs. They understand that a reliable repro is the foundation.
12
+
13
+ ---
14
+
15
+ ## Step 2: Read a Stack Trace
16
+
17
+ You see:
18
+
19
+ ```
20
+ TypeError: items.forEach is not a function
21
+ at processOrder (orderService.js:12:8)
22
+ at handleCheckout (cart.js:45:22)
23
+ at onClick (CheckoutButton.jsx:8:15)
24
+ ```
25
+
26
+ **Task:** Interpret this stack trace. Where did the error occur? What's the likely cause? What would you check first?
27
+
28
+ **Question:** Why does the top of the stack (orderService.js:12) matter more than the bottom? How does the call path help you?
29
+
30
+ **Checkpoint:** The user identifies: error at `orderService.js:12`, `items` is not an array (maybe null/undefined or wrong type). They'd check what's passed to `processOrder` and where it comes from. They understand bottom = entry, top = failure.
31
+
32
+ ---
33
+
34
+ ## Step 3: Form a Hypothesis
35
+
36
+ The bug: "Paginated list shows wrong items on page 3." You haven't looked at the code yet.
37
+
38
+ <!-- hint:card type="tip" title="A testable hypothesis: specific, falsifiable, and suggests a check" -->
39
+
40
+ **Task:** Write two possible hypotheses. For each, state (a) what you'd check, and (b) a test that would confirm or refute it.
41
+
42
+ **Question:** What makes a hypothesis "testable"? Why is "maybe it's a bug" not useful?
43
+
44
+ **Checkpoint:** User's hypotheses are specific (e.g., "off-by-one in page index" or "API returns wrong offset"). Their tests are concrete (inspect API response, log page index). They understand testable = can verify with a check.
45
+
46
+ ---
47
+
48
+ ## Step 4: Binary Search in Code
49
+
50
+ You have a 200-line function. The bug appears when processing "order #1234" but not "order #1233."
51
+
52
+ <!-- hint:buttons type="single" prompt="What's your first move to isolate the bug?" options="Bisect by order ID,Comment out half the function,Read line by line from top" -->
53
+
54
+ **Task:** Describe how you'd use binary search to isolate the problem. What would you try first? Second?
55
+
56
+ **Question:** Why is binary search faster than reading line-by-line from the top? When might it not work?
57
+
58
+ **Checkpoint:** User suggests: bisect by order ID range, or comment out half the function and test. They understand that halving reduces search time. They note it may not work if the bug depends on complex interaction.
59
+
60
+ ---
61
+
62
+ ## Step 5: Use the Debugger
63
+
64
+ You're debugging a function that calculates a total. The total is wrong for a specific input.
65
+
66
+ **Embed:** https://developer.chrome.com/docs/devtools/javascript/
67
+
68
+ **Task:** Describe how you'd use breakpoints to find the bug. Where would you set them? What would you inspect? What's the difference between "step over" and "step into"?
69
+
70
+ **Question:** When is `console.log` enough vs when do you need a real debugger?
71
+
72
+ **Checkpoint:** User would set a breakpoint in the calculation loop, inspect variables (item, total), step through. Step over = run current line without entering; step into = go inside a function call. Console.log works for simple cases; debugger for loops, async, complex state.
73
+
74
+ ---
75
+
76
+ ## Step 6: Distinguish Cause from Symptom
77
+
78
+ The bug: "User profile page shows 'undefined' for the avatar." Someone suggests: "Just add a fallback: `avatar || 'default.png'`."
79
+
80
+ **Task:** Why might that fix be addressing the symptom instead of the cause? What would you investigate before (or in addition to) adding a fallback?
81
+
82
+ **Question:** When is a defensive fix (like a fallback) acceptable vs when must you fix the root cause?
83
+
84
+ **Checkpoint:** User recognizes: the real bug could be that the API isn't returning the avatar, or the wrong field is read. A fallback hides the symptom; the underlying bug might cause other issues. Defensive fixes are OK for resilience; root cause should still be found and fixed when possible.