Skip to content

About

AI Code Debugger Pro πŸš€ Automated Code Debugging, Optimization & Generation using Google Gemini 2.0 Pro β€” by Robina Mirbahar

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

335 Commits

Folders and files

Repository files navigation

πŸš€ AI Code Debugger Pro – AI-Powered Code Analysis & Generation

AI Code Debugger

Author & Architect: Robina Mirbahar (Google Developer Expert in Cloud & AI Β· Google Cloud Champion Innovator Β· Co-Author of AI Engineering)
πŸ“š Architecture Track: Automated Static Analysis, Root-Cause Bug Detection & Unit Test Synthesis
Core Stack: Google Gemini API, Google AI Studio, Python AST Diagnostics, and Automated Patch Generation.


🎯 Why I Built AI Code Debugger Pro (Engineering Purpose & Real-World Value)

1. 🐞 Eliminating Manual Stack-Trace Hunting

I built AI Code Debugger Pro to turn cryptic compiler errors, race conditions, and runtime stack traces into structured root-cause explanations with drop-in patched code.

2. ⚑ Time & Space Complexity Refactoring

Beyond fixing syntax bugs, I designed the analyzer to detect $O(n^2)$ bottlenecks, memory leaks, and anti-patterns, rewriting them into idiomatic, high-performance implementations.

3. πŸ”’ Built-In Security & Unit Test Synthesis

Every debugging pass automatically checks for injection flaws and generates edge-case unit tests so fixed bugs never regress.


πŸ—οΈ System Architecture

flowchart TD
    subgraph Input ["1. Developer Source & Error Context"]
        I_Code["Source Code Snippet / File"]
        I_Err["Stack Trace & Compiler Diagnostics"]
    end
    subgraph Engine ["2. Gemini Static & Runtime Analyzer"]
        E_AST["Syntax & Control-Flow Inspection"]
        E_Sec["OWASP Security & Edge-Case Audit"]
        E_Opt["Big-O Complexity Optimizer"]
    end
    subgraph Output ["3. Actionable Repair Artifacts"]
        O_Patch["Patched Drop-In Code Diff"]
        O_Test["Generated Regression Unit Tests"]
    end
    I_Code & I_Err --> E_AST --> E_Sec --> E_Opt
    E_Opt --> O_Patch & O_Test
Loading

AI Code Debugger Pro is an AI-powered tool designed to assist developers in debugging, optimizing, and generating code with Google Gemini 2.0 Pro. Whether you need to fix errors, improve performance, or generate code snippets, this interactive tool streamlines the process in a user-friendly interface.

πŸ”— Live Demo: AI Code Debugger Pro

✨ Key Features

πŸ“€ Code Upload & Manual Input

βœ”οΈ Upload files (.py, .js, .java, .cpp, etc.) or paste code for analysis.
βœ”οΈ Supports multiple programming languages with auto-detection.

πŸ” AI-Powered Code Analysis (Using Gemini 2.0 Pro)

βœ”οΈ Detects syntax, logic, and performance issues.
βœ”οΈ Provides:
βœ… Corrected Code (with line numbers & highlights).
βœ… Error Explanation (detailed breakdown).
βœ… Optimization Suggestions (best practices & security tips).

πŸ€– AI Agent for Follow-Up Questions

βœ”οΈ Ask follow-up questions about the analyzed code.
βœ”οΈ Get context-aware answers based on the code and analysis results.
βœ”οΈ Example questions:

  • "Can you explain the security issue on line 12?"
  • "How can I optimize this code further?"
  • "What does the complexity 'medium' mean in this context?"

πŸ’‘ AI Code Generation (Powered by Gemini 2.0 Pro)

βœ”οΈ Enter a natural language prompt, and AI will generate fully functional, optimized code.
βœ”οΈ Ensures syntax correctness, efficiency, and clarity.

πŸ“Š Side-by-Side Comparisons

βœ”οΈ View original & corrected code in an interactive UI.
βœ”οΈ Structured explanations of errors and fixes.

⚑ Instant Feedback & History Tracking

βœ”οΈ Stores analysis & generation results within the session.
βœ”οΈ Displays execution time for performance tracking.

πŸ” Secure Processing

βœ”οΈ Powered by Google Gemini 2.0 Pro for high-quality AI-driven analysis.
βœ”οΈ No code storage beyond the session for security & privacy.

οΏ½ Model Used: Google Gemini 2.0 Pro

πŸ”Ή Why Gemini 2.0 Pro?
βœ… Advanced NLP – Handles complex coding queries.
βœ… Contextual Understanding – Provides in-depth debugging & categorization.
βœ… Optimized for Code Generation – Produces structured, efficient, and secure code.

🎯 Use Cases

πŸ‘©β€πŸ’» Students & Learners – Quickly debug and understand errors.
πŸ› οΈ Developers & Engineers – Improve efficiency and follow best practices.
πŸ” Security Analysts – Identify vulnerabilities in the code.
πŸ“Š Tech Leads & Reviewers – Automate parts of the review process.

🎬 Demo Walkthrough

πŸ”Ή Step 1: Paste or Upload Code β†’ Select language & analysis type β†’ Click Analyze Code

πŸ”Ή Step 2: AI Debugging & Recommendations β†’ View Corrected Code, Explanation & Optimizations

πŸ”Ή Step 3: AI Code Generation β†’ Enter a description β†’ Click Generate Code

πŸ”Ή Step 4: Ask Follow-Up Questions β†’ Get context-aware answers from the AI agent.

πŸ”„ Workflow

  1. Input Code:

    • Upload a code file or paste code directly into the text area.
    • Select the programming language or use Auto-Detect.
  2. Analyze Code:

    • Click Analyze Code to start the AI-powered analysis.
    • The app detects syntax errors, logical errors, and security issues.
  3. View Results:

    • See the corrected code with line numbers and highlights.
    • Read detailed explanations of errors and fixes.
    • Get optimization suggestions and security tips.
  4. Ask Follow-Up Questions:

    • Use the AI agent to ask questions about the analyzed code.
    • Get context-aware answers based on the code and analysis results.
  5. Generate Code:

    • Enter a natural language prompt to generate new code.
    • The AI generates fully functional, optimized code based on your description.
  6. Compare & Optimize:

    • View side-by-side comparisons of the original and corrected code.
    • Apply optimizations and security fixes suggested by the AI.

πŸš€ Get Started

1️⃣ Installation

Ensure you have Python 3.8+ installed, then run:

pip install streamlit google-generativeai pygments

2️⃣ ** Run the App**

streamlit run AIdebugger.py

🌟 Contribute & Support

πŸ› οΈ Want to improve AI Code Debugger Pro? Contributions are welcome! Fork the repo and submit a PR.

πŸ”₯ Conclusion

AI Code Debugger Pro, powered by Google Gemini 2.0 Pro, is a game-changer for developers – offering instant debugging, deep analysis, AI-generated solutions, and follow-up support to save time and improve code quality. πŸš€

πŸ”— Try it now: AI Code Debugger Pro

Official Google Developer Resources

About

AI Code Debugger Pro πŸš€ Automated Code Debugging, Optimization & Generation using Google Gemini 2.0 Pro β€” by Robina Mirbahar

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages