diff --git a/utbot-go/README.md b/docs/GoSupport.md similarity index 84% rename from utbot-go/README.md rename to docs/GoSupport.md index 4ce416e740..04c06ea00a 100644 --- a/utbot-go/README.md +++ b/docs/GoSupport.md @@ -10,19 +10,19 @@ so feel free to [contribute](https://github.com/UnitTestBot/UTBotJava/blob/main/ ## Features and details UnitTestBot Go now implements the _basic fuzzing technique_. -It generates input values with respect to parameter types, +It generates input values considering the parameter types, inserts these values into the user functions, and executes the resulting test cases. ### Supported types for function parameters -At the moment, UnitTestBot Go is able to generate values for _primitive types_, _arrays_, _slices_ and _structs_. +Now UnitTestBot Go can generate values for _primitive types_, _arrays_, _slices_ and _structs_. For _floating point types_, UnitTestBot Go supports working with _infinity_ and _NaN_. ### Supported types for the returned results For the returned function results, -UnitTestBot Go supports the `error` type in addition to all the types supported for the function parameters. +UnitTestBot Go supports the `error` type as well as all the types supported for the function parameters. It also captures `panic` cases correctly. @@ -58,44 +58,45 @@ use the `go mod tidy` command. For editing and formatting `go.mod` files, use th In the future, we plan to make UnitTestBot Go working with arbitrary code as input and generate the simplest Go projects automatically. -## Installation and usage +## IntelliJ IDEA plugin -### IntelliJ IDEA plugin +### Requirements -#### Requirements - -* IntelliJ IDEA (Ultimate Edition) — versions from 2022.2 to 2022.2.4 +* IntelliJ IDEA Ultimate — for compatibility, see [UnitTestBot on JetBrains Marketplace](https://plugins.jetbrains.com/plugin/19445-unittestbot/versions). * Go SDK 1.18 or later * Compatible [Go plugin](https://plugins.jetbrains.com/plugin/9568-go) for IntelliJ IDEA * Properly configured `go.mod` file for the code under test * `github.com/stretchr/testify/assert` Go module installed (IntelliJ IDEA automatically offers to install it as soon as the tests are generated) -#### Installation +### Installation + +Please refer to [UnitTestBot user guide](https://github.com/UnitTestBot/UTBotJava/wiki/Install-or-update-plugin). + +### Usage -To install the UnitTestBot Go plugin in IntelliJ IDEA, refer to [UnitTestBot user guide](https://github.com/UnitTestBot/UTBotJava/wiki/Install-or-update-plugin). +1. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools**, choose **UnitTestBot** and enable **Experimental languages support**. -#### Usage + **(!) NOTE:** be sure to enable this option for **_each_** project. -1. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools** > **UnitTestBot** and enable **Experimental languages support**. 2. Open a `.go` file and press **Alt+Shift+U**. 3. In the **Generate Tests with UnitTestBot** window, you can configure the settings. -### CLI +## Command-line interface (CLI) -#### Requirements +### Requirements * Java SDK 11 or later * Go SDK 1.18 or later * Properly configured `go.mod` file for the code under test -* GCC as well as `github.com/stretchr/testify/assert` and `golang.org/x/tools@v0.4.0` Go modules installed +* GCC and `github.com/stretchr/testify/assert` installed -#### Installation +### Installation To install the UnitTestBot Go CLI application, go to GitHub, scroll through the release notes and click **Assets**. Download the zip-archive named like **utbot-cli-VERSION**. Extract the JAR file from the archive. -#### Usage +### Usage Run the extracted JAR file using a command line: `generateGo` and `runGo` actions are supported for now. To find info about the options for these actions, @@ -138,4 +139,4 @@ java -jar utbot-cli-2022.8-beta.jar runGo --help ## Contributing to UnitTestBot Go To take part in project development or learn more about UnitTestBot Go, check -out the [Developer guide](docs/DEVELOPER_GUIDE.md) and our [future plans](docs/FUTURE_PLANS.md). \ No newline at end of file +out the [Developer guide](../utbot-go/docs/DEVELOPER_GUIDE.md) and our [plans](../utbot-go/docs/FUTURE_PLANS.md). \ No newline at end of file diff --git a/docs/JavaScriptSupport.md b/docs/JavaScriptSupport.md index ecd7d39b09..cfafa94e42 100644 --- a/docs/JavaScriptSupport.md +++ b/docs/JavaScriptSupport.md @@ -1,38 +1,44 @@ -# UnitTestBot JavaScript plugin setup +# UnitTestBot JavaScript -## How to start using UnitTestBot JavaScript +[UnitTestBot](https://www.utbot.org/) is the tool for automated unit test generation available as an IntelliJ IDEA plugin, or a command-line interface. -1. [Install](https://www.jetbrains.com/idea/download/) the latest version of IntelliJ IDEA Ultimate. -2. [Install](https://plugins.jetbrains.com/plugin/19445-unittestbot) the latest version of UnitTestBot plugin. -3. [Install](https://nodejs.org/en/download/) Node.js 10.0.0 or later. Add Node.js to environment variables for better experience. -4. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools** > **UnitTestBot** and enable **Experimental languages support**. -5. Go to **File** > **Settings** > **Languages & Frameworks**, choose **Node.js** and check if the path to Node.js executable file is specified. -6. In a JavaScript file, press **Alt+Shift+U** to open the generation dialog. +Now UnitTestBot provides fuzzing-based support for JavaScript. -## Troubleshooting: _npm_ cannot install requirements +## IntelliJ IDEA plugin -1. The system prohibits installation +### Requirements -Solution: run _cmd_ via `sudo` or with administrator access, run `npm install -g `. +1. IntelliJ IDEA Ultimate — for compatibility, see [UnitTestBot on JetBrains Marketplace](https://plugins.jetbrains.com/plugin/19445-unittestbot/versions). +2. UnitTestBot plugin: please refer to [UnitTestBot user guide](https://github.com/UnitTestBot/UTBotJava/wiki/Install-or-update-plugin). +3. [Node.js 10.0.0 or later](https://nodejs.org/en/download/) (we recommend that you add Node.js to environment variables) + +_Note:_ when _npm_ cannot install requirements, try troubleshooting. +1. If the system prohibits installation: run _cmd_ via `sudo` or with administrator access, run `npm install -g `. +2. If Node.js is missing, or _npm_ is not installed: install Node.js with default configuration from the official website. -2. Node.js is missing, or _npm_ is not installed +### How to use -Solution: install Node.js with default configuration from the official website. +1. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools**, choose **UnitTestBot** and enable **Experimental languages support**. + + **(!) NOTE:** be sure to enable this option for **_each_** project. -# JavaScript Command Line Interface usage +2. Go to **File** > **Settings** > **Languages & Frameworks**, choose **Node.js** and check if the path to Node.js executable file is specified. +3. In a JavaScript file, press **Alt+Shift+U** to open the generation dialog. -## Build +## Command-line interface (CLI) + +### Build 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. -## Requirements +### Requirements -* [Install](https://nodejs.org/en/download/) Node.js 10.0.0 or later -* [Install](https://www.oracle.com/java/technologies/downloads/) Java 11 or later -* Install _nyc_ 15.1.0 or later: `> npm install -g nyc` -* Install Mocha 10.0.0 or later: `> npm install -g mocha` +* [Node.js 10.0.0 or later](https://nodejs.org/en/download/) +* [Java 11 or later](https://www.oracle.com/java/technologies/downloads/) +* _nyc_ 15.1.0 or later: `> npm install -g nyc` +* Mocha 10.0.0 or later: `> npm install -g mocha` -## Basic usage +_Note:_ for each new project, _npm_ needs internet connection to install the required packages. ### Generate tests: `generate_js` diff --git a/docs/PythonSupport.md b/docs/PythonSupport.md new file mode 100644 index 0000000000..eea6d80909 --- /dev/null +++ b/docs/PythonSupport.md @@ -0,0 +1,31 @@ +# UnitTestBot Python + +[UnitTestBot](https://www.utbot.org/) is the tool for automated unit test generation available as an IntelliJ IDEA plugin, or a command-line interface. + +Now UnitTestBot provides fuzzing-based support for Python. + +## Requirements + +1. IntelliJ IDEA — for compatibility, see [UnitTestBot on JetBrains Marketplace](https://plugins.jetbrains.com/plugin/19445-unittestbot/versions). +2. Python 3.8 or later +3. [Python plugin](https://plugins.jetbrains.com/plugin/631-python) for IntelliJ IDEA + +If you already have a Python project, you usually have no need to install or configure anything else, but if you +have trouble with launching UnitTestBot for Python code, please refer to [advanced requirements section](../utbot-python/docs/CLI.md#requirements). + +## How to install and use + +To try UnitTestBot Python in your IntelliJ IDEA: +1. To install the plugin, please refer to [UnitTestBot user guide](https://github.com/UnitTestBot/UTBotJava/wiki/Install-or-update-plugin). +2. Configure the Python interpreter for your project and make sure IntelliJ IDEA resolves all the imports. +3. In your IntelliJ IDEA, go to **File** > **Settings** > **Tools**, choose **UnitTestBot** and enable **Experimental languages support**. + + **(!) NOTE:** be sure to enable this option for **_each_** project. + +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. + +To use UnitTestBot Python via command-line interface, please refer to the [CLI guide](../utbot-python/docs/CLI.md). + +## How to contribute and get support + +To get information on contributing and getting support, please see [UnitTestBot Java Readme](https://github.com/UnitTestBot/UTBotJava#readme). diff --git a/utbot-python/README.md b/utbot-python/README.md deleted file mode 100644 index e5c0f6529b..0000000000 --- a/utbot-python/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# UTBot for Python - -UTBot is the tool for automated unit test generation. You can read more about this project [on the official website](https://www.utbot.org/). - -This is the support of UTBot for Python. - -UTBot tries to maximize the code coverage while minimizing the number of tests. For now, we use only the fuzzing technique for Python. - -# Get started - -There are two ways to use UTBot: as an IntelliJ IDEA plugin or through a command line interface. - -You can download both archives [here](https://github.com/UnitTestBot/UTBotJava/actions/runs/2956160534). - -## Python requirements - -UTBot Python has been tested on Python 3.8 and 3.9. Some syntax from Python 3.10 is not supported. - -Usually nothing has to be done manually, but if you have any troubles with requirements, refer to [requirements section](docs/CLI.md#requirements) in CLI documentation. - -## IntelliJ IDEA plugin - -IntelliJ IDEA version should be 2022.1. - -1. Make sure you already have the Python plugin installed. - -2. Download the archive with the plugin and install it following [this instruction](https://www.jetbrains.com/help/idea/managing-plugins.html#install_plugin_from_disk). - -3. Configure the Python interpreter for your project and make sure that IDEA resolves all imports. - -4. After indexing has finished, move the cursor to a function, press ALT+SHIFT+U (or ALT+U, ALT+T in Ubuntu), and generate tests. - -### Dependency - -Package `com.intellij.modules.python` in `/utbot-intellij/resources/plugin.xml` is necessary dependecy for now, it is needed to use Python Psi tree. - - -## Command line interface - -You can find documentation on CLI usage [here](docs/CLI.md). - -# Contribute - -Read more in [UTBot Java Readme](../README.md#contribute-to-utbot-java). - -# Support - -Read more in [UTBot Java Readme](../README.md#find-support).