Script Valley
Reading Other People's Code
Debugging Code You've Never Seen/Assessment

Practice & Assessment

Test your understanding of Debugging Code You've Never Seen

Multiple Choice Questions

5
1

A stack trace has 15 frames. The first 2 are in your application code and the rest are in Express internals. Where is the bug most likely located?

2

What is the key difference between Step Over and Step Into in a debugger?

3

You're debugging a bug that only occurs for users with a specific ID. Which debugger feature handles this most efficiently?

4

In production logs, what is the primary purpose of a requestId or correlationId field?

5

When forming a debugging hypothesis, what makes it 'good' versus 'bad'?

Coding Challenges

1
1

Stack Trace Detective

Create a Node.js file buggy-app.js containing three functions: parseConfig(filePath), validateConfig(config), and startApp(filePath) that calls the first two. Introduce a bug where parseConfig returns null for a missing file, and validateConfig crashes with a TypeError when accessing null.timeout. Run the app to generate a stack trace. Then write a bug-report.md containing: (1) the full stack trace, (2) identification of the application frame where the bug originates, (3) your diagnosis of the root cause, (4) the fix applied, (5) the corrected output. Input: your buggy-app.js. Output: bug-report.md and fixed-app.js. Time estimate: 20 minutes.

Easy

Mini Project

1

Debugging an Open-Source Bug

Go to the GitHub issues list of any popular Node.js or Python library with 1000+ stars. Find an open bug labeled 'bug' that has a reproduction case. Your task: (1) reproduce the bug locally and capture the full stack trace in reproduction.txt, (2) use the debugger (not just console.log) to trace execution to the root cause — document your session as a step-by-step walkthrough in debug-session.md, (3) form three successive hypotheses, note which were wrong and why in hypotheses.md, (4) identify the exact line and variable state where behavior diverges from expected, (5) write a proposed fix in fix.patch (git diff format) and explain it in fix-explanation.md. If you can, open a real pull request. Uses all Module 4 skills: stack trace reading, strategic logging, debugger usage, hypothesis formation, and log analysis.

Hard