Testing Chapter 23 IB103 Week 12 (part 3). Verify that a complex (any) program works correctly, that the program meets specifications The chapter reviews.

Slides:



Advertisements
Similar presentations
C++ Introduction.
Advertisements

Computer Science 101 While Statement. Iteration: The While-Statement The syntax for the While- Statement is while : The syntax for the While- Statement.
PZ03D Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03D - Program verification Programming Language Design.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Software Failure: Reasons Incorrect, missing, impossible requirements * Requirement validation. Incorrect specification * Specification verification. Faulty.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Debugging Techniques1. 2 Introduction Bugs How to debug Using of debugger provided by the IDE Exception Handling Techniques.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Chapter 2- Visual Basic Schneider
White Box Testing and Symbolic Execution Written by Michael Beder.
© The McGraw-Hill Companies, 2006 Chapter 9 Software quality.
White Box Testing and Symbolic Execution Written by Michael Beder.
Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
COMP2001 Testing. Aims of Testing To achieve a correct system producing correct results with a variety of input data.
Program Design and Development
White Box Testing and Symbolic Execution Written by Michael Beder.
16/27/2015 3:38 AM6/27/2015 3:38 AM6/27/2015 3:38 AMTesting and Debugging Testing The process of verifying the software performs to the specifications.
1 CSE1301 Computer Programming: Lecture 15 Flowcharts, Testing and Debugging.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Testing Dr. Andrew Wallace PhD BEng(hons) EurIng
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Software.
JS Arrays, Functions, Events Week 5 INFM 603. Agenda Arrays Functions Event-Driven Programming.
Using a Debugger. SWC What is ”debugging”? An error in a computer program is often called a ”bug”… …so, to ”debug” is to find and get rid of errors in.
CMSC 345 Fall 2000 Unit Testing. The testing process.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
Functions Copyright © J. Mercer, A function is a number-machine that transforms numbers from one set called the domain into a set of new numbers.
CS1: chr, jeh, & Testing vs. Debugging Testing finds problems –Unit test –Integration test –System test Debugging finds and fixes causes.
Designing and Debugging Batch and Interactive COBOL Programs Chapter 5.
Chapter 3 Developing an algorithm. Objectives To introduce methods of analysing a problem and developing a solution To develop simple algorithms using.
For Loops (ProjFor1, ProjFor2, ProjFor3, ProjFor4, textbox, textbox1) Please use speaker notes for additional information!
School of Computer Science & Information Technology G6DICP - Lecture 9 Software Development Techniques.
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.
Testing Methods Carl Smith National Certificate Year 2 – Unit 4.
Developing an Algorithm
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
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.
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
The Software Development Process
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
The Anatomy of a Computer Program Unit 3. Programs are Directions  A computer carries out the instructions in a program, line by line, exactly as they.
Theory and Practice of Software Testing
Software Quality Assurance and Testing Fazal Rehman Shamil.
EGR 115 Introduction to Computing for Engineers Branching & Program Design – Part 3 Friday 03 Oct 2014 EGR 115 Introduction to Computing for Engineers.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Boundary Value Testing 1.A type of “Black box” functional testing –The program is viewed as a mathematical “function” –The program takes inputs and maps.
Copyright © 2014 Curt Hill Algorithms From the Mathematical Perspective.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Testing.
Rekayasa Perangkat Lunak Part-13
Introduction to Programming and Visual Basic
CS1101X Programming Methodology
Chapter 2- Visual Basic Schneider
Chapter 2 Assignment and Interactive Input
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Designing and Debugging Batch and Interactive COBOL Programs
Lecture 09:Software Testing
Chapter 2- Visual Basic Schneider
Chapter 2- Visual Basic Schneider
CSE 1020:Software Development
Software Development Chapter 1.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Testing Chapter 23 IB103 Week 12 (part 3)

Verify that a complex (any) program works correctly, that the program meets specifications The chapter reviews different approaches – to check (verification) and notes deficiencies

Approaches to verification Black box (functional) White box (structural) Reviews (walkthroughs) Stepping through code with debugger Formal methods

In Java the classes are a natural size piece to work with A class at a time (to check/debug) After every class has been tested (unit testing) the complete system is tested (integration or system testing) Example specifications “ input to the program is a series of numbers via a text field, terminated by a negative number. Display the sum.”

After review: Are the numbers integer or floating point? What is the range and precision? Is the terminating negative number to be included in the sum?

Clarification to the specifications: Integer numbers to be used Range from 0 to Button “End of Data” now terminates (so no need to worry about a terminating negative number)

Tests: Black box – we assume no knowledge of the programs inner workings – we only consider in/output (functional) Select representative data Key in 8 12 [End of Data] button Key in just [End of Data] button Key in [End of Data] button what was expected in each trial? Note discrepancies Use equivalence partitions, identify common features

White box: Make use of knowledge of how program works, it’s structure Test all possible paths (with simple data)

Inspections and walkthroughs Study source code listings Try to detect bugs (before the compiler does) Have another person (pair of eyes) check your program – sometimes we cannot see forest for the trees. Others can see our errors and we can bring a fresh viewpoint looking at their program

To inspect: Need specifications Text of source code Some checks to be made Variables initialized? Loops initialized and terminated? Methods invoked and are passed correct parameters? Desk check (play computer) line by line Does the method achieve its desired purpose?

Other considerations Are variable names meaningful? Indentation consistent? Logic clear and correct? Step through the code a line at a time check the value held by variables (use debugger if possible) Formal verification – using mathematics Does program meet the specifications

Z and VDM languages that check specifications (not commonly used) 1. Write program and verify it meets specifications 2. Derive program from specifications be means of transformations (favored more common approach)

Unit testing and integration (system) testing May use all approaches or combination (black, white – boxes, inspection and debugger, step through) Create a test bed (check each method, display output independent of program) Then if method runs put it into the system Incremental development Write small piece of code: key it in, compile,run debug add to program the tested piece, Repeat until program is complete