Software Testing.

Slides:



Advertisements
Similar presentations
Object Oriented Analysis And Design-IT0207 iiI Semester
Advertisements

Defect testing Objectives
DETAILED DESIGN, IMPLEMENTATIONA AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
1 Integration Testing CS 4311 I. Burnstein. Practical Software Testing, Springer-Verlag, 2003.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Software Engineering-II Sir zubair sajid. What’s the difference? Verification – Are you building the product right? – Software must conform to its specification.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Integration testing Satish Mishra
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Illinois Institute of Technology
CS 425/625 Software Engineering Software Testing
1 Software Testing and Quality Assurance Lecture 1 Software Verification & Validation.
Outline Types of errors Component Testing Testing Strategy
Software Testing Name: Madam Currie Course: Swen5431 Semester: Summer 2K.
Software Testing Prasad G.
Software Testing & Strategies
Software System Integration
BY RAJESWARI S SOFTWARE TESTING. INTRODUCTION Software testing is the process of testing the software product. Effective software testing will contribute.
Introduction to Computer Technology
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 22Slide 1 Verification and Validation u Assuring that a software system meets a user's.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Extreme Programming Software Development Written by Sanjay Kumar.
Test plans CSCI102 - Systems ITCS905 - Systems MCS Systems.
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.
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.
INT-Evry (Masters IT– Soft Eng)IntegrationTesting.1 (OO) Integration Testing What: Integration testing is a phase of software testing in which.
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.
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
Ch6: Software Verification. 1 Decision table based testing  Applicability:  Spec. is described by a decision table.  Tables describe:  How combinations.
Software Testing Testing types Testing strategy Testing principles.
Testing Workflow In the Unified Process and Agile/Scrum processes.
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
1 C++ Plus Data Structures Nell Dale Chapter 1 Software Engineering Principles Modified from the Slides made by Sylvia Sorkin, Community College of Baltimore.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
TESTING LEVELS Unit Testing Integration Testing System Testing Acceptance Testing.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Integration testing Integrate two or more module.i.e. communicate between the modules. Follow a white box testing (Testing the code)
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
1 Software Testing Strategies: Approaches, Issues, Testing Tools.
Chapter 1 Software Engineering Principles. Problem analysis Requirements elicitation Software specification High- and low-level design Implementation.
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.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Defect testing Testing programs to establish the presence of system defects.
Testing Integral part of the software development process.
Software Testing. Software Quality Assurance Overarching term Time consuming (40% to 90% of dev effort) Includes –Verification: Building the product right,
Software Testing Strategies for building test group
Software Testing.
Rekayasa Perangkat Lunak Part-13
SUCHITA M.DAKI TYIT(sem v)
Software Engineering (CSI 321)
Chapter 13 & 14 Software Testing Strategies and Techniques
Lecture 09:Software Testing
Static Testing Static testing refers to testing that takes place without Execution - examining and reviewing it. Dynamic Testing Dynamic testing is what.
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Unit IV – Chapter 2 V-Test Model.
Presentation transcript:

Software Testing

Software Testing ‘The process of executing a program... with the intention of finding errors’ (Myers, 1976) Example: Test a module that inputs three integers (i1, i2, and i3) and outputs that they make an equilateral triangle make an isosceles triangle make a scalene triangle do not make a triangle (an error) Adapted from Binder (1999), originally proposed by Myers (1979).

Testing example Take the time now to work out what tests need to be done, for example: i1 not > 0 i1 + i2 <= i3 i1, i2, i3 all > 0 and all = etc

Use this space to write some test cases Testing example (2) Use this space to write some test cases

How many cases did you identify? Testing example (3) How many cases did you identify? If you thought that 10 or fewer tests were enough, you were missing essential cases If you thought that 20 or fewer tests were enough, you were making assumptions about the implementation

Testing example (4) To test the module thoroughly (exhaustively), we need to test every possible input For 32 bit integers, we have 4x10^9 possible values 3 integers have 6.4 x 10^28 values If we test 1000 cases per second, testing this module exhaustively would take more than a billion times the age of the universe! Clearly, we will need to be more selective in the way we test!

Finding Errors ‘The process of executing a program... with the intention of finding errors’ (Myers, 1976) There are two kinds of errors Errors of omission we have left something out that we should put in test that all the requirements and specifications are satisfied Errors of commission we have put something in that we should leave out impractical to test that only the requirements and specifications are satisfied, ie the product does nothing else

Context of testing Since we cannot test exhaustively, we compliment our testing with Quality Assurance techniques such as code walkthroughs inspections reviews

Equivalence Classes Many exhaustive tests would be testing the same logical path, so we assume these can be combined Such a set of cases is called an equivalence class These equivalence classes can be derived from the requirements or the specification

Hazards We test for known or likely causes of error Test every line of code Test every path in a module Test equivalence class boundary conditions Test complex logic Test interfaces Re-test super-class in sub-class Test object life cycles Test using “real” data volumes etc

Selecting tests Testing for known hazards From experience we have learned that we can get good results by Testing for known hazards Testing every known “business scenario” and “use case” Major Decisions: WHO WHAT HOW

Who does the Testing? The programmer ? An independent team ? The users ? Everyone!

What to Test Unit testing procedural function, OO method Module testing procedural program, OO class Subsystem testing Integration testing Acceptance testing

What to Test ... Unit Testing Testing is not debugging If our software fails a test, we do debugging to find the cause Test The lowest level functions and procedures in isolation Each logic path in the component specifications Every line of code (white box) What features of the Eiffel language assist with testing? What do preconditions do? What do postconditions do?

