Skip to content

MANAST11/ai-debugging-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ai-debugging-assistant

AI-powered debugging assistant that teaches Python through guided discovery. Uses Socratic method & progressive hints to help students learn from their bugs, not just fix them. Built for FOSSEE Python Screening Task.

Overview

Traditional debugging assistance often provides direct solutions, creating dependency rather than learning. This AI assistant uses proven educational methodologies to guide students through the debugging process, helping them understand not just what's wrong, but why it's wrong and how to avoid similar issues in the future. The system is built on three core principles:

  • Never provide direct solutions - Students learn through discovery
  • Socratic teaching method - Guides with questions and progressive hints
  • Concept-focused learning - Connects specific bugs to broader programming principles

Whether you're an instructor looking to provide consistent debugging support or a student wanting to develop independent problem-solving skills, this AI assistant provides structured, educational guidance for Python programming challenges.

Quick Start

  1. Copy the prompt from the section prompt.txt
  2. Paste into your preferred AI system (ChatGPT, Claude, Gemini, etc.)
  3. Test with sample buggy code from the test_cases/ folder
  4. Verify the AI follows the teaching methodology - it should guide, not solve
  5. Begin using with real student code debugging scenarios

The system works immediately with any major AI language model and requires no additional setup or dependencies.

How to Use

For Instructors

Implementation Steps:

  1. Choose Your AI Platform: ChatGPT-4, Claude, or Google Gemini work best
  2. Install the Prompt: Copy the complete prompt and paste it as a system prompt or save as a custom GPT
  3. Test with Sample Cases: Use the provided test cases in test_cases/ folder to verify functionality
  4. Monitor Initial Student Interactions: Ensure the AI maintains educational standards
  5. Adjust if Needed: Fine-tune based on your specific student population

Quality Assurance:

  • Regular Monitoring: Check that the AI never provides direct solutions
  • Student Feedback: Gather input on helpfulness and clarity of AI responses
  • Consistency Checks: Verify the AI follows the 7-step debugging process consistently
  • Adaptation Monitoring: Ensure appropriate difficulty level for your students

For Students

Getting Started:

  1. Prepare Your Code: Have your buggy Python code ready
  2. Describe Your Goal: Briefly explain what you're trying to achieve
  3. Include Error Messages: Copy any error messages you're seeing
  4. Ask for Help: Submit everything to the AI assistant

Best Interaction Practices:

  • Be Specific: "I'm trying to calculate averages but getting a TypeError" is better than "My code doesn't work"
  • Follow the Hints: Work through each suggestion before asking for the next one
  • Ask Questions: If you don't understand a concept, ask for clarification
  • Test Your Changes: Try each suggested approach and report back on what happens
  • Share Your Attempts: Let the AI know what you've tried so it can guide you better

Sample Student Interaction Format:

"Hi CodeMentor! I'm working on a program that calculates test score averages, 
but I'm getting this error:

[paste your code here]

Error message: TypeError: unsupported operand type(s) for +: 'int' and 'str'

I think it should add up all the scores and divide by the number of tests, 
but something's going wrong. Can you help me understand what's happening?"

What to Expect:

  • No Direct Solutions: The AI will guide you to discover the answer
  • Step-by-Step Help: Systematic approach to identifying and understanding errors
  • Concept Learning: Explanations that help you avoid similar problems in the future
  • Encouraging Support: Patient, positive tone that reduces debugging anxiety
  • Progressive Hints: Increasingly specific guidance until you reach understanding

Testing and Validation

Demonstration Cases

The examples/ folder contains three comprehensive demonstrations showing how the AI assistant handles common Python debugging scenarios:

Test Case 1: Type Error (Input/String Conversion)

  • Problem: Student trying to perform arithmetic on string input
  • Demonstrates: How the AI guides toward type conversion without revealing int() function
  • Educational Focus: Data types and user input handling

Test Case 2: Logic Error (Index Out of Range)

  • Problem: Off-by-one error in list iteration
  • Demonstrates: Step-by-step code tracing and logical thinking development
  • Educational Focus: List indexing and loop construction

Test Case 3: Syntax Error (Missing Parameter Separator)

  • Problem: Missing comma in function definition
  • Demonstrates: Syntax pattern recognition and comparison techniques
  • Educational Focus: Function definition structure and Python syntax rules

Quality Metrics

Each test case validates that the AI assistant:

  • Never provides direct solutions (0% solution leakage rate)
  • Follows the 7-step debugging process (100% structural compliance)
  • Maintains encouraging tone (positive language analysis)
  • Provides progressive hints (2-3 escalating clues per response)
  • Teaches underlying concepts (connects bugs to broader principles)
  • Gives clear next steps (actionable guidance for continued learning)

Success Benchmarks:

  • Constraint Compliance: 100% (Critical requirement)
  • Process Adherence: 95%+ (Consistency measure)
  • Student Satisfaction: 90%+ (Educational effectiveness)
  • Concept Retention: 80%+ (Learning outcome verification)

Validation Checklist

Before deploying, verify that the AI assistant:

  • Identifies error types correctly (SyntaxError, TypeError, LogicError, etc.)
  • Explains errors in plain English, not technical jargon
  • Provides hints that lead toward solutions without revealing them
  • Connects specific bugs to broader programming concepts
  • Maintains patient, encouraging tone throughout interactions
  • Uses the structured response format consistently
  • Handles edge cases appropriately (multiple errors, correct code, etc.)

