SlideShare a Scribd company logo
1 of 22
Download to read offline
1/12

International Workshop on Principles of Software Evolution · Helsinki, Finland, 1 September 2003




How History Justifies
System Architecture (or not)
Thomas Zimmermann
(with Stephan Diehl and Andreas Zeller)
Lehrstuhl Softwaretechnik
Universit¨t des Saarlandes, Saarbr¨cken, Germany
         a                        u
2/12
The Problem
Your task: extend the debug component in GCC!
You identify the variable xcoff debug hooks.
What else do you need to change?
2/12
The Problem
Your task: extend the debug component in GCC!
You identify the variable xcoff debug hooks.
What else do you need to change?

General issue: only change coupled entities!
You can detect existing coupling by

 • Program Analysis—e.g. def-use associations.
 • Learning from History—entities changed together.
3/12
Evolutionary Coupling
                                   34
     gcc/gcc/dbxout.c [134]             gcc/gcc/sdbout.c [74]
                dbx_debug_hooks         sdb_debug_hooks

                      [12]                    [12]



                      [10]
               xcoff_debug_hooks
3/12
Evolutionary Coupling
                                      34
        gcc/gcc/dbxout.c [134]                  gcc/gcc/sdbout.c [74]
                   dbx_debug_hooks              sdb_debug_hooks
                                      12
                         [12]                         [12]
                                           10
                       10

                         [10]
                  xcoff_debug_hooks




Support: How much evidence (= simultaneous changes)?
Confidence: How relevant is coupling for participants?
3/12
Evolutionary Coupling
                                             34
        gcc/gcc/dbxout.c [134]                         gcc/gcc/sdbout.c [74]
                   dbx_debug_hooks                     sdb_debug_hooks
                                             12
                            [12]                              [12]
                                         4        10
                                                                 4
                         10

                            [10]                               [4]
                                             4
                   xcoff_debug_hooks                    sdb_global_decl()

                   dbx_functions_end()

             [6]            [7]
                     2
        dbx_symbol_name()


Support: How much evidence (= simultaneous changes)?
Confidence: How relevant is coupling for participants?
4/12
What We Do
Our ROSE prototype analyzes evolution of CVS archives.


                            ROSE                       Couplings
              Reengineering Of Software Evolution
                                                       Graphs
 CVS
              Step 1: Restore Transactions from CVS
                                                       Metrics
              Step 2: Identify Modified Entities


ROSE determines entities at different granularities:

coarse-granular entities: directories, modules, files
fine-granular entities: methods, variables, sections
5/12
Step 1: Restoring Transactions
Two atomic changes δi and δi+1 are part of one
transaction ∆ = (δ1 , . . . , δn ) if:

                   author(δi ) = author(δi+1 ) ∧
              log message(δi ) = log message(δi+1 ) ∧
        |time(δi+1 ) − time(δi )| < 200 seconds

We use a sliding window instead of a fixed one.


GNU C Compiler (GCC):
The average transaction length is 6.2 seconds.
The maximal transaction length is 1 hour 32 minutes.
6/12
Step 2: Light-Weight Analysis
      File: Animals.java

      1 class Cat {
      3   public String[] COLORS = {
              ...
     23   }

     25   public Cat() {
              ...
     30   }
          ...
     56 }
     58 class Dog {
     60   public String[] COLORS = {
              ...
     80   }
          ...
     99 }
6/12
Step 2: Light-Weight Analysis
      File: Animals.java               Step A: Map to Entities

      1 class Cat {
      3   public String[] COLORS = {   Cat.COLORS
                ...
                                       lines 3-23
     23     }
                                                     Class Cat
     25                                              lines 1-56
            public Cat() {             Cat.Cat()
                ...
                                       lines 25-30
     30   }
          ...
     56 }
     58 class Dog {
     60   public String[] COLORS = {   Dog.COLORS    Class Dog
              ...
                                       lines 60-80   lines 58-99
     80     }
            ...
     99 }
6/12
Step 2: Light-Weight Analysis
         File: Animals.java              Step A: Map to Entities

        1 class Cat {
        3   public String[] COLORS = {
                                         Cat.COLORS
       17     ...
                                         lines 3-23
       23   }
                                                       Class Cat
       25                                              lines 1-56
            public Cat() {
                                         Cat.Cat()
                ...
                                         lines 25-30
       30   }
            ...
       56 }
       58 class Dog {
       60   public String[] COLORS = {
                                         Dog.COLORS    Class Dog
                ...
                                         lines 60-80   lines 58-99
       80     }
              ...
       99 }

                                         Step B: Filter Entities


We analyze C/C++, JAVA, PYTHON, TEX and TEXINFO files.
We get the modified methods, variables and subsections.
7/12
Example: GCC

                               i386.c
           pentiumpro_cost
               [12]
 i486_cost
                       pentium_cost
   [11]
                      [11]


    [12]
   i386_cost [14]
            k6_cost
7/12
Example: GCC

                               i386.c
           pentiumpro_cost
               [12]
 i486_cost
                       pentium_cost
   [11]
                      [11]
              11
    [12]
   i386_cost [14]
            k6_cost
7/12
Example: GCC

                               i386.c       i386.h
           pentiumpro_cost
               [12]
 i486_cost
                       pentium_cost
   [11]
                                        9
                      [11]                            [11]
              11
                                                     processor_cost
    [12]
   i386_cost [14]
            k6_cost
8/12
Visualizing Coupling
    A   B   C   D
                       High Confidence
A

B
C
                       Low Confidence
D
                       No Coupling (No Support)
8/12
Visualizing Coupling
     A     B     C   D
                                High Confidence
A

B
C
                                Low Confidence
D
                                No Coupling (No Support)
     A               C
               [3]         A ⇒ C: Confidence 3/10 = 30%
    [10]             [4]
                           C ⇒ A: Confidence 3/4 = 75%
9/12
Comparing Architecture with Evolution


                               Directory
                                 ddd/




                              DDD Source



                                  Libraries
           Pics
            Icons

                    Patches

                     Tests
9/12
Comparing Architecture with Evolution


                               Directory
                                 ddd/




                              DDD Source
                                               Bad architecture



                                  Libraries
           Pics
            Icons

                    Patches

                     Tests
                                              Better architecture
10/12
Measuring Evolutionary Coupling
Evolutionary Coupling Index (ECI).
   Different levels: entity/file or file/directory level.
                            # external couplings
                    ECI =
                            # internal couplings

The lower the ECI, the better the modularity.
10/12
Measuring Evolutionary Coupling
Evolutionary Coupling Index (ECI).
   Different levels: entity/file or file/directory level.
                            # external couplings
                    ECI =
                            # internal couplings

The lower the ECI, the better the modularity.

                File/Directory         Entity/File
                      ECI             ECI     ECIfiltered
        GCC          5.757            3.615    1.504
        DDD          0.250            4.462    1.922
        APACHE       2.827           11.815    0.675
        OPENSSL      8.665          101.053    7.859

Comparing only one level may be misleading (DDD).
11/12
Guiding the Programmer
12/12
Conclusion
Fine-grained evolutionary coupling. . .

 • detects coupling between non-program entities.
   e.g. coupling between a function and a database schema
 • guides developers while making changes.
   Programmers who changed this function also changed. . .
 • gives better(?) results than coarse-grained coupling.
   Coupling between files doesn’t tell you that much
 • can be compared with given coupling (= architecture).
   Results are mixed—what is coupling, anyway?

Those who cannot learn from history are doomed to repeat it.
                    (George Santayana)

More Related Content

What's hot

Advanced Java Practical File
Advanced Java Practical FileAdvanced Java Practical File
Advanced Java Practical File
Soumya Behera
 
Undoing Event-driven Adaptation of Business Processes
Undoing Event-driven Adaptation of Business ProcessesUndoing Event-driven Adaptation of Business Processes
Undoing Event-driven Adaptation of Business Processes
Sébastien Mosser
 

What's hot (20)

Advanced Java Practical File
Advanced Java Practical FileAdvanced Java Practical File
Advanced Java Practical File
 
Ad java prac sol set
Ad java prac sol setAd java prac sol set
Ad java prac sol set
 
Developing for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQLDeveloping for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQL
 
Hibernate
HibernateHibernate
Hibernate
 
Threads v3
Threads v3Threads v3
Threads v3
 
