SlideShare une entreprise Scribd logo
1  sur  113
Static ABAP code
                                 Analysis
                      A Comparison of Tools with some kind of field report




Sonntag, 13. Mai 12                                                         1
Disclaimer

                • First talk at a SIT

                • Not a native English speaker

                • This presentation represents my personal
                  opinon and is not related to any company or
                  the single godly truth




Sonntag, 13. Mai 12                                             2
Agenda
                  •   Motivation
                  •   Tools for static ABAP code analysis
                      •   CAST Application Intelligence Plattform
                      •   VirtualForge CodeProfiler
                      •   SAP Code Inspector
                      •   Sonar ABAP Plug-in
                  •   Lessons Learned
                  •   Summary

Sonntag, 13. Mai 12                                                 3
Who am I?

                      • Markus Theilen
                      • Enterprise Architect at EWE ENERGIE AG
                      • before that Software Architect at BTC AG
                      • responsible for Customer Care and Billing
                        for Utilities



Sonntag, 13. Mai 12                                                 4
Motivation



Sonntag, 13. Mai 12                5
Background

                      • EWE does not use SAP IS-U for Customer
                        Care and Billing, but develops its own
                        solution: easy+
                      • Since 1995 this solution is built and
                        maintained by BTC AG on behalf of
                        EWE ENERGIE AG



Sonntag, 13. Mai 12                                              6
easy+
                      • Productive use since 1997
                      • Pure ABAP coding
                      • Today, about 100 people in development
                        and maintenance + 20 people in support
                      • used by EWE and about 10 public services
                        companies


Sonntag, 13. Mai 12                                                7
easy+: A few facts

                      • over 25 million invoices billed so far
                      • 8,8 TByte data volume
                      • 8.2 million lines of code
                      • 700 packages, 8,000 reports 6,000 classes
                      • 8,000 tables

Sonntag, 13. Mai 12                                                 8
Problems
                      •   Team size and fluctuation
                          leads to very
                          heterogenous knowledge
                          and skill set

                      •   Maintenance is getting
                          harder with each iteration

                      •   Too much code for
                          manual review of coding
                          guidelines



Sonntag, 13. Mai 12                                    9
Problems
                      •   With code size,
                          complexity can grow
                          exponentially

                      •   Code that looks locally
                          ok can lead to problems
                          when seen in its context
                          and call hierarchy

                      •   Complexity is too high
                          for manual checks



Sonntag, 13. Mai 12                                  10
Problems
                      •   No factual statements




                                                     ?
                          about code quality
                          possible

                      •   No direct indicators for
                          architects/management to
                          decide about where to
                          spend time and money to
                          correct the most urgent
                          problems first




Sonntag, 13. Mai 12                                      11
But #1 Problem is:

                       You do not know what
                      your problems are, until
                      you measure your code!



Sonntag, 13. Mai 12                              12
Use of static analysis

                      • Gives insight and leads you to your
                        problems
                      • Gives possibility to concentrate on hot
                        spots
                      • Base decisions on facts, not myths and
                        rumours!



Sonntag, 13. Mai 12                                               13
Use of static analysis
                      • tool-based analysis is cheaper than manual
                        reviews, but it comes with a price and is far
                        from being perfect!
                        • false positives, missed violations
                      • expect no solution for your problems,
                        tools just help to find and pinpoint them!
                      • only static information is examined,
                        mostly no dynamic aspects are covered!


Sonntag, 13. Mai 12                                                     14
What a tool should offer
                      • reliable rule engine
                      • definition of exceptions / false positives
                      • explanations of rules
                       • reasoning, good/bad examples
                      • seamless integration into development
                        cycle


Sonntag, 13. Mai 12                                                 15
The Tools



Sonntag, 13. Mai 12               16
CAST
                      Application Intelligence
                             Plattform
                         (in production)

Sonntag, 13. Mai 12                              17
What is it?
                      • developed by CAST, headquaters located in
                        France
                        • „world-wide leader in automated
                          application intelligence“
                      • not just a simple scanner-and-rules-engine,
                        but an application metadata knowledge
                        base


Sonntag, 13. Mai 12                                                   18
How it works
                      •   external scanning and analysis engine,
                          written in C++
                      •   transfer of source information via extraction
                          report and files
                      •   analysis of source code, mapping to common meta
                          model, creation of relations between objects
                          (calls, uses, etc.)
                      •   results are shown in dashboard web application
                          and in fat client for architecture analysis


Sonntag, 13. Mai 12                                                         19
How it works
                      • CAST uses a customisable hierarchy of
                        result aggregation
                       • health factors like robustness,
                          performance
                       • quality indicators like complexity,
                          programming practices, documentation
                       • quality metrics (basic rules)
Sonntag, 13. Mai 12                                              20
Health Factors Quality Indicators             Metrics
                                                          Metric1
                      Performance        Complexity
                                                          Metric2

                                                          Metric3

                                                          Metric4
                       Robustness        Architecture     Metric5

                                                          Metric6

                                                          Metric7

                         Security       Prog. Practice    Metric8

                                                          Metric9

                                                          Metric10

                                                          Metric11
                      Transferability    Conventions
                                                          Metric12

                                                          Metric13

                                                          Metric14
                      Changebility      Documentation
                                                          Metric15


Sonntag, 13. Mai 12                                                  21
CAST Application View
Sonntag, 13. Mai 12                           22
CAST Violation View
Sonntag, 13. Mai 12                         23
CAST Investigation View
Sonntag, 13. Mai 12                        24
CAST rule details
Sonntag, 13. Mai 12                       25
CAST Portfolio View
Sonntag, 13. Mai 12                         26
CAST Management Studio I
Sonntag, 13. Mai 12                         27
ERGEBNISSE APRIL-2012
                                                                                                               27. APRIL 2012
                                        Verletzungen pro kLOC                                                                                     Top 10 Verletzungen
                                                  Viol.     Diff.    Viol.     Diff.                                        Metrikname                                          Verletzungen        Gewichtet           Diff.
                          Themengebiet
                                                  krit      krit     Total     Total
                                                                                             Avoid unchecked return code (SY-SUBRC) after OPEN SQL…                                     15384         246144            2192
                      Abrechnen                   2,97      -0,01    30,61      0,00         Avoid undocumented Methods                                                                 28923         144615            1545
                      Accounting                  2,34      -0,01    47,34     -0,08         Avoid _SELECT *_ or _SELECT SINGLE *_ queries                                              15662         125296             528
                      Architektur                 2,91      -0,01    42,44      0,03         Avoid using literals in assignments (hardcoded values)                                     23646         118230             750
                      BusinessWarehouse           5,20       0,01    33,28      0,03         Avoid unreferenced Methods                                                                 23340         93360             2500
                      CustomerCare                2,62      -0,04    45,68      0,28         Avoid Methods with a very low comment/code ratio                                           23479         70437              528
                      Messen                      2,93       0,14    40,13      0,29         Avoid using LOOP INTO, use LOOP ASSIGNING instead                                          11518         69108              492
                      MPK                         1,88       0,01    50,43      0,18         Avoid missing WHEN OTHERS in CASE statements                                                6511         52088              360
                      OutputManagement            3,29       0,00    31,18     -0,01
                                                                                             Avoid Artifacts with a Complex SELECT Clause                                               7545           45270             162
                      Statistik                   3,44      -0,01    34,10     -0,22
                                                                                             Avoid Artifacts with High Cyclomatic Complexity                                            5028           40224            2624
                      easy+                       2,69       0,00    40,85      0,08
                                                                                            Die Tabelle zeigt die schwerwiegendsten Verletzungen des easy+. Neben der Verletzungsanzahl ist auch der gewichtete Wert dargestellt,
                      Diese Tabelle zeigt die Anzahl der kritischen Verletzungen und die    der für das Ranking ausschlaggebend ist.
                      Gesamtanzahl auf tausend Codezeilen innerhalb der Themengebiets.
                      Beispiel: Ein Viol.krit-Wert von 3 sagt aus, dass in tausend                          Gewichteter easy+-Qualitätswert und Abnahmestatus
                      Codezeilen im Durchschnitt 3 kritische Regelverletzungen vorliegen.
                                                                                                                Startwert        Aktuell         Diff.     Diff. %     Status
                                                  CAST Biggest Loser
                                                                                                                1388953          1402761        13808        0,99
                      Rang        Themengebiet            Startgewicht       Aktuell        Diff.(%)
                                                                                                           Diese Tabelle zeigt den aktuellen Status für das Quality Gate zum
                         1     Statistik                      220,13          218,92         -0,55         Abnahme- bzw. zum Systemintegrationstest (AT bzw. SIT). Ist der aktuelle
                                                                                                           Wert kleiner/gleich des Startwerts, ist der Status grün, sonst ist er rot.
                         2     Accounting                     258,62          258,10         -0,20
                                                                                                            Alles aufwachen, bitte!
                         3     Abrechnen                      210,84          210,72         -0,06
                                                                                                            Des entwicklungsarmen Releasestarts wegen, liegt die letzte CAST-Auswertung mittlerweile fast vier
                         4     OutputManagement               218,02          217,98         -0,02          Wochen zurück. Diese längere Pause bleibt allerdings künftig wieder die Ausnahme und so werdet Ihr ab
                         5     Architektur                    251,44          251,46         0,01           sofort wieder zwei-wöchentlich über den aktuellen Stand informiert.
                         6     CustomerCare                   270,70          270,97         0,10           Trotz des vergleichsweise geringen Entwicklungsumfangs in diesen ersten Wochen haben sich wieder
                         7     BusinessWarehouse              244,40          244,74         0,14           diverse Regelverletzungen eingeschlichen, die den Qualitäts-Startwert bereits um fast ein volles Prozent
                                                                                                            übersteigen. Spätestens mit diesem Flyer sollten alle Entwickler wieder darauf achten, die CAST-Regeln im
                         8     MPK                            262,63          263,25         0,24           Rahmen ihrer Entwicklung einzuhalten und vorhandene zu entfernen.
                         9     Messen                         252,94          255,03         0,82
                                                                                                            Das Rotlicht-Milieu zieht um
                               easy+                          243,70          243,90         0,08
                                                                                                            Mit den ersten vergleichbaren Biggest Loser-Zahlen seit Release 35/2 steht nun fest, dass sich das TG
                      Diese Tabelle zeigt das CAST Biggest Loser-Startgewicht gemessen am                   Business Warehouse nach einer neuen Zimmerbeleuchtung umsehen muss, denn die rote Laterne wechselt
                      Qualitätswert pro tausend Zeilen Quellcode für jedes Themengebiet.                    den Schreibtisch zu den Kollegen vom TG Messen.




                       CAST Monthly Flyer
Sonntag, 13. Mai 12                                                                                                                                                                                                                 28
Unique selling points
                      •   common meta model for development objects
                          and its relations
                      •   change impact analysis, support for cost
                          estimation, path finder along call stacks
                      •   cross technology analysis (Java, C#, C++, ABAP,
                          COBOL...)
                      •   management dashboard and longterm evaluation
                      •   layered, weighted aggregation of results


Sonntag, 13. Mai 12                                                         29
Drawbacks
                      •   speed of ABAP analysis (easy+: 14-17 h)
                      •   no sound ABAP know-how up to now
                      •   some unstable, heurisitic rules
                      •   big initial and ongoing invest
                          •   license, maintenance, education, administration
                      •   no integration in ABAP development cycle
                      •   sluggish support and information policy


Sonntag, 13. Mai 12                                                             30
Links

                      • Vendor homepage:
                        http://www.castsoftware.com
                      • Product homepage
                        http://www.castsoftware.com/products/
                        cast-application-intelligence-platform




Sonntag, 13. Mai 12                                              31
Virtual Forge
                        CodeProfiler
                      (in examination)


Sonntag, 13. Mai 12                      32
What is it?
                      • developed by Virtual Forge GmbH
                       • THE ABAP security experts
                      • scans ABAP code, checks against rules and
                        presents the results
                      • concentrates on ABAP analysis in security,
                        compliance, performance and robustness


Sonntag, 13. Mai 12                                                  33
How it works
                      • external scanning and analysis engine,
                        written in Java
                      • transfer of source information directly
                        via RFC or file-based
                      • results are generated as PDF or
                        shown in SAP (Tx „Finding Manager“)
                      • uses SAP BI for management views
Sonntag, 13. Mai 12                                               34
Ergebnisdarstellung in SAP
                      Finding Manager


                      PPT Masterfolie
                      zur Erstellung von Präsentationen




                      © 2011 Virtual Forge GmbH || www.virtualforge.com || All rights reserved.
                      © 2011 Virtual Forge GmbH www.virtualforge.com All rights reserved.




                                 Finding Manager
Sonntag, 13. Mai 12                                                                               35
2 Executive Summary




                         2 Executive Summary

                         The ABAP code has been analyzed with 100 test cases. 55 of those test cases yielded
                         findings, totaling 28825 findings. 1535 of them have been rated as critical. The findings are
                         distributed as follows:

                                                            Critical Findings                    Total Findings         # Analyzed
                           Test Domain
                                                           #                    ME           #               ME         Testcases

                         Security                               186                   N/A        3493             N/A           48

                         Compliance                             292                   N/A        2069             N/A            7

                         Performance                            938                   N/A        9148             N/A           19

                         Maintainability                            0                 N/A    10593                N/A           11

                         Robustness                             119                   N/A        3522             N/A           10

                         Data-Loss-                                 0                 N/A            0            N/A            5
                         Prevention
                         * ME = Mitigation Effort (N/A = Not completely configured)



                         Also, 0 countermeasures have been detected that have prevented additional security
                         findings. Please note that 0 findings have been manually suppressed by developers.

                         Some test cases are used for informational purposes only. These yielded 856 findings as a
                         basis for further analysis by experts.




                      Example PDF report
Sonntag, 13. Mai 12                                                                    -2-                                           36
Daten- und Kontrollflussanalyse


                      PPT Masterfolie
                                METHOD read



                      zur Erstellung von Präsentationen
                                   METHOD read .

                                    DATA: request         TYPE REF TO if_http_request.
                                                                                                   Input

                                                                                         request->get_form_field()
                                    DATA: s_html          TYPE string.
                                    DATA: event           TYPE string.                                               Stored in variable


                        1           s_html = request->get_form_field( 'mydata' ).

                                    CALL METHOD me->process
                                     EXPORTING
                        2             s_data = s_html.
                                     RETURN.
                                                                                                  s_html


                                   ENDMETHOD.                                                                        Passed on to another method and variable



                                METHOD process


                                   METHOD process .
                                                                                                  s_data
                                    DATA: s_out           TYPE string.
                                    DATA: out             TYPE REF TO if_bsp_writer.

                        3           CONCATENATE           `<b>`
                                                          s_data                                                     Modifed and copied to another variable
                                                          `</b>`
                                                          INTO s_out.

                                    out = me->get_previous_out( ).                                s_out


                        4           out->print_string( s_out ).

                                   ENDMETHOD.
                                                                                                  Output
                                                                                                                     Passed on to dangerous function
                                                                                             out->print_string()




                      © 2011 Virtual Forge GmbH || www.virtualforge.com || All rights reserved.
                      © 2011 Virtual Forge GmbH www.virtualforge.com All rights reserved.




                 Data / Control Flow Analysis
Sonntag, 13. Mai 12                                                                                                                                             37
Unique selling points
                      • Speed of analysis (easy+: 1.5 h)
                      • data and control flow analysis
                      • automated corrections possible
                      • superb rules in security domain
                      • sound integration in development cycle
                       • SE80, TMS, ChaRm, CTS(+)
Sonntag, 13. Mai 12                                              38
Drawbacks

                      • not that strong in code quality rules yet
                       • performance, maintenance, robustness
                      • no support for other languages than ABAP


Sonntag, 13. Mai 12                                                 39
Links

                      • Vendor homepage:
                        http://virtualforge.com/
                      • Product homepage:
                        http://virtualforge.com/index.php/en/
                        portfolio/codeprofiler.html
                      • Product Review from KuppingerCole

Sonntag, 13. Mai 12                                             40
SAP Code Inspector
                        (in production)


Sonntag, 13. Mai 12                        41
What is it?

                      • developed by SAP, in ABAP-OO
                      • scans ABAP code, checks against rules and
                        presents the results as tree or list
                      • integrated into every AS ABAP
                      • Transactions SCI and SCII

