Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 10: Testing and Inspecting to Ensure High Quality Part 1:

Slides:



Advertisements
Similar presentations
Testing and Inspecting to Ensure High Quality
Advertisements

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.
Testing and Quality Assurance
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
10 Software Engineering Foundations of Computer Science ã Cengage Learning.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
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.
Unit Testing CS 414 – Software Engineering I Don Bagert Rose-Hulman Institute of Technology January 16, 2003.
OHT 9.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Chapter 9.3 Software Testing Strategies.
Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.
BY RAJESWARI S SOFTWARE TESTING. INTRODUCTION Software testing is the process of testing the software product. Effective software testing will contribute.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Testing and Inspecting to Ensure High Quality Part 1: Basic Definitions Effective and Efficient Testing Lots of Personal Notes.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
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.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 10: Testing and Inspecting to Ensure High Quality Part 1:
CMSC 345 Fall 2000 Unit Testing. The testing process.
Prof. Mohamed Batouche Software Testing.
Software Engineering DKT 311 Lecture 11 Verification and critical system validation.
Software Engineering Chapter 23 Software Testing Ku-Yaw Chang Assistant Professor Department of Computer Science and Information.
Coverage – “Systematic” Testing Chapter 20. Dividing the input space for failure search Testing requires selecting inputs to try on the program, but how.
Lecture 11 Testing and Debugging SFDV Principles of Information Systems.
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 Testing. What is Software Testing? Definition: 1.is an investigation conducted to provide stakeholders with information about the quality of.
Software Testing Testing types Testing strategy Testing principles.
Testing -- Part II. Testing The role of testing is to: w Locate errors that can then be fixed to produce a more reliable product w Design tests that systematically.
Chapter SIX Implementation, Testing and Pragmatics Making it a reality.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
Black-box Testing.
©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.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
Software Engineering 2004 Jyrki Nummenmaa 1 BACKGROUND There is no way to generally test programs exhaustively (that is, going through all execution.
CPSC 873 John D. McGregor Session 9 Testing Vocabulary.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Testing and inspecting to ensure high quality An extreme and easily understood kind of failure is an outright crash. However, any violation of requirements.
Software Quality Assurance and Testing Fazal Rehman Shamil.
1. Black Box Testing  Black box testing is also called functional testing  Black box testing ignores the internal mechanism of a system or component.
Dynamic Testing.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
Software Engineering Testing. These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright.
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.
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.
Software Testing.
Software Testing.
Rekayasa Perangkat Lunak Part-13
Software Testing.
SOFTWARE TESTING OVERVIEW
Software Engineering (CSI 321)
UNIT-IV ECS-602 Software engineering PART-I
Software testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
Lecture 09:Software Testing
CS240: Advanced Programming Concepts
Chapter 10 – 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.
Software Testing “If you can’t test it, you can’t design it”
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 10: Testing and Inspecting to Ensure High Quality Part 1: Basic Definitions Effective and Efficient Testing Lots of Personal Notes

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality2 Testing and Inspections – two very important concepts / activities in software development. We often have roles of testers; individual developers; members of development teams; independent test groups; quality assurance groups, etc. Quality Control; Editors; … We have many different kinds / types of tests too. Exist at many different levels for many different stakeholders. Some are automated; many are hands-on… Some test parts of system; others whole; Some at different stages of development; …. Many Many names!!!! Note: a successful test is one that identifies a flaw. We will present a lot of very important material in these last lectures.

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality3 Tests White box testing; black box testing Verification and validation (V&V) Branch testing, path testing, statement testing Alpha testing, beta testing Acceptance testing Unit test, subsystem test, system test, integrated system test, … Independent test groups Environmental system testing Operational Field Testing Running in parallel; running live;

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality4 Organizational Considerations DIREP Deficiency Report Tracked, prioritized, resources allocated... Incident Report Problem Ticket – Fix Ticket Office of Primary Responsibility (OPR); Office of Collateral Responsibility… (OCR) Product Manager…..

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality Basic definitions A failure is an unacceptable behaviour exhibited by a system —The frequency of failures measures the reliability —An important design objective is to achieve a very low failure rate and hence high reliability. —A failure can result from a violation of an explicit or implicit requirement —An extreme and easily understood kind of failure is an outright crash!! We clearly want to reduce the frequency of failures (MTBF) and damage caused by failures. (Mean Time Between Failures) We measure failures and time to repair (MTTR) as measures of reliability. (Mean Time to Repair)

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality6 A defect is a flaw in any aspect of the system that contributes, or may potentially contribute, to the occurrence of one or more failures —It might take several defects to cause a particular failure —Note also that a defect can occur anywhere – requirements, design, implementation, testing, etc. True Story: “Mr. Smith said this couldn’t happen!” An error is a slip-up or inappropriate decision by a software developer that leads to the introduction of a defect

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality Effective and Efficient Testing To test effectively, you must use a strategy that uncovers as many defects as possible. Testing really attempts to find defects! Pure and simple! To test efficiently, you must find the largest possible number of defects using the fewest possible tests. This is where the problems come in. There are many kinds of tests designed to uncover different kinds of defects. Testing must be efficient. We cannot test everything. Rather, we design different kinds of tests for sufficient ‘coverage.’ All kinds of tests: Some are lumped into categories called Coverage Tests. statement coverage branch coverage path coverage….. We will discuss ahead.

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality8 Black-box testing Testers provide the system with inputs and observe the outputs They can see none of: —The source code —The internal data —Any of the design documentation describing the system’s internals Simply putting in inputs and observing outputs. Bouncing these against the requirements. This is the kind of testing that end-users most frequently undertake – for obvious reasons. Called validation testing / acceptance testing - IF done when system is declared ‘finished.’ —May be called other things (alpha testing; beta testing…) Black box testing is designed to show functionality and (often to a lesser degree at this time – but not always…) satisfaction of non- functional requirements. (performance, load…) Generally, black box testing is designed to verify functionality!!

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality9 Who does this? Clearly, end users. BUT: developers must do their own ‘verification’ of functionality before turning this loose! Developers: ‘verification’ Customers: ‘validation’ Hence V&V.

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality10 Glass-box testing – White-box testing Also called ‘white-box’ or ‘structural’ testing Developers and Testers have access to the system design They can —Examine the design documents —View the code —Observe at run time the steps taken by algorithms and their internal data Individual programmers often informally employ glass- box testing to verify their own code.

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality11 More – White Box testing  Unit Testing Developers are always responsible for their own modules. Developers ‘verify’ their products. Usually called ‘unit test’ But there are many kinds of unit testing…

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality12 Glass-Box (White Box) Testing - More Path Testing – exhaustive; impossible; there is an infinite number of paths in a non-trivial program. Branch testing – Edge testing – the most feasible Design a test so that all of the edges of a node are executed. What do we mean by ‘edge?’ Consider a flowgraph of an algorithm…. (Think of a program flowchart)

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality13 White box: Flow Graphs Want a minimum number of tests that assures a high degree of reliability. Know we cannot test all paths in a non-trivial program. Want a ‘representative set.’ Given a flow graph, there are a couple of formulas that will provide the minimum number of tests (like number of nodes – number of edges + 1) (?) and others. One famous way is the Cyclomatic Complexity of a Flowgraph. Defined to be: number of regions of the graph + 1 The ‘number’ of regions is called the cyclomatic complexity of the routine.

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality14 Equivalence Class Testing This is a Bigee! It is inappropriate to test by brute force, using every possible input value —Discussed; Takes a huge amount of time —Is impractical and is pointless! Far better: divide the possible inputs into groups which you believe will be treated similarly by all algorithms. —Such groups are called equivalence classes. Recall ramdomizing in File Structures (hashing…). If we used an Equivalence mod 4, we essentially divided all ‘remainders’ into one of five sets; those with remainders 0, 1, 2, 3, and 4. ALL divisions resulted in one of these remainders. We applied this equivalence relation to the set of integers and obtained a set of equivalence classes the Union of which constitutes the original set of Integers. —EC1 U EC2 U … ECn = set of I+

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality15 Examples of equivalence classes —A tester needs only to run one test per equivalence class —The tester has to -understand the required input, -appreciate how the software may have been designed Example: —Valid input is a month number (1-12) —Equivalence classes are: [-∞..0], [1..12], [13.. ∞] These are the three equivalence classes. In Equivalence Class Testing, we select inputs from each of the equivalence classes and include a representative value from EACH equivalence class.

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality16 More on Equivalence Class Testing So, for valid integers ranging from 1 through 12, equivalence classes are as indicated (above). Integers less than 1; Integers between 1 and 12 inclusive Integers greater than 12. (Is this enough?) What if there is more than a single value we are testing?

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality17 Combinations of equivalence classes Combinatorial explosion means that you cannot realistically test every possible system-wide equivalence class. —If there are 4 inputs with 5 possible values there are 5 4 (i.e.625) possible system-wide equivalence classes. While you should first make sure that at least one test is run with every equivalence class of every individual input, you should also test all combinations where an input is likely to affect the interpretation of another. Compatibility tests; Associativity tests. —Examples: field: non-zero rpi,  rank had to be officer (grade O1 through O10) —Range tests: If grade = O4, salary must fall between $nnnn and $nnnnnn. —Testing multiple fields – all white box!!!

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality18 Testing at boundaries of equivalence classes – Boundary Value Testing More errors in software occur at the boundaries of equivalence classes than at any other place!! AMEN!!! The idea of equivalence class testing should be expanded to specifically test values at the extremes of each equivalence class —E.g. The number 0 often causes problems  E.g.: If the valid input is a month number (1-12) —Test equivalence classes as before -Test -24; +24, and a 6 (representative values) —Test boundaries: 0, 1, 12 and 13 as well as very large positive and negative values

© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality19 Coming Defects in ordinary algorithms…. There are many of these. Read carefully.