JetBrains-Research / TestSpark

TestSpark - a plugin for generating unit tests. TestSpark natively integrates different AI-based test generation tools and techniques in the IDE. Started by SERG TU Delft. Currently under implementation by JetBrains Research (Software Testing Research) for research purposes.
MIT License
47 stars 13 forks source link

[ICTL-907] Parsing LLM Response for Kotlin tests (without UI representation and compilation) #277

Closed Frosendroska closed 2 months ago

Frosendroska commented 3 months ago

Description of changes made

The ticket with the explanation. In this PR I introduce the parsing of LLM response. I made the strategy for Kotlin and Java, since they have similar structure of tests. Moreover, mow we pass the language variable to different stages of the cycle.

Why is merge request needed

We need to know how to retrieve tests from response to be able to compile them then.

Other notes

Closes #907

What is missing?

Please note that in this PR I do not introduce the compilation part: we are not creating the compilable file with tests to represent them in the UI. We are just parsing the answer from LLM

Vladislav0Art commented 3 months ago

The problem is now apparent:

Screenshot 2024-07-01 at 12 44 41

The enum ChatMessageRole is not pre-processed before sending the response. Thus, it comes into the response as User. It should be turned into the corresponding lowercased strings.

Working on it

UPD: Fixed in #284