Undoing Event-driven Adaptation of Business Processes
Undoing Event-driven Adaptation of Business ProcessesUndoing Event-driven Adaptation of Business Processes
Undoing Event-driven Adaptation of Business Processes
 
Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)Rules Engine - java(Drools) & ruby(ruleby)
Rules Engine - java(Drools) & ruby(ruleby)
 
The uniform interface is 42
The uniform interface is 42The uniform interface is 42
The uniform interface is 42
 
Swift for TensorFlow - CoreML Personalization
Swift for TensorFlow - CoreML PersonalizationSwift for TensorFlow - CoreML Personalization
Swift for TensorFlow - CoreML Personalization
 
Clojure: a LISP for the JVM
Clojure: a LISP for the JVMClojure: a LISP for the JVM
Clojure: a LISP for the JVM
 
DynaMine: Finding Common Error Patterns by Mining Software Revision Histories
DynaMine: Finding Common Error Patterns by Mining Software Revision HistoriesDynaMine: Finding Common Error Patterns by Mining Software Revision Histories
DynaMine: Finding Common Error Patterns by Mining Software Revision Histories
 
Vaadin 7
Vaadin 7Vaadin 7
Vaadin 7
 
Talk - Query monad
Talk - Query monad Talk - Query monad
Talk - Query monad
 
Jdbc oracle
Jdbc oracleJdbc oracle
Jdbc oracle
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
 
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMEREVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
 
Unit Testing with Foq
Unit Testing with FoqUnit Testing with Foq
Unit Testing with Foq
 
Java
JavaJava
Java
 
Metrics for example Java project
Metrics for example Java projectMetrics for example Java project
Metrics for example Java project
 
OR Mapping- nhibernate Presentation
OR Mapping- nhibernate PresentationOR Mapping- nhibernate Presentation
OR Mapping- nhibernate Presentation
 

Viewers also liked

Viewers also liked (19)

Predicting Subsystem Defects using Dependency Graph Complexities
Predicting Subsystem Defects using Dependency Graph Complexities Predicting Subsystem Defects using Dependency Graph Complexities
Predicting Subsystem Defects using Dependency Graph Complexities
 
Preprocessing CVS Data for Fine-Grained Analysis
Preprocessing CVS Data for Fine-Grained AnalysisPreprocessing CVS Data for Fine-Grained Analysis
Preprocessing CVS Data for Fine-Grained Analysis
 
Mining Version Archives for Co-changed Lines
Mining Version Archives for Co-changed LinesMining Version Archives for Co-changed Lines
Mining Version Archives for Co-changed Lines
 
Aspect Mining for Large Systems
Aspect Mining for Large SystemsAspect Mining for Large Systems
Aspect Mining for Large Systems
 
Mining Workspace Updates in CVS
Mining Workspace Updates in CVSMining Workspace Updates in CVS
Mining Workspace Updates in CVS
 
Meet Tom and his Fish
Meet Tom and his FishMeet Tom and his Fish
Meet Tom and his Fish
 
Not my bug! Reasons for software bug report reassignments
Not my bug! Reasons for software bug report reassignmentsNot my bug! Reasons for software bug report reassignments
Not my bug! Reasons for software bug report reassignments
 
Automatic Identification of Bug-Introducing Changes
Automatic Identification of Bug-Introducing ChangesAutomatic Identification of Bug-Introducing Changes
Automatic Identification of Bug-Introducing Changes
 
Quality of Bug Reports in Open Source
Quality of Bug Reports in Open SourceQuality of Bug Reports in Open Source
Quality of Bug Reports in Open Source
 
Characterizing and Predicting Which Bugs Get Reopened
Characterizing and Predicting Which Bugs Get ReopenedCharacterizing and Predicting Which Bugs Get Reopened
Characterizing and Predicting Which Bugs Get Reopened
 
esolang: Esoterische Programmiersprachen
esolang: Esoterische Programmiersprachenesolang: Esoterische Programmiersprachen
esolang: Esoterische Programmiersprachen
 
Security trend analysis with CVE topic models
Security trend analysis with CVE topic modelsSecurity trend analysis with CVE topic models
Security trend analysis with CVE topic models
 
Characterizing and predicting which bugs get fixed
Characterizing and predicting which bugs get fixedCharacterizing and predicting which bugs get fixed
Characterizing and predicting which bugs get fixed
 
