2_Testing Testing techniques. Testing Crucial stage in the software development process. Significant portion of your time on testing for each programming.

Slides:



Advertisements
Similar presentations
Topics Introduction Types of Errors Exceptions Exception Handling
Advertisements

Chapter 15 Debugging. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Debugging with High Level Languages.
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.
An Introduction to Java Programming and Object- Oriented Application Development Chapter 8 Exceptions and Assertions.
Programming Types of Testing.
Debugging Techniques1. 2 Introduction Bugs How to debug Using of debugger provided by the IDE Exception Handling Techniques.
A Review. a review of lessons learned so far… ( 2 steps forward - 1 step back) Software Development Cycle: design, implement, test, debug, document Large.
Lecture Roger Sutton CO331 Visual programming 15: Debugging 1.
Programming Languages: Notes for Class Discussion: V Deena Engel’s class.
Program Correctness and Efficiency Chapter 2. Chapter Objectives  To understand the differences between the three categories of program errors  To understand.
How to Debug VB .NET Code.
Java Review 2 – Errors, Exceptions, Debugging Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Python Mini-Course University of Oklahoma Department of Psychology Day 1 – Lesson 2 Fundamentals of Programming Languages 4/5/09 Python Mini-Course: Day.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Object Oriented Programming
UNIT 3 TEMPLATE AND EXCEPTION HANDLING. Introduction  Program errors are also referred to as program bugs.  A C program may have one or more of four.
Chapter 1.4 Programming languages Homework Due: Monday, August 11, 2014.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC BUILDING BLOCKS Bilal Munir Mughal 1 Chapter-5.
Programming Lifecycle
Debugging. Compile problems Read the whole complaint! Runtime problems –Exceptions –Incorrect behavior.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
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.
1 Problem Solving with C++ The Object of Programming Walter Savitch Chapter 1 Introduction to Computers and C++ Programming Slides by David B. Teague,
Testing Methods Carl Smith National Certificate Year 2 – Unit 4.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
ME 142 Engineering Computation I Debugging Techniques.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Controlling Execution Programming Right from the Start with Visual Basic.NET 1/e 8.
Introduction to Problem Solving. Steps in Programming A Very Simplified Picture –Problem Definition & Analysis – High Level Strategy for a solution –Arriving.
Debugging and Profiling With some help from Software Carpentry resources.
Basic Programming Lingo. A program is also known as a  Sequence of instructions  Application  App  Binary  Executable.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
1 Program Planning and Design Important stages before actual program is written.
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Error messages 25-Apr-17.
School of Computer Science & Information Technology G6DICP - Lecture 6 Errors, bugs and debugging.
ERRORS. Types of errors: Syntax errors Logical errors.
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
The Hashemite University Computer Engineering Department
CS 177 Week 10 Recitation Slides 1 1 Debugging. Announcements 2 2.
Error Handling Tonga Institute of Higher Education.
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.
Principles of Programming CSEB134 : BS/ CHAPTER Fundamentals of the C Programming Language.
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.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
UML Diagrams and Software Testing Instructor: Scott Kristjanson CMPT 135 SFU Surrey, Spring 2016.
Harvard Mark I Howard Aiken was a pioneer in computing and a creator of conceptual design for IBM in the 1940s. He envisioned an electro-mechanical computing.
Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
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 and Debugging.
Software Design and Development
Debugging CMSC 202.
2_Testing Testing techniques.
Problem Solving Techniques
Chapter 15 Debugging.
Tonga Institute of Higher Education
Chapter 15 Debugging.
Bugs & Debugging - Testing
Chapter 15 Debugging.
Chapter 15 Debugging.
Presentation transcript:

2_Testing Testing techniques

Testing Crucial stage in the software development process. Significant portion of your time on testing for each programming exercise in this course. Testing ensures that the program that you are developing meets the requirements of the problem. Later –JUnit framework to perform one kind of testing called “unit testing.” –Exception for runtime faults Testing allows you to detect bugs in your code. After a bug is identified, it must be fixed without introducing other bugs.

Bug Types and Debugging Techniques Syntax errors –A syntax error occurs when a program does not satisfy the grammatical rules of the programming language. For example, in Java, each declaration statement must end with a semi-colon. Forgetting it is a syntax error. Among other things, it is the role of the compiler to catch syntax errors. Therefore, such errors are the easiest to catch and fix. –Errors.java

Bug Types and Debugging Techniques Runtime errors –A runtime error occurs when the execution of the program terminates abnormally. Note that these errors manifest themselves at run time, not at compile time, which makes them more problematic than syntax errors. For example, an exception is raised when attempting to divide by zero.

Bug Types and Debugging Techniques Logic errors A logic error exists every time the program does not behave the way it was supposed to, as specified in the requirements. These are the worst kind of errors because they are not caught by the compiler and they do not cause the program to crash. They may go undetected for a long time since they may manifest themselves only in a particular setting, e.g., for specific input values.

Debugging Debugging is the process of correcting errors in a program. Use a combination of techniques for debugging: 1.Hand-trace the program 2.Insert ’print’ statements to keep track of which instructions are executed and what values variables take. 3. Use a software utility called a debugger to: Set breakpoints Execute your program one statement at a time Display the value of variables and inspect the state of objects Step into a method’s body or step over a method call Inspect the call sequence Pause (halt), resume, or terminate a long-running program

Example: Counting syllables One simple algorithm to count the number of syllables in a word: –count the number of vowel groups in the word, where a vowel group is a sequence of consecutive vowels that is surrounded by consonants on both sides or else appears at the beginning or the end of the word. –This algorithm works in most cases provided silent e’s are removed from the end of the word, since they do not constitute a new syllable (e.g., in “niece” or “course”). In addition, a vowel count of zero is treated as a count of one to account for words such as “the” that end in e and contain only one syllable.

An FSM for a syllable-counter Event state vowelnot a vowel Not in VGIn VG (count++)Not in VG In VG Not in VG