JetBrains-Research / JetBrains-Research/TestSpark
Prohibit line-based test generation for meaningless line types (comments, single brackets, etc)
- Dominant language
- Kotlin
- Stars
- 88
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
We are not allowing line generation for empty lines, but it can be asked for comment lines (or brackets) if it is surrounded by class/function. The result will be almost identical to the whole class test generation, but it's weird.
In the following case, we cannot generate line-based test for `(*)` but we can do it for `(**)` (likely, because this comment is considered as part of a method):
```kotlin
// my comment here! - not allowed for line generation (*)
// my comment here! - allowed for line generation (**)
fun multwice(a: Int) = a * 2
```
**_Solution idea_**: For each line generation, check if it includes something besides comments, open/closed brackets and allow generation only in such case
Contributor guide
Research direction
Start by locating the line-based test generation entry point and reproduce the Kotlin example with comment-only and bracket-only lines. Trace how the selected line is classified, then verify that generation is rejected when a line contains only comments or brackets and remains allowed when it contains code such as the function declaration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100