Skip to content

Hanif-adedotun/hiro

Repository files navigation

logo

Hiro

Let Hiro handle your testing and documentation, so you can focus on building.

contributors last update forks stars open issues license


📔 Table of Contents

🌟 About the Project

screenshot

Hiro is an AI tool designed to automatically generate unit test cases and requirement documentation for your codebase, regardless of the programming language or framework you're using.

👾 Tech Stack

  • Backend: Python 3.x
  • AI/ML: LangChain, Groq (Llama 3.3 70B), Google Generative AI
  • Web Framework: Streamlit
  • GitHub Integration: PyGithub, GitHub API
  • Environment Management: python-dotenv
  • Testing: pytest, debugpy
  • Dependencies: See requirements.txt for complete list

🎯 Features

  • Language Agnostic: Works with any programming language or testing framework
  • AI-Powered Test Generation: Uses Groq's Llama 3.3 70B model to generate comprehensive test cases
  • GitHub Integration: Direct integration with GitHub repositories via PyGithub
  • Repository Analysis: Automatically analyzes repository structure and file contents
  • Automated Test File Creation: Creates properly named test files in organized directories
  • Metadata Generation: Generates detailed metadata and package requirements for each test
  • Streamlit Web Interface: User-friendly web interface for easy interaction
  • Branch Management: Automatically creates and manages test branches on GitHub
  • Multiple AI Models: Supports Groq and Google Generative AI for flexible AI processing

🎯 How it Works

  1. Repository Analysis: Hiro connects to your GitHub repository and analyzes its file structure and contents
  2. Code Context Extraction: The system extracts relevant code files, skipping binary and configuration files
  3. AI Processing: The code is processed by Groq's Llama 3.3 70B model to understand functionality and generate appropriate test cases
  4. Test Generation: AI generates up to 3 comprehensive test cases per file, following testing best practices
  5. Metadata Creation: Each test includes metadata and required package information for easy setup
  6. GitHub Integration: Tests are automatically committed to a new branch called hiro-tests on your repository

🔑 Environment Variables

To run this project, you will need to add the following environment variables to your .env file

GITHUB_PERSONAL_ACCESS_TOKEN - Your GitHub personal access token for repository access

GROQ_API_KEY - Your Groq API key for AI model access

GOOGLE_API_KEY - Your Google API key for additional AI services

🧰 Getting Started

‼️ Prerequisites

This project requires Python 3.x and pip

  • Python 3.7 or higher
  • pip (Python package installer)
  • Git (for GitHub integration)

⚙️ Installation

  1. Clone the repository
  git clone https://github.com/hanif-adedotun/hiro.git
  cd hiro
  1. Navigate to the server directory
  cd server
  1. Create a virtual environment (recommended)
  python -m venv .venv
  source .venv/bin/activate 
  1. Install dependencies
  pip install -r requirements.txt
  1. Create a .env file in the server directory and add your API keys
  touch .env 

🏃 Run Locally

  1. Make sure you're in the server directory and have activated your virtual environment
  cd server
  source .venv/bin/activate 
  1. Ensure your .env file contains the required API keys
  GITHUB_PERSONAL_ACCESS_TOKEN=your_github_token
  GROQ_API_KEY=your_groq_api_key
  GOOGLE_API_KEY=your_google_api_key
  1. Run the application
  python app.py
  1. For the Streamlit web interface, run:
  streamlit run streamlit_app.py

The application will start and you can begin generating test cases for your repositories.

👀 Usage

Command Line Interface

  1. Run the main application:
python app.py
  1. Follow the prompts to provide your GitHub repository URL

  2. The system will automatically:

    • Analyze your repository structure
    • Generate test cases for each relevant file
    • Create organized test files in a hiro-tests directory
    • Commit the tests to a new branch on your repository

Web Interface

  1. Start the Streamlit application:
streamlit run streamlit_app.py
  1. Open your browser to the provided local URL (usually http://localhost:8501)

  2. Use the web interface to:

    • Enter repository URLs
    • Monitor test generation progress
    • View generated test files and metadata
    • Manage your test generation workflow

🧭 Roadmap

  • Basic GitHub repository integration
  • AI-powered test generation with Groq
  • Streamlit web interface
  • Automated test file creation and organization
  • GitHub branch management and commits
  • Enhanced test coverage analysis
  • Dashboard for test result reporting and analytics
  • Integration with more AI models
  • Automated documentation generation
  • CI/CD pipeline integration

👋 Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

⚠️ License

Distributed under the no License. See LICENSE.txt for more information.

🤝 Contact

Hanif - @devhanif - hiro@hanif.one

Project Link: https://github.com/hanif-adedotun/hiro

About

Hiro! The only AI tool you need to test your code

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors