CAST: Adding Spring Lowers the Quality of JEE Applications
A CAST report discloses that JEE enterprise software has lower quality when using Spring or Struts than using just Hibernate. Also, the quality degrades when Java is mixed with C or C++.
CAST Software has recently released the report Java Applications and Coffee: The Variations are Endless. The purpose of the CAST CRASH report is to understand the impact on structural quality –measured in reliability, security, performance, maintenance - of JEE applications when using various frameworks and when Java code is combined with other technologies. The report has analyzed in particular the impact of Hibernate, Spring and Struts on 496 JEE business applications (not open source) belonging mostly to Fortune 500 companies and totaling 152 millions lines of code.
The findings of the report are:
-
Around half of JEE applications do not use frameworks. The large number may be explained by the fact that the development of some of them started before any framework was available.
-
Applications without frameworks have a large variation in quality, between 2.7 and 3.7 on scale from 1 to 4. The report authors’ interpretation is that frameworks tend to raise the quality of applications by setting constraints and enforcing certain architectural patterns.
-
Applications using Struts or Spring besides Hibernate have lower quality levels then those having just Hibernate. One of the reasons is that such applications have a much larger codebase and are more complex. But the averages of all categories are spread closely around 3.25, as shown in the following chart. (The thin gray lines show how quality of all applications in a category is dispersed while the white horizontal bar in the middle represents the average for that category.)

-
Adding both Spring and Hibernate makes JEE applications 2-3 times larger than other variants of JEE apps: 498 KLoC compared to 184 KLoC for apps without any framework or 183 KLoC for those using Struts (shown in the picture below).

-
The codebase size of pure JEE application is up to 6 times smaller than of those using JEE and C++, as shown below.

-
Pure JEE applications (not mixed with non-Java technologies) have higher quality.
-
The quality of JEE applications tends to degrade when mixed with other technologies especially C/C++. Older/lower-level technologies seem to lower the quality of applications. The quality remains about the same when mixed with .NET technologies:

