Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Ollama support; also linked in paper. #5

Merged
merged 4 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added CoverUp-arxiv-2403.16218.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ CoverUp then engages in a conversation with an [LLM](https://en.wikipedia.org/wi
prompting for tests, checking the results to verify that they run and increase coverage (again using SlipCover), and re-prompting for adjustments as necessary.
Finally, CoverUp checks that the new tests integrate well, attempting to resolve any issues it finds.

For technical details and a complete evaluation, see our arXiv paper, [_CoverUp: Coverage-Guided LLM-Based Test Generation_](https://arxiv.org/abs/2403.16218) ([PDF](https://github.com/plasma-umass/CoverUp/blob/main/CoverUp-arxiv-2403.16218.pdf)).

## Installing CoverUp

CoverUp is available from PyPI, so you can install simply with
Expand Down
10 changes: 8 additions & 2 deletions src/coverup/coverup.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,14 @@ def pl(item, singular, plural = None):
log_write(seg, "Too many attempts, giving up")
break

if not (response := await do_chat(seg, {'model': args.model, 'messages': messages,
'temperature': args.model_temperature})):
completion = {'model': args.model,
'messages': messages,
'temperature': args.model_temperature}

if "ollama" in args.model:
completion["api_base"] = "http://localhost:11434"

if not (response := await do_chat(seg, completion)):
log_write(seg, "giving up")
break

Expand Down
Loading