Unit tests are essential for fast but save development. They freeze intended behavior, and therefore let us find bugs due to changes or refactoring hiccups with ease. This saves us a lot of time which we don’t spend on debugging. Nonetheless, writing and maintaining unit tests takes precious development time away.
At Symflower, our vision is that no one has to write unit tests by hand anymore. Instead, unit tests are generated, and only reviewed by the developer. If such a generated test describes the intended behavior, its behavior can be freezed by adding the test to the existing test suite. In case the test indicates unwanted behavior, the developer can use that unit test as a reproducer to fix the implementation.
With our new test review workflow for the Symflower Visual Studio Code extension we take the next step towards getting rid of manually written tests for Go and Java.
By executing one of the commands
Symflower: Generate Unit Tests for File or
Symflower: Generate Unit Tests for Function, Symflower generates unit tests which describe the behavior of your current implementation. The generated tests are then shown next to the implementation and you can review them and check if they match the intended behavior.
add test integrates the test into your existing test suite, and therefore freezes the behavior described by the test. The next time the implementation changes you can be sure that this behavior won’t be broken anymore!
To help you decide which tests are relevant, we are working on additional information right in your editor. Here’s a sneak peek: Showing code coverage information for individual tests in your source code.
We’d love to hear your feedback on how you like the test review workflow. If you think something is missing, please let us know via our public issue tracker or drop us a mail at firstname.lastname@example.org . Don’t forget to subscribe to our newsletter and follow us on Twitter, LinkedIn, and Facebook to get notified on new articles about software development and software testing, or if you are simply into memes.