Skip to content

Commit

Permalink
Merge pull request #384 from JetBrains-Research/pderakhshanfar/improv…
Browse files Browse the repository at this point in the history
…ements/update-readme

Update Docs
  • Loading branch information
pderakhshanfar authored Oct 16, 2024
2 parents fe4c48c + 5af6116 commit c0b50cd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 29 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<!-- Keep a Changelog guide -> https://keepachangelog.com -->

# TestSpark Changelog

## Unreleased
## 0.3.0
### Fixed
- Multiple bugs in the UI.
- Multiple bugs in the LLM-based test generation algorithm.
### Changed
- Major refactoring: removed most of the global services.
- Migration to Gradle IntelliJ Plugin 2.x,
### Added
- Full LLM-based Kotlin test generation for line, method/function, and class.
- Integration with HuggingFace.
- Support IDEA `242.*`.

## 0.2.1
### Fixed
Expand Down
25 changes: 1 addition & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,30 +229,7 @@ All the listener classes can be found in `listeners` directory.
### Services

All the service classes can be found in `services` directory.

- `CoverageSelectionToggleListener` is a topic interface for showing or hiding highlighting when the coverage is toggled for one test or many tests.
- `CoverageToolWindowDisplayService` creates the *"Coverage visualisation"* tool window panel and the coverage table to display the test coverage data of the tests generated by EvoSuite.
- `CoverageVisualisationService` visualises the coverage in the gutter and the editor (by colouring), injects the coverage data into the *"Coverage visualisation"* tool window tab.
- `ErrorMonitor` class for handling error occurrences.
- `QuickAccessParametersService` allows to load and get the state of the parameters in the *"Parameters"* tool window panel.
- `RunnerService` is used to limit TestSpark to generate tests only once at a time.
- `SettingsApplicationService` stores the application-level settings persistently. It uses `SettingsApplicationState` class for that.
- `SettingsProjectService` stores the project-level settings persistently. It uses `SettingsProjectState` class for that.
- `StaticInvalidationService` invalidates the cache statically.
- `TestCaseCachingService` contains the data structure for caching the generated test cases and is responsible for adding, retrieving and removing (invalidating) the generated tests.
- `TestCaseDisplayService` displays the tests generated by EvoSuite, in the *"Generated tests"* tool window panel.
- `TestSparkTelemetryService` sends usage information to Intelligent Collaboration Tools Lab at JetBrains Research if the user has opted in.

### Settings

All the classes related to TestSpark `Settings/Preferences` page can be found in `settings` directory.

- `SettingsApplicationState` is responsible for storing the values of the EvoSuite Settings entries.
- `SettingsEvoSuiteComponent` displays and captures the changes to the values of the entries in the EvoSuite page of the Settings dialog.
- `SettingsEvoSuiteConfigurable` allows to configure some EvoSuite settings via the EvoSuite page in the Settings dialog, observes the changes and manages the UI and state.
- `SettingsPluginComponent` displays and captures the changes to the values of the entries in the TestSpark main page of the Settings dialog.
- `SettingsPluginConfigurable` allows to configure some Plugin settings via the Plugin page in the Settings dialog, observes the changes and manages the UI and state.
- `SettingsProjectState` is responsible for storing the values of the Plugin Settings entries.
We currently have three services for managing EvoSuite settings (`EvoSuiteSettingsService`), the LLM-based approach/generation (`LLMSettingsService`), and general plugin settings (`PluginSettingsService`).

### Tools

Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ TestSpark is a plugin for generating unit tests. TestSpark natively integrates d

TestSpark currently supports two test generation strategies:
<ul>
<li>LLM-based test generation (using <a href="https://openai.com">OpenAI</a> and JetBrains internal AI Assistant platform)</li>
<li>LLM-based test generation (using <a href="https://openai.com">OpenAI</a>, HuggingFace, and JetBrains internal AI Assistant platform)</li>
<li>Local search-based test generation (using <a href="https://www.evosuite.org">EvoSuite</a>)</li>
</ul>
<h4>LLM-based test generation</h4>
<p>For this type of test generation, TestSpark sends request to different Large Language Models. Also, it automatically checks if tests are valid before presenting it to users.</p>
<p>This feature needs a token from OpenAI platform or the AI Assistant platform.</p>
<p>This feature needs a token from OpenAI, HuggingFace, or the AI Assistant platform.</p>
<ul>
<li>Supports Java (any version).</li>
<li>Supports Java (any version) and Kotlin (K2 mode should be disabled, checkout the Settings section on README).</li>
<li>Generates unit tests for capturing failures.</li>
<li>Generate tests for Java classes, methods, and single lines.</li>
</ul>
Expand Down Expand Up @@ -70,6 +70,7 @@ If you are running the plugin for the first time, checkout the [Settings](#setti
- [Coverage](#coverage)
- [Integrating tests into the project](#integrating-tests-into-the-project)
- [Settings](#settings)
- [Disable K2 for Kotlin Test Generation](#disable-K2)
- [Telemetry](#telemetry-opt-in)

### Generating Tests
Expand Down Expand Up @@ -229,7 +230,9 @@ Or to a new file:

![Tests adding to a new file](readme-images/gifs/AddingToANewFile.gif#gh-light-mode-only)
![Tests adding to a new file_dark](readme-images/gifs/AddingToANewFile_dark.gif#gh-dark-mode-only)

### Disable K2
For LLM-based Kotlin test generation, you need to disable the K2 mode for now.
![Disable K2 mode](readme-images/pngs/k2-mode/disable-k2.png)
### Settings
<!-- How can users configure the plugin to match their needs? -->
The plugin is configured mainly through the Settings menu. The plugin settings can be found under <kbd>Settings</kbd> > <kbd>Tools</kbd> > <kbd>TestSpark</kbd>. Here, the user is able to select options for the plugin:
Expand Down
Binary file added readme-images/pngs/k2-mode/disable-k2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c0b50cd

Please sign in to comment.