Saturday, 28 December 2013

Java power tools series - Preface

I intend to write series of posts in favor of java developers (who works on java related frameworks and products) to realize - how range of tools can power you to work efficiently? Fundamentally powering your work by adopting tooling strategy is not just for Java developers, instead it is applicable to most of widely used programming languages in software development and maintenance. So on top of using IDE (e.g. Eclipse), developers should always weigh to take advantage of available various plug-ins/tools in their programming area (e.g. .NET programmer, functional programming, RDBMS/NoSQL developer…) for next shown categories.

In most of cases, I would consider public available open source projects or sample applications code to demonstrate capabilities of various tools. I would  provide my personal feedback about given tool on below parameters.
  • When to use and key features?
  • Initial learning curve and ease-of-use?
  • Setup requirements?
  • Cost (Free or Commercial)?
  • Limitations / Challenges?

Tools classification

Most of tools perform static and/or dynamic program analysis. Broadly I will write series of articles to promote usage of tools for java projects in below categories,

Tool Category
(Click below link for detail)
Description / Purpose
  • Must consider for code review activity.
  • Use for architecture, design and code quality management.
  • Very useful for code refactoring and re-engineering.
  • Example features - Code analysis for coding standards, bad practices and potential bugs; Code coverage; Duplicate code detection; Dependency analysis; Quality metrics, Technical debt measurement, etc.
    • Drawing diagrams for architecture and design documentation.
    • Reverse engineering = Generating diagram from code by using static and/or dynamic analysis.
      • Understand and document code architecture of complex/large system from generated diagrams.
      • Very useful to perform impact analysis of unknown code to reduce the bug fix and release cycle time of applications.
    • Forward engineering = First design using UML diagrams and then generate code from diagrams.
    • Roundtrip engineering =  Forward + Reverse engineering.
      • UML diagram and Java code are constantly maintained in sync.
          • Java Performance tuning - JVM profiling, discover memory leaks, thread dump analysis...
          • How to detect root cause of performance problem in production environment?
          • How APM (application performance monitoring) tool help developer and tester?
            • What could be tools, techniques and programming considerations to improve java developer productivity?

            What is Static vs. Dynamic program analysis?

            • Static analysis is performed on some version of code (source code, compiled version of code, build file) without executing the computer software. Some of related tools, I would cover in static code analyzers category.
            • Dynamic analysis is performed by executing the computer programs (that means based on the system execution or in runtime manner), often using instrumentation. I would cover some of dynamic code analyzer tools in reverse engineering and performance diagnosis categories.
            • Dynamic analysis cannot guarantee the full coverage of the source code, as it runs based on user interaction or automatic tests. However dynamic analysis can deal with real runtime values and context of executed use case compare to static analysis. Most of time, dynamic analysis is much more complex to work with compare to static analysis.

            Follow my next posts, if the answer is "No" for below questions

            • Instead of just depending on your own knowledge or manual peer code review, do you perform self code audit using tools?
            • Do you know, what is dependency structure matrix (DSM) or cyclic dependencies and how to manage those?
            • Do you know, how UML tool can help for code generation, reverse engineering or roundtrip engineering?
            • There is a need to maintain large and complex legacy systems of the enterprise, but system’s documentation is missing or outdated. Beside that you have insufficient knowledge of functionality, architecture and code. In such situation do you use range of tools for visually explore the code or  doing impact analysis?
            • You are not able to understand code sequence flow for the given functional use case. Do you know how tools can help to explore code of critical use cases by generating sequence diagrams on the fly?
            • Code is becoming problematic to update and bug fix in one area causes other unexpected bugs in system; but you just keep working on it with great frustration. Do you know, how to measure technical debt and justify such problems to higher management?
            • There is an performance issue reported in production environment. Do you know, which tools can be used in development environment for troubleshooting?
            • The reported performance issue is not reproducible in development/QA environment. Do you know, which tools can be used in production environment for troubleshooting?

            Motivation of this blog series

            In starting of my career in the year 2003, I got opportunity to work in new development project and hence as a java developer I was responsible for developing and unit testing  components as per provided LLD. Even though I had tried writing all code meticulously, I had done considerable amount of rework against manual code review comments provided by my team lead. Now I realize - if I had performed “self-code-review” using code quality tools at that time, I could have understood axiomatic java standards/practices and produced much better quality code with help of tools.

            After getting 2-3 years of development experience, all of a sudden I got new assignment to work independently on ugly legacy project code base for enhancement, bug fixing and performance improvement tasks. There were multiple events, when I was at my wit's end to deliver a complex patch or fix in the existing messy system. At that time I used to think  "how anyone can work on such tasks with insufficient knowledge of existing code and functionality of the system"! But anyway I used to deliver such challenging tasks with some delays and great struggle. Now I realize – I could have done better job, if I had used set of java tools for dependency analysis, reverse engineering and performance analysis instead of just depending on self debugging skills and Eclipse IDE.

            To summaries, my gumption to write next series of posts is all about encouraging java developers to adopt new tools and techniques for working effectively.


            I don't aim to exploit code of any open source project or sample application in "java power tools series" posts, while I reference selected publicly available code for sharing my experience and evaluation feedback of given tool. Also I am not biased to particular free or commercial tools, rather my objective is about sharing my own experience on set of tools.

            Also Refer

            1 comment:

            1. I found this blog very useful. I am looking for more information about listed open source static analysis tools. Thanks for sharing