Skip to content

Commit ec26f59

Browse files
authored
Update UnitTestBot Python, JavaScript, Go docs (#1989)
* Python, JavaScript, Go docs updated * Py and Go doss moved to docs folder and updated * Updated Intellij IDEA version * Minor fixes on IJ IDEA compatibility, npm, and shortcuts
1 parent 164ae58 commit ec26f59

File tree

4 files changed

+77
-87
lines changed

4 files changed

+77
-87
lines changed

utbot-go/README.md renamed to docs/GoSupport.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ so feel free to [contribute](https://github.com/UnitTestBot/UTBotJava/blob/main/
1010
## Features and details
1111

1212
UnitTestBot Go now implements the _basic fuzzing technique_.
13-
It generates input values with respect to parameter types,
13+
It generates input values considering the parameter types,
1414
inserts these values into the user functions, and executes the resulting test cases.
1515

1616
### Supported types for function parameters
1717

18-
At the moment, UnitTestBot Go is able to generate values for _primitive types_, _arrays_, _slices_ and _structs_.
18+
Now UnitTestBot Go can generate values for _primitive types_, _arrays_, _slices_ and _structs_.
1919

2020
For _floating point types_, UnitTestBot Go supports working with _infinity_ and _NaN_.
2121

2222
### Supported types for the returned results
2323

2424
For the returned function results,
25-
UnitTestBot Go supports the `error` type in addition to all the types supported for the function parameters.
25+
UnitTestBot Go supports the `error` type as well as all the types supported for the function parameters.
2626

2727
It also captures `panic` cases correctly.
2828

@@ -58,44 +58,45 @@ use the `go mod tidy` command. For editing and formatting `go.mod` files, use th
5858
In the future, we plan to make UnitTestBot Go working with arbitrary code as input and generate the simplest
5959
Go projects automatically.
6060

61-
## Installation and usage
61+
## IntelliJ IDEA plugin
6262

63-
### IntelliJ IDEA plugin
63+
### Requirements
6464

65-
#### Requirements
66-
67-
* IntelliJ IDEA (Ultimate Edition) — versions from 2022.2 to 2022.2.4
65+
* IntelliJ IDEA Ultimate — for compatibility, see [UnitTestBot on JetBrains Marketplace](https://plugins.jetbrains.com/plugin/19445-unittestbot/versions).
6866
* Go SDK 1.18 or later
6967
* Compatible [Go plugin](https://plugins.jetbrains.com/plugin/9568-go) for IntelliJ IDEA
7068
* Properly configured `go.mod` file for the code under test
7169
* `github.com/stretchr/testify/assert` Go module installed (IntelliJ IDEA automatically offers to install it as soon as the tests are generated)
7270

73-
#### Installation
71+
### Installation
72+
73+
Please refer to [UnitTestBot user guide](https://github.com/UnitTestBot/UTBotJava/wiki/Install-or-update-plugin).
74+
75+
### Usage
7476

75-
To install the UnitTestBot Go plugin in IntelliJ IDEA, refer to [UnitTestBot user guide](https://github.com/UnitTestBot/UTBotJava/wiki/Install-or-update-plugin).
77+
1. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools**, choose **UnitTestBot** and enable **Experimental languages support**.
7678

77-
#### Usage
79+
**(!) NOTE:** be sure to enable this option for **_each_** project.
7880

79-
1. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools** > **UnitTestBot** and enable **Experimental languages support**.
8081
2. Open a `.go` file and press **Alt+Shift+U**.
8182
3. In the **Generate Tests with UnitTestBot** window, you can configure the settings.
8283

83-
### CLI
84+
## Command-line interface (CLI)
8485

85-
#### Requirements
86+
### Requirements
8687

8788
* Java SDK 11 or later
8889
* Go SDK 1.18 or later
8990
* Properly configured `go.mod` file for the code under test
90-
* GCC as well as `github.com/stretchr/testify/assert` and `golang.org/x/tools@v0.4.0` Go modules installed
91+
* GCC and `github.com/stretchr/testify/assert` installed
9192

92-
#### Installation
93+
### Installation
9394

9495
To install the UnitTestBot Go CLI application, go to GitHub, scroll through the release notes and click **Assets**.
9596
Download the zip-archive named like **utbot-cli-VERSION**.
9697
Extract the JAR file from the archive.
9798

98-
#### Usage
99+
### Usage
99100

100101
Run the extracted JAR file using a command line: `generateGo` and `runGo` actions are supported for now.
101102
To find info about the options for these actions,
@@ -138,4 +139,4 @@ java -jar utbot-cli-2022.8-beta.jar runGo --help
138139
## Contributing to UnitTestBot Go
139140

140141
To take part in project development or learn more about UnitTestBot Go, check
141-
out the [Developer guide](docs/DEVELOPER_GUIDE.md) and our [future plans](docs/FUTURE_PLANS.md).
142+
out the [Developer guide](../utbot-go/docs/DEVELOPER_GUIDE.md) and our [plans](../utbot-go/docs/FUTURE_PLANS.md).

docs/JavaScriptSupport.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
1-
# UnitTestBot JavaScript plugin setup
1+
# UnitTestBot JavaScript
22

3-
## How to start using UnitTestBot JavaScript
3+
[UnitTestBot](https://www.utbot.org/) is the tool for automated unit test generation available as an IntelliJ IDEA plugin, or a command-line interface.
44

5-
1. [Install](https://www.jetbrains.com/idea/download/) the latest version of IntelliJ IDEA Ultimate.
6-
2. [Install](https://plugins.jetbrains.com/plugin/19445-unittestbot) the latest version of UnitTestBot plugin.
7-
3. [Install](https://nodejs.org/en/download/) Node.js 10.0.0 or later. Add Node.js to environment variables for better experience.
8-
4. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools** > **UnitTestBot** and enable **Experimental languages support**.
9-
5. Go to **File** > **Settings** > **Languages & Frameworks**, choose **Node.js** and check if the path to Node.js executable file is specified.
10-
6. In a JavaScript file, press **Alt+Shift+U** to open the generation dialog.
5+
Now UnitTestBot provides fuzzing-based support for JavaScript.
116

12-
## Troubleshooting: _npm_ cannot install requirements
7+
## IntelliJ IDEA plugin
138

14-
1. The system prohibits installation
9+
### Requirements
1510

16-
Solution: run _cmd_ via `sudo` or with administrator access, run `npm install -g <missing requirement>`.
11+
1. IntelliJ IDEA Ultimate — for compatibility, see [UnitTestBot on JetBrains Marketplace](https://plugins.jetbrains.com/plugin/19445-unittestbot/versions).
12+
2. UnitTestBot plugin: please refer to [UnitTestBot user guide](https://github.com/UnitTestBot/UTBotJava/wiki/Install-or-update-plugin).
13+
3. [Node.js 10.0.0 or later](https://nodejs.org/en/download/) (we recommend that you add Node.js to environment variables)
14+
15+
_Note:_ when _npm_ cannot install requirements, try troubleshooting.
16+
1. If the system prohibits installation: run _cmd_ via `sudo` or with administrator access, run `npm install -g <missing requirement>`.
17+
2. If Node.js is missing, or _npm_ is not installed: install Node.js with default configuration from the official website.
1718

18-
2. Node.js is missing, or _npm_ is not installed
19+
### How to use
1920

20-
Solution: install Node.js with default configuration from the official website.
21+
1. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools**, choose **UnitTestBot** and enable **Experimental languages support**.
22+
23+
**(!) NOTE:** be sure to enable this option for **_each_** project.
2124

22-
# JavaScript Command Line Interface usage
25+
2. Go to **File** > **Settings** > **Languages & Frameworks**, choose **Node.js** and check if the path to Node.js executable file is specified.
26+
3. In a JavaScript file, press **Alt+Shift+U** to open the generation dialog.
2327

24-
## Build
28+
## Command-line interface (CLI)
29+
30+
### Build
2531

2632
JAR file can be built in [GitHub Actions](https://github.com/UnitTestBot/UTBotJava/actions/workflows/publish-plugin-and-cli-from-branch.yml) with the `publish-plugin-and-cli-from-branch` script.
2733

28-
## Requirements
34+
### Requirements
2935

30-
* [Install](https://nodejs.org/en/download/) Node.js 10.0.0 or later
31-
* [Install](https://www.oracle.com/java/technologies/downloads/) Java 11 or later
32-
* Install _nyc_ 15.1.0 or later: `> npm install -g nyc`
33-
* Install Mocha 10.0.0 or later: `> npm install -g mocha`
36+
* [Node.js 10.0.0 or later](https://nodejs.org/en/download/)
37+
* [Java 11 or later](https://www.oracle.com/java/technologies/downloads/)
38+
* _nyc_ 15.1.0 or later: `> npm install -g nyc`
39+
* Mocha 10.0.0 or later: `> npm install -g mocha`
3440

35-
## Basic usage
41+
_Note:_ for each new project, _npm_ needs internet connection to install the required packages.
3642

3743
### Generate tests: `generate_js`
3844

docs/PythonSupport.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# UnitTestBot Python
2+
3+
[UnitTestBot](https://www.utbot.org/) is the tool for automated unit test generation available as an IntelliJ IDEA plugin, or a command-line interface.
4+
5+
Now UnitTestBot provides fuzzing-based support for Python.
6+
7+
## Requirements
8+
9+
1. IntelliJ IDEA — for compatibility, see [UnitTestBot on JetBrains Marketplace](https://plugins.jetbrains.com/plugin/19445-unittestbot/versions).
10+
2. Python 3.8 or later
11+
3. [Python plugin](https://plugins.jetbrains.com/plugin/631-python) for IntelliJ IDEA
12+
13+
If you already have a Python project, you usually have no need to install or configure anything else, but if you
14+
have trouble with launching UnitTestBot for Python code, please refer to [advanced requirements section](../utbot-python/docs/CLI.md#requirements).
15+
16+
## How to install and use
17+
18+
To try UnitTestBot Python in your IntelliJ IDEA:
19+
1. To install the plugin, please refer to [UnitTestBot user guide](https://github.com/UnitTestBot/UTBotJava/wiki/Install-or-update-plugin).
20+
2. Configure the Python interpreter for your project and make sure IntelliJ IDEA resolves all the imports.
21+
3. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools**, choose **UnitTestBot** and enable **Experimental languages support**.
22+
23+
**(!) NOTE:** be sure to enable this option for **_each_** project.
24+
25+
4. To generate tests, place the caret at the required function and press **Alt+Shift+U**. To find the appropriate shortcut for the OS you are using, check the context menu.
26+
27+
To use UnitTestBot Python via command-line interface, please refer to the [CLI guide](../utbot-python/docs/CLI.md).
28+
29+
## How to contribute and get support
30+
31+
To get information on contributing and getting support, please see [UnitTestBot Java Readme](https://github.com/UnitTestBot/UTBotJava#readme).

utbot-python/README.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)