220 likes | 381 Views
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
E N D
JQuery:Finding your way throughscattered 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 • 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…
Call Hierarchy JQuery: Motivation Inheritance Hierarchy Explosion of browsers • Browsers are too specific • Poor use of screen Real-Estate • Exploration itself is scattered and tangled Package Explorer Search
Choose New Browser Start with Package Browser 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.
Abstract Class Browser Package Browser JQuery: How it works Both views in same window Bundled with many more browsers
Select extension point JQuery: How it works Incrementally perform the exploration by extending each view with a sub-view
JQuery: How it works Incrementally perform the exploration by extending views with a new extensions • Select extension point • Choose sub-query
JQuery: 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
JQuery: How it works Filtering by regular expression • Search for “Figure”: • Open query dialog • double-click
JQuery: How it works Filtering by regular expression • Search for “Figure”: • Open query dialog • Edit query
JQuery: How it works Filtering by regular expression • Search for “Figure”: • Open query dialog • Edit query • Close dialogue (query automatically re-executes)
JQuery: How it works Filtering by regular expression Browser is now filtered by “Figure” Can customize queries in many other ways too.
JQuery: 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.
JQuery: The Plan Change Pen Color Menu ??? No Frame Frame Rectangle Text
Found by regex search for *Attribute* Change Attribute Command JQuery: Executing the Plan ??? Change Pen Color Menu Step 1: Find menu creation ??? Step 2: Find relationship to frames Frame No Frame Rectangle Text
creates Draw Application createColorMenu calls createAttrMenu Determined that Pen Color sets Menu FrameColor Attribute JQuery: Executing the Plan Change Attribute Command execute ??? Frame No Frame Rectangle Text
calls Figure implemented by setAttr Determined that Pen Color sets FrameColor Attribute Attribute Figure setAttr dataflow sidetrack to explore FigureAttributes drawFr JQuery: Executing the Plan creates Change Attribute Command Draw Application createColorMenu execute calls createAttrMenu getAttr Frame No Frame Rectangle Text
Determined that Pen Color sets FrameColor Attribute sidetrack to explore FigureAttributes implemented by drawFr drawFr JQuery: 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
JQuery: within a single navigation view Current IDE’s: “explosion” of disconnected views retain context reduce disorientation loss of context disorientation JQuery: Versatile Code Navigator Browse Scattered Code Browsing structural views Searching for a specific pattern Following relationships
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!
JQuery: De-tangling searching Why use 4 browsers when you can use 1?
Download JQuery (new release out soon): Google: Questions? JQuery • Prevents tangled and scattered searches • Reduces disorientation of complex exploration • Maintains context Andrew Eisenberg: ade@cs.ubc.ca