Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Chapter 15 Debugging. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Debugging with High Level Languages.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
FIT FIT1002 Computer Programming Unit 19 Testing and Debugging.
Debugging code with limited system resource. Minheng Tan Oct
1 CSE1301 Computer Programming: Lecture 15 Flowcharts and Debugging.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Java Review 2 – Errors, Exceptions, Debugging Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 CSE1301 Computer Programming: Lecture 15 Flowcharts, Testing and Debugging.
Loops Repetition Statements. Repetition statements allow us to execute a statement multiple times Often they are referred to as loops Like conditional.
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
1 Chapter Two Introduction to the Programming Language C.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
1/20 Symbolic Execution and Program Testing Charngki PSWLAB Symbolic Execution and Program Testing James C.King IBM Thomas J.Watson Research Center.
Selection Hussein Suleman UCT Dept of Computer Science CS115 ~ 2004.
Software Testing Damian Gordon.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
Chapter 10 – Testing and Debugging. Chapter Goals ► Learn techniques to test your code ► Learn to carry out unit tests ► Understand principles of test.
Debugging. 2 © 2003, Espirity Inc. Module Road Map 1.Eclipse Debugging  Debug Perspective  Debug Session  Breakpoint  Debug Views  Breakpoint Types.
Chapter 02 (Part III) Introduction to C++ Programming.
2_Testing Testing techniques. Testing Crucial stage in the software development process. Significant portion of your time on testing for each programming.
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.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
ME 142 Engineering Computation I Debugging Techniques.
COMP 121 Week 1: Testing and Debugging. Testing Program testing can be used to show the presence of bugs, but never to show their absence! ~ Edsger Dijkstra.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
Java Basics Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
Debuggers in Python. The Debugger Every programming IDE has a tool called a debugger. This application does NOT locate or fix your bugs for you! It slows.
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
Design - programming Cmpe 450 Fall Dynamic Analysis Software quality Design carefully from the start Simple and clean Fewer errors Finding errors.
SOFTWARE TESTING. INTRODUCTION Testing forms the first step in determining the errors in a program. It is the major quality control measure used during.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 3 – Inventory Application: Introducing Variables,
Compilers and Interpreters. HARDWARE Machine LanguageAssembly Language High Level Language C++ Visual Basic JAVA Humans.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
1First BlueJ Day, Houston, Texas, 1st March 2006 Debugging in BlueJ Davin McCall.
Flow of Control: Loops Module 4. Objectives Design a loop Use while, do, and for in a program Use the for-each with enumerations Use assertion checks.
Compilers and Interpreters
Chapter 7 What’s Wrong with It? (Syntax and Logic Errors) Clearly Visual Basic: Programming with Visual Basic nd Edition.
1 CSE1301 Computer Programming: Lecture 16 Flow Diagrams and Debugging.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
MOOR ERROR HANDLING Types of error How to test your code for errors How to detect errors How to recover from errors.
1 Sections 7.2 – 7.7 Nested Control Statements Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
UCT Department of Computer Science Computer Science 1015F Iteration
Testing and Debugging UCT Department of Computer Science Computer Science 1015F Hussein Suleman March 2009.
Wrapper Classes Debugging Interlude 1
ME 142 Engineering Computation I
Testing Tutorial 7.
Testing and Debugging PPT By :Dr. R. Mall.
Dept of Computer Science University of Maryland College Park
Topics: jGRASP editor ideosyncrasies assert debugger.
Testing and Debugging.
Software Design and Development
LESSON 20.
2_Testing Testing techniques.
Testing Key Revision Points.
Chapter 15 Debugging.
Debugging CSCE 121 J. Michael Moore.
Chapter 15 Debugging.
BugHint: A Visual Debugger Based on Graph Mining
IDE’s and Debugging.
Whitebox Testing.
CSE 1020:Software Development
Chapter 15 Debugging.
Debugging.
Chapter 15 Debugging.
Presentation transcript:

Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F

Debugging  Debugging is the process of finding errors or bugs in the code.  A debugger is a tool for executing an application where the programmer can carefully control execution and inspect data.  Features include: step through code one instruction at a time viewing variables insert and remove breakpoints to pause execution

Test Cases  Based on Input: Choose one value in each equivalence classes – sets of input values that behave similarly. Choose values on either side of and at boundary values – values between equivalence classes.  Based on Code: Path coverage: choose values that test every possible path through the statements at least once. Statement coverage: Choose values that test every possible statement at least once.

Assertions  In Java a programmer can specify conditions that must always be satisfied at particular points (invariants) or the program produces an error. This is an assertion.  Example: assert (input > 0);

Tracing  Insert temporary statements into code to output values during calculation.  Very useful when there is no debugger!  Example: int x = y*y*2; int z = x+5; System.out.println (z); if (z == 13)‏ { … } trace instruction