Changes and Bugs: Mining and Predicting Development Activities
Changes and Bugs: Mining and Predicting Development ActivitiesChanges and Bugs: Mining and Predicting Development Activities
Changes and Bugs: Mining and Predicting Development Activities
 
Got Myth? Myths in Software Engineering
Got Myth? Myths in Software EngineeringGot Myth? Myths in Software Engineering
Got Myth? Myths in Software Engineering
 
Predicting Defects using Network Analysis on Dependency Graphs
Predicting Defects using Network Analysis on Dependency GraphsPredicting Defects using Network Analysis on Dependency Graphs
Predicting Defects using Network Analysis on Dependency Graphs
 
When do changes induce fixes?
When do changes induce fixes?When do changes induce fixes?
When do changes induce fixes?
 
Software Analytics = Sharing Information
Software Analytics = Sharing InformationSoftware Analytics = Sharing Information
Software Analytics = Sharing Information
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
 

Similar to How History Justifies System Architecture (or Not)

Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
Raffi Khatchadourian
 

Similar to How History Justifies System Architecture (or Not) (20)

Lambdas & Streams
Lambdas & StreamsLambdas & Streams
Lambdas & Streams
 
Accelerating Random Forests in Scikit-Learn
Accelerating Random Forests in Scikit-LearnAccelerating Random Forests in Scikit-Learn
Accelerating Random Forests in Scikit-Learn
 
Automatic and Interpretable Machine Learning with H2O and LIME
Automatic and Interpretable Machine Learning with H2O and LIMEAutomatic and Interpretable Machine Learning with H2O and LIME
Automatic and Interpretable Machine Learning with H2O and LIME
 
Collections forceawakens
Collections forceawakensCollections forceawakens
Collections forceawakens
 
Effective Java, Third Edition - Keepin' it Effective
Effective Java, Third Edition - Keepin' it EffectiveEffective Java, Third Edition - Keepin' it Effective
Effective Java, Third Edition - Keepin' it Effective
 
Java collections the force awakens
Java collections  the force awakensJava collections  the force awakens
Java collections the force awakens
 
A Taste of Dotty
A Taste of DottyA Taste of Dotty
A Taste of Dotty
 
Design patterns with kotlin
Design patterns with kotlinDesign patterns with kotlin
Design patterns with kotlin
 
Solid scala
Solid scalaSolid scala
Solid scala
 
Oops recap
Oops recapOops recap
Oops recap
 
Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)
 
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
Towards Safe Automated Refactoring of Imperative Deep Learning Programs to Gr...
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEW
 
k-means algorithm implementation on Hadoop
k-means algorithm implementation on Hadoopk-means algorithm implementation on Hadoop
k-means algorithm implementation on Hadoop
 
BARRACUDA, AN OPEN SOURCE FRAMEWORK FOR PARALLELIZING DIVIDE AND CONQUER ALGO...
BARRACUDA, AN OPEN SOURCE FRAMEWORK FOR PARALLELIZING DIVIDE AND CONQUER ALGO...BARRACUDA, AN OPEN SOURCE FRAMEWORK FOR PARALLELIZING DIVIDE AND CONQUER ALGO...
BARRACUDA, AN OPEN SOURCE FRAMEWORK FOR PARALLELIZING DIVIDE AND CONQUER ALGO...
 
Clojure And Swing
Clojure And SwingClojure And Swing
Clojure And Swing
 
Machine Learning meets DevOps
Machine Learning meets DevOpsMachine Learning meets DevOps
Machine Learning meets DevOps
 
BDS_QA.pdf
BDS_QA.pdfBDS_QA.pdf
BDS_QA.pdf
 
Learn basics of Clojure/script and Reagent
Learn basics of Clojure/script and ReagentLearn basics of Clojure/script and Reagent
Learn basics of Clojure/script and Reagent
 
00_Introduction to Java.ppt
00_Introduction to Java.ppt00_Introduction to Java.ppt
00_Introduction to Java.ppt
 

More from Thomas Zimmermann

Analytics for software development
Analytics for software developmentAnalytics for software development
Analytics for software development
Thomas Zimmermann
 

More from Thomas Zimmermann (13)

MSR 2013 Preview
MSR 2013 PreviewMSR 2013 Preview
MSR 2013 Preview
 