What to Test ... Module Testing The interaction of all the related components of a module / class Tests the module as a stand-alone entity What do Eiffel invariants do? In an OO system how would you create a ‘test harness’ or ‘test driver’ for a module?

What to Test ... Subsystem Testing Tests the interfaces between the modules Scenarios or Use Cases are employed to test module interaction

What to Test ... Integration (System) Testing Tests interactions between sub-systems and components System performance Stress testing Volume testing Scenarios or Use Cases specified in the requirements

What to Test ... Acceptance Testing Tests the whole system with Scenarios or Use Cases specified in the requirements Tests the whole system with live data Establishes the ‘validity’ of the system

How to Test Software 2. Establish a test strategy 1. Use a Test Plan Top/Down Bottom/Up Techniques White Box Black Box 3. Use appropriate tools Automate as much testing as possible

How to Test Software... 1. Use a Test Plan The Test Plan establishes: Standards, deliverables Major testing phases Traceability of testing to requirements Test schedule and resource allocation Test record documentation Testing strategies Examples of Test Plans are provided in the tutorial notes and the assignment

How to Test Software … Assignment Testing Documents - Test Plan 1. To be completed from the requirement specifications before any code is written, i.e., Expected Results - Test Plan - Test Summary 2. To be completed during testing, i.e., Expected + Actual Results - Test Report

How to Test Software … Assignment Testing Documents … - Test Plan - Describe how you are going to verify that your system modifications will work as specified - Only include tests for your modifications (+ any missing tests from Stage 0)) - Test Summary - show all the tests, including regression tests, i.e. show all Stage 1 tests as well as your own tests - use as a checklist of all tests

How to Test Software … Assignment Testing Documents … Test Report Includes black and white box testing: Test Plan showing actual results for your tests Test Summary of all tests with indication of all working tests (i.e. a checklist ‘tick’ for all working tests)

Top-Down and Bottom-Up Testing How to Test Software... 2. Establish a Test Strategy Top-Down and Bottom-Up Testing Top-Down Testing Major Features: . Control program is tested first . Modules are integrated one at a time . Major emphasis is on interface testing . Starts at sub-system level with modules as ‘stubs’ . Then tests modules with functions as ‘stubs’ . Used in conjunction with top-down program development

How to Test Software... 2. Establish a Test Strategy Top-Down and Bottom-Up Testing Bottom-Up Testing Major Features: Allows early testing aimed at proving feasibility of particular modules Modules can be integrated in various clusters as desired Major emphasis is on module functionality and performance

How to Test Software... Testing Strategies Top-Down Testing Advantages Design errors are trapped earlier A working (prototype) system Enables early validation of design Disadvantages Difficult to produce a stub for a complex component Difficult to observe test output from top-level modules

How to Test Software... Testing Strategies ... Bottom-Up Testing Advantages Easier to create test cases and observe output Uses simple drivers for low-level modules to provide data and the interface Natural fit with OO development techniques Disadvantages No ‘program’ until all modules tested High-level errors may cause changes in lower modules

How to Test Software... Testing Strategies … Advantages (again) Top-Down No test drivers are needed The control program plus a few modules forms a basic early prototype Interface errors discovered early Modular features aid debugging Bottom-Up No test stubs are needed Easier to adjust manpower needs Errors in critical modules are found early Natural fit with OO development techniques

How to Test Software... Testing Strategies … Disadvantages (again) Top-Down . Test stubs are needed . Extended early phases dictate a slow manpower buildup . Errors in critical modules at low levels are found late Bottom-Up . Test drivers are needed . Many modules must be integrated before a working program is available . Interface errors are discovered late

How to Test Software... 2. Establish a Test Strategy ... Testing Techniques Structural (White Box) Testing Functional (Black Box) Testing Equivalence Partitioning Mathematical / Formal Verification Paradigm / Language hazards

How to Test Software... Testing Techniques Structural (White Box) Testing Use code to derive a program flow-graph which shows all logic paths Maximum test paths = program’s ‘Cyclomatic Complexity’ (McCabe) Use a dynamic program analyser to identify code not executed White Box Testing attempts to test every line of code

How to Test Software... Testing Techniques ... Functional (Black Box) Testing Test cases are based on functions as outlined in specification Can be developed when program specifications are complete ie before code is started The Test Plan with the test cases can be developed from the functional requirements Black Box testing only checks the outputs for accuracy – not every line of code is tested.

How to Test Software... Testing Techniques ... White Box testing should only be used for Unit testing White Box and Black Box testing can be used for Module testing Only use Black Box testing for Subsystem testing Integration testing Acceptance testing

How to Test Software... 3. Use Appropriate Testing Tools Test data generators Test control / evaluation environments Program analysers Static Dynamic File comparators Simulators Symbolic program dumps Trace packages Interactive debugging environments

Regression Testing Maintenance/Development Testing Differences Only changes need to be reviewed Only new test cases that exercise the change need to be developed Test results compared against previous test results (Regression Testing) Data collected during impact analysis identifies testing at each level

When to Stop Testing ... When do you stop testing? NOT - When delivery date arrives!! - usually what happens!! It should be: When test goals have been reached code coverage case coverage risk coverage defect density (defects / LOC) defect arrival rate

Testing Summary When testing always: Use a Test Plan Use testing strategies and techniques Top/Down - Bottom/Up White Box - Black Box Use appropriate tools : automate tests For maintenance – Regression Test