visual debugging software
play

Visual Debugging Software What is Debugging Visualization - PDF document

Visual Debugging Software What is Debugging Visualization Visualizing Program State Incremental interactive unfolding (DDD) Visual Memory Abstract representations (traversal-based) Debugging Focusing: memory


  1. Visual Debugging Software • What is „Debugging“ Visualization • Visualizing – Program State • Incremental interactive unfolding (DDD) Visual Memory • Abstract representations (traversal-based) Debugging • Focusing: memory graphs • Reference pattern extraction – Test Results (test suites) • Dices Code • Participation in coverage and failures Debugging Data Display Debugger DDD • Visualize Program State • Debugging • Interactive debugger = Detecting, locating and fixing errors in – Execute program in a defined environment programs – Stop execution at specified situations • Common Tasks [see Pan&DeMillo&Spafford:97] (conditional break points) – Identify statements involved – Inspect program state – Select statements which might contain faults – Modify program state and continue execution – Hypothesize about suspicious faults – Restore program variables to a specific state See [Zeller:IFUE01,Zeller&Lütkehaus:96] Incremental, Interactive Nested Boxes Unfolding of Data Structures (gdb) display *tree *tree = { fvalue = 7, _name = 0x8049e88 "Ada", _left = 0x804d7d8, _right = 0x0, _left_thread = false, right_thread = false, date = {day of week = Thu, day = 1, month = 1, year = 1970, _vptr. = 0x8049f78 <Date virtual tablei>}, static shared = 4711} (gdb) _ 1

  2. Traversal-based Visualization Aliasing Detection � Sharing Nodes • Typical visualization produced by a visual debugger http://www.cs.princeton.edu/~jlk/viz Example Rule Traversal-based Visualization Class of Objects to apply rule to Class of Objects to apply rule to • Traverse linked data structure Name of rule Name of rule • Match found data with rules: Pattern to match object with Op plusPattern = Pattern to match object with { int op = Op.PLUS; } : – rules produce visual objects (model), Create objects of Create objects of node=TreeNode(icon=“plus.bmp“), – these are then rendered by a separate component. visual model visual model TreeEdge(from=parent, to=node), � plusPattern.left(parent=node), Traverse referenced Traverse referenced objects, pass node objects, pass node � plusPattern.right(parent=node); in environment in environment Here: class Op { final static int PLUS=1; int op; Expr left, right ...} class TreeNode { String icon; ... } class TreeEdge { TreeNode from, to; ... } Memory Graphs What if the data structures to be visualized are really large? • represent the memory of a program. • Nodes = memory content • Arrows = possible access paths. • Focus on modified parts (c.f. abstract • unfolding all accessible data structures in the program. algorithm animation) All common data structures like structs, unions, arrays or pointers are properly represented. • Group elements, form collections of data • Memory graph of GNU compiler has about 40.000 with similar structure. nodes !!! • Applications – common subgraphs to isolate differences between program states. 2

  3. Reference Pattern Extraction Jinsight (http://www.research.ibm.com/jinsight/) • At each level unfolding groups objects of the same class together. X-Slice Slicing http://xsuds.argreenhouse.com/html-man/xslice.html#770301 • X-Slice is a slicing and dicing • Static slice = set of all program points that may affect tool for C the value of a particular output or a instance of a variable at a certain program point. � data flow analysis programs. • Dynamic slice = set of all program points that for a • the dice given input actually affect a program point or instance represents the of a variable at a certain program point. intersection of a • Execution slice = set of all program points executed for failing test case a given input. and a sucessful • Dice = set difference of two slices test case. Coverage and Tests Discrete Approach • Input – Source code – For each test case • its pass/fail status • statements that it executes • Display statements in program according to the test cases that execute them Both passed & failed test cases Only passed Only failed test cases test cases Statements executed by: 3

  4. Example Example Test Cases Test Cases 3,3,5 1,2,3 3,2,1 5,5,5 5,3,4 2,1,3 3,3,5 1,2,3 3,2,1 5,5,5 5,3,4 2,1,3 mid() { mid() { int x,y,z,m; int x,y,z,m; h h h h h h h h h h h h 1: read(“Enter 3 numbers:”,x,y,z); 1: read(“Enter 3 numbers:”,x,y,z); h h h h h h h h h h h h 2: m = z; 2: m = z; h h h h h h h h h h h h 3: if (y<z) 3: if (y<z) h h 4: if (x<y) 4: if (x<y) h h 5: m = y; 5: m = y; h h h h h h 6: else if (x<z) 6: else if (x<z) h h h h 7: m = y; 7: m = y; h h h h h h 8: else 8: else h h 9: if (x>y) 9: if (x>y) h h 10: m = y; 10: m = y; 11: else if (x>z) 11: else if (x>z) 12: m = x; 12: m = x; h h h h h h h h h h h h 13: print(“Middle number is:”, m); 13: print(“Middle number is:”, m); } } Pass Status: P P P P P F Pass Status: P P P P P F Continuous Approach Hue 10 failed test cases = 100% • Distribute statements executed by both passed and 10 10 failed test cases = 100% a = b; failed test cases over spectrum 0 passed test cases = 0% 10 10 • Indicate the relative success rate of each statement m = y; by its hue Both passed & failed test cases Only passed Only failed 1 failed test cases = 10% 20 passed test cases = 10 % test cases test cases 10 200 c = d; 0 passed test cases = 0% 10 Discrete Approach: Continuous Approach: Brightness Brightness 10 failed test cases = 100% • Using total percentage of test 10 10 failed test cases 10 failed test cases = 100% = 100% m = y; cases that execute a statement 0 passed test cases = 0% 10 10 may cause important 10 m = y; m = y; statements to be overlooked 1 failed test cases = 10% 20 passed test cases = 10 % 20 passed test cases = 10 % 10 200 200 • Instead we use the higher of m = y; 0 passed test cases = 0% 30 total test cases = 14% the two independent 10 210 percentages 4

  5. Scalability Example • Large programs difficult to display Test Cases • Use the line-of-pixels, SeeSoft, view 3,3,5 1,2,3 3,2,1 5,5,5 5,3,4 2,1,3 } mid() { int x,y,z,m; • Each character in the source is displayed as a pixel h h h h h h 1: read(“Enter 3 numbers:”,x,y,z); mid() { h h h h h h 2: m = z; int x,y,z,m; h h h h h h 3: if (y<z) read(“Enter 3 numbers:”,x,y,z); h 4: if (x<y) m = z; h 5: m = y; if (y<z) h h h 6: else if (x<z) if (x<y) h h 7: m = y; m = y; h h h 8: else else if (x<z) h 9: if (x>y) m = y; h 10: m = y; else 11: else if (x>z) if (x>y) 12: m = x; [Eick,Steffen,Sumner, m = y; h h h h h h 13: print(“Middle number is:”, m); TSE 1992] else if (x>z) } Pass Status: P P P P P F m = x; print(“Middle number is:”, m); } Tarantula Visualization Pipeline Memory Code Read Program Trace program Memory execution, visited Data Acquisition program points, success or failure Alias Detection, Slicing and Dicing Common Subgraph Filtering of Memory graphs Text, Nested Boxes, Program Code,Color Graphs coding, „SeeSoft“ Visualization Approach 5

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend