Java CodeQuality Tools.

1. CodePro Analytix
It’s a great tool (Eclipse plugin) for improving software quality. It has the next key features: Code Analysis, JUnit Test Generation, JUnit Test Editor, Similar Code Analysis, Metrics, Code Coverage and Dependency Analysis.
2. PMD
It scans Java source code and looks for potential problems: Possible bugs, Dead code, Suboptimal code, Overcomplicated expressions and Duplicate code.
3. FindBugs
It looks for bugs in Java programs. It can detect a variety of common coding mistakes, including thread synchronization problems, misuse of API methods, etc.
4. Cobertura
It’s a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage.
5. Emma
It is a fast Java code coverage tool based on bytecode instrumentation. It differs from the existing tools by enabling coverage profiling on large scale enterprise software projects with simultaneous emphasis on fast individual development.
6. Checkstyle
It is a development tool to help programmers write Java code that adheres to a coding standard.
7. JBoss Tattletale
JBoss Tattletale is a tool that can help you get an overview of the project you are working on or a product that you depend on. The tool will recursive scan a directory for JAR files and generate linked and formatted HTML reports.
8. UCDetector
UCDetector (Unecessary Code Detector) is a Open Source eclipse PlugIn Tool to find unecessary (dead) java code. It also tries to make code final, protected or private. UCDetector also finds cyclic dependencies between classes.
9. Sonar
Sonar is a continuous quality control tool for Java applications. Its basic purpose in life is to join your existing continuous integration tools to place all your development projects under quality control.
10. XRadar
The XRadar is an open extensible code report tool that produces HTML/SVG reports of the systems current state and the development over time. Uses DependencyFinder, JDepend, PMD, PMD-CPD, JavaNCSS, Cobertura, Checkstyle, XSource, JUnit, Java2HTML, ant and maven.
11. QALab
QALab consolidates data from Checkstyle, PMD, FindBugs and Simian and displays it in one consolidated view. QALab keeps a track of the changes over time, thereby allowing you to see trends over time. You can tell weather the number of violations has increased or decreased – on a per file basis, or for the entire project. It also plots charts of this data. QALab plugs in to maven or ant.
12. Clirr
Clirr is a tool that checks Java libraries for binary and source compatibility with older releases. Basically you give it two sets of jar files and Clirr dumps out a list of changes in the public api. The Clirr Ant task can be configured to break the build if it detects incompatible api changes. In a continuous integration process Clirr can automatically prevent accidental introduction of binary or source compatibility problems.
13. JDiff
JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared. This is very useful for describing exactly what has changed between two releases of a product. Only the API (Application Programming Interface) of each version is compared. It does not compare what the source code does when executed.
14. JLint
It checks your Java code and find bugs, inconsistencies and synchronization problems by doing data flow analysis and building the lock graph.
15. JDepend
JDepend traverses Java class file directories and generates design quality metrics for each Java package. JDepend allows you to automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to effectively manage and control package dependencies.
16. cloc
cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
17. Dependometer
Dependometer performs a static analysis of physical dependencies within a software system. Dependometer validates dependencies against the logical architecture structuring the system into classes, packages, subsystems, vertical slices and layers and detects cycles between these structural elements. Furthermore, it calculates a number of quality metrics on the different abstraction layers and reports any violations against the configured thresholds.
18. Hammurapi
Hammurapi is an open source code inspection tool. Its release comes with more than 100 inspectors which inspect different aspects of code: Compliance with EJB specification, threading issues, coding standards, and much more.
19. JavaNCSS
JavaNCSS is a simple command line utility which measures two standard source code metrics for the Java programming language. The metrics are collected globally, for each class and/or for each function.
20. DCD
DCD finds dead code in your Java applications.
21. Classycle
Classycle’s Analyser analyses the static class and package dependencies in Java applications or libraries. It is especially helpful for finding cyclic dependencies between classes or packages. Classycle is similar to JDepend which does also a dependency analysis but only on the package level.
22. ckjm
The program ckjm calculates Chidamber and Kemerer object-oriented metrics by processing the bytecode of compiled Java files. The program calculates for each class the following six metrics proposed by Chidamber and Kemerer.
23. Jameleon
Jameleon is an automated testing framework that can be easily used by technical and non-technical users alike. One of the main concepts behind Jameleon is to create a group of keywords or tags that represent different screens of an application. All of the logic required to automate each particular screen can be defined in Java and mapped to these keywords. The keywords can then be organized with different data sets to form test scripts without requiring an in-depth knowledge of how the application works. The test scripts are then used to automate testing and to generate manual test case documentation.
24. DoctorJ
DoctorJ analyzes Java code, in the following functional areas: documentation verification, statistics generation and syntax analysis.
25. Macker
Macker is a build-time architectural rule checking utility for Java developers. It’s meant to model the architectural ideals programmers always dream up for their projects, and then break — it helps keep code clean and consistent. You can tailor a rules file to suit a specific project’s structure, or write some general ‘good practice’ rules for your code. Macker doesn’t try to shove anybody else’s rules down your throat; it’s flexible, and writing a rules file is part of the development process for each unique project.
26. Squale
Squale is a qualimetry platform that allows to analyze multi-language software applications in order to give a sharp and comprehensive picture of their quality: High level factors for top-managers and Practical indicators for development teams.
27. SourceMonitor
The freeware program SourceMonitor lets you see inside your software source code to find out how much code you have and to identify the relative complexity of your modules. For example, you can use SourceMonitor to identify the code that is most likely to contain defects and thus warrants formal review.
28. Panopticon
The Panopticode project provides a set of open source tools for gathering, correlating, and displaying code metrics.
29. Eclipse Metrics plugin
Provide metrics calculation and dependency analyzer plugin for the Eclipse platform. Measure various metrics with average and standard deviation and detect cycles in package and type dependencies and graph them.
30. QJ-Pro
QJ-Pro is a comprehensive software inspection tool targeted towards the software developer. Developers can automatically inspect their Java source code and improve their Java programming skills as they write their programs. QJ-Pro provides descriptive Java patterns explaining error prone code constructs and providing solutions for it.
31. Byecycle
Byecycle is an auto-arranging dependency analysis plugin for Eclipse. Its goal is to make you feel sick when you see bad code and to make you feel happy when you see good code.
32. Coqua
Coqua measures 5 distinct Java code quality metrics, providing an overview and history for the management, and down-to-the-code, detailed views for the developer. Metrics can be defined per team. Ideal for mid- to large-sized and/or offshore projects.
33. Dependency Finder
Extracts dependencies and OO metrics from Java class files produced by most Java compilers.
34. Jalopy
Jalopy is an easily configurable source code formatter that can detect, and fix, a number of code convention flaws that might appear in Java code. Jalopy is more of a code fixer than a code checker. Jalopy plug-ins are present for most IDEs and, in most cases, they gel quite seamlessly with the IDE.
35. JarAnalyzer
JarAnalyzer is a dependency management tool for .jar files. JarAnalyzer will analyze all .jar in a given directory and identify the dependencies between each. Output formats include xml, with a stylesheet included to transform it to html, and GraphViz DOT, allowing you to produce a visual component diagram showing the relationships between .jar files. The xml output includes important design metrics such as Afferent and Efferent coupling, Abstractness, Instability, and Distance. There is also an Ant task available that allows you to include JarAnalyzer as part of your build script.
36. Condenser
Condenser is a tool for finding and removing duplicated Java code. Unlike tools that only locate duplicated code, the aim of Condenser is to also automatically remove duplicated code where it is safe to do so.
37. Relief
Relief provides a new look on Java projects. Relying on our ability to deal with real objects by examining their shape, size or relative place in space it gives a ‘physical’ view on java packages, types and fields and their relationships, making them easier to handle. Lets discuss quickly how we interprete physical properties and how it can help us to grasp project characteristics.
38. JCSC
JCSC is a powerful tool to check source code against a highly definable coding standard and potential bad code. The standard covers naming conventions for class, interfaces, fields, parameter, … . Also the structural layout of the type (class/interface) can be defined. Like where to place fields, either before or after the methods and in which order. The order can be defined through the visibility or by type (instance, class, constant). The same is applicable for methods. Each of those rules is highly customizable. Readability is enhanced by defining where to put white spaces in the code and when to use braces. The existence of correct JavaDoc can be enforced and various levels. Apart from that, it finds weaknesses in the the code — potential bugs — like empty catch/finally block, switch without default, throwing of type ‘Exception’, slow code.
39. Spoon
Spoon is a Java program processor that fully supports Java 5. It provides a complete and fine-grained Java metamodel where any program element (classes, methods, fields, statements, expressions…) can be accessed both for reading and modification. Spoon can be used on validation purpose, to ensure that your programs respect some programming conventions or guidelines, or for program transformation, by using a pure-Java template engine.
40. Lint4j
Lint4j (‘Lint for Java’) is a static Java source and byte code analyzer that detects locking and threading issues, performance and scalability problems, and checks complex contracts such as Java serialization by performing type, data flow, and lock graph analysis.
41. Crap4j
Crap4j is a Java implementation of the CRAP (Change Risk Analysis and Predictions) software metric – a mildly offensive metric name to help protect you from truly offensive code.
42. PathFinder
Java PathFinder (JPF) is a system to verify executable Java bytecode programs. In its basic form, it is a Java Virtual Machine (JVM) that is used as an explicit state software model checker, systematically exploring all potential execution paths of a program to find violations of properties like deadlocks or unhandled exceptions. Unlike traditional debuggers, JPF reports the entire execution path that leads to a defect. JPF is especially well-suited to finding hard-to-test concurrency defects in multithreaded program
43. Soot
Soot can be used as a stand alone tool to optimize or inspect class files, as well as a framework to develop optimizations or transformations on Java bytecode.
44. ESC/Java2
The Extended Static Checker for Java version 2 (ESC/Java2) is a programming tool that attempts to find common run-time errors in JML-annotated Java programs by static analysis of the program code and its formal annotations. Users can control the amount and kinds of checking that ESC/Java2 performs by annotating their programs with specially formatted comments called pragmas.