Predicting Method Crashes with Bytecode Operations
Predicting Method Crashes with Bytecode OperationsPredicting Method Crashes with Bytecode Operations
Predicting Method Crashes with Bytecode Operations
 
Analytics for smarter software development
Analytics for smarter software development Analytics for smarter software development
Analytics for smarter software development
 
Klingon Countdown Timer
Klingon Countdown TimerKlingon Countdown Timer
Klingon Countdown Timer
 
Data driven games user research
Data driven games user researchData driven games user research
Data driven games user research
 
Empirical Software Engineering at Microsoft Research
Empirical Software Engineering at Microsoft ResearchEmpirical Software Engineering at Microsoft Research
Empirical Software Engineering at Microsoft Research
 
Analytics for software development
Analytics for software developmentAnalytics for software development
Analytics for software development
 
Cross-project defect prediction
Cross-project defect predictionCross-project defect prediction
Cross-project defect prediction
 
Changes and Bugs: Mining and Predicting Development Activities
Changes and Bugs: Mining and Predicting Development ActivitiesChanges and Bugs: Mining and Predicting Development Activities
Changes and Bugs: Mining and Predicting Development Activities
 
Mining Software Archives to Support Software Development
Mining Software Archives to Support Software DevelopmentMining Software Archives to Support Software Development
Mining Software Archives to Support Software Development
 
TA-RE: An Exchange Language for Mining Software Repositories
TA-RE: An Exchange Language for Mining Software RepositoriesTA-RE: An Exchange Language for Mining Software Repositories
TA-RE: An Exchange Language for Mining Software Repositories
 
Fine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFELFine-grained Processing of CVS Archives with APFEL
Fine-grained Processing of CVS Archives with APFEL
 
HATARI: Raising Risk Awareness
HATARI: Raising Risk AwarenessHATARI: Raising Risk Awareness
HATARI: Raising Risk Awareness
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

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
 
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
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
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...
 

