JetBrains-Research / JetBrains-Research/TestSpark

Duplication of interesting classes in context sent to the LLM

Open
#501 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
88
Forks
24
PR merge metrics
No merged PRs in 30d

Description

### Involved Module
- [ ] UI
- [ ] EvoSuite
- [x] LLM
- [ ] Kex
- [ ] Other (please explain)

### Describe the bug

If the same class is retrieved as an "interesting class" several times, several occurrences of the class will be present in the final context despite the ``MutableSet`` used.

### To Reproduce

Steps to reproduce the behavior:
1. Open a class with several methods which use the same other class
2. Generate tests for the class.
3. Go to the idea.log to see the prompt.
4. The "other" class appears several times in the prompt.

### Expected behavior

If the "other" class is present several times, only one occurrence of the method signature must be present in the final prompt.

### Screenshots
If applicable, add screenshots to help explain your problem.

### Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by generating tests for a class whose several methods use the same other class, then inspect the prompt in idea.log. Trace the code that collects interesting classes and assembles the final LLM context; done means each class's method signature appears only once despite repeated retrieval.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
ai, devtools, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.