Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>SymflowerNew to Visual Studio Code? Get it now.

Symflower

Symflower

symflower.com
|
3,702 installs
| (4) | Free
Fully automatically generates high coverage unit tests for your source code while you are coding.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Symflower for Visual Studio Code

Symflower fully automatically generates high coverage unit tests for your source code: revealing bugs and security issues while you are coding. You can equip legacy projects with strong test suites and streamline your TDD workflow with automated test case generation to find every edge case. Find out more at https://symflower.com.

Generate Unit Tests

Table of contents

  • Quick Start
  • Features
  • Commands
  • Tutorials
  • Supported Languages
  • Requirements
  • Feedback

Please note, this extension is an early beta version that does not yet have every feature of Symflower. However, your feedback is very welcome! We are adding new features and fixing bugs every day so please let us know if something is not working or if you are expecting different results.

Quick Start

Copy the following code into a file named "Copy.java", right-click anywhere into the function to open the context menu and then click on "Symflower: Generate Tests for Function".

class Copy {
	static String[] copy(String[] from, String[] to) {
		for (int i = 0; i < from.length; i++) {
			to[i] = from[i];
		}

		return to;
	}
}

Symflower will analyze the source code and generate the following test cases to fully cover every path of the implementation.

import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;

public class CopySymflowerTest {
	@Test
	public void copy1() {
		String[] from = null;
		String[] to = null;
		// assertThrows(java.lang.NullPointerException.class, () -> {
		Copy.copy(from, to);
		// });
	}

	@Test
	public void copy2() {
		String[] from = {};
		String[] to = null;
		String[] actual = Copy.copy(from, to);

		assertNull(actual);
	}

	@Test
	public void copy3() {
		String[] from = { null };
		String[] to = null;
		// assertThrows(java.lang.NullPointerException.class, () -> {
		Copy.copy(from, to);
		// });
	}

	@Test
	public void copy4() {
		String[] from = { null };
		String[] to = { null };
		String[] expected = { null };
		String[] actual = Copy.copy(from, to);

		assertArrayEquals(expected, actual);
	}

	@Test
	public void copy5() {
		String[] from = { "" };
		String[] to = {};
		// assertThrows(ArrayIndexOutOfBoundsException.class, () -> {
		Copy.copy(from, to);
		// });
	}
}

That is it! You have just saved minutes of thinking and typing by using one of the core functionalities of Symflower. Take a look at the following sections for more, and of course, there are commands and keyboard shortcuts to make your day even more effortless.

Features

Test Template Generation

No need to write boilerplate code anymore! Let the extension generate all the boilerplate you need to write a perfectly integrated test for your project and focus on your test candidates and checks instead. See the list of available commands for details.

Generate Test Templates

Unit Test Generation

Generate unit tests with test candidates and let Symflower take care of completely writing your test cases. Make sure to enable on-save generation of tests in your settings to update your tests while you are typing. See the list of available commands for details.

Generate Unit Tests

Commands

Command Description
Symflower: Add Test Template for Function Adds a new test case template for the s function to your test suite.
Symflower: Add Test Templates for File Adds a new test case template for every function within the file to your test suite.
Symflower: Generate Tests for File Generates test cases for every function within the file and lets you review and add them to your test file interactively.
Symflower: Generate Tests for Function Generates test cases for the current function and lets you review and add them to your test file interactively.
Symflower: Restart Language Server Restarts the Symflower language server.
Symflower: Stop Language Server Stops the Symflower language server.

Tutorials

Check out our tutorial at https://get.symflower.com/ to get a quick glimpse on how Symflower helps you implement features and fix bugs.

Supported languages

  • Go 1.0-1.19
  • Java 1-17

Requirements

  • Supported operating systems:
    • Linux
    • MacOS
    • Windows
  • Supported architectures:
    • x86 with 64bit
    • ARM with 64bit

Feedback

We encourage you to send us your feedback on how you like Symflower. If you are missing a feature or found a problem that you think should be fixed, please open an issue on our community issue tracker or write us an email at hello@symflower.com. Subscribe to the Symflower newsletter to receive updates on new features, use cases and topics on software development.

© 2023 Symflower GmbH

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft