Definitions. Error. A wrong decision made during software development

Similar documents
Chapter 5. Functions for All Subtasks. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

CS 11 C track: lecture 1

Exceptions. Your computer takes exception. The Exception Class. Causes of Exceptions

n Some thoughts on software development n The idea of a calculator n Using a grammar n Expression evaluation n Program organization n Analysis

One advantage that SONAR has over any other music-sequencing product I ve worked

Structuring Redundancy for Fault Tolerance. CSE 598D: Fault Tolerant Software

Data diverse software fault tolerance techniques

Python Programming: An Introduction to Computer Science

COP4020 Programming Languages. Compilers and Interpreters Prof. Robert van Engelen

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

GE FUNDAMENTALS OF COMPUTING AND PROGRAMMING UNIT III

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 13 Control and Sequencing: Hardwired and Microprogrammed Control

CS 111: Program Design I Lecture # 7: First Loop, Web Crawler, Functions

Workflow model GM AR. Gumpy. Dynagump. At a very high level, this is what gump does. We ll be looking at each of the items described here seperately.

n Maurice Wilkes, 1949 n Organize software to minimize errors. n Eliminate most of the errors we made anyway.

Morgan Kaufmann Publishers 26 February, COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 5.

JavaFX. JavaFX 2.2 Installation Guide Release 2.2 E August 2012 Installation instructions by operating system for JavaFX 2.

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance

How do we evaluate algorithms?

Chapter 10. Defining Classes. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

University of Waterloo Department of Electrical and Computer Engineering ECE 250 Algorithms and Data Structures

. Written in factored form it is easy to see that the roots are 2, 2, i,

CMSC Computer Architecture Lecture 12: Virtual Memory. Prof. Yanjing Li University of Chicago

Creating Test Harnesses and Starter Applications

Recursion. Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Review: Method Frames

Baan Tools User Management

What are we going to learn? CSC Data Structures Analysis of Algorithms. Overview. Algorithm, and Inputs

Project 2.5 Improved Euler Implementation

Web OS Switch Software

CS425 Project Assignment

System and Software Architecture Description (SSAD)

Term Project Report. This component works to detect gesture from the patient as a sign of emergency message and send it to the emergency manager.

Chapter 4. Procedural Abstraction and Functions That Return a Value. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

LifeBook P Series Notebook BIOS BIOS SETUP UTILITY

Network Time Protocol (NTP)

n Learn how resiliency strategies reduce risk n Discover automation strategies to reduce risk

Transitioning to BGP

Chapter 4 The Datapath

CIS 121 Data Structures and Algorithms with Java Spring Stacks, Queues, and Heaps Monday, February 18 / Tuesday, February 19

Fujitsu LifeBook P Series

Threads and Concurrency in Java: Part 1

Threads and Concurrency in Java: Part 1

Python Programming: An Introduction to Computer Science

CIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Code Review Defects. Authors: Mika V. Mäntylä and Casper Lassenius Original version: 4 Sep, 2007 Made available online: 24 April, 2013

Last class. n Scheme. n Equality testing. n eq? vs. equal? n Higher-order functions. n map, foldr, foldl. n Tail recursion

3.1 Overview of MySQL Programs. These programs are discussed further in Chapter 4, Database Administration. Client programs that access the server:

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design

Network Time Protocol (NTP)

Appendix D. Controller Implementation

Multi-Threading. Hyper-, Multi-, and Simultaneous Thread Execution

HAFOD MAKING A COMPLAINT [NEW]_Layout 1 21/03/ :06 Page 1 MAKING A COMPLAINT

Descriptive Statistics Summary Lists

Running Time. Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Τεχνολογία Λογισμικού

Running Time ( 3.1) Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Analysis of Algorithms

Outline and Reading. Analysis of Algorithms. Running Time. Experimental Studies. Limitations of Experiments. Theoretical Analysis

Baan Finance Financial Statements

1. SWITCHING FUNDAMENTALS

n We have discussed classes in previous lectures n Here, we discuss design of classes n Library design considerations

Priority Queues. Binary Heaps

Fujitsu LifeBook C Series

CS 683: Advanced Design and Analysis of Algorithms

Abstract. Chapter 4 Computation. Overview 8/13/18. Bjarne Stroustrup Note:

Custodial Integrator Automation Guide

BEA WebLogic Application Integration A Component of BEA WebLogic Integration. Adapter Development Guide

SCI Reflective Memory

IMP: Superposer Integrated Morphometrics Package Superposition Tool

WORKED EXAMPLE 7.1. Producing a Mass Mailing. We want to automate the process of producing mass mailings. A typical letter might look as follows:

Oracle Server. What s New in this Release? Release Notes

Avid Interplay Bundle

From last week. Lecture 5. Outline. Principles of programming languages

MR-2010I %MktBSize Macro 989. %MktBSize Macro

BEA WebLogic Process Integrator

Ones Assignment Method for Solving Traveling Salesman Problem