The report is based on source code analysis that CAST uses to evaluate the quality of many Fortune 500 enterprise software.
Makes sense
by
Cameron Purdy
Peace,
Cameron Purdy | Oracle
Lies, damned lies and statistics
by
Pavel Grushetzky
If CAST would find a bunch of Spring-less JEE apps that introduced Spring, and measure quality before and after, that could give a food for thought.
Or if it would let a bunch of teams build the same app with and without Spring...
With just numbers from this report it is easy to speculate
"Spring lowers quality of JEE apps"
"Pure JEE is for simplest and smallest apps"
The report supports both statements - and none at the same time.
Really?
by
Albert Mendonca
Re: Really?
by
Jonathan Allen
Nice
by
Juan Pickselov
Then? So in code, do we have If Than Statements?
Or maybe...
by
Richard Richter
Good survey is a good thing, they collected some interesting data I guess, but those conclusions are just plain silly, comparing incomparable. Not to mention that with all the convergence in Java EE vs Spring space, Spring still can give a lot to Java EE and I'll gladly see how Java EE gets simpler. Good that Java EE started to prune things, Java SE libs would need that as well. Because on this front any lib can beat Java standards with its wannabe backwards compatibility.
PHP vs J2EE
by
Vic Cvc
Re: Really?
by
anshuman mehta
Statistics?
by
Hugo Valk
- The average quality when using Java frameworks is roughly the same
- Using Hibernate seems to raise quality vs. using JPA or even plain JDBC, but the sample size is too small to draw a definitive conclusion
- Using an extra web framework raises your LoC
- JEE combined with COBOL gives you highest average quality next to JEE only (probably because we are talking banking systems here)
- Having to integrate your JEE app with C/C++ systems seems to affect quality, but the sample size is too small to draw a definitive conclusion
There is nothing to conclude about the quality of Spring and Struts, since the samples are too small.
Re: Really?
by
John Doe
SpringFramework is absolutely not a standard, and itself even doesn't respect the SOLID and KISS principles needed
by every thing that need to be big. Spring awesomeness touches its end ...
Spring vs JEE
by
raj n
Re: Really?
by
Albert Mendonca
Re: Really?
by
Albert Mendonca
Re: Really?
by
John Doe
I won't list all the painfull option springframework offers, and the lack of convention its imperative style plus xml brings.
Would you agree that saying "if a project have a poor quality using spring it's because people do not know the quintessence of spring"
is not an option. On top of that If you want develop a framework don't go with spring, an application yes but not a framework.
In the other hand, when I talk about standard, I did not say JEE is THE way. I am myself measured. SpringFramework and Oracle propose
enterprise solutions but I wont' take any of them. I mean one of the whole stack. Spring is too bloated and unmodular, JEE stack is not
developer friendly, I think bringing injection by the app server is a mistake.
My way, good little library with one purpose example : Guice, Shiro, reflections, Jersey many others. Plus some JSR 330, 310 , 303, ...
I take care of the integration.
Torture numbers, and they’ll confess to anything
by
Ronald Miura
From the actual video:
"Conclusions:
- In addition to ease of development, frameworks do enable higher quality of applications
- Larger more complex applications tend to use a combination of frameworks in their architecture (Hibernate + Spring)"
That is, frameworks are good, and people tend to use more of them to solve large/complex problems.
But one thing must be noted: the conclusions of the research are not what was posted at InfoQ. I just don't know if is due Abel Avram's incapacity of reading the slides, 'pure JEE' fanboyism, or just desire to generate controversy (thus, more traffic to the site). From the InfoQ article:
"- Applications using Struts or Spring besides Hibernate have lower quality levels then those having just Hibernate. One of the reasons is that such applications have a much larger codebase and are more complex."
That is, Spring is (or frameworks in general besides Hibernate are) bad. He mistakes cause as consequence, affirming the complete inverse of the original conclusion.
meh
Re: Torture numbers, and they’ll confess to anything
by
Abel Avram
you may want to read the article again. My article is in accordance with the study.
JEE applications (no frameworks) have a quality spread over a larger interval of the scale compared to those using frameworks. (Frameworks vs. no frameworks) The explanation: frameworks introduce a number of usage patterns that force such applications keep their quality spread over a smaller interval.
Another conclusion is that Spring apps have lower quality than those using just Hibernate. (This is a comparison between apps using frameworks.) And the explanation is not that Spring lowers the quality by itself, but rather because apps using Spring are larger and more complex, being prone to more errors.
If Springs apps have a slight quality problem does not mean Spring is bad. Spring offers a number of features that bring a JEE app much faster to the market outweighing the slight dip in quality.
Re: Torture numbers, and they’ll confess to anything
by
Ronald Miura
And the explanation is not that Spring lowers the quality by itself, but rather because apps using Spring are larger and more complex, being prone to more errors.
You should read the title again.
If Springs apps have a slight quality problem does not mean Spring is bad. Spring offers a number of features that bring a JEE app much faster to the market outweighing the slight dip in quality.
Spring apps don't have a 'slight quality problem'! Large and complex applications have a 'quality problem', Spring, probably, is what made it 'slight'.
As i said, the study itself gets to a reasonable conclusion. Which doesn't include Spring bashing.
And, to those who didn't bother to watch the video, the author says that most 'No framework' apps in the study are old or very small apps. Not complex apps made simple by using the magic of EJB3. Although, personally, I would never classify an application that uses EJB3, CDI, or JPA as 'No framework', as they are just platform-provided frameworks.
... and statistics
by
Mark N
What if you add JUnit?
by
ANDREW CLIFFORD
No comment on quality versus cost or time-to-market. Struts probably points to very old development that is mature and probably in an organization that doesn't make quality a priority. It doesn't say how Spring is used: Spring MVC? DI? JdbcTemplate? Quality seems to be lower on the web app tier. Does a JEE container mean just Tomcat/Jetty or does it have to have the full-blown EJB container too.
I could see how Hibernate might hurt performance quality if it's not tuned correctly. Struts, again, is a sign of other low quality practices. I can't say I understand how adding Spring could lower quality other than selecting it may mean a general loss of control on technical stewardship.
Still the numbers are interesting but I need to know what they mean by quality and how it is actionable.
Re: Spring vs JEE
by
First name Last name
Closed metrics on a closed data set
by
Mathhew Miller
Funny, that more complex applications might use more frameworks and also have lower total quality than less complex applications.
Of course, lines of code has been a godawful metric since forever, so already we're also dealing with bozos. Are they counting each line feed in an XML file as a "line?" Are they analyzing code per or post cglib?
I don't have a horse in this race, having used all the technologies listed. But I do have a code quality suite I won't be buying.
Full report available
by
Alexandra Szynkarski
It gives more detail into the stats that were presented. Also a look at the types of violations associated to each framework.
Educational Content
Managing Build Jobs for Continuous Delivery
Martin Peston May 24, 2013
Clojure in the Field
Stuart Halloway May 23, 2013
Tuning the Size of Your Thread Pool
Kirk Pepperdine May 23, 2013




Hello stranger!
You need to Register an InfoQ account or Login to post comments. But there's so much more behind being registered.Get the most out of the InfoQ experience.
Tell us what you think