Title: JQuery: Finding your way through scattered code
1JQueryFinding your way throughscattered code
- Andrew Eisenberg, Doug Janzen, Kris De Volder,
Ryan Wannop
Software Practices Lab. -- The University of
British Columbia
2JQuery Motivation
- 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
Most modern IDEs can help with all of this, but
3JQuery Motivation
Inheritance Hierarchy
- Browsers are too specific
- Poor use of screen Real-Estate
- Exploration itself is scattered and tangled
Package Explorer
Search
4JQuery How it works
Avoiding loss of context Problem Too many
browsers leads to loss of context. Solution
Support many views within a single tool.
5JQuery How it works
Both views in same window
Bundled with many more browsers
6JQuery How it works
Incrementally perform the exploration by
extending each view with a sub-view
7JQuery How it works
Incrementally perform the exploration by
extending views with a new extensions
- Select extension point
- Choose sub-query
8JQuery How it works
Incrementally perform the exploration by
extending views with a new extensions
- Select extension point
- Choose sub-query
- Continue exploration
Bundled with many more sub-browsers
9JQuery How it works
Filtering by regular expression
- Search for Figure
- Open query dialog
10JQuery How it works
Filtering by regular expression
- Search for Figure
- Open query dialog
- Edit query
11JQuery How it works
Filtering by regular expression
- Search for Figure
- Open query dialog
- Edit query
- Close dialogue (query automatically re-executes)
12JQuery How it works
Filtering by regular expression
Browser is now filtered by Figure
Can customize queries in many other ways too.
13JQuery An Example
Task
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.
14JQuery The Plan
Change Pen Color
Menu
???
No Frame
Frame
Rectangle
Text
15JQuery Executing the Plan
???
Change Pen Color
Menu
Step 1 Find menu creation
???
Step 2 Find relationship to frames
Frame
No Frame
Rectangle
Text
16JQuery Executing the Plan
Change Attribute Command
execute
???
Frame
No Frame
Rectangle
Text
17JQuery Executing the Plan
creates
Change Attribute Command
Draw Application
createColorMenu
execute
calls
createAttrMenu
getAttr
Frame
No Frame
Rectangle
Text
18JQuery Executing the Plan
creates
Change Attribute Command
Draw Application
createColorMenu
execute
calls
calls
createAttrMenu
Figure
implemented by
setAttr
change this method
Attribute Figure
setAttr
dataflow
getAttr
drawFr
Rectangle Figure
Text Figure
19JQuery Versatile Code Navigator
Browse Scattered Code
- Browsing structural views
- Searching for a specific pattern
- Following relationships
20JQuery Customization
- can create more powerful queries
- can include data from other tools
- has extendable menu items
- virtual source files (in next release)
See our website!
21JQuery De-tangling searching
Why use 4 browsers when you can use 1?
22Questions?
JQuery
- Prevents tangled and scattered searches
- Reduces disorientation of complex exploration
- Maintains context
Andrew Eisenberg ade_at_cs.ubc.ca
23JQuery Executing the Plan
24JQuery Executing the Plan
Change Attribute Command
Attribute Figure
Frame
No Frame
Rectangle
Text
25JQuery How it works
Avoiding loss of context Problem Too many
browsers leads to loss of context. Solution
Support many views within a single tool.
results
queries
source code facts
26JQuery How it works
Avoiding loss of context
The answer to a query prompts another query
results
query
source code facts
27JQuery Finished!
Change Attribute Command
Step 1
Figure
Attribute Figure
Step 2
Text Figure
Rectangle Figure