Presentation is loading. Please wait.

Presentation is loading. Please wait.

Alexander Serebrenik, Serguei Roubtsov LaQuSo & SET

Similar presentations


Presentation on theme: "Alexander Serebrenik, Serguei Roubtsov LaQuSo & SET"— Presentation transcript:

1 Alexander Serebrenik, Serguei Roubtsov LaQuSo & SET
Assessing Software Maintainability with Visual Analytics: SQuAVisiT Experience Alexander Serebrenik, Serguei Roubtsov LaQuSo & SET

2 Real life industrial systems
They are often: Not only OO (e.g., legacy systems) Heterogeneous (C/Assembler, Cobol/PL SQL,…) Incomplete (some code is in libraries and third-party components) Not compilable and executable within analysis environment ( ‘weird’ OS, proprietary development environment, …) / LaQuSo / Mathematics & Computer Science

3 Goal: Maintainability assessment
Maintenance is a problem 2007, US companies spent 100 billion US$ In some Dutch companies: 60-80% of the budget / LaQuSo / Mathematics & Computer Science

4 What code is hard to maintain?
Badly understandable not documented cluttered or inconsistently used/developed code too big Badly modifiable code is duplicated code is intertwined code is non-extendable code is non-portable Badly testable / analysable code is too complex / LaQuSo / Mathematics & Computer Science

5 Approaches Typical approaches Problems with Analyze + Visualize
“Pretty pictures”: do not convey meaning “Ugly pictures”: do not scale “One to rule them all”: rigid architectures Different tools provide different insights! / LaQuSo / Mathematics & Computer Science

6 Visual Software Analytics = Analysis + Visualisation + Flexibility
Our approach Visual Software Analytics = Analysis + Visualisation + Flexibility AV Repository (2) (3) (4) (1) Name, Class Count, Abstract Class Count, Ca, Ce, A, I, D, V: com.caucho.burlap.client,0,0,1,0,0,0,1,1 com.caucho.burlap.io,0,0,1,0,0,0,1,1 bsh,0,0,1,0,0,0,1,1 com.ibatis.common.util,0,0,1,0,0,0,1,1 oracle.toplink.exceptions,0,0,2,0,0,0,1,1 oracle.toplink.essentials.sessions,0,0,1,0,0,0,1,1 com.caucho.hessian.server,0,0,1,0,0,0,1,1 com.caucho.hessian.io,0,0,1,0,0,0,1,1 com.caucho.burlap.server,0,0,1,0,0,0,1,1 com.caucho.hessian.client,0,0,1,0,0,0,1,1 oracle.toplink.internal.databaseaccess,0,0,1,0,0,0,1,1 oracle.toplink.expressions,0,0,1,0,0,0,1,1 oracle.toplink.sessionbroker,0,0,1,0,0,0,1,1 oracle.toplink.sessions,0,0,2,0,0,0,1,1 oracle.toplink.threetier,0,0,1,0,0,0,1,1 oracle.toplink.queryframework,0,0,1,0,0,0,1,1 oracle.toplink.jndi,0,0,1,0,0,0,1,1 oracle.toplink.logging,0,0,1,0,0,0,1,1 oracle.toplink.publicinterface,0,0,2,0,0,0,1,1 oracle.toplink.tools.sessionconfiguration,0,0,1,0,0,0,1,1 org.apache.catalina.loader,0,0,1,0,0,0,1,1 org.aspectj.weaver,0,0,2,0,0,0,1,1 org.aspectj.weaver.ast,0,0,1,0,0,0,1,1 org.apache.axis.encoding.ser,0,0,1,0,0,0,1,1 org.aopalliance.intercept,0,0,24,0,0,0,1,1 oracle.toplink.tools.sessionmanagement,0,0,1,0,0,0,1,1 org.aopalliance.aop,0,0,9,0,0,0,1,1 org.quartz.spi,0,0,1,0,0,0,1,1 org.aspectj.weaver.loadtime,0,0,1,0,0,0,1,1 org.aspectj.weaver.bcel,0,0,1,0,0,0,1,1 org.aspectj.weaver.internal.tools,0,0,1,0,0,0,1,1 org.quartz.utils,0,0,1,0,0,0,1,1 org.springframework.aop,24,20,17,6,0,83,0,26,0,09,1 org.quartz.xml,0,0,1,0,0,0,1,1 org.springframework.jdbc.core,53,20,6,20,0,38,0,77,0,15,1 org.springframework.jdbc.core.metadata,22,2,1,10,0,09,0,91,0,1 org.springframework.aop.config,17,3,1,15,0,18,0,94,0,11,1 org.springframework.aop.framework,37,9,22,18,0,24,0,45,0,31,1 org.springframework.aop.aspectj,39,7,3,24,0,18,0,89,0,07,1 org.springframework.aop.aspectj.annotation,27,3,0,19,0,11,1,0,11,1 org.springframework.aop.aspectj.autoproxy,3,0,1,8,0,0,89,0,11,1 org.springframework.jdbc.object,14,8,0,12,0,57,1,0,57,1 org.springframework.jdbc.support.incrementer,15,4,0,8,0,27,1,0,27,1 org.springframework.jdbc.datasource.lookup,8,2,2,13,0,25,0,87,0,12,1 org.springframework.jdbc.support,15,5,12,16,0,33,0,57,0,1,1 org.springframework.jdbc.datasource,27,7,13,14,0,26,0,52,0,22,1 org.springframework.jdbc.core.support,8,5,2,14,0,62,0,88,0,5,1 org.springframework.jdbc.core.namedparam,10,4,3,12,0,4,0,8,0,2,1 org.springframework.jdbc.core.simple,17,6,0,12,0,35,1,0,35,1 org.springframework.web.servlet.view.xslt,4,2,0,17,0,5,1,0,5,1 org.springframework.web.struts,16,5,0,22,0,31,1,0,31,1 org.springframework.jdbc.support.xml,7,6,0,7,0,86,1,0,86,1 org.springframework.jdbc.support.rowset,4,2,2,6,0,5,0,75,0,25,1 org.springframework.jdbc.support.nativejdbc,10,2,2,7,0,2,0,78,0,02,1 org.springframework.jdbc.support.lob,18,5,5,12,0,28,0,71,0,02,1 org.xml.sax,0,0,3,0,0,0,1,1 org.springframework.web.util,24,6,26,15,0,25,0,37,0,38,1 org.w3c.dom,0,0,12,0,0,0,1,1 / LaQuSo / Mathematics & Computer Science