This list includes open sourced and free tools. I intentionally have excluded commercial tools. I’m sure there are much more tools. In case your know some of them which isn’t listed here please add comment to this post.

Grails doc 3.1 version

Grails documentation last version 3.1: Grails documentation 3.1

The Grails Framework – Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith, Lari Hotari
Version: 3.0.1 Now Grails moved to Apache projects completely…

Grails is a full stack framework and attempts to solve as many pieces of the web development puzzle through the core technology and its associated plugins. Included out the box are things like:

  • An easy to use Object Relational Mapping (ORM) layer built on Hibernate
  • An expressive view technology called Groovy Server Pages (GSP)
  • A controller layer built on Spring MVC
  • An interactive command line environment and build system based on Gradle
  • An embedded Tomcat container which is configured for on the fly reloading
  • Dependency injection with the inbuilt Spring container
  • Support for internationalization (i18n) built on Spring’s core MessageSource concept
  • A transactional service layer built on Spring’s transaction abstraction

All of these are made easy to use through the power of the Groovy language and the extensive use of Domain Specific Languages (DSLs)

This documentation will take you through getting started with Grails and building web applications with the Grails framework.

The term ‘java developer’ covers a wide range of individuals. It starts with fresh graduates looking for jobs and goes up till experienced Java Enterprise Edition developers. There are a wide range of concepts and skills that Java developers must posses in order to be important in the industry. It is highly advisable to know the language fundamentals thoroughly, rather than specific frameworks or syntax. The following websites will offer professional Java developers a storehouse of valuable information as also a platform to interact and prosper!

