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 (ICTL) for research purposes.
MIT License
35 stars 9 forks source link

If the prompt only has polymorphic relationships, the prompt does not provide any instruction #254

Open pderakhshanfar opened 4 weeks ago

pderakhshanfar commented 4 weeks ago

Describe the bug In the case that we don't have any method signatures in the prompt, but instead we have multiple polymorphic relations, the prompt just provide sentences like "Class X is a sub-class of class Y". In these cases, LLM usually mocks these classes and ignores the fact that it can use the sub-classes in the test.

To Reproduce Steps to reproduce the behavior:

  1. Generate tests that do not have any objects as input parameters of their methods (e.g., this class)
  2. check the prompt

Expected behavior The insertPolymorphismRelations method should also add instructions like Use the following information about the polymorphic relationship of classes that exist in the project. Don't use mocking for these classes.