Sonntag, 13. Mai 12                                                 42
How it works

                      • internal scanning and rule checking,
                        implemented in ABAP-OO
                      • no need to transfer development objects, it
                        all stays in the system
                      • results can be analyzed in TX SCI

Sonntag, 13. Mai 12                                                   43
How it works




Sonntag, 13. Mai 12                  44
How it works




                              Check variant
                                (how?)




Sonntag, 13. Mai 12                           44
How it works




                       Object set   Check variant
                        (what?)       (how?)




Sonntag, 13. Mai 12                                 44
How it works
                                    Inspection




                      references                 references



                       Object set                Check variant
                        (what?)                    (how?)




Sonntag, 13. Mai 12                                              44
How it works
                                    Inspection


                                     Results




                      references                 references



                       Object set                Check variant
                        (what?)                    (how?)




Sonntag, 13. Mai 12                                              44
SAP CI Tx SCI
Sonntag, 13. Mai 12                   45
SAP CI Result Details
Sonntag, 13. Mai 12                           46
CI reports you should
                            know about
                      • RS_CI_EMAIL:
                        sends emails with inspection results to
                        developers that own violating objects
                       • RS_CI_EMAILTEMPLATE:
                          template for this email
                      • RS_CI_INSPECTOR:
                        plan inspections as background jobs


Sonntag, 13. Mai 12                                               47
CI reports you should
                           know about
                 •    RS_CI_DIFF:
                      diff between two versions
                      of an inspection, send diff
                      per email

                 •    RS_CI_COMPARE:
                      diff between two
                      inspections




Sonntag, 13. Mai 12                                 48
Unique selling points

                      • build by same vendor as AS ABAP
                      • integrated into ABAP system
                       • no additional hardware or software
                          needed
                      • API to call in custom code and extend
                        with own rules


Sonntag, 13. Mai 12                                             49
Unique selling points

                      • no additional license and maitenance
                        costs
                      • strong rules in performance domain
                      • good integration in development cyclce
                      • stable rules, seldom false positives

Sonntag, 13. Mai 12                                              50
Drawbacks

                      • no dashboard or BI integration
                      • very few cross-object rules
                      • performance:
                       • some rules consume a lot of memory
                       • contains some very slow checks

Sonntag, 13. Mai 12                                           51
Links


                      •   Book:
                          „Praxishandbuch Code
                          Inspector“




Sonntag, 13. Mai 12                                52
Sonar ABAP Plug-In
                       (in examination)


Sonntag, 13. Mai 12                        53
What is it?

                      • developed by SonarSource and Obeo
                      • scans ABAP code, checks against 50+ rules
                        and presents the results in a nice
                        dashboard
                      • integrated into inspection plattform Sonar

Sonntag, 13. Mai 12                                                  54
How it works

                      • scanning and analysing is implemented in
                        Java, needs JRE/JDK and RDBMS
                      • code of objects needs to be exported into
                        files, folder structure defines result
                        structure
                      • results are presented in Sonar dashboards

Sonntag, 13. Mai 12                                                 55
Sonar Dashboard
Sonntag, 13. Mai 12                     56
Sonar Hotspots
Sonntag, 13. Mai 12                    57
Sonar Components
Sonntag, 13. Mai 12                      58
Sonar Source View
Sonntag, 13. Mai 12                       59
Sonar Time Machine
Sonntag, 13. Mai 12                        60
Unique selling points
                      • ease of installation, administration
                      • moderate costs
                      • entry to the fabulous Sonar plattform
                       • plugins like Views, SQUALE etc.
                       • configurable dashboards with myriads
                          of views
                       • extensibility
Sonntag, 13. Mai 12                                             61
Drawbacks
                      •   no source code extractor out of the box
                          •   trying to change this
                      •   small rule base yet (V1.1)
                          •   integration of Code Inspector results in
                              examination
                      •   no real inhouse ABAP know-how
                      •   analysis runs still break without proper error
                          documentation in current version


Sonntag, 13. Mai 12                                                        62
Links
                      • Vendor homepages:
                        http://www.sonarsource.com/
                        http://www.obeo.fr/
                      • Product homepages:
                        http://www.sonarsource.com/products/
                        plugins/languages/abap/
                        http://www.sonarsource.com/products/
                        software/sonar/


Sonntag, 13. Mai 12                                            63
Lessons Learned
                          so far...


Sonntag, 13. Mai 12                     64
Things to know before
                 establishing static code analysis
                      •   Not everyone is very fond of transparency!
                      •   Talk to your workers‘ council early, if there is one!
                      •   Be aware of „benchmark optimisations“!
                          •   correcting „for the tool“ can have negative
                              impact
                      •   Be aware of the impact of false positives!
                          •   trust in tools fades with each of it



Sonntag, 13. Mai 12                                                               65
Things to do when
                 establishing static code analysis
                      • start small, grow large
                       • activate one check after the other
                       • start with new code, then spread by
                          packages
                      • integrate analysis results into developers
                        daily routine (IDE, TMS)
                      • exclude generated ABAP coding
Sonntag, 13. Mai 12                                                  66
Things to do when
                 establishing static code analysis
                      • have a working QA process established
                        before starting tool integration
                      • integrate analysis results into SLAs
                      • integrate analysis results into manager‘s
                        targets
                        • make them pay for not giving you the
                          space to build great software!


Sonntag, 13. Mai 12                                                 67
Things to do when
                 establishing static code analysis

                      •   try to keep the whole
                          process fun and
                          entertaining for
                          developers

                      •   do not overload the
                          change process




Sonntag, 13. Mai 12                                  68
Things to do when
                 establishing static code analysis

                      •   try to keep the whole
                          process fun and
                          entertaining for
                          developers

                      •   do not overload the
                          change process




Sonntag, 13. Mai 12                                  68
Things to do when
                 establishing static code analysis

                      •   try to keep the whole
                          process fun and
                          entertaining for
                          developers

                      •   do not overload the
                          change process




Sonntag, 13. Mai 12                                  68
Things to do when
                 establishing static code analysis

                      •   try to keep the whole
                          process fun and
                          entertaining for
                          developers

                      •   do not overload the
                          change process




Sonntag, 13. Mai 12                                  68
Things to do when
                 establishing static code analysis

                      •   try to keep the whole
                          process fun and
                          entertaining for
                          developers

                      •   do not overload the
                          change process




Sonntag, 13. Mai 12                                  68
Things to do when
                 establishing static code analysis

                      •   try to keep the whole
                          process fun and
                          entertaining for
                          developers

                      •   do not overload the
                          change process




Sonntag, 13. Mai 12                                  68
Things to do when
                 establishing static code analysis

                      •   try to keep the whole
                          process fun and
                          entertaining for
                          developers

                      •   do not overload the
                          change process




Sonntag, 13. Mai 12                                  68
Architektur                 2,91      -0,01    42,44     0,03          Avoid using lit
                                                        BusinessWarehouse           5,20      0,01     33,28     0,03          Avoid unrefer


                           Keep it entertaining:
                                                        CustomerCare                2,62      -0,04    45,68     0,28          Avoid Method
                                                        Messen                      2,93      0,14     40,13     0,29          Avoid using L
                                                        MPK                         1,88      0,01     50,43     0,18          Avoid missing
                                                        OutputManagement            3,29      0,00     31,18     -0,01


                            „Biggest Looser“
                                                                                                                               Avoid Artifacts
                                                        Statistik                   3,44      -0,01    34,10     -0,22
                                                                                                                               Avoid Artifacts
                                                        easy+                       2,69      0,00     40,85     0,08
                                                                                                                              Die Tabelle zeigt
                                                        Diese Tabelle zeigt die Anzahl der kritischen Verletzungen und die    der für das Rankin
                                                        Gesamtanzahl auf tausend Codezeilen innerhalb der Themengebiets.
                                                        Beispiel: Ein Viol.krit-Wert von 3 sagt aus, dass in tausend
                                                        Codezeilen im Durchschnitt 3 kritische Regelverletzungen vorliegen.

                      •   At start of a new                                         CAST Biggest Loser
                          release, the sum of           Rang         Team
                                                                    Themengebiet               Start
                                                                                            Startgewicht       Cur.
                                                                                                               Aktuell        Dif
                                                                                                                              Diff.(%)
                                                                                                                                                D
                          weighted violations per          1     Statistik                      220,13          218,92         -0,55            A
                                                                                                                                                W
                          1k code lines is                 2
                                                           3
                                                                 Accounting
                                                                 Abrechnen
                                                                                                258,62
                                                                                                210,84
                                                                                                                258,10
                                                                                                                210,72
                                                                                                                               -0,20
                                                                                                                               -0,06
                                                                                                                                                A

                          measured per                     4     OutputManagement               218,02          217,98         -0,02
                                                                                                                                                D
                                                                                                                                                W
                          development team                 5     Architektur                    251,44          251,46         0,01             s
                                                           6     CustomerCare                   270,70          270,97         0,10             T


                      •
                                                           7     BusinessWarehouse              244,40          244,74         0,14             d
                          With every snapshot              8     MPK                            262,63          263,25         0,24
                                                                                                                                                ü
                                                                                                                                                R
                          this rating is recalculated      9     Messen                         252,94          255,03         0,82
                                                                                                                                                D
                                                                 easy+                          243,70          243,90         0,08
                                                                                                                                                M

                      •   At end of release, the
                                                        Diese Tabelle zeigt das CAST Biggest Loser-Startgewicht gemessen am
                                                        Qualitätswert pro tausend Zeilen Quellcode für jedes Themengebiet.
                                                                                                                                                B
                                                                                                                                                d

                          best team gets an award