7 SQuAVisiT Flexible Languages Analysis tools Visualization tools
Plug-in architecture Languages C, Cobol, Java, JavaScript, PL/SQL Analysis tools dependency extractors, duplication detectors, error detectors, metrics calculators, parsers, style checkers Visualization tools Gemini, GraphViz, ExTraVis (thank you Danny!), MatrixZoom, MetricsView / LaQuSo / Mathematics & Computer Science

8 1000 facets of visual analytics based on LaQuSo case studies
/ LaQuSo / Mathematics & Computer Science

9 LaQuSo? / LaQuSo / Mathematics & Computer Science

10 Industrial cases Usually up to 2 weeks analysis time
Range from 150 KLOC to 1.7 MLOC Homogeneous and heterogeneous Customers usually report problems experienced: Need to migrate due to discontinuation of support by a third party Danger of architecture deterioration due to extensive change Lack of knowledge due to high degree of staff rotation Maintenance (dis)continuation decision As an illustration we discuss only some of the analyses carried out in each case. / LaQuSo / Mathematics & Computer Science

11 Overview of industrial cases
Expert system Emb. system Front-end Pension fund Size (KLOC) 300 (JavaScript, C++, Java, PL SQL, Cobol) 150 (C) 700 (Java, J2EE platform) 1700 (Cobol, PL SQL) Age (years) 15 6 Not yet in use 17 Analyses shown Dependencies, duplication Dependencies OO metrics Dead code Visualization / LaQuSo / Mathematics & Computer Science

12 Industrial case: Insurance company’s expert system
What kind of system do we have? Heterogeneous: Javascript, PL/SQL, C++, Java, Cobol Medium size: 300 KLOC 15 years old Scarce documentation Oracle DB Problem reported Maintenance (dis)continuation decision Expert system / LaQuSo / Mathematics & Computer Science

13 Dependencies Model: Matrix View
Data layer (Almost) layered: good design BUT data layer is accessed from several layers Layers affected by calls from top layer are visible (red squares) What are the maintenance implications of this figure? Do not support the green parts! / LaQuSo / Mathematics & Computer Science

14 Dependencies Model: Extravis
Absence of dedicated data access layer is confirmed HTTP is called only internally Green ‘bubbles’: controversial coding approach Parameters as names f(1,3) -> f_1_3 / LaQuSo / Mathematics & Computer Science

15 Code duplication model: CCFinder/Gemini
PL/SQL part Code is polluted with duplication: restructuring would improve maintainability but may change the architecture PL/SQL Upper corner: tlp00000 and variants Next tlp0040 (diacritics elimination conversions) Next tlp21200 vs tlp61200 Next tlp21400 and variants (central group) / LaQuSo / Mathematics & Computer Science

16 What can we conclude? Layered architecture
System is well-structured Controversial coding practices But locally well-documented (not shown here) Code polluted by duplication Low impact if no major changes are expected Conclusions: Maintain for limited amount of time (3-5 years) Encourage knowledge sharing Develop overview documentation / LaQuSo / Mathematics & Computer Science