prerequisites: 6.046, 6.041/2, ability to do proofs Randomized algorithms: make random choices during run. Main benefits:

Elementary Educational Computer

BAAN IVc/BaanERP. Conversion Guide Oracle7 to Oracle8

MOTIF XF Extension Owner s Manual

The VSS CCD photometry spreadsheet

Topics. Instance object. Instance object. Fundamentals of OT. Object notation. How do objects collaborate? Pearson Education 2007 Appendix (RASD 3/e)

What Is Object-Orientation?

CS 111: Program Design I Lecture 15: Objects, Pandas, Modules. Robert H. Sloan & Richard Warner University of Illinois at Chicago October 13, 2016

BEA Tuxedo. Creating CORBA Client Applications

Module Instantiation. Finite State Machines. Two Types of FSMs. Finite State Machines. Given submodule mux32two: Instantiation of mux32two

Morgan Kaufmann Publishers 26 February, COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 5

BEA WebLogic Commerce Server. Registration and User Processing Package

CS : Programming for Non-Majors, Summer 2007 Programming Project #3: Two Little Calculations Due by 12:00pm (noon) Wednesday June

ARM. Microcontroller Development Tools. ARM RealView C/C++ Compilation Tools with MicroLib. Easy-to-use IDE Supports Complete Development Cycle

Package RcppRoll. December 22, 2014

Guide to Applying Online

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 4. The Processor. Single-Cycle Disadvantages & Advantages

A collection of open-sourced RISC-V processors

Computers and Scientific Thinking

Adapter for Mainframe

Lecture 6. Lecturer: Ronitt Rubinfeld Scribes: Chen Ziv, Eliav Buchnik, Ophir Arie, Jonathan Gradstein

BEA Tuxedo. Creating CORBA Server Applications

Transcription:

Debuggig

Defiitios Error A wrog decisio made durig software developmet

Defiitios 2 Error A wrog decisio made durig software developmet Defect bug sometimes meas this The term Fault is also used Property of software that may cause the system to deviate from its iteded behaviour

Defiitios 3 Error A wrog decisio made durig software developmet Defect bug sometimes meas this The term Fault is also used Property of software that may cause the system to deviate from its iteded behaviour Fault bug sometimes meas this The term Failure is also used The evet i which software deviates from its iteded behaviour

Defiitios 4 Error A wrog decisio made durig software developmet Defect bug sometimes meas this The term Fault is also used Property of software that may cause the system to deviate from its iteded behaviour Fault bug sometimes meas this The term Failure is also used The evet i which software deviates from its iteded behaviour Error ==> Defect ==> Fault Error ==> Fault ==> Failure

What is debuggig? Debug 6

What is debuggig? 2 You have ru a test that detects a fault Debug 7

What is debuggig? 3 You have ru a test that detects a fault Assumig the test is correct, that implies there is a defect i the program you are testig Debug 8

What is debuggig? 4 You have ru a test that detects a fault Assumig the test is correct, that implies there is a defect i the program you are testig You wat to fid the error i your desig / implemetatio that led to the defect Debug 9

What is debuggig? 5 You have ru a test that detects a fault Assumig the test is correct, that implies there is a defect i the program you are testig You wat to fid the error i your desig / implemetatio that led to the defect What do you do? Debug 10

What is debuggig? 6 You have ru a test that detects a fault Assumig the test is correct, that implies there is a defect i the program you are testig You wat to fid the error i your desig / implemetatio that led to the defect What do you do? You trace the executio path followed by the test Debug 11

What is debuggig? 7 You have ru a test that detects a fault Assumig the test is correct, that implies there is a defect i the program you are testig You wat to fid the error i your desig / implemetatio that led to the defect What do you do? You trace the executio path followed by the test Check the state of the program at each step Debug 12

What is debuggig? 8 You have ru a test that detects a fault Assumig the test is correct, that implies there is a defect i the program you are testig You wat to fid the error i your desig / implemetatio that led to the defect What do you do? You trace the executio path followed by the test Check the state of the program at each step Util you fid the error Debug 13

What is debuggig? 9 You have ru a test that detects a fault Assumig the test is correct, that implies there is a defect i the program you are testig You wat to fid the error i your desig / implemetatio that led to the defect What do you do? You trace the executio path followed by the test Check the state of the program at each step Util you fid the error Correct the error by??? Debug 14

What is debuggig? 10 You have ru a test that detects a fault Assumig the test is correct, that implies there is a defect i the program you are testig You wat to fid the error i your desig / implemetatio that led to the defect What do you do? You trace the executio path followed by the test Check the state of the program at each step Util you fid the error Correct the error by Esurig the program correctly implemets the desig Esurig the desig is correct Debug 15

Fudametal method prit the (sub)state Beefit The method works i the vast majority of cases, i all laguages ad all operatig systems Debug 16

