Note
Intention Test VS Code extension has not implemented one-click running for now. A local Python backend should be started before running the extension.
Intention Test requires the following development languages:
- Python 3.10+ with PyTorch
- Node.js
And the following tools for source code analyzation:
- Oracle JDK 1.8 (with
JAVA_HOMEenvironment variable set to its path, and other JDK distributions are not tested) - Apache Maven (make sure
mvnormvn.cmdcould be found in thePATHenvironment variable) - CodeQL CLI
And an OpenAI API key to access GPT-4o.
We suggest using Python 3.10 which has been tested on. First install the requirements:
cd backend
# For CPU / Apple Silicon
pip install -r requirements.txt
# For NVIDIA GPU (CUDA 12.4)
pip install -r requirements-cuda.txtModify the backend/config.ini:
[openai]
apikey = your-open-ai-key
url = https://api.openai.com/v1
[tools]
codeql = your-path-to-code-ql-executableThen start the backend HTTP server:
# Start on default 8080 port
python server.py
# Start on another port
python server.py --port 12345First build the React frontend:
cd web
npm install
npm run build
cd ..Then install the extension dependencies:
cd extension
npm installThen in VS Code, start the extension by the Run Extension debug option.
If you have specified another port when starting the backend server,
change the port in settings of the new Extension Development Host window via Intention Test: Port before generating test cases.
Now the tool only supports running on the demo project backend/data/spark inside this repository.
- Test tube icon comes from https://www.svgrepo.com/svg/525096/test-tube-minimalistic