Tools integrate Tools work together Tools work together Models - - PowerPoint PPT Presentation

tools integrate tools work together tools work together
SMART_READER_LITE
LIVE PREVIEW

Tools integrate Tools work together Tools work together Models - - PowerPoint PPT Presentation

Programming Environments The Future of Programming Environments Past of Andreas Zeller programming environments Saarland University A Tool Set Tools evolve Tools integrate Tools work together Tools work together Models Specs Code


slide-1
SLIDE 1

The Future of

Programming Environments

Andreas Zeller

Saarland University

Programming Environments

Past of

programming environments

A Tool Set Tools evolve

slide-2
SLIDE 2

Tools integrate Tools work together Tools work together

Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests

slide-3
SLIDE 3

Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests Bugs Changes Changes

12

Programmers who changed this function also changed…

slide-4
SLIDE 4

13

Eclipse Preferences

Your task – extend Eclipse with a new preference:

14

Preference Code

Preferences are stored in the field fkeys[]:

What else do you need to change?

15

Eclipse Code

27,000 files 20,000 classes 200,000 methods

What else do you need to change?

12,000 non-Java

16

EROSE

funded by IBM Eclipse Innovation Grant

slide-5
SLIDE 5

Laser 2006 – Summer School on Software Engineering

CVS Version Archive

2003-02-19 (aweinand): fixed #13332

createGeneralPage() createT extComparePage() fKeys[] initDefaults() buildnotes_compare.html PatchMessages.properties plugin.properties

18

Mining Associations

#42 fKeys[], initDefaults(), …, plugin.properties, … #752 fKeys[], initDefaults(), …, plugin.properties, … #9872 fKeys[], initDefaults(), …, plugin.properties, … #11386 fKeys[], initDefaults(), … #20814 fKeys[], initDefaults(), …, plugin.properties, … #30989 fKeys[], initDefaults(), …, plugin.properties, … #41999 fKeys[], initDefaults(), …, plugin.properties, … #47423 fKeys[], initDefaults(), …, plugin.properties, …

19

Mining Associations

#42 fKeys[], initDefaults(), …, plugin.properties, … #752 fKeys[], initDefaults(), …, plugin.properties, … #9872 fKeys[], initDefaults(), …, plugin.properties, … #11386 fKeys[], initDefaults(), … #20814 fKeys[], initDefaults(), …, plugin.properties, … #30989 fKeys[], initDefaults(), …, plugin.properties, … #41999 fKeys[], initDefaults(), …, plugin.properties, … #47423 fKeys[], initDefaults(), …, plugin.properties, …

{fKeys[], initDefaults()} ⇒ {plugin.properties}

Support 7, Confidence 7/8 = 0.875

20

Classical Data Mining

Classical association mining finds all rules:

  • Helpful in understanding general patterns
  • Requires high support thresholds
  • Takes time to compute (3 days and more)
slide-6
SLIDE 6

21

Mining on Demand

Alternative – mine only matching rules:

  • Mine only rules related to the situation,

i.e. ⇒ X

  • Mine only rules which have a singleton as

consequent, i.e. ⇒ {x} Average runtime of a query: 0.5 seconds

22

Evaluation

  • The programmer has changed one entity.

Can eROSE suggest related entities?

  • Evaluation using last 1,000 transactions
  • f eight open-source CVS repositories
  • Training: all transactions before evaluation

23

Precision vs. Recall

What EROSE finds What it should find False positives False negatives Correct prediction

High precision = returned entities are relevant = few false positives High recall = relevant entities are returned = few false negatives

24

Results

Entities Files Recall Precision Top 3 Recall Precision Top 3 Eclipse 0.15 0.26 0.53 0.17 0.26 0.54 GCC 0.28 0.39 0.89 0.44 0.42 0.87 GIMP 0.12 0.25 0.91 0.27 0.26 0.90 JBOSS 0.16 0.38 0.69 0.25 0.37 0.64 JEDIT 0.07 0.16 0.52 0.25 0.22 0.68 KOFFICE 0.08 0.17 0.46 0.24 0.26 0.67 POSTGRES 0.13 0.23 0.59 0.23 0.24 0.68 PYTHON 0.14 0.24 0.51 0.24 0.36 0.60 Average 0.15 0.26 0.64 0.26 0.30 0.70