Sonntag, 13. Mai 12                                                                                                                        69
Keep it entertaining:
                           „The Red Lantern“
                      •   With every snapshot
                          there is a rating of
                          development teams
                          („Biggest Looser“)

                      •   The team with the
                          highest degradation
                          since baseline gets the
                          Red Lantern on its team
                          leader‘s desk




Sonntag, 13. Mai 12                                 70
Summary



Sonntag, 13. Mai 12             71
A fool with a tool...




Sonntag, 13. Mai 12                           72
A fool with a tool...

                      • the best working tool for static ABAP code
                        analysis is...
                       • you, the ABAP expert!
                      • Integrate tools when code and team sizing
                        grow beyond manual review capabilities



Sonntag, 13. Mai 12                                                  72
My personal, biased
                               advice
                      • Want to get into tool-based code analysis,
                        no money to spend for external tools:
                        => SAP Code Inspector
                      • Substantial code bases in technologies
                        other than ABAP, cross-technology analysis
                        a must, more than rules engine needed,
                        lots of money to spend:
                        => CAST AIP


Sonntag, 13. Mai 12                                                  73
My personal, biased
                                advice
                      • Die-hard ABAP development, security and
                        compliance is a big concern, results near to
                        developers a must, a little bit of money on
                        the bench:
                        => Virtual Forge Code Profiler
                      • Lots of Java code and a little bit of ABAP,
                        small budget, no need for deep ABAP
                        coverage now:
                        => keep an eye on Sonar ABAP plug-in


Sonntag, 13. Mai 12                                                    74
VirtualForge       SAP            Sonar
                  Criteria       CAST AIP
                                            CodeProfiler    Code Inspector   ABAP Plug-In
                 ease of
              administration       --           +              ++               +
               management
               dashboards         ++            +              --             +
                      costs       --            -              ++            O-+
             overall technical
                 quality           O            +               +               O
               support for
             other languages      ++            --              --             ++
                 analysis
               performance         --          ++                -              --
                 long-time
                 evaluation,
                   trends
                                  ++            +               --             ++
               integration in
               development
                  process
                                   --           +               +               --

Sonntag, 13. Mai 12                                                                        75
VirtualForge       SAP            Sonar
                  Criteria     CAST AIP
                                          CodeProfiler    Code Inspector   ABAP Plug-In
                 hardware
               requirements      --           O              ++               O
             Extendable with
                own rules      yes/O         no            yes/+             no
                  rule
              documentation      +           ++              O               O




Sonntag, 13. Mai 12                                                                      76
Questions ?
Sonntag, 13. Mai 12                 77
Thanks for listening!

                      • Contact Information
                       • Markus.Theilen@ewe.de
                       • Twitter: @therealtier


Sonntag, 13. Mai 12                              78
Backup



Sonntag, 13. Mai 12            79
CAST Custom
                      Action Plan Viewer
Sonntag, 13. Mai 12                        80
CAST Acceptance View
Sonntag, 13. Mai 12                      81
CAST Management Studio II
Sonntag, 13. Mai 12                          82
CAST Action Plan
Sonntag, 13. Mai 12                      83
CAST Assessment View
Sonntag, 13. Mai 12                      84
CAST Compliance View
Sonntag, 13. Mai 12                     85
CAST Development View
Sonntag, 13. Mai 12                      86
CAST Enhancement View
Sonntag, 13. Mai 12                      87
CAST Evolution View
Sonntag, 13. Mai 12                         88
CAST Project View
Sonntag, 13. Mai 12                       89
SAP CI Result Tree
Sonntag, 13. Mai 12                        90
SAP CI Tx SCII
Sonntag, 13. Mai 12                    91
SAP CI Inspection
Sonntag, 13. Mai 12                       92
SAP CI Object Set
Sonntag, 13. Mai 12                       93
SAP CI Check Variant
Sonntag, 13. Mai 12                          94
Exclude generated
                             maintenance views
                      •   In object set you can       Edit
                          exclude generated                  exclude Maint.View

                          functions groups for
                          maintenance views

                      •   These function groups
                          cause a lot of violations
                          that you should not
                          bother about




Sonntag, 13. Mai 12                                                               95
Sonar Action Plan
Sonntag, 13. Mai 12                       96
Sonar Clouds
Sonntag, 13. Mai 12                  97
Sonar Start Page
Sonntag, 13. Mai 12                      98
Sonar Reviews
Sonntag, 13. Mai 12                   99
Sonar Tree Map
Sonntag, 13. Mai 12                    100
Sonar Violation Drilldown
Sonntag, 13. Mai 12                         101
Sonar manual violation
Sonntag, 13. Mai 12                            102

Contenu connexe

Tendances

SAP HANA Migration Deck.pptx
SAP HANA Migration Deck.pptxSAP HANA Migration Deck.pptx
SAP HANA Migration Deck.pptx
SingbBablu
 
Sap basis course content
Sap basis course contentSap basis course content
Sap basis course content
Muhammad Shamim
 

Tendances (20)

SAP System copy
SAP System copySAP System copy
SAP System copy
 
SAP HANA Migration Deck.pptx
SAP HANA Migration Deck.pptxSAP HANA Migration Deck.pptx
SAP HANA Migration Deck.pptx
 
Migrating Critical Workloads at Scale: Best Practice for SAP Migration - AWS ...
Migrating Critical Workloads at Scale: Best Practice for SAP Migration - AWS ...Migrating Critical Workloads at Scale: Best Practice for SAP Migration - AWS ...
Migrating Critical Workloads at Scale: Best Practice for SAP Migration - AWS ...
 
2015 04 Preparing for the SAP S/4HANA Migration
2015 04 Preparing for the SAP S/4HANA Migration2015 04 Preparing for the SAP S/4HANA Migration
2015 04 Preparing for the SAP S/4HANA Migration
 
Transition to SAP S/4HANA System Conversion: A step-by-step guide
Transition to SAP S/4HANA System Conversion: A step-by-step guide Transition to SAP S/4HANA System Conversion: A step-by-step guide
Transition to SAP S/4HANA System Conversion: A step-by-step guide
 
SAP HANA SPS10- Multitenant Database Containers
SAP HANA SPS10- Multitenant Database ContainersSAP HANA SPS10- Multitenant Database Containers
SAP HANA SPS10- Multitenant Database Containers
 
SAP Cloud Platform Integration L2 Deck 2017Q4
SAP Cloud Platform Integration L2 Deck 2017Q4SAP Cloud Platform Integration L2 Deck 2017Q4
SAP Cloud Platform Integration L2 Deck 2017Q4
 
Simplify your SAP CPI development with Figaf
Simplify your SAP CPI development with FigafSimplify your SAP CPI development with Figaf
Simplify your SAP CPI development with Figaf
 
Sap system landscape best practice
Sap system landscape best practiceSap system landscape best practice
Sap system landscape best practice
 
SAP Testing
SAP TestingSAP Testing
SAP Testing
 
SAP S/4HANA: Everything you need to know for a successul implementation
SAP S/4HANA: Everything you need to know for a successul implementationSAP S/4HANA: Everything you need to know for a successul implementation
SAP S/4HANA: Everything you need to know for a successul implementation
 
