Symflower Newsletter November-December 2023 - Santa’s here with a bag full of shiny new features and awesome content!

Symflower Newsletter November-December 2023 - Santa’s here with a bag full of shiny new features and awesome content!

Hello ??

Ho-ho-ho, here comes Santa! ???? Since we won’t be sending another newsletter in December, Christmas comes early this year! ?? Our team of elves here at Symflower has been busy putting a whole range of updates and new features under the tree for you.

First and foremost: a new code lens feature for JetBrains Editors (Android Studio, IntelliJ IDEA, GoLand) and VS Code! You can now very simply create tests by clicking… well, “create test”. Once turned on, this code lens (code vision in JetBrains editors) will appear by all functions and methods that allow test template generation with Symflower.

Here is how you can activate and use this feature in IntelliJ:

And here’s how to activate and use it in VS Code:

Have feedback about the new code lens feature? Drop us a line at [email protected]! We will make this feature enabled by default in January, so your feedback on how to improve it is most welcome.

In other news, Symflower now supports Mockito for Spring (Boot) testing. We’ve also improved caching to reduce execution time for bigger projects, and updated how Symflower handles errors to make things easier to debug. The plugin now supports testing for all officially supported Java Spring repository types. Also, Symflower now generates test templates for Java Spring repository components that are declared as an interface, e.g. most commonly JPA repositories! Finally (among a variety of other updates), Symflower now correctly parses all Java version declarations in Maven files.

Learn more about these updates below, or check out our documentation for details.

Have an important Java, Spring, or Spring Boot repository that you’d like to use Symflower with? Share it with us so we can make sure Symflower works for your use cases! Get in touch at [email protected].

??????????????????????????????

With that, let us thank you for all your support this year. The team at Symflower wishes you a joyous holiday season and a Happy New Year, and don’t forget to tell all your friends about Symflower at that NYE party! ??

??????????????????????????????

What’s new in Symflower? ??

NEW FEATURES

“Create test” code lens in VS Code and IntelliJ IDEs ?? To help easily generate smart test templates, you can now enable a “create test” code lens in VS Code or a code vision in IntelliJ that appears by all functions and methods that allow test template generation. Enable this cool new feature via Symflower’s settings in your editor. If you're using VS Code, you can also?set?symflower.editor.codeLens.createTest to true in your settings file. Have feedback about this feature or found a bug? We’d love to hear your feedback at [email protected]!

Support Mockito for Spring (Boot) testing ?? Detect when Mockito is used for testing and generate tests using Mockito when using Symflower’s smart test templates.

Support Java Spring repository components declared as an interface ?? Generate test templates for Java Spring repository components that are declared as an interface, which is how most repositories (especially JPA-based ones) are defined.

Add Spring examples for smart test templates to the documentation ?? Java's Spring framework is notoriously complicated. Documenting the features supported by Symflower's smart test template generation helps users that are new to testing with Java Spring.

Correctly parse Java version declarations in Maven files ?? All commonly defined and reported Java version declarations are now successfully parsed and automatically forwarded to parse and generate source code that is compatible with your project.

Generate java.util.List with an ArrayList instead of just null ?? Initialize java.util.List with an ArrayList instead of null if no further information is known to allow faster implementation of your test scenario.

Support for all Java Spring repository types ?? Symflower now supports testing for all officially supported Java Spring repository types.

Extend smart test template introduction in documentation ?? With this change, we’re starting to document all the features of Symflower's smart test templates with in-depth examples that you can try yourself.

Integrate installing Java into Symflower ?? Allow to install Java via Symflower if necessary on Linux, MacOS, and Windows.


CHANGES & BUG FIXES

Have any feedback about using Symflower with Java, Spring, or Spring Boot? Let us know at [email protected]!

Generate whole tests and test templates for Java enum methods ?? Forward the location of enum methods so they can be addressed in editors, enabling test suite and test template generation.