1.DZone - DZone

Place where community members discover and share the latest and most popular news from around the web. This community-driven page is carefully moderated by an expert editorial staff to ensure the content remains interesting and relevant.

2.LeetCode - LeetCode

LeetCode is a social platform for preparing IT technical interviews. The website provides code solution using the Online Judge system, high quality article featuring in-depth thought process and more.

3.Stackoverflow - Stackoverflow

Stack Overflow is a question and answer site for professional and enthusiast programmers. It’s 100 per cent free, no registration required.

4.Java SE Technical Documentation - Java SE Technical Documentation

Contains all documents you will need to use API of Java SE. It’s a one-stop shop for everything recent in the world of Java and it’s Oracle’s official website, so all the material here is 100 per cent geniune and update very frequently.

5.Coursera - Coursera

Coursera is an education platform that partners with top universities and organisations worldwide, to offer courses online for anyone to take, for free.

6.Java World - Java World

JavaWorld is the leading independent resource for enterprise Java technology developers, architects, and managers who want to learn more about Java and related technologies from professional developers and trusted industry experts. JavaWorld reaches the core audience of IT professionals who are planning, developing, deploying, and integrating Java-based solutions on an enterprise level.

7.Github - Github

Apart from hosting your projects for free, Github is also an excellent resource for learning popular Java libraries and frameworks with corresponding examples.

8.Program Creek - Program Creek

The website contains some very interesting articles written by people from different areas. The articles here are supported by relevant diagrams and code examples.

9.Wikipedia - Wikipedia

Our discussion will be far from over without the mention of this particular website that has been a store house of immense resources on practically any topic out there. You may just want to know some concept, but not learn much and the website will do you loads of good. Frequently updated information is available for free.

Java may not be the newest programming language around, but it is still one of the most popular. This is an Object Oriented Programming (OOP) language, which has become a mainstay in most enterprise and home projects.
Here are a few good design principles you should follow:

1. DRY
DRY stands for Don’t Repeat Yourself, which is pretty self explanatory. This means that you shouldn’t be duplicating your code in a program. If a code fragment is appearing in two places, then you would do well to turn it into a method instead of writing the entire fragment again. Lack of duplication helps in easy maintenance of the code.

2. Encapsulation

Whether your project gets bought over or whether you work on it yourself, your code will always change. So, it is good to encapsulate the part of the code that you think will be changed. This makes you code easy to maintain and test.

