Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding...
Transcript of Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding...
![Page 1: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/1.jpg)
Debugging in AnyLogic
Nathaniel Osgood
CMPT 858
4-5-2011
![Page 2: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/2.jpg)
Avoiding Debugging
• Defensive Programming
• Offensive Programming
![Page 3: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/3.jpg)
Offensive Programming: Try to Get Broken Program to Fail Early, Hard
• Asserts: Actually quit the program
• Fill memory allocated with illegal values
• Fill object w/illegal data just before deletion
• Set buffers at end of heap, so that overwrites likely trigger page fault
• Setting default values to be illegal in enums
• We will talk about Assertions & Error Handling later this week
![Page 4: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/4.jpg)
Assertion Goal: Fail Early!
• Alert programmer to misplaced assumptions as early as possible
• Benefits
– Documents assumptions
– Reduces likelihood that error will slip through
• Helps discourage “lazy” handling of only common case
• Forces developer to deal explicitly with bug before continuing
– Reduces debugging time
– Helps improve thoroughness of tests
![Page 5: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/5.jpg)
Avoid Side Effects in Assertions
• Because assertions may be completely removed from the program, it is unsafe to rely on side effects occuring in them
Arnold et al. The Java Programming Language, Fourth Edition. 2006.
![Page 6: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/6.jpg)
Enabling Assertions in AnyLogic
![Page 7: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/7.jpg)
Enabling Assertions in Java
• 2 ways
– Usual: Via java runtime command line
• e.g.
– Less common: via reflection (ClassLoader)
Arnold et al. The Java Programming Language, Fourth Edition. 2006.
![Page 8: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/8.jpg)
Debugging AnyLogic
• Debugging is the process of locating the faults behind observed failures
• AnyLogic’s education now contains a debugger
• You can attach to AnyLogic from debuggers such as eclipse
– The key thing is to set anylogic to use a port
![Page 9: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/9.jpg)
Debugging Options
• Using output for manual tracing & reporting
• Using AspectJ & tracing
• Using an external debugger (e.g. via eclipse)
• Using AnyLogic Professional/Research debugger
![Page 10: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/10.jpg)
Using output for manual tracing & reporting
• Pros – Minimal learning curve
– Flexible
– Easily targeted
• Cons – Requires time-consuming manual
• “markup”
• de-markup
– Can require many build/simulation iterations to localize problem
– Limited capacity of console
![Page 11: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/11.jpg)
Output to the Console: How To
• System.err.println(String)
– System.err.println("Sent cure message to person [" + associatedPerson + "]");
• traceln(String)
• System.out.println(String)
![Page 12: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/12.jpg)
Use in AnyLogic
![Page 13: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/13.jpg)
AspectJ and Eclipse
• AspectJ is a language that allows for succinctly describing “cross cutting” functionality in programs – such as tracing or logging requests
• AspectJ can automatically insert tracing instrumentation into our code
– This gives us many of the benefits of manual tracing program execution without the need for the markup & mark-down work
![Page 14: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/14.jpg)
AnyLogic Built-in Debugger
![Page 15: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/15.jpg)
Running the Debugger
![Page 16: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/16.jpg)
Running the Models
![Page 17: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/17.jpg)
Setting a Breakpoint
![Page 18: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/18.jpg)
When we Hit the Breakpoint…
![Page 19: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/19.jpg)
Components to Direct Execution
![Page 20: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/20.jpg)
Visible (“In-Scope”) Variables
![Page 21: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/21.jpg)
Exploring Composite Variable Values in the Debugger
![Page 22: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/22.jpg)
Inspecting Composite Variables
![Page 23: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/23.jpg)
Changing Variable Values During Debugging
![Page 24: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/24.jpg)
Stepping into Auto-Generated Code
![Page 25: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/25.jpg)
Seeing Result of Expression Evaluation
Note that this doesn’t update immediate – may need to switch stack frames in the “Debug” method To see the update
![Page 26: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/26.jpg)
External Debugging in Eclipse
• The “Eclipse” editor is one of the most popular extant software development tools
• Eclipse offers plug-ins of many sorts
– Debuggers
– Profilers
– Visualization tools
– Version control of models
• Eclipse can be used to debug AnyLogic models at the Java source-code level
![Page 27: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/27.jpg)
Steps Required for Eclipse Debugging
• One time set-up for a particular model
– Set up AnyLogic to allow debugging connections
– Set up Eclipse to know
• How to connect to AnyLogic
• Where to look for source code files
• Every time want to debug
– Go to Eclipse
– Tell debugger to connect to AnyLogic process
– Interrupt process
– Set breakpoints, etc.
![Page 28: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/28.jpg)
Setup In AnyLogic
• -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8321
• These go under the "Advanced" tab of the simulation run to use
![Page 29: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/29.jpg)
Set up: Creating a Debugging Configuration in Eclipse
![Page 30: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/30.jpg)
Setting Up Source Code Folders
![Page 31: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/31.jpg)
Add Source Folder
![Page 32: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/32.jpg)
Once Set up, Can…
• Set breakpoints
• See the variables, with symbolic information
• Suggestions
– Set a breakpoint on a thrown runtime exception (regardless of whether caught)
– Throw a caught runtime exception from model startup code
– When catch this in Eclipse, can then use to set breakpoints (including in other files)
![Page 33: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/33.jpg)
Example Setup: Set up Function to Trigger the Debugger
![Page 34: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/34.jpg)
In Startup Code for Model, Call Function
![Page 35: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/35.jpg)
In Eclipse, Open “Debug” Perspective
![Page 36: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/36.jpg)
Request Creation of Exception Breakpoint
![Page 37: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/37.jpg)
Request as Breakpoint Regardless of Handling
![Page 38: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/38.jpg)
Should Now be in List of Enabled Breakpoints
![Page 39: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/39.jpg)
Start AnyLogic Model (Experiment with Extra Debugging JVM Arguments)
![Page 40: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/40.jpg)
Leave on Opening Screen for Now (So We can Set up Eclipse)
![Page 41: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/41.jpg)
Go To Eclipse & Request AnyLogic Debugging Debug Configuration (previously set up)
![Page 42: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/42.jpg)
Should Immediately See Something Like This
![Page 43: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/43.jpg)
Return to AnyLogic & Start Simulation via Button Push
![Page 44: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/44.jpg)
Back in Eclipse, the Debugger Should have been Triggered & at Exception Handler
(If not, close “Main.java” and double-click on topmost “stack frame” (Where Exception is triggered))
![Page 45: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/45.jpg)
Now Can Set Breakpoints in Main.java or Elsewhere (Here: Person.java)
![Page 46: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/46.jpg)
Warning: Breakpoints are Not Shown in Source Window – Just in
“Breakpoints” area
![Page 47: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/47.jpg)
Press “Resume” to Continue – Awaiting a Breakpoint
![Page 48: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/48.jpg)
Example Breakpoint in Main
![Page 49: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/49.jpg)
Example Breakpoint in Person
![Page 50: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/50.jpg)
Once at Breakpoint, Can Look at Variables, Single Step, etc.
![Page 51: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/51.jpg)
Variables Displayed
![Page 52: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/52.jpg)
Terminating Execution from AnyLogic Console
![Page 53: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/53.jpg)
Eclipse is Now Detached
![Page 54: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/54.jpg)
Remembering Breakpoints
• Note Eclipse does remember breakpoints from session to session
• So breakpoints that set earlier in an anylogic session will work again even after close eclipse and restart it again
• Suggestions – Consider creating a common breakpoints (e.g. at
Main.start)
– Disable and enable breakpoints rather than deleting them
![Page 55: Debugging in AnyLogic - University of Saskatchewan · Nathaniel Osgood CMPT 858 4-5-2011 . Avoiding Debugging •Defensive Programming ... •These go under the "Advanced" tab of](https://reader034.fdocuments.in/reader034/viewer/2022051917/6008e274bfe1ff322106d812/html5/thumbnails/55.jpg)
Example of Debugging Session