Mock Java Spring dependencies annotated with @Component ?? This change fixes the problem that dependencies marked with the @Component annotation were not auto-wired in tests. From now on, all dependencies are correctly added to tests via auto-wiring.?

Allow the "." pattern in all file paths ?? Clean file paths to allow the "." pattern that is generally used for filtering. For example, **.java which filters for all Java files in the current directory recursively can be written as ./**.java (or .\**.java for Windows users). With this change, all "." mentions for a directory are correctly applied.

Handle unknown @ExtendWith parameters ?? Generate a regular test template (instead of an integration test) if an unknown parameter for @ExtendWith was found. That’s most commonly used as @ExtendWith(MockitoExtension.class) to do mocking over Mockito instead of Java Spring's mocking.

Correctly handle missing request mapping annotations in Java Spring controllers ?? When generating a test template for Java Spring controllers without a request mapping annotation, generate full-blown test templates instead of empty test cases to reduce time to test.

Wait for background tasks to finish upon exiting ?? When exiting Symflower, wait for background tasks to finish but do not trigger new processes. This leads to correctly written cache files all the time.

Forward Maven configuration problems as soft errors ?? Instead of failing immediately, Symflower can now "heal" Maven configuration errors using default values to analyze code and generate tests without the user being disturbed.

Fully resolve recursive variables in Maven configurations ???Variables in Maven configurations are a useful mechanism to clearly define configurations. From now on, Symflower will recursively resolve variables and report non-defined variables in Maven configurations.

Add news line after Java annotations ?? Correctly update the positions of existing Java annotations and AST nodes to have every Java annotation in its own line.


LINTER RULES

Go linter rule: Use any instead of interface{} ?? This new rule will make code consistent by only using any instead of allowing interface{} as well.

Go linter rule: Always use backticks "`" as quotation for attributes ?? This rule forces attribute quotes to consistently use backticks "`" as their quotations.

Go linter rule: Use errors.New instead of fmt.Errorf ?? When no arguments besides the error message are given, mark fmt.Errorf(x) to be replaced by errors.New(x).

Go linter rule: Check that a slice/map is nil before checking its length 0?? Mark expressions like len(x) == 0 && x != nil that first check the length of an expression before checking if an expression is nil.

Go linter rule: Use strconv.Atoi instead of strconv.ParseInt when applicable ? Mark strconv.ParseInt(..., 10, 0) usages to be replaced by strconv.Atoi as using the simplest version to convert a "string" to an "int" will make code consistent.

See Symflower's public changelog for a complete and detailed list of changes.


Interesting reads

JUnit testing tips and tricks 1/3: How to ignore test cases in JUnit 4 and 5?

Need to skip tests? ?? Read our latest post on ignoring tests in JUnit 4 and 5, plus a bit of a bonus topic ??!


Introduction to Spring Boot

New to Spring Boot? ?? Here’s our fundamental intro to Spring Boot which covers all the basics, the key features, pros and cons, and a quick getting started guide!


Mocking frameworks for Java: Mockito vs EasyMock vs JMockit

New to mocking? ?? Check out our latest post which explores the use of mocking, benefits, challenges, and a comparison of the popular mocking frameworks Mockito, EasyMock, and JMockit! ??


Security testing tools and techniques

Are your products secure? ?? Learn the basics of security testing in our latest blog post ??


2024 Software testing trends to watch out for

Are your software testing processes ready for 2024? ?? Here’s a summary of the key trends we expect to shape the future of software Quality Assurance!


JetBrains Aqua: an IDE for test automation

JetBrains Aqua is still in the free preview phase ?? Is it worth checking out? Here’s our analysis of this new IDE.


Chaos engineering 101 & Best practices for chaos testing

Are you familiar with chaos testing? ????Here’s our introduction to chaos engineering and some key best practices for chaos testing ??


要查看或添加评论,请登录

Symflower的更多文章

社区洞察

其他会员也浏览了