3. Design Principle

Here you should try and follow an open closed design principle. This means that you classes, functions or methods should be Open so that new functionality can be added easily. The Open Closed Design Principle focuses on this aspect and makes it possible to avoid unauthorised changes to already tested and working code.

4. Single Responsibility Principle (SRP)

According to this principle, a class should be handling a single functionality. In addition, there should be more than one reason for a developer to change a class from what it currently does. For example, if you have multiple functionalities in a class in Java then you might face problems when you are coupling this fake Java.

5. Dependency

The framework that you use already provides you dependence, which means that looking for it a additionally will be a waste of time. You can also use byte code instrumentation as well. Some Aspect Oriented Programming (AOP) framework already does this. Lastly, you can also make the use of proxies.

6. Composition over Inheritance

According to many programmers, composition is more important than inheritance. They say that you should be focusing on the composition of your program than on employing a flexible inheritance structure. This is because composition allows you to change the behaviour of a class at runtime. Interface on the other hand allows you to use polymorphism, providing the flexibility to replace something with better implementation.

7. Liskov Substitution Principle (LSP)

This principle states that you must be able to subtypes for super types. This means that any methods or functions in your program that are making the use of super class types, then they should also be able to work with the sub class. It is in close relation to SRP and the Interface Segregation Principle.

8. Interface Segregation principle (ISP)

This principle tells you to ensure that clients do not implement any interface that it doesn’t use. In Java, an interface has the disadvantage from the design point of view, to implement all methods before the classes can use it;

9. Programming for Interface

A programmer should always be programming for the interface and not for the implementation that will give them flexibility in code. Make use of interface types on variables and return types on methods. In addition, argument types should also be use.

10. Delegate

Delegate the tasks of your program to specific to classes. An example of this would be the equals () and hashCode() method.

Honestly, Java is the best thing that has happened to developers. The write-once, run-mostly-everywhere language is simply awesome. It is undoubtedly very stable and ubiquitous. However, all said and done, Java is not 100 per cent perfect. It does come with its own set of problems (not major, we say) that can be quite frustrating at the end of the day!
Here are 10 things we absolutely hate about Java:
1. Long CamelCase names
Gluing together long sentences in the form of variable names by capitalising the first letters might add a bit of self-documentation to the code. Many developers would agree to the fact, however some are even of the opinion that Long CamelCase names can be quite taxing. Take for instance, i // holds the interest rate before taxes as per regulation 43 is any day easier to read than interestRateHoldingVariableAdjusted ForTaxesAsDefinedByRegulation43, right?
2. Punctuation
The one thing that distinctly separates Java from others is the rampant availability of punctuation like curly brackets, semicolons, and parentheses. Although punctuation lovers might beg to disagree, most programmers are rather not very fond punctuation abundancy. They on the contrary see it as visual noise that in turn leads to a disconnect between the developer and the compiler.
3. Open source confusion
Ok, be honest, is Java open source or not? Of course developers might contend that the JREs and JDKs are freely available, but does that mean your safe? Developers around the globe live a under a constant threat of anxiety peaking out from countless imaginative legal repurcussions when using Java.
4. The Java thread pig farm
Node.js users constantly ridicule Java server platform saying that the Java thread factory is one big pig farm that adds 2MB of additional fat to the server RAM profile each and every time someone clicks on any supported Web link. During its initial days, Java threads were extremely lightweight when comapared to competing solutions.

5. Intolerably slow startup times

No one question the fact that Java apps run fairly smoothly upon start, what is painstaking is the start up. It’s exceptionally slow, a considerable issue for developers. For instance, Android app creators know and constantly fret about how slowly the simulator code runs on the desktop.

6. Endless checking for null pointers
This is perhaps one of the most frustrating aspects of Java. It requires countless ‘if’ statements to check if variables ended up null. Well, if they did not, the entire Java thread would eventually crash with NullPointerExceptions.
7. Object creation overhead
Tossing everything into an object might seem ‘effective’, however, those who do it know how slow the process of creating a Java object can be. Furthermore, the process is expensive. Notably most programmers who aspire to speed up coding more often than not tend to avoid the object-oriented model.
8. Primitive wrappers to use data structures
The Java data structures are pretty neat, however the only downside is that they require programmers to wrap their basic values in objects to use them. This turns a four-byte ‘int’ into a big, fat object.
9. Strings are big, need overhead, and are final
Strings are objects that can’t be changed. Its highly advisable programmers get them right the first time. In case you go wrong somewhere, you will have to create an entirely new object and copy it all over.
10. No global variables
Absence of global variables entails in programmers creating Global class and fill it with static variables. Meanwhile, others build singleton objects, however there are serious issues about efficiency here.