SlideShare a Scribd company logo
1 of 38
Ensuring high code quality in Java development :  tools and procedures     Presented by Mikhail Vladimirov  (Leximera, Inc.  http://www.leximera.com) June, 2010
The overall goal of IT governance is to avoid project failures, minimize the number of situations requiring “remediation” initiatives and maximize ROI in IT.   With the existing trend to outsource (inshore and outshore) the IT development function, corporations are adopting more strict IT governance and compliance policies.    Promotion of efficient and effective IT controls in design and development help achieve some of the IT governance goals.   The need for strict IT governance
Enforcing SDLC standard’s provisions IT governance is ensured, among other things, by enforcing the Corporate Software Development Life Cycle  (SDLC) standard.  The Build phase of the SDLC standard includes such activities as code reviews and unit testing.
Software quality & human factor  ,[object Object],[object Object]
Broken Window Theory (and human factor) ,[object Object],[object Object]
How we measure software quality?  [controversial topic] ,[object Object],[object Object],[object Object]
Unit testing is an integral part of SDLC Unit tests are written contracts that individual units of new or modified/re-factored code must satisfy (work as per software design specification).  Creating unit tests in parallel with code (or even ahead of it) leads to the creation of more maintainable and functional code.  It also helps reduce uncertainty of the code correctness early in the Build phase of the SDLC.  Unit tests document the behaviour of the system by showing the inputs/outputs and the API in action.
Unit testing: extending scope JUnit is the standard automated testing framework used in Java development.  This system is normally supplemented by such testing toolkits as JMockit and EasyMock which can be used to augment simple unit tests and build a solid platform for Test-Driven Development.
Multithreaded unit tests One of the areas JUnit doesn't cover is that of multithreaded unit tests, which are absolutely needed, for instance, to verify thread-safety of the new piece of code or  a 3 rd  party module / library.
Unit testing of thread-safety
Adding more value: code coverage tools ,[object Object]
Code coverage activity Code coverage tools report the percentage of code accessed during testing and provide code metrics at the  class ,  method ,  line  or  basic block  level that can help identify un-used/unreachable code.  Un-used (e.g. legacy) code (normally shown in red in reports) can be potentially safely removed (if the complete test suites were run against it) or additional tests be created.  The “greener” are the code coverage reports, the better code coverage is provided by the existing tests.
Code Coverage Activity (cont’d) Cobertura generated HTML report
Code Coverage Activity (cont’d) Eclipsed-based EMMA generated report (can also be exported into the HTML format)
Code review and analysis objectives ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Extreme Programming practice ,[object Object]
Roles and responsibilities in code review exercise   ,[object Object],[object Object],[object Object],[object Object],[object Object]
Code review feedback document ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Manual code review (cont’d) ,[object Object]
Code management in modern IDEs Modern Integrated Development Environments (IDE), e.g. Eclipse, IntelliJ, NetBeans used for development on Java™ platform offer a powerful code management toolset that can do real-time syntax checking, on-demand re-factoring, formatting and more. For example, IDEs will generate visual clues to help developer see some  code defects right away as they are typing.  Eclipse, for instance, will underline the code that declares a variables but never uses it:  Or even identify a possible null pointer situation that may happen at run-time:
Enforcing coding standard and guidelines: Code Formatting Template The compliance with coding standards is, in part, ensured by using a uniform code formatting template  (which meets formatting guidelines, e.g. line length, size/type of the indent, comments, java statements layout, etc.)  by all developers on the project.  First, the template file meeting the standard’s criteria is created end exported (a one-time exercise), then the template file is cascaded to project developers who import and use it in their IDEs.
Automated code inspection and analysis   This exercise is mostly done via static code analysis tools that inspect program’s source code or generated byte-code and compare extracted elements against the repository of known defective code patterns.  Static analysis solutions not only detect but in many cases offer corrective actions to fix coding problems.  A good analyzer should have a good ratio of real issues count to the number of (usually harmless) warnings.  Many tools provide means to create user-specific rule sets.  The grouping by defect categories, ranking and setting priorities help with defect systematization.
Commercial tools ,[object Object],[object Object],[object Object],[object Object]
RSA editions ,[object Object]
Free automated code analysis tools   ,[object Object],[object Object],[object Object],[object Object],[object Object]
FindBugs Eclipse plug-in
FindBugs: sample diagnostics report ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Stacking up FindBugs to IBM Software Analyzer  In comparison with IBM Software Analyzer, FindBugs, out of the box, definitely lacks such features as Visual Summary and PDF reports as well as some additional features.  Some developers would argue that FindBugs offers plenty of information in a way that lends itself to report generation in any imaginable format.   RSA offers an array of features that have their own specific audiences, e.g. the Java Architectural Discovery feature helps identify design patterns used in the project (e.g. Singleton or Factory method).
Stacking up FindBugs to IBM Software Analyzer (cont’d) Extensive Java metrics section of RSA offers a wide range of various heuristic-based ratios (e.g. lack of cohesion) the usefulness of some of which remains to be seen:
Stacking up FindBugs to IBM Software Analyzer (cont’d) When it comes to the hard-core functionality, FindBugs provides better diagnostics and easier result extraction (e.g. copying the results in the flat text format in the clipboard).  For example, the following sub-optimal creation of an instance of a Long number:  Long longWeekEndDays = new Long (3); was identified by both products.   IBM’s RSA gives the following recommendation:  Avoid instantiating a Number using new FindBugs goes farther by advising on action required: inefficient new Long(long) constructor; use Long.valueOf(long) instead
Causes for performance issues
Runtime metrics check: Window’s perfmon ,[object Object]
Runtime metrics check: JDK’s JConsole ,[object Object]
JDK’s VisualVM ,[object Object]
Runtime metrics check:  WebSphere Tivoli Performance Viewer
Tivoli metrics (sample) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Q &
Thank you!

More Related Content

What's hot

YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
Yury M
 
Gui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paperGui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paper
Izzat Alsmadi
 
Manual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answersManual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answers
Sachin Gupta
 
documentation-testing.ppt
documentation-testing.pptdocumentation-testing.ppt
documentation-testing.ppt
Gaurav Nigam
 
Testing terms & definitions
Testing terms & definitionsTesting terms & definitions
Testing terms & definitions
Sachin MK
 

What's hot (20)

White box & black box testing
White box & black box testingWhite box & black box testing
White box & black box testing
 
nullcon 2011 - Fuzzing with Complexities
nullcon 2011 - Fuzzing with Complexitiesnullcon 2011 - Fuzzing with Complexities
nullcon 2011 - Fuzzing with Complexities
 
test
testtest
test
 
Manual Testing.
Manual Testing.Manual Testing.
Manual Testing.
 
Automation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in HyderabadAutomation testing by Durgasoft in Hyderabad
Automation testing by Durgasoft in Hyderabad
 
Software coding and testing
Software coding and testingSoftware coding and testing
Software coding and testing
 
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
 
Manual testing visonia
Manual testing   visoniaManual testing   visonia
Manual testing visonia
 
07 Outsource To India Independent Testing
07 Outsource To India Independent Testing07 Outsource To India Independent Testing
07 Outsource To India Independent Testing
 
Importance of Software testing in SDLC and Agile
Importance of Software testing in SDLC and AgileImportance of Software testing in SDLC and Agile
Importance of Software testing in SDLC and Agile
 
9. Software Implementation
9. Software Implementation9. Software Implementation
9. Software Implementation
 
Gui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paperGui path oriented test generation algorithms paper
Gui path oriented test generation algorithms paper
 
10. Software testing overview
10. Software testing overview10. Software testing overview
10. Software testing overview
 
Manual testing
Manual testingManual testing
Manual testing
 
Model-Based Testing: Theory and Practice. Keynote @ MoTiP (ISSRE) 2012.
Model-Based Testing: Theory and Practice. Keynote @ MoTiP (ISSRE) 2012.Model-Based Testing: Theory and Practice. Keynote @ MoTiP (ISSRE) 2012.
Model-Based Testing: Theory and Practice. Keynote @ MoTiP (ISSRE) 2012.
 
Software coding & testing, software engineering
Software coding & testing, software engineeringSoftware coding & testing, software engineering
Software coding & testing, software engineering
 
Manual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answersManual software-testing-interview-questions-with-answers
Manual software-testing-interview-questions-with-answers
 
documentation-testing.ppt
documentation-testing.pptdocumentation-testing.ppt
documentation-testing.ppt
 
Softwareenggineering lab manual
Softwareenggineering lab manualSoftwareenggineering lab manual
Softwareenggineering lab manual
 
Testing terms & definitions
Testing terms & definitionsTesting terms & definitions
Testing terms & definitions
 

Viewers also liked

Preemptive Error Detection with FindBugs
Preemptive Error Detection with FindBugsPreemptive Error Detection with FindBugs
Preemptive Error Detection with FindBugs
Guo Albert
 
Finding bugs that matter with Findbugs
Finding bugs that matter with FindbugsFinding bugs that matter with Findbugs
Finding bugs that matter with Findbugs
Carol McDonald
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality Tools
Orest Ivasiv
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
SlideShare
 

Viewers also liked (10)

Preemptive Error Detection with FindBugs
Preemptive Error Detection with FindBugsPreemptive Error Detection with FindBugs
Preemptive Error Detection with FindBugs
 
Finding bugs that matter with Findbugs
Finding bugs that matter with FindbugsFinding bugs that matter with Findbugs
Finding bugs that matter with Findbugs
 
Introduction to FindBugs
Introduction to FindBugsIntroduction to FindBugs
Introduction to FindBugs
 
Story behind PF 2016
Story behind PF 2016Story behind PF 2016
Story behind PF 2016
 
C language in our world 2016
C language in our world 2016C language in our world 2016
C language in our world 2016
 
Java Code Quality Tools
Java Code Quality ToolsJava Code Quality Tools
Java Code Quality Tools
 
Tracking and improving software quality with SonarQube
Tracking and improving software quality with SonarQubeTracking and improving software quality with SonarQube
Tracking and improving software quality with SonarQube
 
ATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven DevelopmentATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven Development
 
Development of Mobile Applications
Development of Mobile ApplicationsDevelopment of Mobile Applications
Development of Mobile Applications
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
 

Similar to Ensuring code quality

Code Review
Code ReviewCode Review
Code Review
Ravi Raj
 
Different Methodologies For Testing Web Application Testing
Different Methodologies For Testing Web Application TestingDifferent Methodologies For Testing Web Application Testing
Different Methodologies For Testing Web Application Testing
Rachel Davis
 
Agile Engineering
Agile EngineeringAgile Engineering
Agile Engineering
John Lewis
 

Similar to Ensuring code quality (20)

Unit iv
Unit ivUnit iv
Unit iv
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
 
Part5 - enforcing coding standard and best practices with jas forge v1.0
Part5 -  enforcing coding standard and best practices with jas forge v1.0Part5 -  enforcing coding standard and best practices with jas forge v1.0
Part5 - enforcing coding standard and best practices with jas forge v1.0
 
Maturity of-code-mgmt-2016-04-06
Maturity of-code-mgmt-2016-04-06Maturity of-code-mgmt-2016-04-06
Maturity of-code-mgmt-2016-04-06
 
Jagrat_Mankad
Jagrat_MankadJagrat_Mankad
Jagrat_Mankad
 
7a Good Programming Practice.pptx
7a Good Programming Practice.pptx7a Good Programming Practice.pptx
7a Good Programming Practice.pptx
 
Qa analyst training
Qa analyst training Qa analyst training
Qa analyst training
 
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
Parasoft .TEST, Write better C# Code Using  Data Flow Analysis Parasoft .TEST, Write better C# Code Using  Data Flow Analysis
Parasoft .TEST, Write better C# Code Using Data Flow Analysis
 
Sanjeevi's SDLC Guest Lecture in Anna University campus at AU-PERS Centre (Ye...
Sanjeevi's SDLC Guest Lecture in Anna University campus at AU-PERS Centre (Ye...Sanjeevi's SDLC Guest Lecture in Anna University campus at AU-PERS Centre (Ye...
Sanjeevi's SDLC Guest Lecture in Anna University campus at AU-PERS Centre (Ye...
 
Code Review
Code ReviewCode Review
Code Review
 
Gcs day1
Gcs day1Gcs day1
Gcs day1
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure
 
software engineering
 software engineering software engineering
software engineering
 
Different Methodologies For Testing Web Application Testing
Different Methodologies For Testing Web Application TestingDifferent Methodologies For Testing Web Application Testing
Different Methodologies For Testing Web Application Testing
 
Open Source Software Testing Tools
Open Source Software Testing ToolsOpen Source Software Testing Tools
Open Source Software Testing Tools
 
Testing fundamentals
Testing fundamentalsTesting fundamentals
Testing fundamentals
 
Increasing Quality with DevOps
Increasing Quality with DevOpsIncreasing Quality with DevOps
Increasing Quality with DevOps
 
Agile Engineering
Agile EngineeringAgile Engineering
Agile Engineering
 
16346915.ppt
16346915.ppt16346915.ppt
16346915.ppt
 
Successful Software Projects - What you need to consider
Successful Software Projects - What you need to considerSuccessful Software Projects - What you need to consider
Successful Software Projects - What you need to consider
 

Recently uploaded

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Christopher Logan Kennedy
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Ensuring code quality

  • 1. Ensuring high code quality in Java development : tools and procedures Presented by Mikhail Vladimirov (Leximera, Inc. http://www.leximera.com) June, 2010
  • 2. The overall goal of IT governance is to avoid project failures, minimize the number of situations requiring “remediation” initiatives and maximize ROI in IT.   With the existing trend to outsource (inshore and outshore) the IT development function, corporations are adopting more strict IT governance and compliance policies.   Promotion of efficient and effective IT controls in design and development help achieve some of the IT governance goals. The need for strict IT governance
  • 3. Enforcing SDLC standard’s provisions IT governance is ensured, among other things, by enforcing the Corporate Software Development Life Cycle (SDLC) standard. The Build phase of the SDLC standard includes such activities as code reviews and unit testing.
  • 4.
  • 5.
  • 6.
  • 7. Unit testing is an integral part of SDLC Unit tests are written contracts that individual units of new or modified/re-factored code must satisfy (work as per software design specification). Creating unit tests in parallel with code (or even ahead of it) leads to the creation of more maintainable and functional code. It also helps reduce uncertainty of the code correctness early in the Build phase of the SDLC. Unit tests document the behaviour of the system by showing the inputs/outputs and the API in action.
  • 8. Unit testing: extending scope JUnit is the standard automated testing framework used in Java development. This system is normally supplemented by such testing toolkits as JMockit and EasyMock which can be used to augment simple unit tests and build a solid platform for Test-Driven Development.
  • 9. Multithreaded unit tests One of the areas JUnit doesn't cover is that of multithreaded unit tests, which are absolutely needed, for instance, to verify thread-safety of the new piece of code or a 3 rd party module / library.
  • 10. Unit testing of thread-safety
  • 11.
  • 12. Code coverage activity Code coverage tools report the percentage of code accessed during testing and provide code metrics at the class , method , line or basic block level that can help identify un-used/unreachable code. Un-used (e.g. legacy) code (normally shown in red in reports) can be potentially safely removed (if the complete test suites were run against it) or additional tests be created. The “greener” are the code coverage reports, the better code coverage is provided by the existing tests.
  • 13. Code Coverage Activity (cont’d) Cobertura generated HTML report
  • 14. Code Coverage Activity (cont’d) Eclipsed-based EMMA generated report (can also be exported into the HTML format)
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. Code management in modern IDEs Modern Integrated Development Environments (IDE), e.g. Eclipse, IntelliJ, NetBeans used for development on Java™ platform offer a powerful code management toolset that can do real-time syntax checking, on-demand re-factoring, formatting and more. For example, IDEs will generate visual clues to help developer see some code defects right away as they are typing. Eclipse, for instance, will underline the code that declares a variables but never uses it: Or even identify a possible null pointer situation that may happen at run-time:
  • 21. Enforcing coding standard and guidelines: Code Formatting Template The compliance with coding standards is, in part, ensured by using a uniform code formatting template (which meets formatting guidelines, e.g. line length, size/type of the indent, comments, java statements layout, etc.) by all developers on the project. First, the template file meeting the standard’s criteria is created end exported (a one-time exercise), then the template file is cascaded to project developers who import and use it in their IDEs.
  • 22. Automated code inspection and analysis This exercise is mostly done via static code analysis tools that inspect program’s source code or generated byte-code and compare extracted elements against the repository of known defective code patterns. Static analysis solutions not only detect but in many cases offer corrective actions to fix coding problems. A good analyzer should have a good ratio of real issues count to the number of (usually harmless) warnings. Many tools provide means to create user-specific rule sets. The grouping by defect categories, ranking and setting priorities help with defect systematization.
  • 23.
  • 24.
  • 25.
  • 27.
  • 28. Stacking up FindBugs to IBM Software Analyzer In comparison with IBM Software Analyzer, FindBugs, out of the box, definitely lacks such features as Visual Summary and PDF reports as well as some additional features. Some developers would argue that FindBugs offers plenty of information in a way that lends itself to report generation in any imaginable format. RSA offers an array of features that have their own specific audiences, e.g. the Java Architectural Discovery feature helps identify design patterns used in the project (e.g. Singleton or Factory method).
  • 29. Stacking up FindBugs to IBM Software Analyzer (cont’d) Extensive Java metrics section of RSA offers a wide range of various heuristic-based ratios (e.g. lack of cohesion) the usefulness of some of which remains to be seen:
  • 30. Stacking up FindBugs to IBM Software Analyzer (cont’d) When it comes to the hard-core functionality, FindBugs provides better diagnostics and easier result extraction (e.g. copying the results in the flat text format in the clipboard). For example, the following sub-optimal creation of an instance of a Long number: Long longWeekEndDays = new Long (3); was identified by both products. IBM’s RSA gives the following recommendation: Avoid instantiating a Number using new FindBugs goes farther by advising on action required: inefficient new Long(long) constructor; use Long.valueOf(long) instead
  • 32.
  • 33.
  • 34.
  • 35. Runtime metrics check: WebSphere Tivoli Performance Viewer
  • 36.
  • 37. A Q &