• Share
  • Email
  • Embed
  • Like
  • Private Content
Analyzing and Improving CA 2E and CA Plex Code Quality
 

Analyzing and Improving CA 2E and CA Plex Code Quality

on

  • 1,562 views

CA 2E and CA Plex applications are very often large and ...

CA 2E and CA Plex applications are very often large and
complex, encompass multiple platforms and languages, and millions of lines of code. It is often difficult to assess code quality, and even harder to make meaningful improvements. This situation results in excessive maintenance costs. In this presentation we look at the use of automated tooling to calculate complexity metrics, located dead code, detect/remove cloned code, and more. We will be using actual CA Plex and CA 2E examples in the demonstration portion.

Statistics

Views

Total Views
1,562
Views on SlideShare
1,142
Embed Views
420

Actions

Likes
0
Downloads
6
Comments
0

3 Embeds 420

http://synonca2e.cmfirsttech.com 331
http://synonca2e.cmfirstgroup.com 76
http://www.marklschroeder.com 13

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Analyzing and Improving CA 2E and CA Plex Code Quality Analyzing and Improving CA 2E and CA Plex Code Quality Presentation Transcript

    • Analyzing and Improving CA 2E/Plex Code Quality John Rhodes Charles WiltCopyright 201x
    • Code Quality in CA Plex/2E• Discussion on the forums• Strong interest on very large code bases• Not so much on CA 2E / Plex – Why? • Lack of tools could be the primary reason. • Lack of knowledge• Presenting Ideas and some concrete progress • Interested in collaboration Copyright 201x Copyright 201x CM First 2
    • Genesis of the idea • CA Repository project • Code comprehension of 250M source code base • Metrics / Clones • Community Interest • Charles WiltCopyright 201x 3
    • Warning - work in progressCopyright 201x 4
    • Why is “code quality” important?Copyright 201x
    • Basic Premise • There is a cost to “own” a line of code • 60-80% of lifecycle cost • Complex code costs more to maintain, Duplicate code is a burden • Shortcuts have costsCopyright 201x 6
    • The Problem Code comprehension of complex systems Impossible to manually analyze large software programs:Code • How is the maintainability – especially on legacy/old code • New analysts – don’t have the Copyright 201x history with the code
    • Overall Solution Automated fact extraction Management Extract Domain Expert Facts External Analysis Expert (rules) Metadata repositoryCopyright 201x
    • 2E Analysis Extract Source Facts Derive Analysis Value Metrics Clones 2E AD X-Analysis Reports Ad-hocRPG, Cobol? Copyright 201x
    • Plex AnalysisSource Stella Extract Derive Analysis Value Tools Facts Metrics ClonesPlex AD DMS Reports Ad-hocJava, C#, C++ Copyright 201x
    • What do you get?Copyright 201x
    • Complexity MetricsMeasure of MaintainabilityCalculated in many IDE’sCyclomatic / Halstead /Maintainability IndexVisual Studio Example -> Copyright 201x
    • Cyclomatic Complexity Metrics if( c1() ) The cyclomatic complexity of the f1(); program is 3 (as the strongly else connected graph for the f2(); program contains 9 edges, 7 if( c2() nodes and 1 connected ) f3(); component) (9-7+1). else f4(); Good Score < 10-15 Copyright 201x
    • Complexity Metrics http://en.wikipedia.org/wiki/Cyclomatic_complexity Enerjy analyzed classes of open-source Java applications and divided them into two sets based on how commonly faults werefound in them. They found strong correlation between cyclomatic complexity and their faultiness, with classes with a combined complexity of 11 having a probability of being fault-prone of just 0.28, rising to 0.98 for classes with a complexity of 74.[ Copyright 201x
    • Clone Detection and Removal• Programmer productivity: Copy/paste/edit • (everybody does it) • typical program > 10% cloned code• Long term maintenance problem • bug reuse • Did I change all the copies? (“What copies?”)• Need to manage clones • locate them • revise/remove Copyright 201x
    • Case Study: Salion (CRM) • Java Application: Core + 6 Customer variants • CloneDR runs every quarter; active clone removal by development team • Total SLOC reduction over time: ~40% “Most of the drop in the source code graph (core) is due to clone detection removal.” Dale Churchett, Architect Core Code Trend Analysis Custom Code Trend 600000 120000 500000 100000 400000 80000Lines Of Code Lines Of Code 300000 60000 200000 40000 100000 20000 0 0 v1_5 v1_6 v1_7 v1_8 v1_9 v1_9r1 v1_9r2 v1_10 v1_11 v1_12 v1_12_1 v1_13 v1_14 v1_15 v1_16 TRUNK v1_5 v1_6 v1_7 v1_8 v1_9 v1_9r1 v1_9r2 v1_10 v1_11 v1_12 v1_12_1 v1_13 v1_14 v1_15 v1_16 TRUNK Release Tag Release Tag Copyright 201x
    • Initial ResultsCopyright 201x
    • 2E Analysis • Metrics Possible • Internal Functions / SCM Correlation?Copyright 201x 18
    • 2E AnalysisCopyright 201x 19
    • Plex Analysis • Metrics Demonstrable • Internal Functions and correlation to SCM? • Clones – FutureCopyright 201x 20
    • Plex Analysis - CintasSource Code Comment Blank Cyclomatic Halstead Filename Lines Lines Lines Lines Complexity Complexity C:/Documents and Settings/C1162332/My Documents/Plex/StellaTool Exports/ExportLargeProperty/Function/Function FirstAid Divisional KPI.Divisional KPI Report.Print Divisional KPI 1884 1884 0 0 497 4595350.5 Report.TXT C:/Documents and Settings/C1162332/My Documents/Plex/StellaTool 4618 4616 2 0 214 1.34E+07 Exports/ExportLargeProperty/Function/Function FirstAid Fire Invoice.Data.Header.Print Customer Invoice.TXT C:/Documents and Settings/C1162332/My Documents/Plex/StellaTool 2487 2479 7 2 204 4713399.5 Exports/ExportLargeProperty/Function/Function FirstAid Invoice Header.Print attributes.Invoice Print.TXT C:/Documents and Settings/C1162332/My Documents/Plex/StellaTool Exports/ExportLargeProperty/Function/Function FirstAid Work Order Header.Customer Service Sheets.Print 3161 3158 3 0 199 7425025 Customer Service Sheets.TXT C:/Documents and Settings/C1162332/My Documents/Plex/StellaTool Exports/ExportLargeProperty/Function/Function FirstAid Divisional KPI.Divisional KPI Report.Pmt Divisional KPI 1173 1172 1 0 184 1837039.2 Report.TXT C:/Documents and Settings/C1162332/My Documents/Plex/StellaTool Exports/ExportLargeProperty/Function/Function FirstAid New Business Report.TSR Sales and Commission 1430 1414 29 5 173 4855147.5 Report.Print Fire Sales and Commission.TXT C:/Documents and Settings/C1162332/My Documents/Plex/StellaTool Exports/ExportLargeProperty/Function/Function FirstAid Customer.Data.Master.Maintenance suite.Change user 2247 2241 6 0 170 3829034.5 interface.TXT C:/Documents and Settings/C1162332/My Documents/Plex/StellaTool Exports/ExportLargeProperty/Function/Function FirstAid Customer.Data.Delivery Information.Maintenance 2747 2732 14 1 166 8507429 suite.Change user interface.TXT C:/Documents and Settings/C1162332/My Documents/Plex/StellaTool 1318 1316 2 0 165 2103735 Exports/ExportLargeProperty/Function/Function FirstAid Fire Invoice.UI.DetailMaint.Change Service Visit Item.TXT Copyright 201x 21
    • Plex AnalysisCopyright 201x 22
    • Demo of processCopyright 201x
    • Interested?• Trial / Alpha version of CA Plex tool• Databorough Trial Version• Thread on CA Forum• Ideas? jdrhodes@cmfirsttech.com Charles.wilt@gmail.com Copyright 201x