Java code testing: these open source tools and rethinking the process can reduce developer burden
Commentary: Developers are doing a lot of testing, new survey reveals. Are there ways to improve testing while reducing the time it takes?
The open source framework Spring and Spring Boot, both created by Rod Johnson, are by far the most popular tools for enterprise Java developers, according to a recently published independent survey of 450 developers small and large organizations. Eighty-six percent of respondents trust Spring / Boot according to the survey, sponsored by Diffblue, a provider of AI-automated Java unit testing software. This is much more than the 60% found by Spring Supplier Pivotal’s Survey of 1,000 Developers Last Year.
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 considerable time that developers spend on testing. Don’t write new applications. Trial. Is this a bad thing?
Back to school (test)
A whopping 96% of Spring users say Spring / Boot tools help them become 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 arguably not a good one, is the amount of time developers spend writing amazing reviews. 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 the things developers really love to do.
So, is this time wasted? Not at all. But maybe the time spent on testing could be minimized. This is the goal.
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’ve found that not only is Spring incredibly popular, but developers feel 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 tooling can help organizations adopt a better way of working.”
Testing as more than an afterthought
A senior product engineer in a Java department 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 moving forward is to focus more on serverless and microservices. Our entire data strategy is also evolving. We want to develop technologies very quickly, create sophisticated, advanced products and be able to evolve them. But we want to do it in a way that is low friction and very easy for developers to implement. We are not trying to reduce their work. We are trying to eliminate the need for separate operational teams. We try to merge the notion of development and quality assurance. ”
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 apps 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 very, very limited unit testing basis or unit testing basis.” His team is therefore in the process of extracting features that can be implemented as functions on their own internal serverless platform. A function can expose a web page or maybe 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, its operation.
“How do I get code out of old systems, then reconstruct 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 for massive efforts 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.
“It’s really about the developer workflow,” he said. “This is how we manage InfoSec, secure coding and all those 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 concerns, and platform development. “The main focus of the technology division this year is to leverage AI-based 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 easier to write Java unit tests in the first place. While testability ranked fourth among the top benefits cited by Spring users, the framework is designed to follow a standardized method of unit testing, with built-in simulation and ease of isolation of units under test and trends from the database. Adding AI to Spring, as Diffblue and others are now doing, 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.