08120: Programming 2: SoftwareTesting and Debugging

Slides:



Advertisements
Similar presentations
Software Testing Techniques
Advertisements

Software Testing Technique. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves.
Software Testing. Quality is Hard to Pin Down Concise, clear definition is elusive Not easily quantifiable Many things to many people You'll know it when.
Chapter 14 Testing Tactics
Verification and Validation
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
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 Engineering-II Sir zubair sajid. What’s the difference? Verification – Are you building the product right? – Software must conform to its specification.
Informatics 43 – April 30, What is a test case? An input to a system, and the correct output. An “input” may be complex. Example: – What is an input.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
OHT 9.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Chapter 9.3 Software Testing Strategies.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Chapter 13 & 14 Software Testing Strategies and Techniques
Testing Dr. Andrew Wallace PhD BEng(hons) EurIng
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.
1 Testing Course notes for CEN Outline  Introduction:  terminology and philosophy  Factors that influence testing  Testing techniques.
1 Software testing. 2 Testing Objectives Testing is a process of executing a program with the intent of finding an error. A good test case is in that.
Software Reviews & testing Software Reviews & testing An Overview.
Software Testing Testing types Testing strategy Testing principles.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
Agenda Introduction Overview of White-box testing Basis path testing
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
The Software Development Process
Testing. Today’s Topics Why Testing? Basic Definitions Kinds of Testing Test-driven Development Code Reviews (not testing) 1.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Software Engineering Saeed Akhtar The University of Lahore.
08120: Programming 2: SoftwareTesting and Debugging Dr Mike Brayshaw.
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Dynamic Testing.
White Box Testing by : Andika Bayu H.
CS223: Software Engineering Lecture 21: Unit Testing Metric.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Testing Integral part of the software development process.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 22 Slide 1 Verification and Validation.
Software Test Metrics When you can measure what you are speaking about and express it in numbers, you know something about it; but when you cannot measure,
CX Introduction to Web Programming Testing.
Testing and Debugging UCT Department of Computer Science Computer Science 1015F Hussein Suleman March 2009.
Software Testing Kobla Setriakor Nyomi Faculty Intern (Programming II)
Verification and Validation
Software TestIng White box testing.
Testing Tutorial 7.
Software Metrics 1.
Software Testing.
Software Testing.
Software Testing Techniques
Software Engineering (CSI 321)
Software Testing An Introduction.
CS5123 Software Validation and Quality Assurance
Software engineering – 1
Some Simple Definitions for Testing
Chapter 13 & 14 Software Testing Strategies and Techniques
Structural testing, Path Testing
White-Box Testing Techniques
Types of Testing Visit to more Learning Resources.
UNIT-IV ECS-602 Software engineering PART-I
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Introduction to Software Testing
Software Testing (Lecture 11-a)
CS240: Advanced Programming Concepts
Informatics 43 – April 28, 2016.
Chapter 10 – Software Testing
Software Testing.
Chapter 10: Testing and Quality Assurance
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

08120: Programming 2: SoftwareTesting and Debugging Dr Mike Brayshaw

Software Testing We study it because we want to get better at it and write better programs Software Development Organisations can spend up to 40% of time testing In critical domains (e.g. flight control, nuclear reactor) costs can be 3 to 5 times costs of all other steps added together It is expensive We need to get it right

Do we always need to test? some people claim no use of formal methods use of rigorous engineering use of high level paradigm program == specification Yes we do - there may be unseen errors (e.g. in spec) - the software may evolve, the world may change, the software may change (new platform or compiler) to err is human, programmers make mistakes, even good ones!!!

Objectives of Testing Is it always a destructive process - are you just trying to break a system? What are trying to find problems and Errors To do so we need to think what are good test cases - a good test case is something that “has a high probability of finding a yet undiscovered error” (Somerville, pp. 610) A successful tests is one that uncovers a hitherto undetected error

What will it reveal? If successful errors! It allows us to test the software against its specification We can check its performance Indirectly it gives insight into the reliability and quality of the software

So how do you go about testing 1 First Approach Does it do the job? does it meet its functional requirements test each function that the software is designed to implement and see if its up for the job this is called black box testing

So how do you go about testing 2 Second Approach Does it work correctly internally? test how the innards work is it implemented as on the technical specification inspect the code itself this is known as white box testing

A systematic approach to testing using White Box and Black Box In Black Box testing we can take the functional requirements of the software and check these In White Box testing or if we know the internal workings of the program we can take a close look at its procedural detail to check its working methods are correct White box testing is very expensive and exhaustive testing is not possible for non-trivial problems Use a combination of white and black box testing

White Box Testing Check all independent paths thru the code Check both sides of logical decisions like Booleans Check all loop with normal values and at limits Check internal data structures

Why go to such lengths? Problems with workhorse code are likely to have been trapped and cured long ago, it’s the seldom used stuff that can still hide problems We may have the wrong intuition about the logical path the program is taking. Stuff that we never expected to be executed could be doing so on a regular basis. Hence the need for path testing. this may also reveal efficiency issues unreachable code

Path Testing 1 We can find the number of different flow of control paths through the program The upper bound - cyclomatic complexity metric - defines the number of independent paths thru a program this also gives an upper bound on the number of tests we need to perform to garentee coverage of all program statements

Path Testing 2 For a given program to test Work out the flow of control for the program Work out cyclomatic complexity Work out a set of linear independent paths Make test cases that will force the program to go down a particular route

Producing a Call Tree: Analysing your program structure Starting with the first procedure (often called main in some languages) draw the calling structure Will show structure of the program Easy to automate (Standard utility in many systems) Finds unused code In OOP can show hierarchy of objects show what inherits what from where allows development of browsers (e.g. BlueJ)

Condition and Loop Testing Can use our existing path detection algorithm to exhaustively white box test conditions For loops we can check for bounds, upper and lower limit. This can be thought of stress testing your loops Instrumenting Your Code

Black Box Testing Does the software meet is functional requirements? Check its input or output is correct Is the system sensitive to different types of data What rates and volumes can the system handle Does it handle boundaries ok? This can be done by software testers who just continually use and re-use the software to make sure it is correct

Development of a Test suit Test all the functional requirements of the software Pushes it through all the moves that you want the program to make Can make an output file that can be compared to previous run throughs so you know you code is correct

Comparison Testing When we need to be sure Two (or more) software teams Same requirements, write two independant programs and compare the behaviour of the two If the work in the same manner then this is a check the all is well In extreme make teams use different language, platforms, or to be really sure different paradigms (e.g. a logic language like Prolog)