Testing and Debugging. Testing Fundamentals  Test as you develop Easier to find bugs early rather than later Prototyping helps identify problems early.

Slides:



Advertisements
Similar presentations
Software Testing and Analysis. Ultimate goal for software testing Quality Assurance.
Advertisements

Verification and Validation
Software Project Management Lecture # 11. Outline Quality Management ( chapter 26 - Pressman )  Software reviews  Formal Inspections & Technical Reviews.
Software Engineering-II Sir zubair sajid. What’s the difference? Verification – Are you building the product right? – Software must conform to its specification.
Testing Without Executing the Code Pavlina Koleva Junior QA Engineer WinCore Telerik QA Academy Telerik QA Academy.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Program Testing Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Testing HCI Usability Testing. Chronological order of testing Individual program units are built and tested (white-box testing / unit testing) Units are.
SE 555 Software Requirements & Specification Requirements Validation.
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
ECE122 L17: Method Development and Testing April 5, 2007 ECE 122 Engineering Problem Solving with Java Lecture 17 Method Development and Testing.
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
 QUALITY ASSURANCE:  QA is defined as a procedure or set of procedures intended to ensure that a product or service under development (before work is.
Verification and Validation
CS1101: Programming Methodology Aaron Tan.
1CMSC 345, Version 4/04 Verification and Validation Reference: Software Engineering, Ian Sommerville, 6th edition, Chapter 19.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
System/Software Testing
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
TESTING.
Objectives Understand the basic concepts and definitions relating to testing, like error, fault, failure, test case, test suite, test harness. Explore.
© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang Unit Testing.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Software Inspection A basic tool for defect removal A basic tool for defect removal Urgent need for QA and removal can be supported by inspection Urgent.
1 Testing Course notes for CEN Outline  Introduction:  terminology and philosophy  Factors that influence testing  Testing techniques.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
Chapter SIX Implementation, Testing and Pragmatics Making it a reality.
Neil Ghani Software testing. 2 Introduction In a perfect world all programs fully verified testing thus redundant Back in the real.
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
Software Testing and Maintenance 1 Code Review  Introduction  How to Conduct Code Review  Practical Tips  Tool Support  Summary.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Chapter 19 Verification and Validation.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
Chapter 12: Software Inspection Omar Meqdadi SE 3860 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Software Engineering 2004 Jyrki Nummenmaa 1 BACKGROUND There is no way to generally test programs exhaustively (that is, going through all execution.
Scientific Debugging. Errors in Software Errors are unexpected behaviors or outputs in programs As long as software is developed by humans, it will contain.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
CPSC 871 John D. McGregor Module 8 Session 1 Testing.
Software Quality Assurance and Testing Fazal Rehman Shamil.
 Software Testing Software Testing  Characteristics of Testable Software Characteristics of Testable Software  A Testing Life Cycle A Testing Life.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Well-behaved objects Main concepts to be covered Testing Debugging Test automation Writing for maintainability Objects First with Java - A Practical.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Defect testing Testing programs to establish the presence of system defects.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
CX Introduction to Web Programming Testing.
CSC 480 Software Engineering
Verification and Validation
CS1101X Programming Methodology
Some Simple Definitions for Testing
Verification and Validation
Types of Testing Visit to more Learning Resources.
Verification and Validation
Software testing strategies 2
Lecture 09:Software Testing
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Code Reviews Assignment Each team should perform a code review
Testing, Inspection, Walkthrough
Presentation transcript:

Testing and Debugging

Testing Fundamentals  Test as you develop Easier to find bugs early rather than later Prototyping helps identify problems early  Categories of bugs software crashes or data corruption failure to meet or satisfy the specification poor or unacceptable performance hard or difficult to use

Testing fundamentals  Impossible to test a program completely  Three distinct paths through the program  If the loop executes 20 times, there are 3 20 different sequences of executions

Reviews and inspections  Inspections Formal process of reviewing code First employed by IBM in 1976 Early work showed that design and review inspections remove 60 percent of the bugs in a product

Reviews and inspections  Roles of participants Moderator  Runs the inspection  Ensure that the process moves along  Referees the discussion  Ensures action items done Inspector  Someone other than author  Some interest in the code  Carefully review code before inspection meeting Author  Minor role  May answer questions about code

Reviews and inspections  Roles of participants Scribe  Record all errors detected  Keep list of action items

Reviews and inspections  Inspection process Planning  Code to review chosen  Moderator assigns task  Checklists created  Moderator assigns a presenter (usually one of the inspectors) Overview  Author describes high-level aspects of project that affected the design or code  Sometimes skipped (if all participants are knowledgeable)

Reviews and inspections  Inspection process Preparation  Working alone, each inspector reviews code noting problems or questions  Shouldn’t take more than a couple of hours Inspection meeting  Presenter walks through the code  Problems are discussed  Scribe records all errors and action items  Errors are not fixed at this time Inspection report  Moderator prepares a written report

Black-box and white-box testing  White-box testing indicates that we can “see” or examine the code as we develop test cases  Block-box testing indicates that we cannot examine the code as we devise test cases Seeing the code can bias the test cases we create Forces testers to use specification rather than the code  Complementary techniques

Black-box and white-box testing Test boundary conditions public static int binarySearch(char[] data, char key) { int left = 0; int right = data.length - 1; while (left <= right) { int mid = (left + right)/2; if (data[mid] == key) { return mid; } else if (data[mid] < key) { left = mid + 1; } else { right = mid - 1; } return data.length; }

Black-box and white-box testing Boundary conditions // validate input if ((year 12)) { System.output.println("Bad request: " + year + " " + month); return; }

Black-box and white-box testing  Suggests the following boundary tests Input YearInput Month

Black-box and white-box testing  Path coverage or path testing—create test cases that causes each edge of the program’s controlflow graph to be executed Example if (x != y) { y = 5; } else { z = z - z; } if (x > 1) { z = z / x; } else { z = 0; } if (x != 3) y = 5z = z - x if (x != 3) y = 5

Black-box and white-box testing  Testing tips Test early Use inspections Test boundaries Test exceptional conditions Make testing easily repeatable

Integration and system testing  Integration testing is done as modules or components are assembled. Attempts to ensure that pieces work together correctly Test interfaces between modules  System testing occurs when the whole system is put together

Debugging  Use the scientific method Gather data Develop a hypothesis Perform experiments Predict new facts Perform experiments Prove or disprove hypothesis

Debugging  Tips and techniques Simplify the problem Stabilize the error Locate the error Explain the bug to someone else Recognize common bugs  Oversubscripting  Dereferencing null Recompile everything Gather more information Pay attention to compiler warnings Fix bugs as you find them Take a break