Fudametal method prit the (sub)state Beefit The method works i the vast majority of cases, i all laguages ad all operatig systems No eed to lear or deped upo a tool customized for the laguage ad operatig system Debug 17

Fudametal method prit the (sub)state Beefit The method works i the vast majority of cases, i all laguages ad all operatig systems No eed to lear or deped upo a tool customized for the laguage ad operatig system After makig a chage, you ru the program ad see if state is correct where it was wrog before Debug 18

Fudametal method prit the (sub)state Drawback It is primitive ad very ad hoc Debug 19

Fudametal method prit the (sub)state Drawback It is primitive ad very ad hoc Program text is added to the system, that eeds to be removed oce the error has bee fixed Debug 20

Fudametal method prit the (sub)state Drawback It is primitive ad very ad hoc Program text is added to the system, that eeds to be removed oce the error has bee fixed It iteracts with the ormal output of the program Debug 21

Fudametal method prit the (sub)state Drawback It is primitive ad very ad hoc Program text is added to the system, that eeds to be removed oce the error has bee fixed It iteracts with the ormal output of the program Ca produce volumious output Debug 22

Fudametal method prit the (sub)state Drawback It is primitive ad very ad hoc Program text is added to the system, that eeds to be removed oce the error has bee fixed It iteracts with the ormal output of the program Ca produce volumious output Have to worry about buffered output, which meas the last few output lies may ot appear Debug 23

Loggig Use the Logger class istead of usig System.out.pritl Logger.getGlobal().ifo Debug 24

Loggig Use the Logger class istead of usig System.out.pritl Logger.getGlobal().ifo You ca have fier-grai loggig. Use fie or severe, i place of ifo Debug 25

Loggig Use the Logger class istead of usig System.out.pritl Logger.getGlobal().ifo You ca have fier-grai loggig. Use fie or severe, i place of ifo The API is i java.util.loggig Debug 26

Loggig Use the Logger class istead of usig System.out.pritl Logger.getGlobal().ifo You ca have fier-grai loggig. Use fie or severe, i place of ifo The API is i java.util.loggig You ca tur off all loggig with Logger.getGlobal().setLevel(Level.OFF); Debug 27

Assertios Be defesive, add assertios to the program Debug 28

Assertios Be defesive, add assertios to the program See Programmig with Assertios docs.oracle.com/javase/7/docs/techotes/guides/laguage/assert.html Debug 29

Assertios Be defesive, add assertios to the program See Programmig with Assertios docs.oracle.com/javase/7/docs/techotes/guides/laguage/assert.html Assert statemets exist i C, C++, Java, Eiffel Check existece i other laguages Debug 30

Assertios Be defesive, add assertios to the program See Programmig with Assertios docs.oracle.com/javase/7/docs/techotes/guides/laguage/assert.html Assert statemets exist i C, C++, Java, Eiffel Check existece i other laguages Assertios ca be implemeted with if the If ot assertio the have a exceptio / problem fi Debug 31

Assertios Be defesive, add assertios to the program See Programmig with Assertios docs.oracle.com/javase/7/docs/techotes/guides/laguage/assert.html Assert statemets exist i C, C++, Java, Eiffel Check existece i other laguages Assertios ca be implemeted with if the If ot assertio the have a exceptio / problem fi Jet Propulsio Lab has all its software i C ad madates the use of assertios Debug 32

Eable assertios i Eclipse Go to Ru à ru cofiguratios Uder Java Applicatio select the applicatio to use assertios Here Copy_Examples Select Argumets tab Add ea i VM argumets Debug 33

Debug Flags Whe debuggig it is useful to tur o ad off various features i a program Debug 34

Debug Flags Whe debuggig it is useful to tur o ad off various features i a program Especially debug output Debug 35

Debug Flags Whe debuggig it is useful to tur o ad off various features i a program Especially debug output Create a Debug class that cotais Boolea flags that ca be set, reset ad toggled Debug 36

Debug Flags Whe debuggig it is useful to tur o ad off various features i a program Especially debug output Create a Debug class that cotais Boolea flags that ca be set, reset ad toggled Use the flags i if statemets that surroud iterestig sectios of your program Debug 37

Debug Flags Whe debuggig it is useful to tur o ad off various features i a program Especially debug output Create a Debug class that cotais Boolea flags that ca be set, reset ad toggled Use the flags i if statemets that surroud iterestig sectios of your program For differet test rus give differet settigs of true ad false to the flags Debug 38

Debug Flags 2 Example if Debug.flag0 the Block1 fi if Debug.flag1 the Block2 fi if Debug.flag3 the Block3 if Debug.flag4 the Block4 fi fi Depedig upo the values of flag0.. flag3 differet combiatios of Block1.. Block4 are executed Debug 39

Program istrumetatio Isertig debug write / log statemets ad usig debug flags is called program istrumetatio Debug 40

Program istrumetatio Isertig debug write / log statemets ad usig debug flags is called program istrumetatio Used judiciously it is a useful method Debug 41