Mastering SAP Monitoring - SAP HANA Monitoring, Management & Automation
Mastering SAP Monitoring - SAP HANA Monitoring, Management & AutomationMastering SAP Monitoring - SAP HANA Monitoring, Management & Automation
Mastering SAP Monitoring - SAP HANA Monitoring, Management & Automation
 
Introduction to ABAP
Introduction to ABAPIntroduction to ABAP
Introduction to ABAP
 
10 Golden Rules for S/4 HANA Migrations
10 Golden Rules for S/4 HANA Migrations10 Golden Rules for S/4 HANA Migrations
10 Golden Rules for S/4 HANA Migrations
 
Focused build overview
Focused build overviewFocused build overview
Focused build overview
 
SAP Business One
SAP Business OneSAP Business One
SAP Business One
 
Extend SAP S/4HANA to deliver real-time intelligent processes
Extend SAP S/4HANA to deliver real-time intelligent processesExtend SAP S/4HANA to deliver real-time intelligent processes
Extend SAP S/4HANA to deliver real-time intelligent processes
 
Sap basis course content
Sap basis course contentSap basis course content
Sap basis course content
 
IDEF0 and Software Process Engineering Model
IDEF0 and Software Process Engineering ModelIDEF0 and Software Process Engineering Model
IDEF0 and Software Process Engineering Model
 
Sap s 4 hana client strategy
Sap s 4 hana client strategySap s 4 hana client strategy
Sap s 4 hana client strategy
 

En vedette

Abap course chapter 7 abap objects and bsp
Abap course   chapter 7 abap objects and bspAbap course   chapter 7 abap objects and bsp
Abap course chapter 7 abap objects and bsp
Milind Patil
 
Abap query
Abap queryAbap query
Abap query
brtkow
 

En vedette (17)

Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...
Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...
Case Study: Automating Code Reviews for Custom SAP ABAP Applications with Vir...
 
How Pratt & Whitney Streamlined Their ABAP Security and Quality Code Review P...
How Pratt & Whitney Streamlined Their ABAP Security and Quality Code Review P...How Pratt & Whitney Streamlined Their ABAP Security and Quality Code Review P...
How Pratt & Whitney Streamlined Their ABAP Security and Quality Code Review P...
 
Abap course chapter 7 abap objects and bsp
Abap course   chapter 7 abap objects and bspAbap course   chapter 7 abap objects and bsp
Abap course chapter 7 abap objects and bsp
 
Usability in ABAP Programs - SITSP2011
Usability in ABAP Programs - SITSP2011Usability in ABAP Programs - SITSP2011
Usability in ABAP Programs - SITSP2011
 
The ABAP Query
The ABAP QueryThe ABAP Query
The ABAP Query
 
Epic abap
Epic  abapEpic  abap
Epic abap
 
Sap abap material
Sap abap materialSap abap material
Sap abap material
 
SAP ABAP data dictionary
SAP ABAP data dictionarySAP ABAP data dictionary
SAP ABAP data dictionary
 
Abap sample
Abap sampleAbap sample
Abap sample
 
Software engineering- system testing
Software engineering- system testingSoftware engineering- system testing
Software engineering- system testing
 
Design patterns in_object-oriented_abap_-_igor_barbaric
Design patterns in_object-oriented_abap_-_igor_barbaricDesign patterns in_object-oriented_abap_-_igor_barbaric
Design patterns in_object-oriented_abap_-_igor_barbaric
 
SAP-ABAP/4@e_max
SAP-ABAP/4@e_maxSAP-ABAP/4@e_max
SAP-ABAP/4@e_max
 
ABAP Test & Troubleshooting @SITMuc 2013
ABAP Test & Troubleshooting @SITMuc 2013ABAP Test & Troubleshooting @SITMuc 2013
ABAP Test & Troubleshooting @SITMuc 2013
 
Qué es abap
Qué es abapQué es abap
Qué es abap
 
Abap query
Abap queryAbap query
Abap query
 
ITSS Trainning | Curso de SAP ABAP Foundations
ITSS Trainning | Curso de SAP ABAP FoundationsITSS Trainning | Curso de SAP ABAP Foundations
ITSS Trainning | Curso de SAP ABAP Foundations
 
Web dynpro for abap
Web dynpro for abapWeb dynpro for abap
Web dynpro for abap
 

Similaire à static ABAP code analyzers

Dan node meetup_socket_talk
Dan node meetup_socket_talkDan node meetup_socket_talk
Dan node meetup_socket_talk
Ishi von Meier
 
Performance for Product Developers
Performance for Product DevelopersPerformance for Product Developers
Performance for Product Developers
Matthew Wilkes
 
Dataiku r users group v2
Dataiku   r users group v2Dataiku   r users group v2
Dataiku r users group v2
Cdiscount
 
Collaborative sourcing keys to unlocking greater value
Collaborative sourcing keys to unlocking greater valueCollaborative sourcing keys to unlocking greater value
Collaborative sourcing keys to unlocking greater value
SAP Ariba
 
Agile in a Legacy World - Sonik Chopra
Agile in a Legacy World - Sonik ChopraAgile in a Legacy World - Sonik Chopra
Agile in a Legacy World - Sonik Chopra
AgileNCR2014
 
5 physical data modeling blunders 09092010
5 physical data modeling blunders 090920105 physical data modeling blunders 09092010
5 physical data modeling blunders 09092010
ERwin Modeling
 

Similaire à static ABAP code analyzers (20)

Dan node meetup_socket_talk
Dan node meetup_socket_talkDan node meetup_socket_talk
Dan node meetup_socket_talk
 
Den Multi Device Konsumenten zufrieden stellen …
Den Multi Device Konsumenten zufrieden stellen …Den Multi Device Konsumenten zufrieden stellen …
Den Multi Device Konsumenten zufrieden stellen …
 
Telco Big Data Workshop Sample
Telco Big Data Workshop SampleTelco Big Data Workshop Sample
Telco Big Data Workshop Sample
 
Big Data at a Gaming Company: Spil Games
Big Data at a Gaming Company: Spil GamesBig Data at a Gaming Company: Spil Games
Big Data at a Gaming Company: Spil Games
 
Performance for Product Developers
Performance for Product DevelopersPerformance for Product Developers
Performance for Product Developers
 
BDW17 London - Abed Ajraou - First Utility - Putting Data Science in your Bus...
BDW17 London - Abed Ajraou - First Utility - Putting Data Science in your Bus...BDW17 London - Abed Ajraou - First Utility - Putting Data Science in your Bus...
BDW17 London - Abed Ajraou - First Utility - Putting Data Science in your Bus...
 
Make Life Suck Less (Building Scalable Systems)
Make Life Suck Less (Building Scalable Systems)Make Life Suck Less (Building Scalable Systems)
Make Life Suck Less (Building Scalable Systems)
 
Dataiku r users group v2
Dataiku   r users group v2Dataiku   r users group v2
Dataiku r users group v2
 
GoDataDriven Giovanni Lanzani
GoDataDriven Giovanni LanzaniGoDataDriven Giovanni Lanzani
GoDataDriven Giovanni Lanzani
 
You've Got No UI?! (Agile Data Teams)
You've Got No UI?! (Agile Data Teams)You've Got No UI?! (Agile Data Teams)
You've Got No UI?! (Agile Data Teams)
 
Giovanni Lanzani GoDataDriven
Giovanni Lanzani GoDataDrivenGiovanni Lanzani GoDataDriven
Giovanni Lanzani GoDataDriven
 
Introduction To Data Vault - DAMA Oregon 2012
Introduction To Data Vault - DAMA Oregon 2012Introduction To Data Vault - DAMA Oregon 2012
Introduction To Data Vault - DAMA Oregon 2012
 
Collaborative sourcing keys to unlocking greater value
Collaborative sourcing keys to unlocking greater valueCollaborative sourcing keys to unlocking greater value
Collaborative sourcing keys to unlocking greater value
 
P12035 simplifiedtech-uadeck-sharedeck
P12035 simplifiedtech-uadeck-sharedeckP12035 simplifiedtech-uadeck-sharedeck
P12035 simplifiedtech-uadeck-sharedeck
 
Qcon talk
Qcon talkQcon talk
Qcon talk
 