slide-7
SLIDE 7

25

Results

Entities Files Recall Precision Top 3 Recall Precision Top 3 Eclipse 0.15 0.26 0.53 0.17 0.26 0.54 GCC 0.28 0.39 0.89 0.44 0.42 0.87 GIMP 0.12 0.25 0.91 0.27 0.26 0.90 JBOSS 0.16 0.38 0.69 0.25 0.37 0.64 JEDIT 0.07 0.16 0.52 0.25 0.22 0.68 KOFFICE 0.08 0.17 0.46 0.24 0.26 0.67 POSTGRE 0.13 0.23 0.59 0.23 0.24 0.68 PYTHON 0.14 0.24 0.51 0.24 0.36 0.60 Average 0.15 0.26 0.64 0.26 0.30 0.70

  • eROSE predicts 15% of all changed entities

(files: 26%)

  • In 64% of all transactions, eROSE’s topmost

three suggestions contain a changed entity (files: 70%)

Changes

27

Code Changes

From: Brian Kahne <bkahne@ibmoto.com> To: DDD Bug Report Address <bug-ddd@gnu.org> Subject: Problem with DDD and GDB 4.17 When using DDD with GDB 4.16, the run command correctly uses any prior command-line arguments, or the value of "set args". However, when I switched to GDB 4.17, this no longer worked: If I entered a run command in the console window, the prior command- line options would be lost. [...]

28

Wie finden wir die alternative Welt?

Version Dierences

Old version Program works New version Program fails Causes

slide-8
SLIDE 8

29

What was Changed

$ diff -r gdb-4.16 gdb-4.17 diff -r gdb-4.16/COPYING gdb-4.17/COPYING 5c5 < 675 Mass Ave, Cambridge, MA 02139, USA

  • > 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

282c282 < Appendix: How to Apply These Terms to Your New Programs

  • > How to Apply These Terms to Your New Programs

…and so on for 178,200 lines (8,721 locations)

General Plan

  • Decompose diff into changes per location

(= 8,721 individual changes)

  • Apply subset of changes, using PATCH
  • Reconstruct GDB; build errors mean

unresolved test outcome

  • Test GDB and return outcome
  • Delta debugging narrows down difference

30 31

Isolating Changes

1 10 100 1000 10000 100000 50 100 150 200 250 300 Changes left Tests executed Delta Debugging Log GDB with ddmin algorithm ... with dd algorithm ... plus scope information

  • Result after 98 tests (= 1 hour)

32

The Failure Cause

diff -r gdb-4.16/gdb/infcmd.c gdb-4.17/gdb/infcmd.c 1239c1278 < "Set arguments to give program being debugged when it is started.\n

  • > "Set argument list to give program being debugged when

it is started.\n

  • Documentation becomes GDB output
  • DDD expects Arguments,

but GDB outputs Argument list

slide-9
SLIDE 9

33

DDChange

Changes Code Tests Bugs Changes Bugs Changes

Map bugs to code locations

slide-10
SLIDE 10

Eclipse Bugs Eclipse Imports

import org.eclipse.jdt.internal.compiler.lookup.*; import org.eclipse.jdt.internal.compiler.*; import org.eclipse.jdt.internal.compiler.ast.*; import org.eclipse.jdt.internal.compiler.util.*; ... import org.eclipse.pde.core.*; import org.eclipse.jface.wizard.*; import org.eclipse.ui.*;

14% of all components importing ui show a post-release defect 71% of all components importing compiler show a post-release defect

Joint work with Adrian Schröter • Tom Zimmermann

Eclipse Imports

Correlation with failure Correlation with success