How History Justifies System Architecture (or Not)

  • 1. 1/12 International Workshop on Principles of Software Evolution · Helsinki, Finland, 1 September 2003 How History Justifies System Architecture (or not) Thomas Zimmermann (with Stephan Diehl and Andreas Zeller) Lehrstuhl Softwaretechnik Universit¨t des Saarlandes, Saarbr¨cken, Germany a u
  • 2. 2/12 The Problem Your task: extend the debug component in GCC! You identify the variable xcoff debug hooks. What else do you need to change?
  • 3. 2/12 The Problem Your task: extend the debug component in GCC! You identify the variable xcoff debug hooks. What else do you need to change? General issue: only change coupled entities! You can detect existing coupling by • Program Analysis—e.g. def-use associations. • Learning from History—entities changed together.
  • 4. 3/12 Evolutionary Coupling 34 gcc/gcc/dbxout.c [134] gcc/gcc/sdbout.c [74] dbx_debug_hooks sdb_debug_hooks [12] [12] [10] xcoff_debug_hooks
  • 5. 3/12 Evolutionary Coupling 34 gcc/gcc/dbxout.c [134] gcc/gcc/sdbout.c [74] dbx_debug_hooks sdb_debug_hooks 12 [12] [12] 10 10 [10] xcoff_debug_hooks Support: How much evidence (= simultaneous changes)? Confidence: How relevant is coupling for participants?
  • 6. 3/12 Evolutionary Coupling 34 gcc/gcc/dbxout.c [134] gcc/gcc/sdbout.c [74] dbx_debug_hooks sdb_debug_hooks 12 [12] [12] 4 10 4 10 [10] [4] 4 xcoff_debug_hooks sdb_global_decl() dbx_functions_end() [6] [7] 2 dbx_symbol_name() Support: How much evidence (= simultaneous changes)? Confidence: How relevant is coupling for participants?
  • 7. 4/12 What We Do Our ROSE prototype analyzes evolution of CVS archives. ROSE Couplings Reengineering Of Software Evolution Graphs CVS Step 1: Restore Transactions from CVS Metrics Step 2: Identify Modified Entities ROSE determines entities at different granularities: coarse-granular entities: directories, modules, files fine-granular entities: methods, variables, sections
  • 8. 5/12 Step 1: Restoring Transactions Two atomic changes δi and δi+1 are part of one transaction ∆ = (δ1 , . . . , δn ) if: author(δi ) = author(δi+1 ) ∧ log message(δi ) = log message(δi+1 ) ∧ |time(δi+1 ) − time(δi )| < 200 seconds We use a sliding window instead of a fixed one. GNU C Compiler (GCC): The average transaction length is 6.2 seconds. The maximal transaction length is 1 hour 32 minutes.
  • 9. 6/12 Step 2: Light-Weight Analysis File: Animals.java 1 class Cat { 3 public String[] COLORS = { ... 23 } 25 public Cat() { ... 30 } ... 56 } 58 class Dog { 60 public String[] COLORS = { ... 80 } ... 99 }
  • 10. 6/12 Step 2: Light-Weight Analysis File: Animals.java Step A: Map to Entities 1 class Cat { 3 public String[] COLORS = { Cat.COLORS ... lines 3-23 23 } Class Cat 25 lines 1-56 public Cat() { Cat.Cat() ... lines 25-30 30 } ... 56 } 58 class Dog { 60 public String[] COLORS = { Dog.COLORS Class Dog ... lines 60-80 lines 58-99 80 } ... 99 }
  • 11. 6/12 Step 2: Light-Weight Analysis File: Animals.java Step A: Map to Entities 1 class Cat { 3 public String[] COLORS = { Cat.COLORS 17 ... lines 3-23 23 } Class Cat 25 lines 1-56 public Cat() { Cat.Cat() ... lines 25-30 30 } ... 56 } 58 class Dog { 60 public String[] COLORS = { Dog.COLORS Class Dog ... lines 60-80 lines 58-99 80 } ... 99 } Step B: Filter Entities We analyze C/C++, JAVA, PYTHON, TEX and TEXINFO files. We get the modified methods, variables and subsections.
  • 12. 7/12 Example: GCC i386.c pentiumpro_cost [12] i486_cost pentium_cost [11] [11] [12] i386_cost [14] k6_cost
  • 13. 7/12 Example: GCC i386.c pentiumpro_cost [12] i486_cost pentium_cost [11] [11] 11 [12] i386_cost [14] k6_cost
  • 14. 7/12 Example: GCC i386.c i386.h pentiumpro_cost [12] i486_cost pentium_cost [11] 9 [11] [11] 11 processor_cost [12] i386_cost [14] k6_cost
  • 15. 8/12 Visualizing Coupling A B C D High Confidence A B C Low Confidence D No Coupling (No Support)
  • 16. 8/12 Visualizing Coupling A B C D High Confidence A B C Low Confidence D No Coupling (No Support) A C [3] A ⇒ C: Confidence 3/10 = 30% [10] [4] C ⇒ A: Confidence 3/4 = 75%
  • 17. 9/12 Comparing Architecture with Evolution Directory ddd/ DDD Source Libraries Pics Icons Patches Tests
  • 18. 9/12 Comparing Architecture with Evolution Directory ddd/ DDD Source Bad architecture Libraries Pics Icons Patches Tests Better architecture
  • 19. 10/12 Measuring Evolutionary Coupling Evolutionary Coupling Index (ECI). Different levels: entity/file or file/directory level. # external couplings ECI = # internal couplings The lower the ECI, the better the modularity.
  • 20. 10/12 Measuring Evolutionary Coupling Evolutionary Coupling Index (ECI). Different levels: entity/file or file/directory level. # external couplings ECI = # internal couplings The lower the ECI, the better the modularity. File/Directory Entity/File ECI ECI ECIfiltered GCC 5.757 3.615 1.504 DDD 0.250 4.462 1.922 APACHE 2.827 11.815 0.675 OPENSSL 8.665 101.053 7.859 Comparing only one level may be misleading (DDD).
  • 22. 12/12 Conclusion Fine-grained evolutionary coupling. . . • detects coupling between non-program entities. e.g. coupling between a function and a database schema • guides developers while making changes. Programmers who changed this function also changed. . . • gives better(?) results than coarse-grained coupling. Coupling between files doesn’t tell you that much • can be compared with given coupling (= architecture). Results are mixed—what is coupling, anyway? Those who cannot learn from history are doomed to repeat it. (George Santayana)