Java code testing: these open source tools and the redesign of the process can reduce developer workload

Comment: The developers are doing a lot of testing, according to a new survey. Are there ways to improve testing while reducing the time it takes?

Image: Getty Images / iStockphoto, monstArrr_

The open source Spring framework and Spring Boot, both created by Rod Johnson, are by far the most popular tools for enterprise Java developers, according to a recently released independent survey of 450 developers from large and small organizations. Eighty-six percent of respondents rely on Spring / Boot according to the survey, sponsored by Diffblue, the vendors of AI-automated Java unit testing software. That’s far more than the 60% found by vendor Spring Pivotal’s own survey of 1,000 developers last year.

Must-read developer content

This latest survey, conducted independently of Pivotal and Diffblue by Vanson Bourne, a UK company, collected responses anonymously from panels of participants (150 in the UK and 300 in the US). The 15-question survey included a mix of Likert scales, multiple-choice questions, and open-ended questions. The biggest surprise? The amount of time developers spend testing. Don’t write new applications. Trial. Is this a bad thing?

Go back to school (test)

A whopping 96% of Spring users say Spring / Boot tools help them be better Java developers. It is perhaps not surprising, although the percentage may be. More surprisingly, 8% of respondents do not use any framework.

But the biggest surprise, and probably not the good one, is the time developers spend writing mind-numbing tests. Yes, the survey found that testing is easier when done with Spring, but up to half a developer’s time is spent writing tests. It’s not time spent adding features, modernizing apps, or doing what developers really love to do.

So is this time wasted? Not at all. But maybe the time spent testing could be minimized. That’s the point.

SEE: 10 Ways to Avoid Developer Burnout (Free PDF) (TechRepublic)

The main reason most production Java developers rely on Spring is because it saves them time (58% in writing code). The second most popular benefit of Spring is that it makes it easier to write unit tests. The survey found that the top three (“very useful”) Java testing tools were Junit (44%), TestNG (40%) and Diffblue Cover (39%).

“We have found that not only is Spring incredibly popular, but developers believe they write better code, achieve better maintainability, and it makes unit testing easier,” said Mathew Lodge, CEO of Diffblue. “The survey shows that developers using Spring are just testing more. We think this is a compelling example of how good tools can help organizations adopt a better way of working.”

Testing as more than an afterthought

A senior product engineer in a large Java store at a large financial services company recently explained to me why testing is so important in his business. “We’re basically trying to create fully automated, immutable services,” he said. For him, testing is at the center of his organization’s strategy (more than 3,500 developers in the company running more than 150 custom applications) to modernize and simplify their software stack.

He said: “Our strategy for the future is to focus more on serverless and microservices. Our entire data strategy is also evolving. to do this in a low friction way that is very easy for developers to implement. We are not trying to minimize their work. We are trying to eliminate the need for separate operations teams. We’re trying to mix the notion of dev and QA. ”

To decouple, the organization needs to better understand its own code, he said. Unit testing helps them do that.

“We’re trying to reduce tailor-made personalization for applications where it makes sense,” he said. “Generating volume around data is what we do. ”

His team breaks down many of their old apps one piece at a time. “Some of our old apps, we don’t understand them very well,” he said. “We don’t have a unit test base, or a very, very limited unit test base.” His team therefore extracts features that can be implemented as functions on their own internal serverless platform. A function can expose a web page, or maybe it’s just a data service. His team needs reliable unit tests to get in and extract the useful bits and possibly change the code. Unit tests record the state of the program, the way it works.

“How do I get the code out of old systems, then reassemble them surgically and be sure I’m not breaking anything?” ” he said. “Test first. Especially if we leave the code in production.”

Its ultimate goal is to remove many older apps that are expensive or difficult to maintain – or just make them more configurable so that it can put upgrade extensions in the hands of users.

Improve the development workflow

What he really wants to create is a self-managed environment where the users – the product managers themselves, who know what’s best for their business, not just the developers – understand their products. Instead of having 10, 20, or 30 “Scrum teams” gathered across the company on a massive effort to test and deploy a release, he wants teams to be able to work and publish independently and not necessarily have to interact. with central development. team.

“This is actually the developer’s workflow,” he said. “That’s how we deal with InfoSec, secure coding and all these different dimensions. We want to try to make life easier for developers so that they can focus on what they do best.”

He wants his engineering group to focus on roadmaps, technology engineering issues, and platform development. “The main focus of the tech division this year is to leverage AI-powered tools,” he said. “We want to seek productivity gains. We want to reduce manual tasks so that we can focus on activities with higher added value.

According to the survey, the good news is that Spring makes it much easier to write Java unit tests in the first place. Although testability ranks fourth among the top benefits cited by Spring users, the framework is designed to follow a standardized method of unit testing, with built-in mockery and ease of isolating tested units and trends from the test. database. Adding AI to Spring, like Diffblue and others are doing now, might be the right amount of magic to make testing easier for developers. This is essential, given how hard they continue to test.

Disclosure: I work for AWS, but the opinions expressed here are my own.

Also look

Comments are closed.