Skip to content

adhi29/AI-Debugging-Mentor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python AI Debugging Assistant

🎯 Project Overview

An advanced prompt system designed to help students debug Python code through guided learning rather than direct solution provision. This system employs educational psychology principles and adaptive AI techniques to create an effective learning experience.

πŸ“ Repository Structure

python-debugging-assistant/
β”œβ”€β”€ README.md                 # This file
β”œβ”€β”€ prompts/
β”‚   β”œβ”€β”€ core_prompt.txt      # Main debugging assistant prompt
β”‚   β”œβ”€β”€ beginner_variant.txt # Specialized for beginners
β”‚   β”œβ”€β”€ advanced_variant.txt # Specialized for advanced users
β”‚   └── examples/           # Example interactions
β”œβ”€β”€ documentation/
β”‚   β”œβ”€β”€ design_rationale.md # Detailed design decisions
β”‚   β”œβ”€β”€ implementation_guide.md # Technical implementation
β”‚   └── testing_framework.md # Testing and validation
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ sample_buggy_code/  # Test cases with buggy code
β”‚   β”œβ”€β”€ expected_responses/ # Expected AI responses
β”‚   └── evaluation_metrics.py # Testing framework
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ beginner_interaction.md
β”‚   β”œβ”€β”€ intermediate_interaction.md
β”‚   └── advanced_interaction.md
└── LICENSE

πŸš€ Quick Start

For Educators

  1. Copy the core prompt from prompts/core_prompt.txt
  2. Paste into your preferred AI assistant (ChatGPT, Claude, etc.)
  3. Submit student code for debugging assistance
  4. The AI will provide guided hints without revealing solutions

For Developers

  1. Clone this repository
  2. Review the implementation guide in documentation/
  3. Adapt the prompts for your specific educational platform
  4. Use the testing framework to validate effectiveness

🧠 Core Innovation

The "Socratic Debugging" Approach

Instead of fixing bugs directly, this system:

  • Asks Strategic Questions: Guides students to discover issues themselves
  • Provides Progressive Hints: Builds understanding step-by-step
  • Maintains Student Agency: Keeps problem-solving control with the learner
  • Adapts to Skill Level: Adjusts complexity based on code analysis

Key Features

  • βœ… Solution-Proof Design: Multiple safeguards prevent direct answers
  • βœ… Adaptive Difficulty: Automatically adjusts to student skill level
  • βœ… Pedagogically Sound: Based on educational research and best practices
  • βœ… Scalable Architecture: Works across different programming concepts
  • βœ… Comprehensive Testing: Includes validation framework and metrics

πŸ“Š Design Rationale

Tone and Style Choices

Encouraging Mentor Approach

  • Rationale: Creates psychological safety essential for effective learning
  • Implementation: Positive reinforcement, patient questioning, enthusiasm for process
  • Research Basis: Growth mindset theory and educational psychology findings

Adaptive Communication

  • Beginners: Simple language, more explicit guidance, concept building
  • Advanced: Technical terminology, deeper questioning, optimization discussions
  • Detection: Automated analysis of code complexity and structure patterns

Balancing Act: Bugs vs. Guidance

The "One Bug Rule"

  • Problem: Students get overwhelmed with multiple corrections
  • Solution: Focus on most critical issue first
  • Benefit: Reduces cognitive load, improves success rates

Progressive Hint System

Level 1: "What do you think happens when you run line 15?"
Level 2: "Remember that Python lists start at index 0"
Level 3: "Try adding a print statement after the loop to see your variable's value"
Level 4: "The issue seems to be in how you're updating your counter variable"

Solution Avoidance Strategy

Multi-Layer Protection

  1. Structural: Response templates with no solution sections
  2. Behavioral: Explicit "never provide corrected code" instructions
  3. Pedagogical: Focus on debugging process, not final answer
  4. Technical: Hint progression system with built-in stopping points

πŸŽ“ Educational Adaptations