Edge Case Handling

The system is tested against challenging scenarios including direct solution requests, multiple errors in code, correct code submissions, and advanced programming concepts. See examples/edge_case_examples.md for detailed demonstrations.

Design Choices

This AI assistant is built on careful design decisions that prioritize educational effectiveness over quick fixes:

Core Design Philosophy

Educational Over Efficiency: Rather than quickly fixing code, the system prioritizes teaching debugging skills that transfer to new problems. Students learn to fish rather than being given fish.

Guided Discovery Learning: Based on the Socratic method, the AI uses questions and progressive hints to lead students to insights rather than presenting information directly.

Systematic Process: The 7-step debugging methodology ensures comprehensive, consistent responses that build systematic thinking skills.

Key Design Decisions

70% Guidance, 30% Identification Balance

  • Identification (30%): Clearly categorize and locate errors so students understand what went wrong
  • Guidance (70%): Focus heavily on hints, questions, and concept teaching to build problem-solving skills
  • Implementation: Template structure dedicates more space to guidance sections than error identification

Progressive Hint System

  • Hint 1: Broad conceptual guidance ("Think about data types")
  • Hint 2: More specific direction ("What does input() return?")
  • Hint 3: Approach suggestion ("How might you convert text to numbers?")
  • Never: Direct code solutions ("Use int(variable)")

Multi-Layered Solution Prevention

  • Absolute constraints mentioned multiple times throughout prompt
  • Positive framing - tells AI what to do, not just what to avoid
  • Redirect training for when students ask directly for solutions
  • Template structure that enforces educational format

Tone and Engagement Strategy

  • Encouraging validation acknowledges student effort before addressing problems
  • Conversational but professional creates approachable authority
  • Future-focused language emphasizes learning outcomes over current problems
  • Analogy requirements make abstract concepts concrete and memorable

Adaptability Features

The system can be modified for different skill levels:

  • Beginner Mode: Extra encouragement, simpler analogies, more specific scaffolding
  • Standard Mode: Balanced approach suitable for most intermediate students
  • Advanced Mode: References to design patterns, performance, and software engineering principles

For detailed reasoning behind each design choice, see DESIGN_CHOICES.md.

File Descriptions

  • prompt.txt: The complete, clean prompt ready to copy-paste into any AI system
  • DESIGN_CHOICES.md: Comprehensive answers to framework questions and detailed design reasoning
  • test_cases/: Three Python files containing common beginner errors for testing the AI assistant
  • examples/: Detailed demonstrations of expected AI responses, including analysis of why each response is educationally effective
  • validation/: Tools and checklists for ensuring the AI assistant maintains quality and educational standards

Key Features

Systematic Debugging Process

Every response follows a structured 7-step methodology:

  1. Acknowledge & Validate student effort
  2. Identify & Categorize the error type
  3. Locate the error precisely
  4. Explain in Plain English what went wrong
  5. Provide Progressive Hints toward the solution
  6. Teach the underlying Concept
  7. Reinforce learning with next steps

Educational Safeguards

  • Solution Prevention: Multiple constraints prevent direct code fixes
  • Concept Connection: Links specific bugs to broader programming principles
  • Progressive Disclosure: Hints become more specific only as needed
  • Learning Reinforcement: Follow-up questions ensure understanding

Consistent Quality

  • Template Structure: Visual formatting ensures consistent, scannable responses
  • Tone Management: Maintains encouraging, patient demeanor across all interactions
  • Process Adherence: Systematic approach prevents skipped steps or incomplete guidance

Adaptable Implementation

  • Platform Agnostic: Works with any major AI language model
  • No Dependencies: Requires no additional software or setup
  • Skill Level Flexible: Can be adapted for different student populations
  • Scalable: Handles multiple students simultaneously without quality degradation

Success Metrics

A successfully implemented AI debugging assistant should demonstrate:

  • 0% Direct Solution Rate: Never provides corrected code directly
  • 100% Process Compliance: Always follows the 7-step debugging methodology
  • High Student Satisfaction: Students report feeling supported and learning effectively
  • Skill Transfer: Students demonstrate improved independent debugging abilities
  • Reduced Instructor Load: Consistent quality support available 24/7

Getting Started

  1. Review the test cases in test_cases/ to understand common scenarios
  2. Examine the example responses in examples/ to see expected AI behavior
  3. Copy the prompt from prompt.txt
  4. Test with your AI platform using the provided sample code
  5. Deploy for student use once you've verified proper functionality

This AI debugging assistant represents a complete educational solution that builds genuine programming skills while providing immediate, supportive guidance for frustrated students.

Repository Structure

ai-debugging-assistant/
├── README.md                          
├── prompt.txt                         
├── DESIGN_CHOICES.md                 
├── test_cases/                       
│   ├── test_case_1_type_error.py
│   ├── test_case_2_logic_error.py
│   └── test_case_3_syntax_error.py
├── examples/                         
│   ├── example_response_1.md
│   ├── example_response_2.md
│   ├── example_response_3.md
│   └── edge_case_examples.md         
└── validation/                       
    └── quality_checklist.md          

About

AI-powered debugging assistant that teaches Python through guided discovery. Uses Socratic method & progressive hints to help students learn from their bugs, not just fix them. Built for FOSSEE Python Screening Task.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages