Code Monkey home page Code Monkey logo

autesting's Introduction

AUTesting

AUTesting(Automatic Unit testing) is project for generating tests with rescue ChatGPT. The main purpose this project is helping c/c++ developer with unit testing written code.

The base of this project is attempt to implement the article https://arxiv.org/abs/2302.06527

Requirements:

  • openAI
  • Key for ChatGPT
  • Cmake
  • Ninja
  • python 3.11

Struct of the main algorithm

plot

Getting started

  • Configure API Key for ChatGPT(link for getting this key) https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety Linux / MacOS Set-up

Option 1: Set your ‘OPENAI_API_KEY’ Environment Variable using zsh

  1. Run the following command in your terminal, replacing yourkey with your API key.

echo "export OPENAI_API_KEY='yourkey'" >> ~/.zshrc

  1. Update the shell with the new variable:

source ~/.zshrc

  1. Confirm that you have set your environment variable using the following command.

echo $OPENAI_API_KEY The value of your API key will be the resulting output.

Start

  • mkdir build
  • python3
  • python3 main.py --source-file="./examples/RBTree/RBTree.c" --include-file="./examples/RBTree/RBTree.h" --compiler=gcc --model-gpt=gpt-4-1106-preview

Current Status

We prepared demo release of this project. This implementation provide good results for coverage c-code. Model chat-gpt-4 give coverage for complex test RBTree is 67 percent. Current demo-version supports only one source file and one header. We would like fix in future releases with support Clang AST.

autesting's People

Contributors

kilka-rav avatar dmitrryy avatar

Stargazers

Серёга avatar  avatar  avatar Makarova Mariia avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

dmitrryy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.