TestGenie - an IntelliJ plugin that natively integrates EvoSuite into the IDE. EvoSuite is an automated test suite generation tool using evolutionary algorithms. Used for research @ SERG, TU Delft.
For the pop-up, which appears during coverage visualisation in the gutter, create the ability to display tests that cover the line which you click the highlight on. The pop-up already displays the test names, these could be made clickable.
Definition of Done
Tooltip which shows, which tests cover a line
Names of tests are pressable/clickable
Once clicked, the test name leads you to the actual test
As a developer, i should be able to access advanced parameters in the Settings menu by pressing the corresponding button on Quick Access tool window panel, so that I can quickly access them in case i want to modify them.
Definition of Done
There is a button "Advanced Parameters" on the tool window Quick Access panel
After pressing the button, the settings menu with the TestGenie Advanced Parameters tab has to open
The button has to work always, no matter if a user has modified anything or not
As a developer, I could have my variables names in the generated tests be based on their usage, not just by their type (e.g if a string is passed as an argument of a method and that argument is named “username”, then the string in the test will also be named “username”), so that it is easier for me to read the generated tests.
UPDATE: after implementing the new features introduced by the client and having a discussion, it has been decided that our part of this issue is going to be implementing telemetry diff specifically for changes made in variable names.
Definition of Done
After modifying and applying the tests, if the telemetry option has been enabled, changes made in variable names are identified and stored in a separate file
The functionality is integrated with already existing telemetry collection
Our client has given us feedback on the relevance of the parameters in our quick access window. Some of the parameters that we have included in the previous sprint are actually rarely (if at all) modified (like e.g local search budget). This issue will focus on incorporating their feedback and correcting the problems.
The fixes should ensure that the code is consistent throughout the entire code base, i.e. if we are removing a certain parameter from the quick access then we should make sure that it is removed correctly in all the places where it is no longer relevant/used.
Definition of Done
The name of the section (the title) has changed from "Frequently used parameters" to "Quick Access Parameters"
The parameters have been placed in the correct order, according to their priorities (e.g search budget is the first);
Clear sections for the groups of the parameters have been created, according to the client (search budget, timeouts, population)
search budget and stopping condition have been placed in own category (since they are related).
It has been made clear that stopping condition is referring to the budget type of search budget (rename or extend a tooltip)
search budget has a dynamic unit depending on the selected type
Parameters tab has been placed to the last place in the tool window
Currently, the DTOs that we use (such as CompactReport) require us to import the entirety of EvoSuite into the classpath. This is not optimal, so it would be best to move those shared DTOs to a separate module, which can then be imported both to Thunderdome and to TestGenie.
Definition of Done
A separate common module is created
All common DTOs are moved to that module and referenced in Thunderdome and TestGenie
Add a color picker to settings which allows the user to change the color of the highlight. This way, the user can use any color they like. Improves accessibility.
Definition of Done
Plugin settings has color picker
Color picker determines color of highlight in gutter
Color picker determines color of highlight in mini-editors
The generated tests tab is currently empty. This tab should not appear until tests are actually generated.
Furthermore, the "Generated tests" tab should be the one that is focused once test generation is complete, rather than the "Coverage visualisation" tab.
Definition of Done
Hide the generated tests tab until tests are generated
The "Generated tests" tab should be the one that is focused once test generation is complete, rather than the "Coverage visualisation" tab
During our client meeting, we have discussed generating tests for classes and methods when clicking on them. The client has given us some feedback that we are going to incorporate in this issue (see Definition of Done)
Furthermore, the issue of generating tests for a class and a method from the last sprint must be continued: it is in its very basic version with a lot of limitations (overloads, java or third-party classes and methods). This will also be handled in this issue.
Definition of Done
Instead of calling EvoSuite with the method prefix (which tests all overloads), descriptors are used so that only the selected method is tested
When clicking somewhere inside a class, there is an option to generate tests for that class
When clicking somewhere inside a method, there is an option to generate tests for that method
NB! If the above 2 points turn out to be impossible to implement, the alternative would be to generate tests based on the clicked symbol
Classes and methods not from the current file are excluded
Since this plugin relies on a custom build of evosuite to work, the jar is currently sources as a raw binary inside the project's root which is not a good practice. Create a separate build process that allows developers to make custom build releases and integrate it with TestGenie's own build process.
Definition of Done
Custom Evosuite build has a separate CI process with artifact releases.
TestGenie's build scripts are extended to leverage the above and allows the developers to seamlessly update their evosuite binary without littering the git history.
Write tests for PSI selection (classes, methods and lines). Verify that only the classes that are supposed to be selected are selected, only the methods that are supposed to be selected are selected and only the lines that are supposed to be selected are selected.
Conduct research on how to test UI in IntelliJ Plugin. Consider reading the documentation from the intellij-platform-plugin-template and the official SDK. Perhaps implement a demo version of how to do testing on a separate test project.
Definition of Done
You read through the documentation from the intellij-platform-plugin-template.
You read through the documentation from SDK.
You tried to make a demo of how testing might work.
As a developer, I should be able to use a Settings menu for the plugin, where I can set parameters such as Algorithms and Population, so that I can easily specify custom parameters where I want and leave the default ones I do not want to modify.
This issue has been modified to account for the new client requirements, which is reordering the options in the currently existing Settings menu.
Definition of Done
Parameters are categorised. Either there are tabs or it is a list with headings
There is an option to modify the parameters
There is a certain boundary on the parameters, so that a developer cannot set unreasonable parameter values (e.g 1000h on running time)
As an TestGenie developer, I should be able to load the default values for parameters from a bundle rather than hardcoding them, so that it is more maintainable in case EvoSuite developers decide to change them.
This issue is primarily related to "Quick Access Parameters"
Definition of Done
There is a bundle with default values
All the hardcoded appearances are substituted with loading the corresponding values from a bundle
It is possible to reset the values to defaults (aka it does not break the current functionality)
As a developer, I should be able to have the option to provide an EvoSuite jar executable to my plugin through a settings menu, so that I can actually use the plugin.
Definition of Done
There is a Setting menu for selecting a jar executable
Runner.kt is in dire need of a refactor. Currently the class has a lot of code duplication and a lot of inefficient usage of IDE real estate. This is a class that should have little to no runtime dependencies or mutable state (the only exception being if the user wants to use a custom java path than their system's default). However, due to the limitations of the build system, it doesn't seem to be possible to inject the required constants which are known at compile time.
Definition of Done
Code repetition is removed
Class is refactored to be convenient to use, i.e. a chainable builder pattern
As a developer, I should be able to provide the assertions that the generated tests should make use of, so that the algorithm can generate better tests and use better assertions in the future.
Note: this feature was tagged with an asterisk in the google doc, it had comments from Martin and Mitchell.
A few implementation things are unclear at the moment, i.e. how should the developer provide the assertions, where, should the developer be notified of successful input?
For more clarification refer to "Assertion Generation" feature in ProjectForum project description.
UPDATE: after implementing the new features introduced by the client and having a discussion, it has been decided that our part of this issue is going to be implementing telemetry diff specifically for changes made in assertions.
Definition of Done
After modifying and applying the tests, if the telemetry option has been enabled, changes made in assertions are identified and stored in the telemetry file
The functionality is integrated with already existing telemetry collection
Create a menu in the tool window which can be used by other components of the plugin (generating tests for a class, generating tests for a method, etc.) to allow the user to view the generated tests.
Definition of Done
In the TestGenie tool window, there is a tab to show generated tests
There is a way for other plugin components to use this tab programmatically
Each generated test case is showed in a small read-only editor within the tool window (stacked vertically on top of each other)
Next to each test case, there is a checkbox to select or deselect the test (selected by default)
There is an "Apply" button to apply the selected test cases (no need for actual functionality just yet)
As a developer, I should be able to see the visualisation of the coverage in the form of coloured highlights next to a line, denoting which tests cover which lines, so that I can see which lines and/or branches are covered by specific test cases.
Definition of Done
User has the ability to visually display which lines are covered by a specific generated test case.
User has the ability to visually display which branches are covered by a specific generated test case.
User can access coverage statistics (e.g. num. of lines tested) on toolbar window in tabular form
As a developer, I must be able to change the default parameters, with which I run EvoSuite when I am generating tests. Namely, the following: the list of parameters the client suggested us, continuous test generation, test sequence creation, test execution, class under test, method under test via a Settings menu.
Definition of Done
The plugin offers a Settings menu
The changes in the Settings menu persist
The Settings menu in the plugin allow the user to change default EvoSuite parameters
Currently, when tests are generated, they appear in the ToolWindow. However, the "Apply" button does not work.
This issue will focus on making it work and actually moving the files in a new test file in the tests folder.
As a developer, I could be able to conduct interactive learning via TestGenie using gathered feedback (e.g provide a proper string format (e.g regex) if the test generator used a wrong string format), so that it can be passed to the EvoSuite application in order to improve the quality and efficiency of the next generated tests.
UPDATE: after implementing the new features introduced by the client and having a discussion, it has been decided that our part of this issue is going to be implementing telemetry diff
The package name of the plugin as well as all identifiers must be changed from com.github.mitchellolsthoorn.testgenie to nl.tudelft.ewi.se.ciselab.testgenie.
Currently, the plugin doesn't differentiate between different editors/workspaces of the user. For example, coverage visualization is always displayed on the editor window that's currently opened, even if the test target is not in that window.
Definition of Done
Make switching tabs while tests are generating not break user experience
Tie test generation result state to editor instance
Create basic integration between EvoSuite and the plugin
Definition of Done
Make it possible to generate tests for a (hardcoded) class from the plugin (i.e. execute the same functionality that a command such as java -jar evosuite-1.2.0.jar -projectCP target/classes/ -class delft.ArrayUtils would have)
Resolve any issues such as Java version or dependency incompatibilities that would prevent this integration from working
As a developer, I should be able to select specific lines in the IDE and tell the plugin to generate tests that cover those lines if they are valid (statements within a method).
Since EvoSuite only supports methods and classes for Units Under Test (UUT) but not specific lines, this feature would wrap around existing functionality and extend on it in the plugin layer.
Definition of Done
The plugin is able to call EvoSuite with the relevant parameters so that the coverage goal is as likely as possible to be achieved.
The user is not allowed to select invalid lines (like e.g declarations, empty lines)
As a developer, I should be able to access advanced parameters in the Settings menu by pressing the corresponding button on Quick Access tool window panel, so that I can quickly access them in case I want to modify them.
Definition of Done
The name of the link is clear or named the same as the settings section in Settings
The name has been placed in an intuitive place on the page
The link works. When pressing the link it opens the IntelliJ Settings, in particular the EvoSuite/TestGenie Settings
As a developer, I should be able to have the option to provide an EvoSuite jar executable to my plugin through a settings menu, so that I can actually use the plugin.
Definition of Done
In the settings menu, there is an option to provide a path to an evosuite jar file
To make it easier for the user to provide the path, a file chooser is shown when entering a path