22
1 Software Practices Lab. -- The University of British Columbia JQuery: Finding your way through scattered code Andrew Eisenberg, Doug Janzen, Kris De Volder, Ryan Wannop Software Practices Lab. -- The University of British Columbia

JQuery: Finding your way through scattered code

  • Upload
    edward

  • View
    30

  • Download
    2

Embed Size (px)

DESCRIPTION

JQuery: Finding your way through scattered code. Andrew Eisenberg, Doug Janzen, Kris De Volder, Ryan Wannop. Software Practices Lab. -- The University of British Columbia. JQuery: Motivation. Typical ways to explore scattered concerns: Browse structural views - PowerPoint PPT Presentation

Citation preview

Page 1: JQuery: Finding your way through scattered code

1Software Practices Lab. -- The University of British Columbia

JQuery:Finding your way through

scattered codeAndrew Eisenberg, Doug Janzen,

Kris De Volder, Ryan Wannop

Software Practices Lab. -- The University of British Columbia

Page 2: JQuery: Finding your way through scattered code

2Software Practices Lab. -- The University of British Columbia

Typical ways to explore scattered concerns:Browse structural views- package structures, inheritance hierarchy

Search for a specific pattern- regular expressions

Follow relationships- calls, instantiates, references

JQuery: Motivation

Most modern IDEs can help with all of this, but…

Page 3: JQuery: Finding your way through scattered code

3Software Practices Lab. -- The University of British Columbia

JQuery: Motivation

Explosion of browsers

Package Explorer

Search

Call Hierarchy Inheritance Hierarchy

Browsers are too specific

Poor use of screen Real-Estate

Exploration itself is scattered and tangled

Page 4: JQuery: Finding your way through scattered code

4Software Practices Lab. -- The University of British Columbia

JQuery: How it works

Avoiding loss of context:Problem: Too many browsers leads to loss of context. Solution: Support many views within a single tool.

Choose New Browser

Start with Package Browser

Page 5: JQuery: Finding your way through scattered code

5Software Practices Lab. -- The University of British Columbia

JQuery: How it works

Abstract Class

Browser

Both views in same window

Package Browser

Bundled with many more browsers

Page 6: JQuery: Finding your way through scattered code

6Software Practices Lab. -- The University of British Columbia

JQuery: How it works

Incrementally perform the exploration by extending each view with a sub-view

1. Select extension point

Page 7: JQuery: Finding your way through scattered code

7Software Practices Lab. -- The University of British Columbia

JQuery: How it works

Incrementally perform the exploration by extending views with a new extensions

1. Select extension point

2. Choose sub-query

Page 8: JQuery: Finding your way through scattered code

8Software Practices Lab. -- The University of British Columbia

JQuery: How it works

Incrementally perform the exploration by extending views with a new extensions

1. Select extension point

2. Choose sub-query

3. Continue exploration

Bundled with many more sub-browsers

Page 9: JQuery: Finding your way through scattered code

9Software Practices Lab. -- The University of British Columbia

JQuery: How it works

Filtering by regular expressionSearch for “Figure”:• Open query dialog

• double-click

Page 10: JQuery: Finding your way through scattered code

10Software Practices Lab. -- The University of British Columbia

JQuery: How it works

Filtering by regular expressionSearch for “Figure”:• Open query dialog• Edit query

Page 11: JQuery: Finding your way through scattered code

11Software Practices Lab. -- The University of British Columbia

JQuery: How it works

Filtering by regular expressionSearch for “Figure”:• Open query dialog• Edit query• Close dialogue

(query automatically re-executes)

Page 12: JQuery: Finding your way through scattered code

12Software Practices Lab. -- The University of British Columbia

JQuery: How it works

Filtering by regular expression

Browser is now filtered by “Figure”

Can customize queries in many other ways too.

Page 13: JQuery: Finding your way through scattered code

13Software Practices Lab. -- The University of British Columbia

JQuery: An Example

Make a enhancement to the JHotDraw codebase. Non-trivial, but some details abstracted away.

Based on an actual task we performed with little prior knowledge of the codebase.

Task:

Page 14: JQuery: Finding your way through scattered code

14Software Practices Lab. -- The University of British Columbia

JQuery: The Plan

Rectangle Text

???

Frame No Frame

Menu Change Pen Color

Page 15: JQuery: Finding your way through scattered code

15Software Practices Lab. -- The University of British Columbia

JQuery: Executing the Plan

Menu Change Pen Color

Rectangle Text

Frame No Frame

Change Attribute Command

Found by regex search for *Attribute*

???

???

Step 1: Find menu

creation

Step 2: Find relationship

to frames

Page 16: JQuery: Finding your way through scattered code

16Software Practices Lab. -- The University of British Columbia

JQuery: Executing the Plan

Change Attribute Command

Rectangle

???

Text

Frame No Frame

Determined that Pen Color sets MenuFrameColor Attribute

execute

createsDraw Application

createColorMenu

callscreateAttrMenu

Page 17: JQuery: Finding your way through scattered code

17Software Practices Lab. -- The University of British Columbia

AttributeFigure

setAttr

implemented by

JQuery: Executing the Plan

Change Attribute Command

Draw Application

Rectangle Text

Frame No Frame

sidetrack to explore FigureAttributes

getAttr

execute

Figure setAttr

callscreateAttrMenu

drawFr

dataflow

createColorMenucreates

calls

Determined that Pen Color setsFrameColor Attribute

Page 18: JQuery: Finding your way through scattered code

18Software Practices Lab. -- The University of British Columbia

JQuery: Executing the Plan

Change Attribute Command

Rectangle Figure

Text Figure

change this method

Figure

AttributeFigure getAttr

drawFr

setAttr

setAttr

drawFr

implemented by

drawFr

executeDraw Application

createAttrMenu

createColorMenu

calls

creates

implemented by

calls

dataflowsidetrack to explore

FigureAttributes

Determined that Pen Color setsFrameColor Attribute

Page 19: JQuery: Finding your way through scattered code

19Software Practices Lab. -- The University of British Columbia

JQuery: Versatile Code Navigator

1. Browsing structural views2. Searching for a specific pattern3. Following relationships

Current IDE’s:“explosion” of

disconnected views

loss of contextdisorientation

JQuery:within a single navigation view

retain contextreduce disorientation

Browse Scattered Code

Page 20: JQuery: Finding your way through scattered code

20Software Practices Lab. -- The University of British Columbia

JQuery: Customization

JQuery can do more:

can create more powerful queries

can include data from other tools

has extendable menu items

virtual source files (in next release)

See our website!

Page 21: JQuery: Finding your way through scattered code

21Software Practices Lab. -- The University of British Columbia

JQuery: De-tangling searching

Why use 4 browsers when you can use 1?

Page 22: JQuery: Finding your way through scattered code

22Software Practices Lab. -- The University of British Columbia

Questions?

Google:Download JQuery (new release out soon):

Prevents tangled and scattered searches

Reduces disorientation of complex exploration

Maintains context

Andrew Eisenberg:[email protected]