pythagora  by Pythagora-io

CLI tool for automated unit test generation via LLMs

Created 2 years ago
1,805 stars

Top 23.8% on SourcePulse

GitHubView on GitHub
Project Summary

Pythagora aims to automate the generation of unit tests for Node.js applications using LLMs, specifically GPT-4. It targets developers seeking to improve code coverage and identify bugs with minimal manual effort, offering a significant time-saving benefit by reducing the need to write tests from scratch.

How It Works

Pythagora parses the target function and its dependencies using Abstract Syntax Trees (AST). This information, along with the function's code, is sent to a Pythagora server which leverages GPT-4 to generate Jest unit tests. This approach allows for the identification of edge cases and potential bugs within the code itself, as demonstrated by bug findings in projects like Lodash.

Quick Start & Requirements

  • Install: npm i pythagora --save-dev
  • Run: npx pythagora --unit-tests --func <FUNCTION_NAME>
  • Prerequisites: OpenAI API Key or Pythagora API Key. Node.js environment.
  • Notes: For Windows, use Git Bash.
  • Docs: Visual Studio Code Extension, Demo Videos

Highlighted Details

  • Generates Jest unit tests for JavaScript and TypeScript.
  • Can generate tests for single functions, files, or entire folders.
  • Supports expanding existing test suites to increase code coverage.
  • Has identified bugs in open-source projects like Lodash and node-fs-extra.

Maintenance & Community

  • Project is in alpha.
  • Community discussion available on Discord.

Licensing & Compatibility

  • License: Not explicitly stated in the README.
  • Compatibility: Primarily for JavaScript/TypeScript. Supports Jest framework. Code is sent to OpenAI for processing; review OpenAI's privacy policy.

Limitations & Caveats

Pythagora is an alpha version and works best with standalone functions; more complex or non-standalone functions may require manual review and modification. Generated tests should always be reviewed before committing. The project is deprecated in favor of GPT Pilot.

Health Check
Last Commit

19 hours ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
11 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Meng Zhang Meng Zhang(Cofounder of TabbyML), and
3 more.

qodo-cover by qodo-ai

0.1%
5k
CLI tool for AI-powered test generation and code coverage enhancement
Created 1 year ago
Updated 4 months ago
Feedback? Help us improve.