-
Notifications
You must be signed in to change notification settings - Fork 22
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
Kex Integration #294
Open
edwin1729
wants to merge
57
commits into
JetBrains-Research:development
Choose a base branch
from
edwin1729:edwin1729/improvement/kex-integration
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Kex Integration #294
edwin1729
wants to merge
57
commits into
JetBrains-Research:development
from
edwin1729:edwin1729/improvement/kex-integration
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Needs debugging and testing * load kex-runner jar from github (build.gradle.kts toplevel) * setup code for kex properties * KexErrorManager based on LLMErrorManager * KexProcessManager based on EvoSuiteProcessManager * Basic UI element (button for running kex) * kex works only for the class codeType (todo funciton and line if possible) * read resource files kex.policy and modules.info
use a provided kex path for now instead of downloading jar and adding dependency use ProcessBuilder (jdk) instead of OSProcessHandler (IJ sdk) use kex.py instead of building java command directly generate Report objects by reading generated java classes
Deleted stuff: running Kex through through OSProcessHandler (IJ sdk) running Kex with kex.py downloading kex from github in build.gradle.kts
arguably overkill solution of modify PsiMethodWrapper class added parameter names, types and return tyepes explicitly updated implementation for java and kotlin
edwin1729
force-pushed
the
edwin1729/improvement/kex-integration
branch
from
July 24, 2024 07:49
e623ee7
to
237e549
Compare
edwin1729
force-pushed
the
edwin1729/improvement/kex-integration
branch
from
July 24, 2024 12:01
935b0c9
to
b766057
Compare
…' into edwin1729/improvement/kex-integration
For multimodule projects using TestSpark the correct module's build directory path is passed based on the location of code for which tests are generated
also fixed a bug with the way options were passed to kex subprocess made them a list of strings instead of a single big space separated string
This also includes a simple string based mapping to jvm types through type erasure
Closes #328 |
arksap2002
added
In progress
PR is in progress
and removed
Ready for review
PR redy for review
labels
Sep 3, 2024
This is expected by TestSpark. Relevant file TestProcess.kt:createXmlFromJacoco:109
arksap2002
approved these changes
Sep 18, 2024
arksap2002
added
improvement
New feature
Ready for review
PR redy for review
and removed
In progress
PR is in progress
labels
Sep 18, 2024
arksap2002
added
Ready for review
PR redy for review
In progress
PR is in progress
and removed
Ready for review
PR redy for review
labels
Nov 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Integrating Kex (Symbolic Execution) into TestSpark
Generates test cases using Kex and displays them in the TestSpark tool window
Summary of changes
The integration of kex follows the example of EvoSuite and LLM for teh most part, so I highlight just the kex specific parts.
Automatic folding (hiding behind
...
) of all code other than test annotated methods in the tool window is implemented. This is using thePsiFile
for each test casePsiMethodWrapper
(and implementations) because kex requires specification of the method for which tests are generated in a specific format. Namely it involves FQNs and an example is given here:org.example.Matrix::product(org.example.Matrix,java.util.function.BinaryOperator,java.util.function.BinaryOperator):org.example.Matrix
Note also that types have been erased. Kex expects JVM types which is easy to get from Java types but not from kotlin. For this reason kotlin is not yet supported by kex.