SlideShare a Scribd company logo
1 of 34
Introduction to
  Static Code Analysis


‫ניתוח סטטי של קוד‬
         ‫מבוא‬
‫צריך לחסל אותם‬
   ‫כשהם קטנים‬
‫מי אני? ולמה אני פה?‬
                         ‫• גיל קיני‬
             ‫• טריניטי תוכנה ומעבר‬
                     ‫• מנהל פורום‬
    ‫‪Static Code Analysis in Israel‬‬
               ‫• אז מה יהיה לנו ...‬
                       ‫– הגדרות‬
                         ‫– שיטות‬
                       ‫– פתרונות‬
‫איך איכות משפיעה על עלות תוכנה‬
‫כמה עולה לי ‪? BUG‬‬
‫"זמן אפס" – הנקודה הזולה‬
  ‫ביותר והיצירתית ביותר‬
     ‫בתהליך הפיתוח‬
‫‪Code Review‬‬
 ‫• תהליך של התבוננות בקוד על ידי בדיקה ויזואלית בלבד‬
‫וללא סיוע של כלים אוטומטיים, ידוע בשם המקובל סקר-‬
            ‫קוד-מקור )‪( Manual / Peer Code-Review‬‬
                                 ‫• לשם בקרת המימוש‬
                                   ‫• שיפור איכות הקוד‬
                                     ‫יעילות / ביצועים‬   ‫–‬
                                               ‫תיעוד‬    ‫–‬
                                  ‫תקינות מימוש לוגי‬     ‫–‬
                  ‫)מקום אחרון( ניפוי שגיאות "טכניות"‬    ‫–‬
‫מה זו אנליזה סטטית?‬

            ‫שיטה של דיבוג תוכנת מחשב )ניפוי שגיאות(‬     ‫•‬
   ‫סריקה וניתוח אוטומטי של קוד המקור למציאת באגים‬       ‫•‬
                            ‫ללא ביצוע או הרצת התוכנית‬   ‫•‬
‫יכול לעזור להבטיח שהקוד הינו איכותי, והמימוש הינו לפי‬   ‫•‬
                                       ‫תקני התעשייה‬
‫מה אנליזה סטטית יכולה לגלות?‬
                            ‫דליפות זיכרון‬   ‫•‬
                        ‫גלישות ממערכים‬      ‫•‬
            ‫גישה למצביעים לא מאותחלים‬       ‫•‬
                           ‫גישה ל- ‪NULL‬‬     ‫•‬
           ‫בעיות בחישוב מקבילי )נעילות(‬     ‫•‬
                                  ‫קוד מת‬    ‫•‬
              ‫שימוש לא זהיר בקלט חיצוני‬     ‫•‬
                    ‫משתנים לא מאותחלים‬      ‫•‬
Accurate Bug Identification &
                Vulnerability Analysis
Quality/Reliability              Security Vulnerability        Maintainability
Memory and resources leaks       Buffer overflow               Architectural violations
Using de-allocated memory        Un-validated user input       Header file structure
Incorrect memory de-allocation   SQL injection                 Deadcode
Dereferencing NULL pointers      Path injection                Unreachable code
Usage of uninitialized data      Cross-site scripting          Calculated values that are never
Resource management              Information leakage           used
Concurrency violations           Weak encryption               Unused function parameters
                                 Vulnerable coding practices   Unused local variables



 + Software metrics generation and management
 + Risk management and mitigation

                                           CONFIDENTIAL
‫חוזקות ויתרונות של ניתוח סטטי ...‬
          ‫• הטמעה מהירה יחסית בתהליך הפיתוח‬
        ‫• אפס מאמץ נדרש מהמפתחים למצוא באג‬
      ‫• מכסה מגוון רחב של באגים / כשלים / בעיות‬
          ‫• מוצא ומדווח על מיקום מדויק של הבאג‬
           ‫• מאפשר מחזור תיקון מהיר של באגים‬
 ‫• נועד לשימוש ע"י מפתחים למציאת באגים בשלבים‬
                         ‫מוקדמים של הפיתוח‬
                                         ‫...‬   ‫•‬
‫... חוזקות ויתרונות של ניתוח סטטי‬
                                            ‫• ...‬
‫• הכלים והתהליכים ניתנים לאוטומציה )בקלות( – קבלה‬
                      ‫מהירה של תוצאות האנליזה‬
    ‫• סורק את כלל הקוד בפרויקט לקבלת "כיסוי" מלא‬
      ‫• מאפשר קבלת מידע נוסף/תומך להבנת הבעיה‬
        ‫)‪ , (traceback‬בכך מקטין את זמן ה-"מחקר"‬
    ‫• מאפשר מציאת באגים בשלבים מוקדמים בתהליך‬
          ‫הפיתוח, מקטין עיכובים ומוזיל עלות תיקון‬
‫חולשות וחסרונות של ניתוח סטטי ...‬
               ‫• הכלים אינם תומכים בכל השפות‬
          ‫• הכלים אינם מכסים את כל סוגי הבאגים‬
‫• לא מכסים סוגיות ומצבים הקשורים בסביבת המטרה‬
                                         ‫• ...‬
‫... חולשות וחסרונות של ניתוח סטטי‬
                                                     ‫• ...‬
‫• טעויות בדיווח מסוגי דיווחי-שקר )שאינם בעיות אמיתיות(‬
                  ‫ודיווחי-חסר )פספוס בעיות אמיתיות(‬
‫– בחירה בכלים חזקים )‪ (High-End‬תחסוך לכם זמן, מאמץ, וכסף‬
      ‫• עלול לספק תחושה שקרית של בטחון שכל הבעיות‬
                                       ‫מטופלות‬
‫סטטי מול דינמי‬
                     ‫• ‪Static Code Analysis‬‬
           ‫כיסוי של כל מסלולי התוכנה האפשריים‬     ‫•‬
                 ‫מהיר – עד פי 2 מזמן קומפילציה‬    ‫•‬
                ‫טיפול במגוון רחב ביותר של בעיות‬   ‫•‬
               ‫תועלת עבור מחיר - הטובה ביותר‬      ‫•‬


                 ‫• ‪Dynamic Code Analysis‬‬
‫מכסה רק את המסלולים אשר עבורים יש ‪test cases‬‬      ‫•‬
                        ‫דורש סביבת הרצה מלאה‬      ‫•‬
                     ‫משנה את התנהגות המערכת‬       ‫•‬
Overview – Software Lifecycle
                              Validation
   System                                                          Acceptance
   Requirements                                                    Test


                              Verification                                      Phase
       Architectural                                      System                Exit
       Design                                             Test                  Criteria


                              Verification                                 Phase
            Detailed                                Integration
                                                     Integration           Exit
            Design                                  Test
                                                     Test                  Criteria

                                                                    Phase
                              Verification
                  Component                  Unit
                                             Unit                   Exit
                  Design                     Test
                                             Test                   Criteria



                                Code
                                                Static Code Analysis
Implementation Flow
Dynamic Testing
‫יכולות של כלי מודרני‬
:Over 1000 customers, including
   Computer
    Computer
   Software
    Software


  Safety-Critical
 Safety-Critical
    Software
  Embedded


   Computer
    Computer
   Hardware
    Hardware


  Network &&
   Network
    Telecom
   Telecom

   Finance &&
    Finance
    Insurance
   Insurance

Spotlight Success:              75% reduction in bugs making it into the wild
Spotlight Success:
                                50% reduction in QA reported defects
                                30% reduction in costs directly related to defects


                     CONFIDENTIAL
‫‪Customers in Israel‬‬




                      ‫לקוחות גלובליים בישראל :‬
‫‪ KLOCWORK‬אנליזה סטטית במאה ה- - 12‬
              ‫אנליזה של מיליוני שורות קוד‬   ‫•‬
                                ‫בבת אחת,‬
                ‫תוך מעקב אחר לוגיקה בין‬
                     ‫קבצים ומודולים שונים‬
                ‫שילוב מלא ב- ‪ IDE‬בעמדת‬      ‫•‬
                                   ‫המפתח‬
                   ‫שילוב בתהליך ה- ‪build‬‬    ‫•‬
                                 ‫המערכתי‬
         ‫אנליזת ארכיטקטורת התוכנה בפועל‬     ‫•‬
                   ‫להבנת הקוד בו מטפלים‬
‫‪ KLOCWORK‬אנליזה סטטית במאה ה- - 12‬

                 ‫מעקב לאורך זמן על איכות‬     ‫•‬
                                  ‫התוכנה‬
           ‫כלי למנהלים לבקרה על התהליך‬       ‫•‬
                 ‫יכולות אינטגרציה לכלי ‪bug‬‬   ‫•‬
            ‫‪ tracking‬ו- ‪ SCM‬ומערכות ‪build‬‬
               ‫הכל נגיש מ- ‪command line‬‬      ‫•‬
‫כלים לארכיטקטים‬
‫• הצגה גרפית ואינטואיטיבית של מבנה התוכנה בפועל‬
‫• יצירת מודולים ויחידות נקיות לשיפור ‪ reuse‬וחיי-מדף‬
                                      ‫ארוכים יותר‬
                  ‫• הבנה ואופטימיזציה של ‪headers‬‬
‫תובנה טובה יותר של התוכנה‬
 ‫• מעל 001 מטריקות – לפי חיתוכים שונים: פרוייקט, צוות,‬
                                                  ‫אדם‬
‫• מעקב אחר תהליך הפיתוח, הערכת וניהול סיכונים, נקיטת‬
                                     ‫צעדים מבעוד מועד‬
                                 ‫• מעודכן אוטומטית בסיום‬
                                             ‫כל אנליזה‬
‫כלים למפתחים – שילוב ב- ‪IDE‬‬
     ‫גם שילוב בסביבת הפיתוח וגם העוצמה והדיוק של‬     ‫•‬
                                  ‫אנליזה מערכתית‬
 ‫חיבור ישיר למפתח – בנוחות לסביבה הגרפית ובגמישות‬    ‫•‬
                          ‫מירבית מ- ‪command line‬‬
  ‫לראות את התמונה הגדולה – ישירות מעמדת המפתח,‬       ‫•‬
‫בדיוק המירבי, בביצועים הטובים ביותר, ובהקשר מערכתי‬
  ‫ניהול ושיתוף – טביעת אצבע של בעיה מאפשרת מעקב‬      ‫•‬
                    ‫וקישור רובסטי של הערות וסטטוס‬
‫ללא אנליזה סטטית‬

                              Cost of Defects:
                              Cost of Defects:
                              Gartner – 50 to 1000X
                              Gartner – 50 to 1000X
                              IBM – 40 to 60 X
                              IBM – 40 to 60 X
                              HP – 30 X
                              HP – 30 X




# Coding
Defects
Found
‫אנליזה סטטית כיום‬
                                                        Source code
                                                        analysis today

                                                                         Cost of Defects:
                                                                         Cost of Defects:
                                ‫• שילוב בתהליך הפיתוח‬                    Gartner – 50 to 1000X
                                                                         Gartner – 50 to 1000X
                                                                         IBM – 40 to 60 X
                                                                         IBM – 40 to 60 X
      CMMI principle is “in-phase” defect containment                    HP – 30 X
                                                                         HP – 30 X


                  ‫• הדור הראשון קידם את מציאת הבאגים‬
                                System Build ‫לשלב‬

           ! check-in ‫• הדור ההבא ימצא את הבאגים לפני‬


# Coding
Defects
Found
‫להכות בברזל כשהוא חם‬
                ‫• שילוב מלא בסביבת הפיתוח‬
                ‫• שיפור ללא החלפת הסביבה‬
           ‫• קוד ללא באגים החל מרמת המפתח‬
                                                               Cost of Defects:
                                                               Cost of Defects:
                                                               Gartner – 50 to 1000X
                                                               Gartner – 50 to 1000X
                                                               IBM – 40 to 60 X
                                                               IBM – 40 to 60 X
                                        Klocwork Insight –
                                                               HP – 30 X
                                                               HP – 30 X
                                        Don’t let bugs enter
                                        the code stream




# Coding
Defects
Found
Connected Desktop Analysis



Developer SCA - Benefits                     System SCA - Benefits
 Reported problems can be fixed right        Required for good analysis accuracy due
   away by the developer before it impacts       to “whole system” visibility
   anyone else                                Essential for management and build over
 Enables “in-phase” defect containment          build reporting on quality trends

Developer SCA – Limitations                  Systems SCA – Limitations
 Accuracy problems if a developer runs       Doesn’t enable “in-phase defect
   only a few files without full system          containment” – developers have to
   context                                       check-in broken code to find out its
 Developers can’t communicate                   broken
   changes/updates to defects they’re         Developers still caught in a “rinse and
   reviewing                                     repeat” bug finding/fix/check-in cycle
( Connected Desktop Analysis (cont’d




 Klocwork developer desktop is automatically connected with system analysis
    » Best performance, best accuracy, full system context delivered locally
    » Creates peer-to-peer collaboration on bug resolution

 Klocwork Insight is the only source code analysis solution to combine the
  productivity benefits of desktop source code analysis with the power and
  accuracy of system-wide analysis
‫הדגמה של הכלי‬
  ‫‪KLOCWORK‬‬
Confidential
Confidential
Confidential
Why Klocwork – What makes us unique

• Proven – over 1000 customers in some of the largest
  most complex software development sites in the
  world use Klocwork

• Developer Focused – Connected Desktop makes
  source code analysis part of a developer’s tool set and
  enable analysis before check-in

• Powerful – breadth of capability in one solution
  includes Quality, Security, Architecture, and Metrics
  analysis

                         Confidential
‫שאלות? טענות? מענות?‬
  ‫• איפה אפשר ללמוד עוד על הנושא?‬
                     ‫• בכל מקום ...‬


          ‫תודה !‬
            ‫גיל קיני‬
              ‫‪Gil @ Trinity.co.il‬‬

More Related Content

Viewers also liked

preparation of aspirin
preparation of aspirinpreparation of aspirin
preparation of aspirinparva1993
 
Introduction and preparation of salicylic acid
Introduction and preparation of salicylic acidIntroduction and preparation of salicylic acid
Introduction and preparation of salicylic acidyagnesh96
 
Salicylate overdose 2
Salicylate overdose 2Salicylate overdose 2
Salicylate overdose 2Malathe Nour
 

Viewers also liked (6)

preparation of aspirin
preparation of aspirinpreparation of aspirin
preparation of aspirin
 
Introduction and preparation of salicylic acid
Introduction and preparation of salicylic acidIntroduction and preparation of salicylic acid
Introduction and preparation of salicylic acid
 
Salicylate overdose 2
Salicylate overdose 2Salicylate overdose 2
Salicylate overdose 2
 
Chemistry of Aspirin
Chemistry of AspirinChemistry of Aspirin
Chemistry of Aspirin
 
Aspirin
AspirinAspirin
Aspirin
 
Aspirin
AspirinAspirin
Aspirin
 

Similar to הרצאת מבוא לאנליזה סטטית ע"י טריניטי תוכנה ומעבר

מהי אנליזה סטטית?
מהי אנליזה סטטית?מהי אנליזה סטטית?
מהי אנליזה סטטית?TrinitySB
 
Qa extreme2011 from classic lc to agile and the testers types of the future_b...
Qa extreme2011 from classic lc to agile and the testers types of the future_b...Qa extreme2011 from classic lc to agile and the testers types of the future_b...
Qa extreme2011 from classic lc to agile and the testers types of the future_b...Eran Kinsbrunner
 
שיחת ייעוץ וירטואלית בדיקות תוכנה 3
שיחת ייעוץ וירטואלית בדיקות תוכנה  3שיחת ייעוץ וירטואלית בדיקות תוכנה  3
שיחת ייעוץ וירטואלית בדיקות תוכנה 3goldts
 
מדידת החזר על השקעה בתהליך פיתוח איכותי
מדידת החזר על השקעה בתהליך פיתוח איכותימדידת החזר על השקעה בתהליך פיתוח איכותי
מדידת החזר על השקעה בתהליך פיתוח איכותיTrinitySB
 
Agile For Website Managers
Agile For Website ManagersAgile For Website Managers
Agile For Website ManagersUdi Salant
 
Agile, XP and Scrum
Agile, XP and ScrumAgile, XP and Scrum
Agile, XP and ScrumAlon Lahav
 
Tescom CM and ALM with IBM Rational (1)
Tescom CM and ALM with IBM Rational (1)Tescom CM and ALM with IBM Rational (1)
Tescom CM and ALM with IBM Rational (1)Tuval Hose
 
Rm saa s for share
Rm saa s for shareRm saa s for share
Rm saa s for shareManageware
 
Rm saa s for share 2
Rm saa s for share 2Rm saa s for share 2
Rm saa s for share 2Manageware
 
Rm saa s for share 2
Rm saa s for share 2Rm saa s for share 2
Rm saa s for share 2Manageware
 
UXI Live 2011 - בדיקות מומחה לממשק
UXI Live 2011 -  בדיקות מומחה לממשקUXI Live 2011 -  בדיקות מומחה לממשק
UXI Live 2011 - בדיקות מומחה לממשקranl
 
הטמעה וניהול נכון ובטוח של קוד פתוח בארגון - טריניטי
הטמעה וניהול נכון ובטוח של קוד פתוח בארגון - טריניטיהטמעה וניהול נכון ובטוח של קוד פתוח בארגון - טריניטי
הטמעה וניהול נכון ובטוח של קוד פתוח בארגון - טריניטיTrinitySB
 
FinanceIT MIS DSS מערכות מידע ניהוליות תומכות החלטה
FinanceIT MIS DSS מערכות מידע ניהוליות תומכות החלטהFinanceIT MIS DSS מערכות מידע ניהוליות תומכות החלטה
FinanceIT MIS DSS מערכות מידע ניהוליות תומכות החלטהFinanceIT MIS DSS
 
ממשק - בדיקות מומחה
ממשק - בדיקות מומחהממשק - בדיקות מומחה
ממשק - בדיקות מומחהRan Liron
 
STR - amit ,nir,micha
STR - amit ,nir,michaSTR - amit ,nir,micha
STR - amit ,nir,michaamit ziserman
 
החלטתם שהארגון שלכם צריך אוטומציה חכמה. מה עכשיו?
החלטתם שהארגון שלכם צריך אוטומציה חכמה. מה עכשיו?החלטתם שהארגון שלכם צריך אוטומציה חכמה. מה עכשיו?
החלטתם שהארגון שלכם צריך אוטומציה חכמה. מה עכשיו?Boris Chernyak
 
הטוב בעולם WMS
 הטוב בעולם WMS  הטוב בעולם WMS
הטוב בעולם WMS Asaf Levi
 

Similar to הרצאת מבוא לאנליזה סטטית ע"י טריניטי תוכנה ומעבר (20)

מהי אנליזה סטטית?
מהי אנליזה סטטית?מהי אנליזה סטטית?
מהי אנליזה סטטית?
 
Qa extreme2011 from classic lc to agile and the testers types of the future_b...
Qa extreme2011 from classic lc to agile and the testers types of the future_b...Qa extreme2011 from classic lc to agile and the testers types of the future_b...
Qa extreme2011 from classic lc to agile and the testers types of the future_b...
 
שיחת ייעוץ וירטואלית בדיקות תוכנה 3
שיחת ייעוץ וירטואלית בדיקות תוכנה  3שיחת ייעוץ וירטואלית בדיקות תוכנה  3
שיחת ייעוץ וירטואלית בדיקות תוכנה 3
 
מדידת החזר על השקעה בתהליך פיתוח איכותי
מדידת החזר על השקעה בתהליך פיתוח איכותימדידת החזר על השקעה בתהליך פיתוח איכותי
מדידת החזר על השקעה בתהליך פיתוח איכותי
 
Trends2010
Trends2010Trends2010
Trends2010
 
Agile For Website Managers
Agile For Website ManagersAgile For Website Managers
Agile For Website Managers
 
Agile, XP and Scrum
Agile, XP and ScrumAgile, XP and Scrum
Agile, XP and Scrum
 
Tescom CM and ALM with IBM Rational (1)
Tescom CM and ALM with IBM Rational (1)Tescom CM and ALM with IBM Rational (1)
Tescom CM and ALM with IBM Rational (1)
 
07 08 istm - it project management-amn
07 08 istm - it project management-amn07 08 istm - it project management-amn
07 08 istm - it project management-amn
 
Rm saa s for share
Rm saa s for shareRm saa s for share
Rm saa s for share
 
Rm saa s for share 2
Rm saa s for share 2Rm saa s for share 2
Rm saa s for share 2
 
Rm saa s for share 2
Rm saa s for share 2Rm saa s for share 2
Rm saa s for share 2
 
UXI Live 2011 - בדיקות מומחה לממשק
UXI Live 2011 -  בדיקות מומחה לממשקUXI Live 2011 -  בדיקות מומחה לממשק
UXI Live 2011 - בדיקות מומחה לממשק
 
Scm
ScmScm
Scm
 
הטמעה וניהול נכון ובטוח של קוד פתוח בארגון - טריניטי
הטמעה וניהול נכון ובטוח של קוד פתוח בארגון - טריניטיהטמעה וניהול נכון ובטוח של קוד פתוח בארגון - טריניטי
הטמעה וניהול נכון ובטוח של קוד פתוח בארגון - טריניטי
 
FinanceIT MIS DSS מערכות מידע ניהוליות תומכות החלטה
FinanceIT MIS DSS מערכות מידע ניהוליות תומכות החלטהFinanceIT MIS DSS מערכות מידע ניהוליות תומכות החלטה
FinanceIT MIS DSS מערכות מידע ניהוליות תומכות החלטה
 
ממשק - בדיקות מומחה
ממשק - בדיקות מומחהממשק - בדיקות מומחה
ממשק - בדיקות מומחה
 
STR - amit ,nir,micha
STR - amit ,nir,michaSTR - amit ,nir,micha
STR - amit ,nir,micha
 
החלטתם שהארגון שלכם צריך אוטומציה חכמה. מה עכשיו?
החלטתם שהארגון שלכם צריך אוטומציה חכמה. מה עכשיו?החלטתם שהארגון שלכם צריך אוטומציה חכמה. מה עכשיו?
החלטתם שהארגון שלכם צריך אוטומציה חכמה. מה עכשיו?
 
הטוב בעולם WMS
 הטוב בעולם WMS  הטוב בעולם WMS
הטוב בעולם WMS
 

הרצאת מבוא לאנליזה סטטית ע"י טריניטי תוכנה ומעבר

  • 1. Introduction to Static Code Analysis ‫ניתוח סטטי של קוד‬ ‫מבוא‬
  • 2. ‫צריך לחסל אותם‬ ‫כשהם קטנים‬
  • 3. ‫מי אני? ולמה אני פה?‬ ‫• גיל קיני‬ ‫• טריניטי תוכנה ומעבר‬ ‫• מנהל פורום‬ ‫‪Static Code Analysis in Israel‬‬ ‫• אז מה יהיה לנו ...‬ ‫– הגדרות‬ ‫– שיטות‬ ‫– פתרונות‬
  • 4. ‫איך איכות משפיעה על עלות תוכנה‬
  • 5. ‫כמה עולה לי ‪? BUG‬‬ ‫"זמן אפס" – הנקודה הזולה‬ ‫ביותר והיצירתית ביותר‬ ‫בתהליך הפיתוח‬
  • 6. ‫‪Code Review‬‬ ‫• תהליך של התבוננות בקוד על ידי בדיקה ויזואלית בלבד‬ ‫וללא סיוע של כלים אוטומטיים, ידוע בשם המקובל סקר-‬ ‫קוד-מקור )‪( Manual / Peer Code-Review‬‬ ‫• לשם בקרת המימוש‬ ‫• שיפור איכות הקוד‬ ‫יעילות / ביצועים‬ ‫–‬ ‫תיעוד‬ ‫–‬ ‫תקינות מימוש לוגי‬ ‫–‬ ‫)מקום אחרון( ניפוי שגיאות "טכניות"‬ ‫–‬
  • 7. ‫מה זו אנליזה סטטית?‬ ‫שיטה של דיבוג תוכנת מחשב )ניפוי שגיאות(‬ ‫•‬ ‫סריקה וניתוח אוטומטי של קוד המקור למציאת באגים‬ ‫•‬ ‫ללא ביצוע או הרצת התוכנית‬ ‫•‬ ‫יכול לעזור להבטיח שהקוד הינו איכותי, והמימוש הינו לפי‬ ‫•‬ ‫תקני התעשייה‬
  • 8. ‫מה אנליזה סטטית יכולה לגלות?‬ ‫דליפות זיכרון‬ ‫•‬ ‫גלישות ממערכים‬ ‫•‬ ‫גישה למצביעים לא מאותחלים‬ ‫•‬ ‫גישה ל- ‪NULL‬‬ ‫•‬ ‫בעיות בחישוב מקבילי )נעילות(‬ ‫•‬ ‫קוד מת‬ ‫•‬ ‫שימוש לא זהיר בקלט חיצוני‬ ‫•‬ ‫משתנים לא מאותחלים‬ ‫•‬
  • 9. Accurate Bug Identification & Vulnerability Analysis Quality/Reliability Security Vulnerability Maintainability Memory and resources leaks Buffer overflow Architectural violations Using de-allocated memory Un-validated user input Header file structure Incorrect memory de-allocation SQL injection Deadcode Dereferencing NULL pointers Path injection Unreachable code Usage of uninitialized data Cross-site scripting Calculated values that are never Resource management Information leakage used Concurrency violations Weak encryption Unused function parameters Vulnerable coding practices Unused local variables + Software metrics generation and management + Risk management and mitigation CONFIDENTIAL
  • 10. ‫חוזקות ויתרונות של ניתוח סטטי ...‬ ‫• הטמעה מהירה יחסית בתהליך הפיתוח‬ ‫• אפס מאמץ נדרש מהמפתחים למצוא באג‬ ‫• מכסה מגוון רחב של באגים / כשלים / בעיות‬ ‫• מוצא ומדווח על מיקום מדויק של הבאג‬ ‫• מאפשר מחזור תיקון מהיר של באגים‬ ‫• נועד לשימוש ע"י מפתחים למציאת באגים בשלבים‬ ‫מוקדמים של הפיתוח‬ ‫...‬ ‫•‬
  • 11. ‫... חוזקות ויתרונות של ניתוח סטטי‬ ‫• ...‬ ‫• הכלים והתהליכים ניתנים לאוטומציה )בקלות( – קבלה‬ ‫מהירה של תוצאות האנליזה‬ ‫• סורק את כלל הקוד בפרויקט לקבלת "כיסוי" מלא‬ ‫• מאפשר קבלת מידע נוסף/תומך להבנת הבעיה‬ ‫)‪ , (traceback‬בכך מקטין את זמן ה-"מחקר"‬ ‫• מאפשר מציאת באגים בשלבים מוקדמים בתהליך‬ ‫הפיתוח, מקטין עיכובים ומוזיל עלות תיקון‬
  • 12. ‫חולשות וחסרונות של ניתוח סטטי ...‬ ‫• הכלים אינם תומכים בכל השפות‬ ‫• הכלים אינם מכסים את כל סוגי הבאגים‬ ‫• לא מכסים סוגיות ומצבים הקשורים בסביבת המטרה‬ ‫• ...‬
  • 13. ‫... חולשות וחסרונות של ניתוח סטטי‬ ‫• ...‬ ‫• טעויות בדיווח מסוגי דיווחי-שקר )שאינם בעיות אמיתיות(‬ ‫ודיווחי-חסר )פספוס בעיות אמיתיות(‬ ‫– בחירה בכלים חזקים )‪ (High-End‬תחסוך לכם זמן, מאמץ, וכסף‬ ‫• עלול לספק תחושה שקרית של בטחון שכל הבעיות‬ ‫מטופלות‬
  • 14. ‫סטטי מול דינמי‬ ‫• ‪Static Code Analysis‬‬ ‫כיסוי של כל מסלולי התוכנה האפשריים‬ ‫•‬ ‫מהיר – עד פי 2 מזמן קומפילציה‬ ‫•‬ ‫טיפול במגוון רחב ביותר של בעיות‬ ‫•‬ ‫תועלת עבור מחיר - הטובה ביותר‬ ‫•‬ ‫• ‪Dynamic Code Analysis‬‬ ‫מכסה רק את המסלולים אשר עבורים יש ‪test cases‬‬ ‫•‬ ‫דורש סביבת הרצה מלאה‬ ‫•‬ ‫משנה את התנהגות המערכת‬ ‫•‬
  • 15. Overview – Software Lifecycle Validation System Acceptance Requirements Test Verification Phase Architectural System Exit Design Test Criteria Verification Phase Detailed Integration Integration Exit Design Test Test Criteria Phase Verification Component Unit Unit Exit Design Test Test Criteria Code Static Code Analysis Implementation Flow Dynamic Testing
  • 16. ‫יכולות של כלי מודרני‬
  • 17. :Over 1000 customers, including Computer Computer Software Software Safety-Critical Safety-Critical Software Embedded Computer Computer Hardware Hardware Network && Network Telecom Telecom Finance && Finance Insurance Insurance Spotlight Success: 75% reduction in bugs making it into the wild Spotlight Success: 50% reduction in QA reported defects 30% reduction in costs directly related to defects CONFIDENTIAL
  • 18. ‫‪Customers in Israel‬‬ ‫לקוחות גלובליים בישראל :‬
  • 19. ‫‪ KLOCWORK‬אנליזה סטטית במאה ה- - 12‬ ‫אנליזה של מיליוני שורות קוד‬ ‫•‬ ‫בבת אחת,‬ ‫תוך מעקב אחר לוגיקה בין‬ ‫קבצים ומודולים שונים‬ ‫שילוב מלא ב- ‪ IDE‬בעמדת‬ ‫•‬ ‫המפתח‬ ‫שילוב בתהליך ה- ‪build‬‬ ‫•‬ ‫המערכתי‬ ‫אנליזת ארכיטקטורת התוכנה בפועל‬ ‫•‬ ‫להבנת הקוד בו מטפלים‬
  • 20. ‫‪ KLOCWORK‬אנליזה סטטית במאה ה- - 12‬ ‫מעקב לאורך זמן על איכות‬ ‫•‬ ‫התוכנה‬ ‫כלי למנהלים לבקרה על התהליך‬ ‫•‬ ‫יכולות אינטגרציה לכלי ‪bug‬‬ ‫•‬ ‫‪ tracking‬ו- ‪ SCM‬ומערכות ‪build‬‬ ‫הכל נגיש מ- ‪command line‬‬ ‫•‬
  • 21. ‫כלים לארכיטקטים‬ ‫• הצגה גרפית ואינטואיטיבית של מבנה התוכנה בפועל‬ ‫• יצירת מודולים ויחידות נקיות לשיפור ‪ reuse‬וחיי-מדף‬ ‫ארוכים יותר‬ ‫• הבנה ואופטימיזציה של ‪headers‬‬
  • 22. ‫תובנה טובה יותר של התוכנה‬ ‫• מעל 001 מטריקות – לפי חיתוכים שונים: פרוייקט, צוות,‬ ‫אדם‬ ‫• מעקב אחר תהליך הפיתוח, הערכת וניהול סיכונים, נקיטת‬ ‫צעדים מבעוד מועד‬ ‫• מעודכן אוטומטית בסיום‬ ‫כל אנליזה‬
  • 23. ‫כלים למפתחים – שילוב ב- ‪IDE‬‬ ‫גם שילוב בסביבת הפיתוח וגם העוצמה והדיוק של‬ ‫•‬ ‫אנליזה מערכתית‬ ‫חיבור ישיר למפתח – בנוחות לסביבה הגרפית ובגמישות‬ ‫•‬ ‫מירבית מ- ‪command line‬‬ ‫לראות את התמונה הגדולה – ישירות מעמדת המפתח,‬ ‫•‬ ‫בדיוק המירבי, בביצועים הטובים ביותר, ובהקשר מערכתי‬ ‫ניהול ושיתוף – טביעת אצבע של בעיה מאפשרת מעקב‬ ‫•‬ ‫וקישור רובסטי של הערות וסטטוס‬
  • 24. ‫ללא אנליזה סטטית‬ Cost of Defects: Cost of Defects: Gartner – 50 to 1000X Gartner – 50 to 1000X IBM – 40 to 60 X IBM – 40 to 60 X HP – 30 X HP – 30 X # Coding Defects Found
  • 25. ‫אנליזה סטטית כיום‬ Source code analysis today Cost of Defects: Cost of Defects: ‫• שילוב בתהליך הפיתוח‬ Gartner – 50 to 1000X Gartner – 50 to 1000X IBM – 40 to 60 X IBM – 40 to 60 X CMMI principle is “in-phase” defect containment HP – 30 X HP – 30 X ‫• הדור הראשון קידם את מציאת הבאגים‬ System Build ‫לשלב‬ ! check-in ‫• הדור ההבא ימצא את הבאגים לפני‬ # Coding Defects Found
  • 26. ‫להכות בברזל כשהוא חם‬ ‫• שילוב מלא בסביבת הפיתוח‬ ‫• שיפור ללא החלפת הסביבה‬ ‫• קוד ללא באגים החל מרמת המפתח‬ Cost of Defects: Cost of Defects: Gartner – 50 to 1000X Gartner – 50 to 1000X IBM – 40 to 60 X IBM – 40 to 60 X Klocwork Insight – HP – 30 X HP – 30 X Don’t let bugs enter the code stream # Coding Defects Found
  • 27. Connected Desktop Analysis Developer SCA - Benefits System SCA - Benefits  Reported problems can be fixed right  Required for good analysis accuracy due away by the developer before it impacts to “whole system” visibility anyone else  Essential for management and build over  Enables “in-phase” defect containment build reporting on quality trends Developer SCA – Limitations Systems SCA – Limitations  Accuracy problems if a developer runs  Doesn’t enable “in-phase defect only a few files without full system containment” – developers have to context check-in broken code to find out its  Developers can’t communicate broken changes/updates to defects they’re  Developers still caught in a “rinse and reviewing repeat” bug finding/fix/check-in cycle
  • 28. ( Connected Desktop Analysis (cont’d  Klocwork developer desktop is automatically connected with system analysis » Best performance, best accuracy, full system context delivered locally » Creates peer-to-peer collaboration on bug resolution  Klocwork Insight is the only source code analysis solution to combine the productivity benefits of desktop source code analysis with the power and accuracy of system-wide analysis
  • 29. ‫הדגמה של הכלי‬ ‫‪KLOCWORK‬‬
  • 33. Why Klocwork – What makes us unique • Proven – over 1000 customers in some of the largest most complex software development sites in the world use Klocwork • Developer Focused – Connected Desktop makes source code analysis part of a developer’s tool set and enable analysis before check-in • Powerful – breadth of capability in one solution includes Quality, Security, Architecture, and Metrics analysis Confidential
  • 34. ‫שאלות? טענות? מענות?‬ ‫• איפה אפשר ללמוד עוד על הנושא?‬ ‫• בכל מקום ...‬ ‫תודה !‬ ‫גיל קיני‬ ‫‪Gil @ Trinity.co.il‬‬

Editor's Notes

  1. © IPL Information Processing Limited Introduce Unit and Integration Testing in relation to traditional Waterfall development lifecycle. Phase Exit Criteria What determines how we move from one testing stage to the next – Phase exit critera: Does the implementation match the design / does it do what it should do (and nothing else)? How much of the code have we tested – code coverage requirements. Verification Flow NB - the verification flow is from test to appropriate de-composed design level. If you are not testing the software object against its designed requirements, then you will end up testing against the code implementation (i.e. only testing that the code does is what the code does) which can give you a false confidence. This is helpful when addressing the question of automatic test case generation. Cantata++ V5 parses the source code to provide all the parameters and global data information required to set data values for test cases, but it does not use this parse to set the data values for test cases – as that would be just testing the code does what the code does (which it will if it compiles), not what it should do according to the design requirement/specification.
  2. - This slide provides additional details on Klocwork’s Architecture and Header File Anomalies
  3. - This slide provides additional details on Klocwork’s Architecture and Header File Anomalies
  4. Developers are the key to the creative process Tools to support developers must work for the developer, not against them: Effectively locate defects and vulnerabilities as early as possible Integrate into the developer’s preferred working environment, don’t force the developer to go “somewhere else” for the information And they must be as non-intrusive as possible Must execute quickly Mustn’t overload the developer with too much “noise” Klocwork Developer High performance defect and vulnerability detection Tightly integrated into major development environments Visual Studio Eclipse IDEA Available via command line interface for non-IDE interaction Providing support for C, C++ and Java on a variety of O/S platforms