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.
- 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
- 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
- Repository Analysis: Hiro connects to your GitHub repository and analyzes its file structure and contents
- Code Context Extraction: The system extracts relevant code files, skipping binary and configuration files
- AI Processing: The code is processed by Groq's Llama 3.3 70B model to understand functionality and generate appropriate test cases
- Test Generation: AI generates up to 3 comprehensive test cases per file, following testing best practices
- Metadata Creation: Each test includes metadata and required package information for easy setup
- GitHub Integration: Tests are automatically committed to a new branch called
hiro-testson your repository
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
This project requires Python 3.x and pip
- Python 3.7 or higher
- pip (Python package installer)
- Git (for GitHub integration)
- Clone the repository
git clone https://github.com/hanif-adedotun/hiro.git
cd hiro- Navigate to the server directory
cd server- Create a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate - Install dependencies
pip install -r requirements.txt- Create a
.envfile in the server directory and add your API keys
touch .env - Make sure you're in the server directory and have activated your virtual environment
cd server
source .venv/bin/activate - Ensure your
.envfile 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- Run the application
python app.py- For the Streamlit web interface, run:
streamlit run streamlit_app.pyThe application will start and you can begin generating test cases for your repositories.
- Run the main application:
python app.py-
Follow the prompts to provide your GitHub repository URL
-
The system will automatically:
- Analyze your repository structure
- Generate test cases for each relevant file
- Create organized test files in a
hiro-testsdirectory - Commit the tests to a new branch on your repository
- Start the Streamlit application:
streamlit run streamlit_app.py-
Open your browser to the provided local URL (usually
http://localhost:8501) -
Use the web interface to:
- Enter repository URLs
- Monitor test generation progress
- View generated test files and metadata
- Manage your test generation workflow
- 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
Contributions are always welcome!
See contributing.md for ways to get started.
Distributed under the no License. See LICENSE.txt for more information.
Hanif - @devhanif - hiro@hanif.one
Project Link: https://github.com/hanif-adedotun/hiro

