Debugging Watch and Text Output Alice. Debugging Techniques Several techniques are helpful in eliminating errors (bugs) in programs: careful design incremental.

Slides:



Advertisements
Similar presentations
C++ Introduction.
Advertisements

Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Code optimization: –A transformation to a program to make it run faster and/or take up less space –Optimization should be safe, preserve the meaning of.
Why care about debugging? How many of you have written a program that worked perfectly the first time? No one (including me!) writes a program that works.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
General Computer Science for Engineers CISC 106 Lecture 21 Dr. John Cavazos Computer and Information Sciences 04/10/2009.
 Monday, 9/9/02, Slide #1 CS106 Introduction to CS1 Monday, 9/9/02  QUESTIONS?? (Exercises, Lab #1, etc.)  Today:  More on float objects  C++ concept:
Ten debugging techniques. The execution process Execution proceeds in a standard series of steps Compute values of subexpressions first Then call value.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Tips & Techniques 6 Random Numbers and Random Motion Alice.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
Visual Basic Debugging Tools Appendix D 6/27/20151Dr. Monther Aldwairi.
Using Java's Math & Scanner class. Java's Mathematical functions (methods) (1)
CHAPTER 1 XNA Game Studio 4.0. Your First Project A computer game is not just a program—it is also lots of other bits and pieces that make playing the.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Python Mini-Course University of Oklahoma Department of Psychology Day 1 – Lesson 2 Fundamentals of Programming Languages 4/5/09 Python Mini-Course: Day.
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
Debugging Cluster Programs using symbolic debuggers.
Programming Logic Program Design. Objectives Steps in program development Algorithms and Pseudocode Data Activity: Alice program.
Execution Control with If/Else and Boolean Functions
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
Arrays and Array Visualization Alice. What is an array? An array is a collection of objects or information that is organized in a specific order. The.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Chapter 1 What is Programming? Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Events Chapter 7 Part 2. While a Key is Pressed Event Specialized event An event occurs when you press a key and continues until you take your finger.
Tutorial 10 Programming with JavaScript
Debugging in Java. Common Bugs Compilation or syntactical errors are the first that you will encounter and the easiest to debug They are usually the result.
ME 142 Engineering Computation I Debugging Techniques.
Creating Projects in JCreator Computer Science 40S.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Program Errors and Debugging Week 10, Thursday Lab.
ORDER OF CONTENT AND INSTRUCTIONS A program in its simplest form usually contains three kinds of activity:  INPUT : The program asks the user for some.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Creating An Animation Program Alice. Recall We began the animation creation process We introduced the concept of storyboard We will continue using the.
Concurrent Programming and Threads Threads Blocking a User Interface.
Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.
Chapter 7 Debugging Techniques Xiaogang Su Department of Statistics University of Central Florida.
Introduction to Visual Basic Programming. Introduction Simple Program: Printing a Line of Text Another Simple Program: Adding Integers Memory Concepts.
Testing Chapter 23 IB103 Week 12 (part 3). Verify that a complex (any) program works correctly, that the program meets specifications The chapter reviews.
Creating a Java Application and Applet
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
PROGRAMMING IN R Introduction to R. In this session I will: Introduce you to the R program and windows Show how to install R Write basic programs in R.
5.01 Understand Different Types of Programming Errors
Creating An Animation Program Alice. Recall We began the animation creation process We introduced the concept of storyboard We will continue using the.
Using Alice.  Alice is visual  Alice is object-oriented (some might say object- based)  Alice eliminates the need to debug syntax errors  Alice introduces.
List Search Alice. Common Uses of Lists Iterating through a list of several like items to accomplish the same task with each item. As in the previous.
Creating an Animation Program Alice. The programming steps.
E Copyright © 2007, Oracle. All rights reserved. Using JDeveloper.
15 Copyright © 2004, Oracle. All rights reserved. Debugging Triggers.
AVCE ICT – Unit 7 - Programming Session 12 - Debugging.
IST 210: PHP LOGIC IST 210: Organization of Data IST210 1.
Chapter 7 What’s Wrong with It? (Syntax and Logic Errors) Clearly Visual Basic: Programming with Visual Basic nd Edition.
COMPUTER PROGRAMMING I SUMMER Understand Different Types of Programming Errors.
Creating an Animation Program Alice. Step 1: Design Decide on the problem to be solved Design a solution We will use a storyboard design technique, commonly.
Introducing Python 3 Introduction to Python. Introduction to Python L1 Introducing Python 3 Learning Objectives Know what Python is and some of the applications.
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
5.01 Understand Different Types of Programming Errors
ME 142 Engineering Computation I
How to debug an application
Testing and Debugging.
5.01 Understand Different Types of Programming Errors
Use proper case (ie Caps for the beginnings of words)
Creating an Animation Program
Tonga Institute of Higher Education
Design and Implementation
Lab 1: Getting started ICE0125 Programming Fundamentals II – C/C++
Variables variable: A piece of the computer's memory that is given a name and type, and can store a value. Like preset stations on a car stereo, or cell.
CSCI N207 Data Analysis Using Spreadsheet
Creating An Animation Program
Presentation transcript:

Debugging Watch and Text Output Alice

Debugging Techniques Several techniques are helpful in eliminating errors (bugs) in programs: careful design incremental development In this session we look at two additional techniques: Watch Text output

Watch Variables are elusive and a bit magical because they exist somewhere in the murky depths of the computer's memory and we can't see what goes on inside them. To help you "see" the inner workings of a variable, Alice provides a watch -- a small window where the value of a variable can be displayed at runtime.

Creating a Watch Select the object in the Object tree and then the variable you want to watch. Then right click on the variable and select watch this variable. In this example, we selected the corvette and then right clicked on its direction variable.

Demo Ch10Lec3DebugWithWatch Concepts illustrated in this example A watch can be used to display the value of a variable every time the value changes. Setting a watch on a variable allows you to see whether the value is changing as expected. If not, you can then change your code to make it work correctly.

Text Output Using a print instruction is another way to keep an eye on the value stored in a variable at runtime. The print instruction causes the animation to be displayed in a split window. One pane displays the animation A second pane is a text console where text output is displayed.

Creating a print instruction

Demo Ch10Lec3DebugWithPrint Concept illustrated in this example A print instruction activates a text console and displays the variable value each time the method is executed.

History The major difference between a watch window and the text output provided by a print instruction is that text output provides a history of the values as the program runs.

Assignment Read Tips & Techniques 10, Debugging with Watch and Text Output