Performing impact analysis is a crucial software development task. It is all about calculating the impact of software change.
Q1. What is an impact analysis? Is it a trivial task?
A1. An impact analysis is about being able to tell which pieces of code, packages, modules, and projects get impacted by a change.
Performing an impact analysis is not a trivial task, and there is not a single tool that can cater for every scenario. You can make use of some static analysis tools like IDEs (e.g. eclipse), JRipples, X-Ray, etc. But, unfortunately applying just static analysis alone not enough, especially in Java and other modern languages whereas lots of things can happen in run time via reflections, dynamic class loading & configuration, polymorphism, byte code injection, proxies, etc.
Q2. How will you go about performing impact analysis in Java?
A2. You need to use a number of different tools and techniques to perform impact analysis.
1. Strong emphasis on writing unit and functional test cases
One of the most important way invented in software development to analyze impact of changes is by executing unit tests and functional tests. When a change is made to a software, the change will quite often have an undesirable or unintended impact on the software as a whole. So, re-executing the automated tests can identify any potential impact of a particular change. Both agile and non-agile Java projects need to have a decent unit testing coverage.
Q3. What is code coverage? How do you measure it?
A3. Code coverage basically tests that how much of your code is covered under tests. There are open source and paid tools like Coverlipse, CodeCover, Cobertura and Atlassian Clover (commercial) to analyze and improve your test coverage.
2. Making use of the IDEs’ and plugins’ search facility
You can use the search facility of your IDE, and additional plugins provided for the IDE. For example,
a) In eclipse Ctrl+Shift+g can be used to search for references
b) You can perform a general “File Search” for keywords on all projects in the work-space.
c) You can use Notepad++ editor and select Search –> Find in files. You can search for a URL or any keyword across a number of files within a folder.
There are instances where you need to perform impact analysis across stored procedures, various services, URLs, environment properties, batch processes, etc. This will require a wider analysis across projects and repositories.
3. Search within your code repository tools like GitHub, Subversion (i.e.SVN)
svn list -R file:///subversion/repository | grep filename
svn list -R file:///subversion/repository | findstr filename
There are SVN tools like SVN Search or SVNQuery which performs SVN repository indexing and searching engine.
Alternatively, checkout the projects to a common folder, and use Notepad++ or other tools to do file system search.
4. Tools like FishEye can be used to search across various code repositories
FisheEye is not targeted for any special programming language. It just supports various version control systems and the concept of text files being changed over time by various people. Handy for text searches like environment based properties files to change a URL or host name from A to B.
5. Grep the Unix/Linux environment where your application is deployed.
You can perform a search on the file system where your application(s) are deployed.
6. Conduct impact analysis sessions across cross functional and system teams and communicate the changes.
Brain storm major areas affected and document them. Have a manual test plan that covers the impacted systems to be tested. Collaborate with cross functional teams and identify any gaps in your analysis. Have a proper review and sign-off process. Get more developers to do peer code reviews.
7. Have proper documentation with high level architecture diagrams and dependency graphs where possible. As the number systems grow, so does the complexity. A typical enterprise Java application makes use of different database servers, messaging servers, ERP systems, BPM systems, Work flow systems, SOA architectures, etc. Use online document management systems like Confluence or Wiki , which enables search for various documents.
8. Analyze across various log files
It is also not easy to monitor service oriented architectures. You can use tools like Splunk to trace transactions across the IT stack while being tested by the testers to proactively identify any issues related to change. Splunk goes across multiple log files.
In addition to using a combination of tools & documentation via unit tests, you need to have a proper process in place to maintain the knowledge of the various systems and processes via confluence/wiki pages, and keep them up to date with proper peer reviews & sign-offs. It is also vital to retain experienced people with internal systems knowledge & do regular knowledge transfers where & when required to bring the new recruits up to speed quickly. You can easily replace a quality Java developer, but cannot easily replace business (i.e. domain) and systems knowledge.