Promise notes
Promise notesPromise notes
Promise notes
 
Agile in a Legacy World - Sonik Chopra
Agile in a Legacy World - Sonik ChopraAgile in a Legacy World - Sonik Chopra
Agile in a Legacy World - Sonik Chopra
 
5 physical data modeling blunders 09092010
5 physical data modeling blunders 090920105 physical data modeling blunders 09092010
5 physical data modeling blunders 09092010
 
Zen and Enterprise Architecture
Zen and Enterprise ArchitectureZen and Enterprise Architecture
Zen and Enterprise Architecture
 
Troubleshooting: A High-Value Asset For The Service-Provider Discipline
Troubleshooting: A High-Value Asset For The Service-Provider DisciplineTroubleshooting: A High-Value Asset For The Service-Provider Discipline
Troubleshooting: A High-Value Asset For The Service-Provider Discipline
 

Dernier

Dernier (20)

Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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, ...
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

static ABAP code analyzers

  • 1. Static ABAP code Analysis A Comparison of Tools with some kind of field report Sonntag, 13. Mai 12 1
  • 2. Disclaimer • First talk at a SIT • Not a native English speaker • This presentation represents my personal opinon and is not related to any company or the single godly truth Sonntag, 13. Mai 12 2
  • 3. Agenda • Motivation • Tools for static ABAP code analysis • CAST Application Intelligence Plattform • VirtualForge CodeProfiler • SAP Code Inspector • Sonar ABAP Plug-in • Lessons Learned • Summary Sonntag, 13. Mai 12 3
  • 4. Who am I? • Markus Theilen • Enterprise Architect at EWE ENERGIE AG • before that Software Architect at BTC AG • responsible for Customer Care and Billing for Utilities Sonntag, 13. Mai 12 4
  • 6. Background • EWE does not use SAP IS-U for Customer Care and Billing, but develops its own solution: easy+ • Since 1995 this solution is built and maintained by BTC AG on behalf of EWE ENERGIE AG Sonntag, 13. Mai 12 6
  • 7. easy+ • Productive use since 1997 • Pure ABAP coding • Today, about 100 people in development and maintenance + 20 people in support • used by EWE and about 10 public services companies Sonntag, 13. Mai 12 7
  • 8. easy+: A few facts • over 25 million invoices billed so far • 8,8 TByte data volume • 8.2 million lines of code • 700 packages, 8,000 reports 6,000 classes • 8,000 tables Sonntag, 13. Mai 12 8
  • 9. Problems • Team size and fluctuation leads to very heterogenous knowledge and skill set • Maintenance is getting harder with each iteration • Too much code for manual review of coding guidelines Sonntag, 13. Mai 12 9
  • 10. Problems • With code size, complexity can grow exponentially • Code that looks locally ok can lead to problems when seen in its context and call hierarchy • Complexity is too high for manual checks Sonntag, 13. Mai 12 10
  • 11. Problems • No factual statements ? about code quality possible • No direct indicators for architects/management to decide about where to spend time and money to correct the most urgent problems first Sonntag, 13. Mai 12 11
  • 12. But #1 Problem is: You do not know what your problems are, until you measure your code! Sonntag, 13. Mai 12 12
  • 13. Use of static analysis • Gives insight and leads you to your problems • Gives possibility to concentrate on hot spots • Base decisions on facts, not myths and rumours! Sonntag, 13. Mai 12 13
  • 14. Use of static analysis • tool-based analysis is cheaper than manual reviews, but it comes with a price and is far from being perfect! • false positives, missed violations • expect no solution for your problems, tools just help to find and pinpoint them! • only static information is examined, mostly no dynamic aspects are covered! Sonntag, 13. Mai 12 14
  • 15. What a tool should offer • reliable rule engine • definition of exceptions / false positives • explanations of rules • reasoning, good/bad examples • seamless integration into development cycle Sonntag, 13. Mai 12 15
  • 17. CAST Application Intelligence Plattform (in production) Sonntag, 13. Mai 12 17
  • 18. What is it? • developed by CAST, headquaters located in France • „world-wide leader in automated application intelligence“ • not just a simple scanner-and-rules-engine, but an application metadata knowledge base Sonntag, 13. Mai 12 18
  • 19. How it works • external scanning and analysis engine, written in C++ • transfer of source information via extraction report and files • analysis of source code, mapping to common meta model, creation of relations between objects (calls, uses, etc.) • results are shown in dashboard web application and in fat client for architecture analysis Sonntag, 13. Mai 12 19
  • 20. How it works • CAST uses a customisable hierarchy of result aggregation • health factors like robustness, performance • quality indicators like complexity, programming practices, documentation • quality metrics (basic rules) Sonntag, 13. Mai 12 20
  • 21. Health Factors Quality Indicators Metrics Metric1 Performance Complexity Metric2 Metric3 Metric4 Robustness Architecture Metric5 Metric6 Metric7 Security Prog. Practice Metric8 Metric9 Metric10 Metric11 Transferability Conventions Metric12 Metric13 Metric14 Changebility Documentation Metric15 Sonntag, 13. Mai 12 21
  • 25. CAST rule details Sonntag, 13. Mai 12 25
  • 27. CAST Management Studio I Sonntag, 13. Mai 12 27
  • 28. ERGEBNISSE APRIL-2012 27. APRIL 2012 Verletzungen pro kLOC Top 10 Verletzungen Viol. Diff. Viol. Diff. Metrikname Verletzungen Gewichtet Diff. Themengebiet krit krit Total Total Avoid unchecked return code (SY-SUBRC) after OPEN SQL… 15384 246144 2192 Abrechnen 2,97 -0,01 30,61 0,00 Avoid undocumented Methods 28923 144615 1545 Accounting 2,34 -0,01 47,34 -0,08 Avoid _SELECT *_ or _SELECT SINGLE *_ queries 15662 125296 528 Architektur 2,91 -0,01 42,44 0,03 Avoid using literals in assignments (hardcoded values) 23646 118230 750 BusinessWarehouse 5,20 0,01 33,28 0,03 Avoid unreferenced Methods 23340 93360 2500 CustomerCare 2,62 -0,04 45,68 0,28 Avoid Methods with a very low comment/code ratio 23479 70437 528 Messen 2,93 0,14 40,13 0,29 Avoid using LOOP INTO, use LOOP ASSIGNING instead 11518 69108 492 MPK 1,88 0,01 50,43 0,18 Avoid missing WHEN OTHERS in CASE statements 6511 52088 360 OutputManagement 3,29 0,00 31,18 -0,01 Avoid Artifacts with a Complex SELECT Clause 7545 45270 162 Statistik 3,44 -0,01 34,10 -0,22 Avoid Artifacts with High Cyclomatic Complexity 5028 40224 2624 easy+ 2,69 0,00 40,85 0,08 Die Tabelle zeigt die schwerwiegendsten Verletzungen des easy+. Neben der Verletzungsanzahl ist auch der gewichtete Wert dargestellt, Diese Tabelle zeigt die Anzahl der kritischen Verletzungen und die der für das Ranking ausschlaggebend ist. Gesamtanzahl auf tausend Codezeilen innerhalb der Themengebiets. Beispiel: Ein Viol.krit-Wert von 3 sagt aus, dass in tausend Gewichteter easy+-Qualitätswert und Abnahmestatus Codezeilen im Durchschnitt 3 kritische Regelverletzungen vorliegen. Startwert Aktuell Diff. Diff. % Status CAST Biggest Loser 1388953 1402761 13808 0,99 Rang Themengebiet Startgewicht Aktuell Diff.(%) Diese Tabelle zeigt den aktuellen Status für das Quality Gate zum 1 Statistik 220,13 218,92 -0,55 Abnahme- bzw. zum Systemintegrationstest (AT bzw. SIT). Ist der aktuelle Wert kleiner/gleich des Startwerts, ist der Status grün, sonst ist er rot. 2 Accounting 258,62 258,10 -0,20 Alles aufwachen, bitte! 3 Abrechnen 210,84 210,72 -0,06 Des entwicklungsarmen Releasestarts wegen, liegt die letzte CAST-Auswertung mittlerweile fast vier 4 OutputManagement 218,02 217,98 -0,02 Wochen zurück. Diese längere Pause bleibt allerdings künftig wieder die Ausnahme und so werdet Ihr ab 5 Architektur 251,44 251,46 0,01 sofort wieder zwei-wöchentlich über den aktuellen Stand informiert. 6 CustomerCare 270,70 270,97 0,10 Trotz des vergleichsweise geringen Entwicklungsumfangs in diesen ersten Wochen haben sich wieder 7 BusinessWarehouse 244,40 244,74 0,14 diverse Regelverletzungen eingeschlichen, die den Qualitäts-Startwert bereits um fast ein volles Prozent übersteigen. Spätestens mit diesem Flyer sollten alle Entwickler wieder darauf achten, die CAST-Regeln im 8 MPK 262,63 263,25 0,24 Rahmen ihrer Entwicklung einzuhalten und vorhandene zu entfernen. 9 Messen 252,94 255,03 0,82 Das Rotlicht-Milieu zieht um easy+ 243,70 243,90 0,08 Mit den ersten vergleichbaren Biggest Loser-Zahlen seit Release 35/2 steht nun fest, dass sich das TG Diese Tabelle zeigt das CAST Biggest Loser-Startgewicht gemessen am Business Warehouse nach einer neuen Zimmerbeleuchtung umsehen muss, denn die rote Laterne wechselt Qualitätswert pro tausend Zeilen Quellcode für jedes Themengebiet. den Schreibtisch zu den Kollegen vom TG Messen. CAST Monthly Flyer Sonntag, 13. Mai 12 28
  • 29. Unique selling points • common meta model for development objects and its relations • change impact analysis, support for cost estimation, path finder along call stacks • cross technology analysis (Java, C#, C++, ABAP, COBOL...) • management dashboard and longterm evaluation • layered, weighted aggregation of results Sonntag, 13. Mai 12 29
  • 30. Drawbacks • speed of ABAP analysis (easy+: 14-17 h) • no sound ABAP know-how up to now • some unstable, heurisitic rules • big initial and ongoing invest • license, maintenance, education, administration • no integration in ABAP development cycle • sluggish support and information policy Sonntag, 13. Mai 12 30
  • 31. Links • Vendor homepage: http://www.castsoftware.com • Product homepage http://www.castsoftware.com/products/ cast-application-intelligence-platform Sonntag, 13. Mai 12 31
  • 32. Virtual Forge CodeProfiler (in examination) Sonntag, 13. Mai 12 32
  • 33. What is it? • developed by Virtual Forge GmbH • THE ABAP security experts • scans ABAP code, checks against rules and presents the results • concentrates on ABAP analysis in security, compliance, performance and robustness Sonntag, 13. Mai 12 33
  • 34. How it works • external scanning and analysis engine, written in Java • transfer of source information directly via RFC or file-based • results are generated as PDF or shown in SAP (Tx „Finding Manager“) • uses SAP BI for management views Sonntag, 13. Mai 12 34
  • 35. Ergebnisdarstellung in SAP Finding Manager PPT Masterfolie zur Erstellung von Präsentationen © 2011 Virtual Forge GmbH || www.virtualforge.com || All rights reserved. © 2011 Virtual Forge GmbH www.virtualforge.com All rights reserved. Finding Manager Sonntag, 13. Mai 12 35
  • 36. 2 Executive Summary 2 Executive Summary The ABAP code has been analyzed with 100 test cases. 55 of those test cases yielded findings, totaling 28825 findings. 1535 of them have been rated as critical. The findings are distributed as follows: Critical Findings Total Findings # Analyzed Test Domain # ME # ME Testcases Security 186 N/A 3493 N/A 48 Compliance 292 N/A 2069 N/A 7 Performance 938 N/A 9148 N/A 19 Maintainability 0 N/A 10593 N/A 11 Robustness 119 N/A 3522 N/A 10 Data-Loss- 0 N/A 0 N/A 5 Prevention * ME = Mitigation Effort (N/A = Not completely configured) Also, 0 countermeasures have been detected that have prevented additional security findings. Please note that 0 findings have been manually suppressed by developers. Some test cases are used for informational purposes only. These yielded 856 findings as a basis for further analysis by experts. Example PDF report Sonntag, 13. Mai 12 -2- 36
  • 37. Daten- und Kontrollflussanalyse PPT Masterfolie METHOD read zur Erstellung von Präsentationen METHOD read . DATA: request TYPE REF TO if_http_request. Input request->get_form_field() DATA: s_html TYPE string. DATA: event TYPE string. Stored in variable 1 s_html = request->get_form_field( 'mydata' ). CALL METHOD me->process EXPORTING 2 s_data = s_html. RETURN. s_html ENDMETHOD. Passed on to another method and variable METHOD process METHOD process . s_data DATA: s_out TYPE string. DATA: out TYPE REF TO if_bsp_writer. 3 CONCATENATE `<b>` s_data Modifed and copied to another variable `</b>` INTO s_out. out = me->get_previous_out( ). s_out 4 out->print_string( s_out ). ENDMETHOD. Output Passed on to dangerous function out->print_string() © 2011 Virtual Forge GmbH || www.virtualforge.com || All rights reserved. © 2011 Virtual Forge GmbH www.virtualforge.com All rights reserved. Data / Control Flow Analysis Sonntag, 13. Mai 12 37
  • 38. Unique selling points • Speed of analysis (easy+: 1.5 h) • data and control flow analysis • automated corrections possible • superb rules in security domain • sound integration in development cycle • SE80, TMS, ChaRm, CTS(+) Sonntag, 13. Mai 12 38
  • 39. Drawbacks • not that strong in code quality rules yet • performance, maintenance, robustness • no support for other languages than ABAP Sonntag, 13. Mai 12 39
  • 40. Links • Vendor homepage: http://virtualforge.com/ • Product homepage: http://virtualforge.com/index.php/en/ portfolio/codeprofiler.html • Product Review from KuppingerCole Sonntag, 13. Mai 12 40
  • 41. SAP Code Inspector (in production) Sonntag, 13. Mai 12 41
  • 42. What is it? • developed by SAP, in ABAP-OO • scans ABAP code, checks against rules and presents the results as tree or list • integrated into every AS ABAP • Transactions SCI and SCII Sonntag, 13. Mai 12 42
  • 43. How it works • internal scanning and rule checking, implemented in ABAP-OO • no need to transfer development objects, it all stays in the system • results can be analyzed in TX SCI Sonntag, 13. Mai 12 43
  • 44. How it works Sonntag, 13. Mai 12 44
  • 45. How it works Check variant (how?) Sonntag, 13. Mai 12 44
  • 46. How it works Object set Check variant (what?) (how?) Sonntag, 13. Mai 12 44
  • 47. How it works Inspection references references Object set Check variant (what?) (how?) Sonntag, 13. Mai 12 44
  • 48. How it works Inspection Results references references Object set Check variant (what?) (how?) Sonntag, 13. Mai 12 44
  • 49. SAP CI Tx SCI Sonntag, 13. Mai 12 45
  • 50. SAP CI Result Details Sonntag, 13. Mai 12 46
  • 51. CI reports you should know about • RS_CI_EMAIL: sends emails with inspection results to developers that own violating objects • RS_CI_EMAILTEMPLATE: template for this email • RS_CI_INSPECTOR: plan inspections as background jobs Sonntag, 13. Mai 12 47
  • 52. CI reports you should know about • RS_CI_DIFF: diff between two versions of an inspection, send diff per email • RS_CI_COMPARE: diff between two inspections Sonntag, 13. Mai 12 48
  • 53. Unique selling points • build by same vendor as AS ABAP • integrated into ABAP system • no additional hardware or software needed • API to call in custom code and extend with own rules Sonntag, 13. Mai 12 49
  • 54. Unique selling points • no additional license and maitenance costs • strong rules in performance domain • good integration in development cyclce • stable rules, seldom false positives Sonntag, 13. Mai 12 50
  • 55. Drawbacks • no dashboard or BI integration • very few cross-object rules • performance: • some rules consume a lot of memory • contains some very slow checks Sonntag, 13. Mai 12 51
  • 56. Links • Book: „Praxishandbuch Code Inspector“ Sonntag, 13. Mai 12 52
  • 57. Sonar ABAP Plug-In (in examination) Sonntag, 13. Mai 12 53
  • 58. What is it? • developed by SonarSource and Obeo • scans ABAP code, checks against 50+ rules and presents the results in a nice dashboard • integrated into inspection plattform Sonar Sonntag, 13. Mai 12 54
  • 59. How it works • scanning and analysing is implemented in Java, needs JRE/JDK and RDBMS • code of objects needs to be exported into files, folder structure defines result structure • results are presented in Sonar dashboards Sonntag, 13. Mai 12 55
  • 63. Sonar Source View Sonntag, 13. Mai 12 59
  • 65. Unique selling points • ease of installation, administration • moderate costs • entry to the fabulous Sonar plattform • plugins like Views, SQUALE etc. • configurable dashboards with myriads of views • extensibility Sonntag, 13. Mai 12 61
  • 66. Drawbacks • no source code extractor out of the box • trying to change this • small rule base yet (V1.1) • integration of Code Inspector results in examination • no real inhouse ABAP know-how • analysis runs still break without proper error documentation in current version Sonntag, 13. Mai 12 62
  • 67. Links • Vendor homepages: http://www.sonarsource.com/ http://www.obeo.fr/ • Product homepages: http://www.sonarsource.com/products/ plugins/languages/abap/ http://www.sonarsource.com/products/ software/sonar/ Sonntag, 13. Mai 12 63
  • 68. Lessons Learned so far... Sonntag, 13. Mai 12 64
  • 69. Things to know before establishing static code analysis • Not everyone is very fond of transparency! • Talk to your workers‘ council early, if there is one! • Be aware of „benchmark optimisations“! • correcting „for the tool“ can have negative impact • Be aware of the impact of false positives! • trust in tools fades with each of it Sonntag, 13. Mai 12 65
  • 70. Things to do when establishing static code analysis • start small, grow large • activate one check after the other • start with new code, then spread by packages • integrate analysis results into developers daily routine (IDE, TMS) • exclude generated ABAP coding Sonntag, 13. Mai 12 66
  • 71. Things to do when establishing static code analysis • have a working QA process established before starting tool integration • integrate analysis results into SLAs • integrate analysis results into manager‘s targets • make them pay for not giving you the space to build great software! Sonntag, 13. Mai 12 67
  • 72. Things to do when establishing static code analysis • try to keep the whole process fun and entertaining for developers • do not overload the change process Sonntag, 13. Mai 12 68
  • 73. Things to do when establishing static code analysis • try to keep the whole process fun and entertaining for developers • do not overload the change process Sonntag, 13. Mai 12 68
  • 74. Things to do when establishing static code analysis • try to keep the whole process fun and entertaining for developers • do not overload the change process Sonntag, 13. Mai 12 68
  • 75. Things to do when establishing static code analysis • try to keep the whole process fun and entertaining for developers • do not overload the change process Sonntag, 13. Mai 12 68
  • 76. Things to do when establishing static code analysis • try to keep the whole process fun and entertaining for developers • do not overload the change process Sonntag, 13. Mai 12 68
  • 77. Things to do when establishing static code analysis • try to keep the whole process fun and entertaining for developers • do not overload the change process Sonntag, 13. Mai 12 68
  • 78. Things to do when establishing static code analysis • try to keep the whole process fun and entertaining for developers • do not overload the change process Sonntag, 13. Mai 12 68
  • 79. Architektur 2,91 -0,01 42,44 0,03 Avoid using lit BusinessWarehouse 5,20 0,01 33,28 0,03 Avoid unrefer Keep it entertaining: CustomerCare 2,62 -0,04 45,68 0,28 Avoid Method Messen 2,93 0,14 40,13 0,29 Avoid using L MPK 1,88 0,01 50,43 0,18 Avoid missing OutputManagement 3,29 0,00 31,18 -0,01 „Biggest Looser“ Avoid Artifacts Statistik 3,44 -0,01 34,10 -0,22 Avoid Artifacts easy+ 2,69 0,00 40,85 0,08 Die Tabelle zeigt Diese Tabelle zeigt die Anzahl der kritischen Verletzungen und die der für das Rankin Gesamtanzahl auf tausend Codezeilen innerhalb der Themengebiets. Beispiel: Ein Viol.krit-Wert von 3 sagt aus, dass in tausend Codezeilen im Durchschnitt 3 kritische Regelverletzungen vorliegen. • At start of a new CAST Biggest Loser release, the sum of Rang Team Themengebiet Start Startgewicht Cur. Aktuell Dif Diff.(%) D weighted violations per 1 Statistik 220,13 218,92 -0,55 A W 1k code lines is 2 3 Accounting Abrechnen 258,62 210,84 258,10 210,72 -0,20 -0,06 A measured per 4 OutputManagement 218,02 217,98 -0,02 D W development team 5 Architektur 251,44 251,46 0,01 s 6 CustomerCare 270,70 270,97 0,10 T • 7 BusinessWarehouse 244,40 244,74 0,14 d With every snapshot 8 MPK 262,63 263,25 0,24 ü R this rating is recalculated 9 Messen 252,94 255,03 0,82 D easy+ 243,70 243,90 0,08 M • At end of release, the Diese Tabelle zeigt das CAST Biggest Loser-Startgewicht gemessen am Qualitätswert pro tausend Zeilen Quellcode für jedes Themengebiet. B d best team gets an award Sonntag, 13. Mai 12 69
  • 80. Keep it entertaining: „The Red Lantern“ • With every snapshot there is a rating of development teams („Biggest Looser“) • The team with the highest degradation since baseline gets the Red Lantern on its team leader‘s desk Sonntag, 13. Mai 12 70
  • 82. A fool with a tool... Sonntag, 13. Mai 12 72
  • 83. A fool with a tool... • the best working tool for static ABAP code analysis is... • you, the ABAP expert! • Integrate tools when code and team sizing grow beyond manual review capabilities Sonntag, 13. Mai 12 72
  • 84. My personal, biased advice • Want to get into tool-based code analysis, no money to spend for external tools: => SAP Code Inspector • Substantial code bases in technologies other than ABAP, cross-technology analysis a must, more than rules engine needed, lots of money to spend: => CAST AIP Sonntag, 13. Mai 12 73
  • 85. My personal, biased advice • Die-hard ABAP development, security and compliance is a big concern, results near to developers a must, a little bit of money on the bench: => Virtual Forge Code Profiler • Lots of Java code and a little bit of ABAP, small budget, no need for deep ABAP coverage now: => keep an eye on Sonar ABAP plug-in Sonntag, 13. Mai 12 74
  • 86. VirtualForge SAP Sonar Criteria CAST AIP CodeProfiler Code Inspector ABAP Plug-In ease of administration -- + ++ + management dashboards ++ + -- + costs -- - ++ O-+ overall technical quality O + + O support for other languages ++ -- -- ++ analysis performance -- ++ - -- long-time evaluation, trends ++ + -- ++ integration in development process -- + + -- Sonntag, 13. Mai 12 75
  • 87. VirtualForge SAP Sonar Criteria CAST AIP CodeProfiler Code Inspector ABAP Plug-In hardware requirements -- O ++ O Extendable with own rules yes/O no yes/+ no rule documentation + ++ O O Sonntag, 13. Mai 12 76
  • 89. Thanks for listening! • Contact Information • Markus.Theilen@ewe.de • Twitter: @therealtier Sonntag, 13. Mai 12 78
  • 91. CAST Custom Action Plan Viewer Sonntag, 13. Mai 12 80
  • 93. CAST Management Studio II Sonntag, 13. Mai 12 82
  • 94. CAST Action Plan Sonntag, 13. Mai 12 83
  • 100. CAST Project View Sonntag, 13. Mai 12 89
  • 101. SAP CI Result Tree Sonntag, 13. Mai 12 90
  • 102. SAP CI Tx SCII Sonntag, 13. Mai 12 91
  • 103. SAP CI Inspection Sonntag, 13. Mai 12 92
  • 104. SAP CI Object Set Sonntag, 13. Mai 12 93
  • 105. SAP CI Check Variant Sonntag, 13. Mai 12 94
  • 106. Exclude generated maintenance views • In object set you can Edit exclude generated exclude Maint.View functions groups for maintenance views • These function groups cause a lot of violations that you should not bother about Sonntag, 13. Mai 12 95
  • 107. Sonar Action Plan Sonntag, 13. Mai 12 96
  • 109. Sonar Start Page Sonntag, 13. Mai 12 98
  • 111. Sonar Tree Map Sonntag, 13. Mai 12 100