AI-Assisted Debugging for Computer Science Students

Don't fix my code.
Teach me why it broke.

TraceTutor uses failed tests, Socratic hints, and misconception tracking to help students debug independently — building deep conceptual intuition instead of copy-pasting answers.

sumArray.js — Socratic Debugging Session
Interactive Preview
Student Submission Test Failed (1/3)
// Loop overshoots array boundary
function sumArray(arr) {
  let total = 0;
  for (let i = 0; i <= arr.length; i++) {
    total += arr[i];
  }
  return total;
}
AssertionError on sumArray([1, 2, 3, 4, 5])
Expected 15, received NaN.
TraceTutor Socratic GuideLevel 1 Hint

“When i becomes equal to arr.length, what element are you trying to access?”

Consider an array of 5 elements: what are the valid indices, and what does JavaScript return when accessing arr[5]?

Why this question?

This prompt directs attention to the array boundary condition without giving away the corrected operator.

Misconception tracked: Array boundary overrunTry this challenge →

Pedagogical Flow

How TraceTutor Teaches You to Debug

Unlike code generators that hand you the final snippet, TraceTutor models the diagnostic process of a senior computer science instructor.

1

Write or inspect buggy code

Start with a targeted challenge or your own code snippet containing subtle logic bugs, off-by-one errors, or state mutation bugs.

> off-by-one loop condition
2

Run tests and understand the failure

Execute automated test suites. TraceTutor highlights the exact failing assertions, input values, and divergent execution paths.

> AssertionError: expected 15, got NaN
3

Get a Socratic hint and fix it yourself

Receive targeted guiding questions that nudge you toward discovering the root cause, reinforcing your mental model for future code.

> "What is arr[arr.length]?"

Core Capabilities

Engineered for Real Understanding

Purpose-built tooling designed to turn failed builds into teachable moments.

Test-Driven Feedback

Immediate test executions with crystal-clear inputs, expected outputs, and stack trace breakdowns.

Socratic AI Hints

Stepwise nudges that ask critical diagnostic questions rather than spoiling the solution.

Misconception Tracking

Identifies recurring bug patterns (off-by-one, type coercion, scope) to reveal true learning gaps.

Mastery Progress

Track conceptual fluency over time with clear mastery indicators from "Needs Practice" to "Mastered".

Ready to debug with confidence?

Try your first challenge now. Diagnose the failing assertion and fix the code with Socratic guidance.