17 Assessment required multiple analyses and visualizations:
Case conclusions Assessment required multiple analyses and visualizations: Dependencies Code duplication and in fact even more Different techniques provide different insights! / LaQuSo / Mathematics & Computer Science

18 Industrial case: Embedded System
What kind of code do we have? C with embedded Assembler Complete Modules of interest can be parsed Medium size: 150 KLOC No documentation Problems reported Danger of architecture deterioration due to extensive change. Developer’s assumption Layered architecture / LaQuSo / Mathematics & Computer Science

19 Dependencies Structure
system is poorly layered unexpected cross-dependencies exist between components / LaQuSo / Mathematics & Computer Science

20 What kind of system do we have?
Industrial case: Insurance company’s front-end What kind of system do we have? Technical data Homogeneous: Java Large: 750 KLOC Oracle DB J2EE (Spring Framework) Recently developed by a third party No documentation Code was not available for our inspection (black box) Expert system / LaQuSo / Mathematics & Computer Science

21 Code not available? What can we do?
Customer SQuAVisiT Install locally. Perform measurements. Tune results Analyse, interpret. report / LaQuSo / Mathematics & Computer Science

22 Understandability: Documentation
No technical documentation available. Comments percentage Average: 43% Ranging from 0% to 1500%. Why? large repeated header blocks of comments commented out code Javadoc 85260 violations Missing or malformed declarations Documentation generation is impossible, or Documentation quality is compromised Documentation quality should be reassessed! / LaQuSo / Mathematics & Computer Science

23 Object-Oriented Metrics for Packages
Abstractness of a package P: ease of inheritance A = #abstract classes in P/#classes in P Instability of a package P: ease of change I = Ce/(Ce + Ca) Efferent coupling (Ce) #packages P depends upon Afferent coupling (Ca) #packages dependent upon P / LaQuSo / Mathematics & Computer Science

24 Modification: Abstractness and Instability
Imbalance is significant Implementation classes Zone of uselessness: lack of dependencies on them 1 Instability (I) Interface classes Zone of pain: hard to change 1 Abstractness (A) / LaQuSo / Mathematics & Computer Science

25 Modification: Abstractness and Instability
Normalized distance = |Abstractness – Instability + 1| Purple – the application, yellow – Spring The application is better! / LaQuSo / Mathematics & Computer Science

26 Object-Oriented Metrics for Classes
WMC – here: number of methods per class DIT – depth of inheritance tree NOC – number of children CBO – number of classes related to a given class RFC – number of different methods that can be executed when a method of the class is invoked / LaQuSo / Mathematics & Computer Science

27 Closer look: Depth of Inheritance
50%of classes with inheritance depth 0. Lack of reuse via inheritance. / LaQuSo / Mathematics & Computer Science

28 Closer look: coupling between objects
CBO = Average #classes related to the given NASA High Quality NASA Low Quality Spring Framework Loan Path 1.25 2.48 4.45 6.83 Average coupling is too high! Reduce dependencies / LaQuSo / Mathematics & Computer Science

29 What have we seen? Understandable not documented Modification
No documentation. Poor Javadoc. Commented out code suspected. Modification intertwined Coupling between objects abstractness instability Better than Spring but improvement possible. inheritance DIT low. Lack of reuse. Architecture is suboptimal Documentation should be reassessed / LaQuSo / Mathematics & Computer Science

30 Recall: we have not seen the code!
Case conclusions Recall: we have not seen the code! Black box analysis Metrics provide valuable insights in software quality Assessment results were confirmed by the customer / LaQuSo / Mathematics & Computer Science

31 Industrial case: Pension fund
What kind of system do we have? Homogeneous: Cobol Large: 1.7 MLOC 17 years old Oracle DB Problem reported Need to migrate due to discontinuation of support / LaQuSo / Mathematics & Computer Science

32 “Empty spaces” in the visualization
Dead code? “Empty spaces” in the visualization 1216 modules not called by other modules Dead code? Other (sub)systems? ~600 are dead Confirmed by the developers / LaQuSo / Mathematics & Computer Science

33 Conclusions Visual software analytics = assessment supported by visualization, analysis and tool flexibility SQuAVisiT is a flexible tool allowing To analyse different languages To address different maintainability aspects To combine different analysis and visualization techniques In practice, SQuAVisiT supported analysis of Middle-size to large systems (150 KLOC – 1.7 MLOC) Short amount of time: days Even black box! / LaQuSo / Mathematics & Computer Science


Download ppt "Alexander Serebrenik, Serguei Roubtsov LaQuSo & SET"

Similar presentations


Ads by Google