Beginner Learners

  • Language: Simple, jargon-free explanations
  • Guidance Level: More explicit direction and concept explanation
  • Patience Factor: Expect more iterations, provide more encouragement
  • Focus Areas: Basic syntax, fundamental concepts, debugging mindset

Advanced Learners

  • Language: Technical terminology appropriate, assume knowledge base
  • Guidance Level: Socratic questioning, challenge assumptions
  • Complexity: Discuss alternative approaches, optimization, best practices
  • Focus Areas: Logic efficiency, code architecture, advanced debugging techniques

πŸ“ˆ Effectiveness Validation

Success Metrics

  • Learning Outcomes: Students solve problems independently after guidance
  • Skill Transfer: Improved debugging ability on new, unseen problems
  • Engagement: Continued effort and deeper questioning from students
  • Satisfaction: Positive feedback on learning experience

Testing Framework

  • Standardized buggy code test cases
  • Blind evaluation of AI responses
  • Student outcome tracking
  • Comparative analysis with traditional debugging help

πŸ› οΈ Implementation Examples

Basic Usage

# Student submits this buggy code:
def find_max(numbers):
    max_num = 0
    for num in numbers:
        if num > max_num:
            max_num = num
    return max_num

# AI Response (following our prompt):
# "Great start! I can see you understand the basic loop structure and comparison logic. 
# Let me ask you this: what happens if your list contains only negative numbers? 
# Try testing your function with the input [-5, -2, -8, -1]. What result do you get, 
# and is that what you'd expect for the 'maximum' value?"

Advanced Interaction

# Advanced student code with subtle bug:
class DataProcessor:
    def __init__(self):
        self.data = []
    
    def process_batch(self, batch):
        results = []
        for item in batch:
            results.append(self.transform(item))
        return results
    
    def transform(self, item):
        # Complex transformation logic
        return item * 2 + 1

# AI Response focuses on architectural considerations:
# "Interesting approach with the class structure! I notice you're processing batches sequentially. 
# Given that each transform() call seems independent, what are your thoughts on the potential 
# for optimization here? Also, consider what happens to your instance state during concurrent 
# operations. Have you considered thread safety implications?"

πŸ”§ Setup Instructions

Step 1: Clone Repository

git clone https://github.com/[your-username]/python-debugging-assistant.git
cd python-debugging-assistant

Step 2: Choose Your Prompt

  • General Use: prompts/core_prompt.txt
  • Beginner Focus: prompts/beginner_variant.txt
  • Advanced Focus: prompts/advanced_variant.txt

Step 3: Integration

  1. Copy chosen prompt to your AI platform
  2. Test with sample code from tests/sample_buggy_code/
  3. Validate responses using tests/evaluation_metrics.py

Step 4: Customization

  • Modify prompts for your specific curriculum
  • Adjust hint progression levels
  • Add domain-specific debugging patterns

πŸ§ͺ Testing Your Implementation

Automated Testing

python tests/evaluation_metrics.py --prompt core_prompt.txt --test-suite basic

Manual Validation Checklist

  • AI never provides direct solutions
  • Responses are encouraging and supportive
  • Hints are appropriate for detected skill level
  • Students can solve problems after guidance
  • Debugging skills transfer to new problems

πŸ“š Further Reading

  • documentation/design_rationale.md - Deep dive into design decisions
  • documentation/implementation_guide.md - Technical implementation details
  • documentation/testing_framework.md - Validation and metrics
  • examples/ - Real interaction examples at different skill levels

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-improvement
  3. Test your changes using the validation framework
  4. Submit a pull request with detailed description

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ† Why This Approach Works

This system succeeds because it:

  • Respects the Learning Process: Maintains student agency in problem-solving
  • Builds Transferable Skills: Teaches debugging mindset, not just bug fixes
  • Adapts to Individual Needs: Responds appropriately to different skill levels
  • Prevents Dependency: Students learn to debug independently
  • Scales Effectively: Works across different programming concepts and complexity levels

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages