Code Monkey home page Code Monkey logo

llm_demo's Introduction

Automated Oracle Generation Tool using Large Language Models

This repository contains an automated Oracle generation tool that leverages the power of Large Language Models (LLMs) to enhance software testing efficiency. The tool is designed to generate JUnit tests and test case assertions, acting as an Oracle for the system under test.

Workflow

The tool follows the following workflow:

  1. JUnit Test Generation: The system under test is input to EvoSuite, a test case generation tool that generates JUnit tests.
  2. Prompt Preparation: Based on query strategies, a prompt is prepared from the code base of the system under test. This prompt is used to query the Large Language Model interface.
  3. LLM Interface: The tool interfaces with multiple Large Language Models through an API. The prompt is sent to the LLM interface, which generates responses in the form of JUnit tests and oracles.
  4. Response Handling: The generated JUnit tests and oracles are received from the LLM interface. The tool checks for any compilation errors in the received responses. If errors are detected, the LLM interface is prompted again for corrected responses.
  5. Test Execution and Comparison: The generated tests are executed, and the tool compares the results with the tests generated by EvoSuite.

Startup

  1. Create a virtual environment python -m venv evooracle_venv
  2. Activate it:
    • Windows:.\evooracle_venv\Scripts\activate
    • Mac: source evooracle_venv/bin/activate
  3. Download the required LLM models and take note of the PATH they're installed to
  4. Clone this repo [email protected]:skhandaker/evooracle.git
  5. Go into the directory cd evooracle
  6. Install the required dependencies pip install -r requirements.txt
  7. Update the base ggml download path of the models in line 17 of app.py, e.g. BASE_PATH = 'C:/Users/User/AppData/Local/nomic.ai/GPT4All/' and openAI api key on line 19
  8. Start the python app by running streamlit run app.py

Other References ๐Ÿ”—

-GPT4AllReference : mainly used to determine how to install the GPT4All library and references. Doco was changing frequently, at the time of coding this was the most up to date example of getting it running.

Who, When, Why?

๐Ÿ‘จ๐Ÿพโ€๐Ÿ’ป Author: Shaker Mahmud Khandaker
๐Ÿ“… Version: 1.x
๐Ÿ“œ License: This project is licensed under the MIT License

llm_demo's People

Contributors

khandakerrahin avatar nicknochnack avatar

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.