SlideShare ist ein Scribd-Unternehmen logo
1 von 51
Downloaden Sie, um offline zu lesen
How Do Software Engineers Understand
Code Changes?
An Exploratory Study in Industry
                                        Yida Tao1, Yingong Dang2, Tao Xie3
                                          Dongmei Zhang2, Sunghun Kim1

                   1The   Hong Kong University of Science & Technology
                                              2Microsoft Research Asia
                                       3North Carolina State University
2
> if (hudRef && hud) {
>   if (hudRef.consolePanel) {
> +    hudRef.consolePanel.hidePopup()


“Why  this change here? This is the
only one that doesn’t seem to make
sense for me…”




    3
>+ struct CIDEntry
                                                 >+ {
                                                 >+ const nsCID* cid;
                                                 >+ bool service;
> if (hudRef && hud) {
>   if (hudRef.consolePanel) {
> +    hudRef.consolePanel.hidePopup()
                                         “What   is this used for, I can’t spot it in
                                         use anywhere. ”
“Why  this change here? This is the
only one that doesn’t seem to make
sense for me…”




    4
>+ struct CIDEntry
                                                 >+ {
                                                 >+ const nsCID* cid;
                                                 >+ bool service;
> if (hudRef && hud) {
>   if (hudRef.consolePanel) {
> +    hudRef.consolePanel.hidePopup()
                                         “What   is this used for, I can’t spot it in
                                         use anywhere. ”
“Why  this change here? This is the
only one that doesn’t seem to make
sense for me…”




> browser_hide_removing.js
>+ browser_imageReload.js
>+ image_Reload.html

“These files are missing from this
patch, aren’t they?”

    5
>+ struct CIDEntry
                                                 >+ {
                                                 >+ const nsCID* cid;
                                                 >+ bool service;
> if (hudRef && hud) {
>   if (hudRef.consolePanel) {
> +    hudRef.consolePanel.hidePopup()
                                         “What   is this used for, I can’t spot it in
                                         use anywhere. ”
“Why  this change here? This is the
only one that doesn’t seem to make
sense for me…”




> browser_hide_removing.js                    >+ for (var i = aURL.length – 1; i >= 1; i--) {
>+ browser_imageReload.js                     >+ var chPrev = aURL.charAt(i – 1) ;
>+ image_Reload.html                          >+ var ch = aURL.charAt(i) ;


“These files are missing from this           “I’m not sure why you walk this char
patch, aren’t they?”                         by char… ”

    6
>+ struct CIDEntry
                                                 >+ {
                                                 >+ const nsCID* cid;
                                                 >+ bool service;
> if (hudRef && hud) {
>   if (hudRef.consolePanel) {
> +    hudRef.consolePanel.hidePopup()
                                         “What   is this used for, I can’t spot it in
                                         use anywhere. ”
“Why  this change here? This is the
only one that doesn’t seem to make
sense for me…”




> browser_hide_removing.js                    >+ for (var i = aURL.length – 1; i >= 1; i--) {
>+ browser_imageReload.js                     >+ var chPrev = aURL.charAt(i – 1) ;
>+ image_Reload.html                          >+ var ch = aURL.charAt(i) ;


“These files are missing from this           “I’m not sure why you walk this char
patch, aren’t they?”                         by char… ”

    7
>+ struct CIDEntry
                                         “…”           >+ {
                                                       >+ const nsCID* cid;
                                                       >+ bool service;
> if (hudRef && hud) {
>   if (hudRef.consolePanel) {
> +    hudRef.consolePanel.hidePopup()
                                               “What   is this used for, I can’t spot it in
                                               use anywhere. ”
“Why  this change here? This is the
only one that doesn’t seem to make
sense for me…”
                                                                                   “…”



> browser_hide_removing.js                          >+ for (var i = aURL.length – 1; i >= 1; i--) {
>+ browser_imageReload.js                           >+ var chPrev = aURL.charAt(i – 1) ;
>+ image_Reload.html                                >+ var ch = aURL.charAt(i) ;


“These files are missing from this       “…”       “I’m not sure why you walk this char
patch, aren’t they?”                               by char… ”

    8
“How do software engineers understand code changes?”




  9
Research Questions
    RQ1: How frequently is code change understanding
     practiced and in which development tasks is it
     required?

    RQ2: What are engineers’ information needs and
     difficulties for understanding code changes?

    RQ3: How to improve the effectiveness and efficiency
     of the practices in understanding code changes?



    10
Study Methodology

Literature           Questionnaire     Pilot Interview
Review               Design

      •Potential        •Investigate       •Question is
       information       RQ1, RQ2           relevant &
       needs                                clear




 11
Study Methodology

Literature               Questionnaire         Pilot Interview
Review                   Design

      •Potential            •Investigate           •Question is
       information           RQ1, RQ2               relevant &
       needs                                        clear



      Online Survey         Follow-up              Analysis
                            Interview

         •Over 1000 MS          •Investigate           •Answering
          employees              RQ3                    RQs



 12
Survey Participants

                  180 respondents (16% response rate)

     Role Distribution                  Product Teams

                                         OS
            PM
                                         Desktop App
            14%
                                         Web App

     Test              Dev               Mobile App
     31%               55%               Service

                                         Others



13
RQs


RQ1   • Frequency ?
      • Development tasks ?




        RQ2           • Information needs ?
                      • Difficulty ?




                          RQ3           • Improvement ?




14
RQ1: Frequency of Understanding Code Changes

       How often do you need to understand code changes?
       o Several times each hour
       o About once an hour
       o Several times each day
       o About once a day
       o Several times each week
       o About once a week
       o Rarely
       o Never




15
RQ1: Frequency of Understanding Code Changes
                          40%
Percentage of responses


                          35%
                          30%
                          25%
                          20%
                          15%
                          10%
                          5%
                          0%




    16
RQ1: Frequency of Understanding Code Changes
                          40%
                                80%
Percentage of responses


                          35%
                          30%
                          25%
                          20%
                          15%
                          10%
                          5%
                          0%




    17
RQ1: Tasks Requiring Code Change Understanding
    “Select the top three tasks that most often require you
     to understand code changes”
        [Design/Planning] Refactoring
        [Implementation] Developing new feature
        [Implementation] Fixing bug
        [Integration] Resolving merge conflict
        [Verification] Reviewing others’ code changes
        [Verification] Reviewing my own code changes
        [Verification] Writing & updating test cases
        Other, please specify




    18
RQ1: Tasks Requiring Code Change Understanding

                                    Percentage of participants who selected the task
                               0%         15%         30%      45%        60%          75%

Reviewing others' changes                                                        121
                  Fixing bug                                              100
      Developing new feature                                         89
Reviewing my own changes                                      73
Writing/updating test cases                           48
                 Refactoring                     34
  Resolving merge conflict                      30




 19
RQ1: Tasks Requiring Code Change Understanding

                                    Percentage of participants who selected the task
                               0%         15%         30%      45%        60%          75%

Reviewing others' changes                                                        121
                  Fixing bug                                              100
      Developing new feature                                         89
Reviewing my own changes                                      73
Writing/updating test cases                           48
                 Refactoring                     34
  Resolving merge conflict                      30




 20
Answers to RQs


RQ1      • Frequently practiced
         • Major development tasks




           RQ2           • Information needs ?
                         • Difficulty ?




                             RQ3          • Improvement ?




21
Potential Information Needs
    Literature review (code-change analysis and management)
        180 articles in 10 SE venues over the past decade




    22
Potential Information Needs
    Literature review (code-change analysis and management)
        180 articles in 10 SE venues over the past decade
                          Reasoning & assessing the change
                          • Clones
                          • Design
                          •…


                          Exploring the change’s context & impact
                          • Risk
                          • Consistency
                          •…


                          Evaluating the change history
                          • Change proneness
                          • Defect proneness

    23
Survey Questions
      “Rate the importance & difficulty of each information need
       (formulated as question) in a change understanding task”

  Very            3
Important
                  2
Important

                  1
Somewhat
Important
                  0
   Not
Important



      24
Survey Questions
      “Rate the importance & difficulty of each information need
       (formulated as question) in a change understanding task”

  Very            3     Very
Important              Difficult
                  2
Important              Difficult

                  1
Somewhat               Relatively
Important                Easy
                  0
   Not                Straightfor
Important                -ward



      25
Survey Questions
      “Rate the importance & difficulty of each information need
       (formulated as question) in a change understanding task”

                                           Does this change
  Very            3     Very
Important              Difficult
                                           introduce code clones?
                  2                        Does this change break
Important              Difficult
                                           any code elsewhere?
                                           Which tests should be run
                  1                        to verify this change?
Somewhat               Relatively
Important                Easy              Is this changed location a
                  0                        hotspot for past fixes?
   Not                Straightfor
Important                -ward             ……



      26
RQ2: Information Needs
                              3
Difficulty of acquiring the




                              2
       information




                              1




                              0
                                  0   1                2   3
                                          Importance
          27
RQ2: Information Needs
                              3
Difficulty of acquiring the




                              2
       information




                              1




                              0
                                  0   1                2   3
                                          Importance
          28
RQ2: Information Needs
                              3
                                             Consistency            Risk
Difficulty of acquiring the




                                                                      Completeness
                              2
       information




                                                                           Correctness
                                                           Design
                              1




                              0
                                  0   1                    2                     3
                                          Importance
          29
Answers to RQs


RQ1      • Frequently practiced
         • Major development tasks




           RQ2           • Risk & Quality are important
                           but difficult to know




                             RQ3           • Improvement ?




30
RQ3: Interview Items
                               3
                                                            Risk
 Difficulty of acquiring the




                               2
        information




                               1




                               0
                                   0   1                2          3
                                           Importance


31
RQ3: Interview Items
                               3
                                                            Risk
 Difficulty of acquiring the




                               2
        information




                               1


                                                             Rationale
                               0
                                   0   1                2          3
                                           Importance


32
RQ3: Interview Items
                               3
                                                                        Risk
 Difficulty of acquiring the




                               2
        information




                                          Defect proneness



                               1       Change proneness


                                                                         Rationale
                               0
                                   0               1                2          3
                                                       Importance


33
Assessing a Change’s Risk
                               3
                                                            Risk
 Difficulty of acquiring the




                               2
        information




                               1




                               0
                                   0   1                2          3
                                           Importance


34
Current Practice on Assessing a Change’s Risk
           Manual Code Review
           •Error prone
           •Cross-components
           •Unclear interface
           •Hidden assumptions
           •…


           Unit & Regression Testing
           •Time consuming
           •Depends on how thorough the tests are
           •…




35
Support Assessing a Change’s Risk




                     •Navigation in diff:
Manual code review




                      using code analysis
                      tools (e.g., go to
                      definition, find all
                      references,
                      caller/callee tree)
                      on the code
                      change


          36
Support Assessing a Change’s Risk
                                                       “…miss a level of
                                                     understanding object
                                                        relationships”


                     •Navigation in diff:
Manual code review




                      using code analysis     Diff
                      tools (e.g., go to
                      definition, find all                    Navigation
                      references,                               in diff
                      caller/callee tree)
                      on the code             Code
                                             Analysis
                      change


          37
Support Assessing a Change’s Risk



          •which code must
Testing



           be retested as it is   “An ‘Intelli-sense’ for updating
           dependent upon         these (affected) tests would be
           the change?            nice as well.”
          •who owns testing
           that dependency?
          •which tests must
           be run?


  38
Discussion
                              3
Difficulty of acquiring the




                              2
       information




                                         Defect proneness


                              1       Change proneness

                                                                          Rationale

                              0
                                  0              1                    2           3
                                                         Importance

          39
Discussion
     Why is understanding the rationale of a change easy?
     • Availability & Quality of commit message
     • “It’s entirely up to the dev making the change as to how hard or
       easy it is for someone else to figure out why the change was
       made.”

     Why are historical metrics not that important?
     • Developers
       • Here and now
       • Short-term issue
       • Own knowledge
     • Testers & PMs
       • Historical metrics might be good to reflect bugginess and
         complexity of a specific area

40
Other Information Needs

“In addition to the information needs listed above, what else
would you ask when you try to understand a code change? How
difficult is it for you to answer?”




41
Other Information Needs

“In addition to the information needs listed above, what else
would you ask when you try to understand a code change? How
difficult is it for you to answer?”



                    “Can this change be broken into
                      smaller discreet changes?”




42
Composite Code Change




43
Understanding a Composite Code Change




44
Decomposing a Composite Code Change




45
Answers to RQs


RQ1      • Frequently practiced
         • Major development tasks




           RQ2            • Risk & Quality are important
                            but difficult to know


                                               • Assessing the risk
                              RQ3                of a change
                                               • Decomposing a
                                                 composite change


46
Summary
    A large-scale exploratory study on industrial practice in
     understanding code changes
        Understanding code changes happens frequently in major
         development tasks




    47
Summary
    A large-scale exploratory study on industrial practice in
     understanding code changes
        Understanding code changes happens frequently in major
         development tasks

    An extensive exploration on engineers’ information needs
     for understanding code changes
        Assessing a change’s risk, consistency & completeness




    48
Summary
    A large-scale exploratory study on industrial practice in
     understanding code changes
        Understanding code changes happens frequently in major
         development tasks

    An extensive exploration on engineers’ information needs
     for understanding code changes
        Assessing a change’s risk, consistency & completeness

    A guideline for future research and tool design that aims at
     supporting change-understanding tasks
        Navigation in diff
        Change decomposition



    49
Acknowledgment
    All participants of survey / interview

    Miryung Kim, Robin Moeur, Thomas Zimmermann, Jacek
     Czerwonka, and Kathryn McKinley




    50
Summary
    A large-scale exploratory study on industrial practice in
     understanding code changes
        Understanding code changes happens frequently in major
         development tasks

    An extensive exploration on engineers’ information needs
     for understanding code changes
        Assessing a change’s risk, consistency & completeness

    A guideline for future research and tool design that aims at
     supporting change-understanding tasks
        Navigation in diff
        Change decomposition



    51

Weitere ähnliche Inhalte

Andere mochten auch

A Survey on Dynamic Symbolic Execution for Automatic Test Generation
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
Sung Kim
 
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
Sung Kim
 

Andere mochten auch (12)

A Survey on Dynamic Symbolic Execution for Automatic Test Generation
A Survey on  Dynamic Symbolic Execution  for Automatic Test GenerationA Survey on  Dynamic Symbolic Execution  for Automatic Test Generation
A Survey on Dynamic Symbolic Execution for Automatic Test Generation
 
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
How We Get There: A Context-Guided Search Strategy in Concolic Testing (FSE 2...
 
Automatic patch generation learned from human written patches
Automatic patch generation learned from human written patchesAutomatic patch generation learned from human written patches
Automatic patch generation learned from human written patches
 
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
 
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
CrashLocator: Locating Crashing Faults Based on Crash Stacks (ISSTA 2014)
 
A Survey on Automatic Test Generation and Crash Reproduction
A Survey on Automatic Test Generation and Crash ReproductionA Survey on Automatic Test Generation and Crash Reproduction
A Survey on Automatic Test Generation and Crash Reproduction
 
Personalized Defect Prediction
Personalized Defect PredictionPersonalized Defect Prediction
Personalized Defect Prediction
 
STAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash ReproductionSTAR: Stack Trace based Automatic Crash Reproduction
STAR: Stack Trace based Automatic Crash Reproduction
 
Transfer defect learning
Transfer defect learningTransfer defect learning
Transfer defect learning
 
Tensor board
Tensor boardTensor board
Tensor board
 
Survey on Software Defect Prediction
Survey on Software Defect PredictionSurvey on Software Defect Prediction
Survey on Software Defect Prediction
 
Time series classification
Time series classificationTime series classification
Time series classification
 

Ähnlich wie How Do Software Engineers Understand Code Changes? FSE 2012

A Small Talk on Getting Big
A Small Talk on Getting BigA Small Talk on Getting Big
A Small Talk on Getting Big
britt
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
jeffz
 
Technical Workshop - Win32/Georbot Analysis
Technical Workshop - Win32/Georbot AnalysisTechnical Workshop - Win32/Georbot Analysis
Technical Workshop - Win32/Georbot Analysis
Positive Hack Days
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
bartzon
 

Ähnlich wie How Do Software Engineers Understand Code Changes? FSE 2012 (20)

How do software engineers understand code changes?
How do software engineers understand code changes?How do software engineers understand code changes?
How do software engineers understand code changes?
 
A Small Talk on Getting Big
A Small Talk on Getting BigA Small Talk on Getting Big
A Small Talk on Getting Big
 
Microservices dengan Go-Kit
Microservices dengan Go-KitMicroservices dengan Go-Kit
Microservices dengan Go-Kit
 
Nodebot: Arte de controlar arduino com javascript
Nodebot: Arte de controlar arduino com javascriptNodebot: Arte de controlar arduino com javascript
Nodebot: Arte de controlar arduino com javascript
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
 
The Key to Machine Learning is Prepping the Right Data with Jean Georges Perrin
The Key to Machine Learning is Prepping the Right Data with Jean Georges Perrin The Key to Machine Learning is Prepping the Right Data with Jean Georges Perrin
The Key to Machine Learning is Prepping the Right Data with Jean Georges Perrin
 
Maintainability SFJS Sept 4 2014
Maintainability SFJS Sept 4 2014 Maintainability SFJS Sept 4 2014
Maintainability SFJS Sept 4 2014
 
Node azure
Node azureNode azure
Node azure
 
Lyon jug-how-to-fail-at-benchmarking
Lyon jug-how-to-fail-at-benchmarkingLyon jug-how-to-fail-at-benchmarking
Lyon jug-how-to-fail-at-benchmarking
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
 
Functional solid
Functional solidFunctional solid
Functional solid
 
What (and why) Admins need to know about Unit Testing, Julio Fernandez & Dori...
What (and why) Admins need to know about Unit Testing, Julio Fernandez & Dori...What (and why) Admins need to know about Unit Testing, Julio Fernandez & Dori...
What (and why) Admins need to know about Unit Testing, Julio Fernandez & Dori...
 
Technical Workshop - Win32/Georbot Analysis
Technical Workshop - Win32/Georbot AnalysisTechnical Workshop - Win32/Georbot Analysis
Technical Workshop - Win32/Georbot Analysis
 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
 
Life Cycle of Metrics, Alerting, and Performance Monitoring in Microservices
Life Cycle of Metrics, Alerting, and Performance Monitoring in MicroservicesLife Cycle of Metrics, Alerting, and Performance Monitoring in Microservices
Life Cycle of Metrics, Alerting, and Performance Monitoring in Microservices
 
Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014
 
Beyond php it's not (just) about the code
Beyond php   it's not (just) about the codeBeyond php   it's not (just) about the code
Beyond php it's not (just) about the code
 
What Lies Beneath
What Lies BeneathWhat Lies Beneath
What Lies Beneath
 
Code Refactoring
Code RefactoringCode Refactoring
Code Refactoring
 

Mehr von Sung Kim

DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningDeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
Sung Kim
 
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Sung Kim
 
A Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution Techniques
Sung Kim
 
MSR2014 opening
MSR2014 openingMSR2014 opening
MSR2014 opening
Sung Kim
 
Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...
Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...
Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...
Sung Kim
 
Self-defending software: Automatically patching errors in deployed software ...
Self-defending software: Automatically patching  errors in deployed software ...Self-defending software: Automatically patching  errors in deployed software ...
Self-defending software: Automatically patching errors in deployed software ...
Sung Kim
 

Mehr von Sung Kim (13)

DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningDeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
 
Deep API Learning (FSE 2016)
Deep API Learning (FSE 2016)Deep API Learning (FSE 2016)
Deep API Learning (FSE 2016)
 
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
 
A Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution Techniques
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled Datasets
 
MSR2014 opening
MSR2014 openingMSR2014 opening
MSR2014 opening
 
Defect, defect, defect: PROMISE 2012 Keynote
Defect, defect, defect: PROMISE 2012 Keynote Defect, defect, defect: PROMISE 2012 Keynote
Defect, defect, defect: PROMISE 2012 Keynote
 
Predicting Recurring Crash Stacks (ASE 2012)
Predicting Recurring Crash Stacks (ASE 2012)Predicting Recurring Crash Stacks (ASE 2012)
Predicting Recurring Crash Stacks (ASE 2012)
 
Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...
Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...
Puzzle-Based Automatic Testing: Bringing Humans Into the Loop by Solving Puzz...
 
Software Development Meets the Wisdom of Crowds
Software Development Meets the Wisdom of CrowdsSoftware Development Meets the Wisdom of Crowds
Software Development Meets the Wisdom of Crowds
 
BugTriage with Bug Tossing Graphs (ESEC/FSE 2009)
BugTriage with Bug Tossing Graphs (ESEC/FSE 2009)BugTriage with Bug Tossing Graphs (ESEC/FSE 2009)
BugTriage with Bug Tossing Graphs (ESEC/FSE 2009)
 
Self-defending software: Automatically patching errors in deployed software ...
Self-defending software: Automatically patching  errors in deployed software ...Self-defending software: Automatically patching  errors in deployed software ...
Self-defending software: Automatically patching errors in deployed software ...
 
ReCrash: Making crashes reproducible by preserving object states (ECOOP 2008)
ReCrash: Making crashes reproducible by preserving object states (ECOOP 2008)ReCrash: Making crashes reproducible by preserving object states (ECOOP 2008)
ReCrash: Making crashes reproducible by preserving object states (ECOOP 2008)
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

How Do Software Engineers Understand Code Changes? FSE 2012

  • 1. How Do Software Engineers Understand Code Changes? An Exploratory Study in Industry Yida Tao1, Yingong Dang2, Tao Xie3 Dongmei Zhang2, Sunghun Kim1 1The Hong Kong University of Science & Technology 2Microsoft Research Asia 3North Carolina State University
  • 2. 2
  • 3. > if (hudRef && hud) { > if (hudRef.consolePanel) { > + hudRef.consolePanel.hidePopup() “Why this change here? This is the only one that doesn’t seem to make sense for me…” 3
  • 4. >+ struct CIDEntry >+ { >+ const nsCID* cid; >+ bool service; > if (hudRef && hud) { > if (hudRef.consolePanel) { > + hudRef.consolePanel.hidePopup() “What is this used for, I can’t spot it in use anywhere. ” “Why this change here? This is the only one that doesn’t seem to make sense for me…” 4
  • 5. >+ struct CIDEntry >+ { >+ const nsCID* cid; >+ bool service; > if (hudRef && hud) { > if (hudRef.consolePanel) { > + hudRef.consolePanel.hidePopup() “What is this used for, I can’t spot it in use anywhere. ” “Why this change here? This is the only one that doesn’t seem to make sense for me…” > browser_hide_removing.js >+ browser_imageReload.js >+ image_Reload.html “These files are missing from this patch, aren’t they?” 5
  • 6. >+ struct CIDEntry >+ { >+ const nsCID* cid; >+ bool service; > if (hudRef && hud) { > if (hudRef.consolePanel) { > + hudRef.consolePanel.hidePopup() “What is this used for, I can’t spot it in use anywhere. ” “Why this change here? This is the only one that doesn’t seem to make sense for me…” > browser_hide_removing.js >+ for (var i = aURL.length – 1; i >= 1; i--) { >+ browser_imageReload.js >+ var chPrev = aURL.charAt(i – 1) ; >+ image_Reload.html >+ var ch = aURL.charAt(i) ; “These files are missing from this “I’m not sure why you walk this char patch, aren’t they?” by char… ” 6
  • 7. >+ struct CIDEntry >+ { >+ const nsCID* cid; >+ bool service; > if (hudRef && hud) { > if (hudRef.consolePanel) { > + hudRef.consolePanel.hidePopup() “What is this used for, I can’t spot it in use anywhere. ” “Why this change here? This is the only one that doesn’t seem to make sense for me…” > browser_hide_removing.js >+ for (var i = aURL.length – 1; i >= 1; i--) { >+ browser_imageReload.js >+ var chPrev = aURL.charAt(i – 1) ; >+ image_Reload.html >+ var ch = aURL.charAt(i) ; “These files are missing from this “I’m not sure why you walk this char patch, aren’t they?” by char… ” 7
  • 8. >+ struct CIDEntry “…” >+ { >+ const nsCID* cid; >+ bool service; > if (hudRef && hud) { > if (hudRef.consolePanel) { > + hudRef.consolePanel.hidePopup() “What is this used for, I can’t spot it in use anywhere. ” “Why this change here? This is the only one that doesn’t seem to make sense for me…” “…” > browser_hide_removing.js >+ for (var i = aURL.length – 1; i >= 1; i--) { >+ browser_imageReload.js >+ var chPrev = aURL.charAt(i – 1) ; >+ image_Reload.html >+ var ch = aURL.charAt(i) ; “These files are missing from this “…” “I’m not sure why you walk this char patch, aren’t they?” by char… ” 8
  • 9. “How do software engineers understand code changes?” 9
  • 10. Research Questions  RQ1: How frequently is code change understanding practiced and in which development tasks is it required?  RQ2: What are engineers’ information needs and difficulties for understanding code changes?  RQ3: How to improve the effectiveness and efficiency of the practices in understanding code changes? 10
  • 11. Study Methodology Literature Questionnaire Pilot Interview Review Design •Potential •Investigate •Question is information RQ1, RQ2 relevant & needs clear 11
  • 12. Study Methodology Literature Questionnaire Pilot Interview Review Design •Potential •Investigate •Question is information RQ1, RQ2 relevant & needs clear Online Survey Follow-up Analysis Interview •Over 1000 MS •Investigate •Answering employees RQ3 RQs 12
  • 13. Survey Participants 180 respondents (16% response rate) Role Distribution Product Teams  OS PM  Desktop App 14%  Web App Test Dev  Mobile App 31% 55%  Service  Others 13
  • 14. RQs RQ1 • Frequency ? • Development tasks ? RQ2 • Information needs ? • Difficulty ? RQ3 • Improvement ? 14
  • 15. RQ1: Frequency of Understanding Code Changes How often do you need to understand code changes? o Several times each hour o About once an hour o Several times each day o About once a day o Several times each week o About once a week o Rarely o Never 15
  • 16. RQ1: Frequency of Understanding Code Changes 40% Percentage of responses 35% 30% 25% 20% 15% 10% 5% 0% 16
  • 17. RQ1: Frequency of Understanding Code Changes 40% 80% Percentage of responses 35% 30% 25% 20% 15% 10% 5% 0% 17
  • 18. RQ1: Tasks Requiring Code Change Understanding  “Select the top three tasks that most often require you to understand code changes”  [Design/Planning] Refactoring  [Implementation] Developing new feature  [Implementation] Fixing bug  [Integration] Resolving merge conflict  [Verification] Reviewing others’ code changes  [Verification] Reviewing my own code changes  [Verification] Writing & updating test cases  Other, please specify 18
  • 19. RQ1: Tasks Requiring Code Change Understanding Percentage of participants who selected the task 0% 15% 30% 45% 60% 75% Reviewing others' changes 121 Fixing bug 100 Developing new feature 89 Reviewing my own changes 73 Writing/updating test cases 48 Refactoring 34 Resolving merge conflict 30 19
  • 20. RQ1: Tasks Requiring Code Change Understanding Percentage of participants who selected the task 0% 15% 30% 45% 60% 75% Reviewing others' changes 121 Fixing bug 100 Developing new feature 89 Reviewing my own changes 73 Writing/updating test cases 48 Refactoring 34 Resolving merge conflict 30 20
  • 21. Answers to RQs RQ1 • Frequently practiced • Major development tasks RQ2 • Information needs ? • Difficulty ? RQ3 • Improvement ? 21
  • 22. Potential Information Needs  Literature review (code-change analysis and management)  180 articles in 10 SE venues over the past decade 22
  • 23. Potential Information Needs  Literature review (code-change analysis and management)  180 articles in 10 SE venues over the past decade Reasoning & assessing the change • Clones • Design •… Exploring the change’s context & impact • Risk • Consistency •… Evaluating the change history • Change proneness • Defect proneness 23
  • 24. Survey Questions  “Rate the importance & difficulty of each information need (formulated as question) in a change understanding task” Very 3 Important 2 Important 1 Somewhat Important 0 Not Important 24
  • 25. Survey Questions  “Rate the importance & difficulty of each information need (formulated as question) in a change understanding task” Very 3 Very Important Difficult 2 Important Difficult 1 Somewhat Relatively Important Easy 0 Not Straightfor Important -ward 25
  • 26. Survey Questions  “Rate the importance & difficulty of each information need (formulated as question) in a change understanding task” Does this change Very 3 Very Important Difficult introduce code clones? 2 Does this change break Important Difficult any code elsewhere? Which tests should be run 1 to verify this change? Somewhat Relatively Important Easy Is this changed location a 0 hotspot for past fixes? Not Straightfor Important -ward …… 26
  • 27. RQ2: Information Needs 3 Difficulty of acquiring the 2 information 1 0 0 1 2 3 Importance 27
  • 28. RQ2: Information Needs 3 Difficulty of acquiring the 2 information 1 0 0 1 2 3 Importance 28
  • 29. RQ2: Information Needs 3 Consistency Risk Difficulty of acquiring the Completeness 2 information Correctness Design 1 0 0 1 2 3 Importance 29
  • 30. Answers to RQs RQ1 • Frequently practiced • Major development tasks RQ2 • Risk & Quality are important but difficult to know RQ3 • Improvement ? 30
  • 31. RQ3: Interview Items 3 Risk Difficulty of acquiring the 2 information 1 0 0 1 2 3 Importance 31
  • 32. RQ3: Interview Items 3 Risk Difficulty of acquiring the 2 information 1 Rationale 0 0 1 2 3 Importance 32
  • 33. RQ3: Interview Items 3 Risk Difficulty of acquiring the 2 information Defect proneness 1 Change proneness Rationale 0 0 1 2 3 Importance 33
  • 34. Assessing a Change’s Risk 3 Risk Difficulty of acquiring the 2 information 1 0 0 1 2 3 Importance 34
  • 35. Current Practice on Assessing a Change’s Risk Manual Code Review •Error prone •Cross-components •Unclear interface •Hidden assumptions •… Unit & Regression Testing •Time consuming •Depends on how thorough the tests are •… 35
  • 36. Support Assessing a Change’s Risk •Navigation in diff: Manual code review using code analysis tools (e.g., go to definition, find all references, caller/callee tree) on the code change 36
  • 37. Support Assessing a Change’s Risk “…miss a level of understanding object relationships” •Navigation in diff: Manual code review using code analysis Diff tools (e.g., go to definition, find all Navigation references, in diff caller/callee tree) on the code Code Analysis change 37
  • 38. Support Assessing a Change’s Risk •which code must Testing be retested as it is “An ‘Intelli-sense’ for updating dependent upon these (affected) tests would be the change? nice as well.” •who owns testing that dependency? •which tests must be run? 38
  • 39. Discussion 3 Difficulty of acquiring the 2 information Defect proneness 1 Change proneness Rationale 0 0 1 2 3 Importance 39
  • 40. Discussion Why is understanding the rationale of a change easy? • Availability & Quality of commit message • “It’s entirely up to the dev making the change as to how hard or easy it is for someone else to figure out why the change was made.” Why are historical metrics not that important? • Developers • Here and now • Short-term issue • Own knowledge • Testers & PMs • Historical metrics might be good to reflect bugginess and complexity of a specific area 40
  • 41. Other Information Needs “In addition to the information needs listed above, what else would you ask when you try to understand a code change? How difficult is it for you to answer?” 41
  • 42. Other Information Needs “In addition to the information needs listed above, what else would you ask when you try to understand a code change? How difficult is it for you to answer?” “Can this change be broken into smaller discreet changes?” 42
  • 44. Understanding a Composite Code Change 44
  • 45. Decomposing a Composite Code Change 45
  • 46. Answers to RQs RQ1 • Frequently practiced • Major development tasks RQ2 • Risk & Quality are important but difficult to know • Assessing the risk RQ3 of a change • Decomposing a composite change 46
  • 47. Summary  A large-scale exploratory study on industrial practice in understanding code changes  Understanding code changes happens frequently in major development tasks 47
  • 48. Summary  A large-scale exploratory study on industrial practice in understanding code changes  Understanding code changes happens frequently in major development tasks  An extensive exploration on engineers’ information needs for understanding code changes  Assessing a change’s risk, consistency & completeness 48
  • 49. Summary  A large-scale exploratory study on industrial practice in understanding code changes  Understanding code changes happens frequently in major development tasks  An extensive exploration on engineers’ information needs for understanding code changes  Assessing a change’s risk, consistency & completeness  A guideline for future research and tool design that aims at supporting change-understanding tasks  Navigation in diff  Change decomposition 49
  • 50. Acknowledgment  All participants of survey / interview  Miryung Kim, Robin Moeur, Thomas Zimmermann, Jacek Czerwonka, and Kathryn McKinley 50
  • 51. Summary  A large-scale exploratory study on industrial practice in understanding code changes  Understanding code changes happens frequently in major development tasks  An extensive exploration on engineers’ information needs for understanding code changes  Assessing a change’s risk, consistency & completeness  A guideline for future research and tool design that aims at supporting change-understanding tasks  Navigation in diff  Change decomposition 51