You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Copy file name to clipboardExpand all lines: docs/GoSupport.md
+19-18Lines changed: 19 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -10,19 +10,19 @@ so feel free to [contribute](https://github.com/UnitTestBot/UTBotJava/blob/main/
10
10
## Features and details
11
11
12
12
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,
14
14
inserts these values into the user functions, and executes the resulting test cases.
15
15
16
16
### Supported types for function parameters
17
17
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_.
19
19
20
20
For _floating point types_, UnitTestBot Go supports working with _infinity_ and _NaN_.
21
21
22
22
### Supported types for the returned results
23
23
24
24
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.
26
26
27
27
It also captures `panic` cases correctly.
28
28
@@ -58,44 +58,45 @@ use the `go mod tidy` command. For editing and formatting `go.mod` files, use th
58
58
In the future, we plan to make UnitTestBot Go working with arbitrary code as input and generate the simplest
59
59
Go projects automatically.
60
60
61
-
## Installation and usage
61
+
## IntelliJ IDEA plugin
62
62
63
-
### IntelliJ IDEA plugin
63
+
### Requirements
64
64
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).
68
66
* Go SDK 1.18 or later
69
67
* Compatible [Go plugin](https://plugins.jetbrains.com/plugin/9568-go) for IntelliJ IDEA
70
68
* Properly configured `go.mod` file for the code under test
71
69
*`github.com/stretchr/testify/assert` Go module installed (IntelliJ IDEA automatically offers to install it as soon as the tests are generated)
72
70
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
74
76
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**.
76
78
77
-
#### Usage
79
+
**(!) NOTE:** be sure to enable this option for **_each_** project.
78
80
79
-
1. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools** > **UnitTestBot** and enable **Experimental languages support**.
80
81
2. Open a `.go` file and press **Alt+Shift+U**.
81
82
3. In the **Generate Tests with UnitTestBot** window, you can configure the settings.
82
83
83
-
### CLI
84
+
##Command-line interface (CLI)
84
85
85
-
####Requirements
86
+
### Requirements
86
87
87
88
* Java SDK 11 or later
88
89
* Go SDK 1.18 or later
89
90
* 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
91
92
92
-
####Installation
93
+
### Installation
93
94
94
95
To install the UnitTestBot Go CLI application, go to GitHub, scroll through the release notes and click **Assets**.
95
96
Download the zip-archive named like **utbot-cli-VERSION**.
96
97
Extract the JAR file from the archive.
97
98
98
-
####Usage
99
+
### Usage
99
100
100
101
Run the extracted JAR file using a command line: `generateGo` and `runGo` actions are supported for now.
Copy file name to clipboardExpand all lines: docs/JavaScriptSupport.md
+27-21Lines changed: 27 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -1,38 +1,44 @@
1
-
# UnitTestBot JavaScript plugin setup
1
+
# UnitTestBot JavaScript
2
2
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.
4
4
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.
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.
17
18
18
-
2. Node.js is missing, or _npm_ is not installed
19
+
### How to use
19
20
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.
21
24
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.
23
27
24
-
## Build
28
+
## Command-line interface (CLI)
29
+
30
+
### Build
25
31
26
32
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.
27
33
28
-
## Requirements
34
+
###Requirements
29
35
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`
34
40
35
-
## Basic usage
41
+
_Note:_ for each new project, _npm_ needs internet connection to install the required packages.
[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).
0 commit comments