import org.eclipse.jdt.internal.compiler.lookup.*; import org.eclipse.jdt.internal.compiler.*; import org.eclipse.jdt.internal.compiler.ast.*; import org.eclipse.jdt.internal.compiler.util.*; ... import org.eclipse.pde.core.*; import org.eclipse.jface.wizard.*; import org.eclipse.ui.*;

Eclipse Imports

Correlation with failure Correlation with success Compiler code • Internals • Core functionality GUI code • Standard Java classes • Help texts

slide-11
SLIDE 11

Predicting failure-prone packages

  • Relate defect density to imports
  • Base: Eclipse bug and version databases

(Bugzilla, CVS)

  • 36% of all packages had post-release defects
  • Prediction using support vector machine

Prediction

~300 Packages

10% 90%

defect no defect

top 5%

Where do bugs come from?

Is it the Developers?

Does experience matter? Bug density correlates with experience!

slide-12
SLIDE 12

How about Testing?

Does code coverage predict bug density? Yes – the more tests, the more bugs!

History?

I found lots of bugs here. Will there be more? Yes!

How about Metrics?

Do code metrics predict bug density? Yes! (but only with history)

Problem Domains?

Do imports predict bug density? Yes! (but only with history)

slide-13
SLIDE 13

What makes code buggy in the first place?

Bugs Changes

  • contain full record of project history
  • maintained via programming environments
  • automatic maintenance and access
  • freely accessible in open source projects

Software Archives

Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests Bugs Changes Code Profiles

“Which modules should I test most?”

slide-14
SLIDE 14

Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests Bugs Changes Effort Code

“How long will it take to fix this bug?”

Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests Bugs Changes Chats e-mail Specs Code

“This requirement is risky”

Empirical Studies

  • Compares what we believe

with what we observe

  • Standard practice in modern science
  • Recent addition to software engineering

Empirical SE

Measure data Build model that explains the data Use model for predictions Test predictive power

slide-15
SLIDE 15

Predicting Effort

Rosenberg, L. and Hyatt, L. “Developing An Effective Metrics Program” European Space Agency Software Assurance Symposium, Netherlands, March, 1996

Predicting Maintainability

171 − 5.2 ln(V ) − 0.23V (G) − 16.2 ln(L) +50 sin

  • 2.4C
  • Maintainability =

Size of vocabulary McCabe complexity code lines Percentage of comment lines

Oman, P . & Hagemeister, J. "Constructing and Testing of Polynomials Predicting Software Maintainability." Journal of Systems and Software 24, 3 (March 1994): 251–266.

Obtaining Data

slide-16
SLIDE 16

Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests

Eclipse Bugs

slide-17
SLIDE 17

Studies

Rosenberg, L. and Hyatt, L. “Developing An Effective Metrics Program” European Space Agency Software Assurance Symposium, Netherlands, March, 1996

Make this Actionable!

“Road map”!

Assistance

Future environments will

  • mine patterns from program + process
  • apply rules to make predictions
  • provide assistance in all development decisions
  • adapt advice to project history

Web 2.0

Usability Economy Design Standardization Remixability Convergence Participation

Widgets Collaboration Sharing Pagerank User Centered Perpetual Beta Trust FOAF Six Degrees XFN Aggregators VC Pay Per Click Modularity Ruby on Rails Syndication SOAP REST SEO IM XHTML Accessibility Semantic XML UMTS Videocasting Podcasting SVG Atom Browser OpenID

Wikis Simplicity Joy of Use AJAX The Long Tail Affiliation CSS Web Standards Microformats DataDriven OpenAPIs RSS Mobility Video Audio Blogs Social Software Recommendation Folksonomy

slide-18
SLIDE 18

Empirical SE 2.0 Web 2.0

Usability Economy Remixability Participation

Collaboration Perpetual Beta Trust

Wikis Simplicity Joy of Use The Long Tail DataDriven Social Software Recommendation

Challenges

Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests

Program Data Process Data

Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests

Deductive Reasoning Inductive Reasoning

slide-19
SLIDE 19

Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests Bugs Changes Effort Navigation Chats e-mail Models Specs Code Traces Profiles Tests

Summary