Błaej Pietrzak

Size: px
Start display at page:

Download "Błaej Pietrzak"

Transcription

1 Błaej Pietrzak Fault model Result-oriented testing Test design approach Domain testing model Category-Partition test pattern Polymorphic message test pattern 1

2 Exhaustive testing is usually impossible (intractable)! for (int i = 0; i < n; i++) { if (a.get(i) == b.get(i)) x[i] = x[i] + 100; else x[i] = x[i] / 2; } n Path No Fault Sensitivity the ability to hide faults from test suite Coincidental Correctness the code produces correct results for some input data short scale(short j) { j = j - 1; //should be j = j + 1 j = j / 30000; return j; } Friedman M. A., Voas J.M.: Software Assessment: reliability, safety, testability. New York, John Wiley & Sons 1995 Only , , -1, 0, 29999, generate incorrect results. For 99,9908% of input values the code generates correct results. 2

3 Why are these properties tested with this technique Answer can be based on common sense, experience, assumption, analysis or experiment. Fault Model shows associations and components of the system being tested that have highest probability for faults to occur. Bug hazard is a circumstance that increase the chance of a bug. Conformance Directed Testing to prove conformance with requirements or specificati Tests are representative enough for essential features of the system being tested Every fault makes the system not conformant (Nonspecific fault model) Fault-Directed Testing To prove implementation faults It is based on observation that conformance can be proved for implementation containing bugs. Specific fault model 3

4 Black box testing White box/glass box/structural testing Result-oriented testing Also called behavioral testing, functional testing, data-driven or input/output-driven testing Unconcerned about the internal program structure Test planning- may start when the spec is circulated Acceptance/qualification testing check whether the program is stable enough to be tested Function test and system test check it against spec Beta testing get user feedback Release testing check all things that will go to the customer /manufacturer, e.g. test the ad copy and sales materials Final acceptance testing by the customer 4

5 Logic-driven: examine the internal program structure Part of coding stage Unit and low-level components are often tested by the structural strategies Scope-specific test design (unit, integration, system) and techniques (white/blackbox) are organized into a coherent whole. Design test cases using scope-appropriate responsibility (functionality) -based patterns. Develop efficient test suites that exercise many responsibilities and component interfaces with just a few test cases. If the components are not trusted, choose an integration cycle based on dependencies to control introduction of untrusted parts. Develop and execute the test suite according to this cycle. Determine responsibility coverage by analysis and implementation coverage by instrumentation. Stop testing when the modeled responsibilities and part interfaces have been covered. 5

6 How much code is exercised by tests Statement coverage Every statement is exercised Branch coverage Every branch has been taken in every possible direction (true and false) How can tests achieve full branch coverage void func(int count) { if ((count % 2) == 0) System.out.println("count is even."); for (; count < 5; count++) System.out.println("count " + count); } 6

7 The if statement would need count both even and odd for loop must evaluate at least once and false at least once Two tests: count =4, count=13 long multiply(int arg1, int arg2) { return arg1 + arg2; } arg1 = 0 and arg2 = 0 produce correct result, coverage 100%. Sometimes 100% coverage could not be achieved (i.e. dead code) 7

8 int claims;... if (claims == 0) {... } else if (claims == 1) {... } else if ((claims >= 2) && (claims <= 4)) {... } else if (claims >= 5) {... } Type- safe exclusion - conditions defined for nonbinary decision variable, which fulfills each one of them with only one value. Claims cannot be simultaneously 0 and 3. Some inputs are mutually exclusive Some inputs cannot be produced by the environment Implementation is structured so as to prevent evaluation Often cause of errors 8

9 Number of claims can be simultaneously 0, 1, 2, 3, 4, 5 or more if (iszeroclaims) {... } if (isoneclaim) {... } if (istwotofourclaims) {... } if (isfiveormoreclaims) {... } Reflects incomplete model Example: Algorithm does not define an action for Insured age = 300. It is unknown what will happen. 9

10 Many bugs only found at class scope Cannot fully exercise a class through its clients Fix bugs close to creation The longer you wait the more expensive it is Debugging during system test sucks Reduces schedule risk Improves productivity classes can be test in parallel Don t delegate testing to your clients To verify a class, do we need to test every object of this class Generally, any bug in a class will be present in all objects of that class. Object-specific bugs are possible if an object is clobbered by a runaway pointer or its class contains self-modifying code. These bugs can be revealed by cluster and subsystem scope testing. 10

11 1. Make a preliminary estimate of class under test Plan budget for testing 2. Design and code a test driver For non trivial classes begin with alpha-omega skeleton After the alpha-omega tests pass, add additional tests 3. Select a class scope test pattern 4. Select test design patterns for each method 5. Arrange method test cases According to sequence called for by the class scope pattern 6. Build the test package When all tests pass, evaluate coverage If coverage is insufficient, develop more tests Goal Demonstrate that class under test is ready to test Two approaches Small pop Alpha-Omega cycle 11

12 A Big Bang integration at class level Excersise all untrusted components simultaneously Effective when CUT is small and simple Servers of the class are stable Inherited features are stable Few intraclass dependencies exist Process Develop entire class Write a test driver using any appropriate test pattern Run the test suite Debug as needed 12

13 Alpha-Omega States: Alpha State: object before it is constructed Omega State: object after it has been deleted Alpha-Omega Cycle: Take an object from alpha to omega Send a message to every method at least once Shows that class is ready for more extensive testing No attempt is made to achieve any coverage Order of calling methods: Constructor method Accessor (get) method Boolean (predicate) method Modifier (set) method Iterator method Destructor method Order within steps: private, protected, public 13

14 Purpose: find test values Subset of all possible values Partition the input value set Find best test values Proposed Methods Equivalence Partitioning (classes of values causing same result) Boundary Value Analysis (special class domain boundary) Improved approach: domain testing model Based on fault model Select values based on value types and type domains Solution for complex types (objects) 14

15 15

16 On, In, Off and Out Points On point (pol. punkt brzegowy) lies on a boundary In point (pol. punkt wewntrzny) is within boundary and not on boundary Off point (pol. punkt pozabrzegowy) lies not on a boundary Out point is outside boundary Condition Off point rule On point Off point y >= 1.0 x <= 10 y <= 10.0 x > 0 Open, true y <= x!stack.isfull() Precision

17 Condition Off point rule On point Off point y >= x <= y <= x > 0 Open, true y <= x!stack.isfull() Precision Condition Off point rule On point Off point y >= x <= y <= x > 0 Open, true 0 1 y <= x!stack.isfull() Precision

18 Solve equation constraints must be fulfilled Check central points of independent variable first x > 0, x <= 10 y >= 1.0, y <= 10.0 y = x so x must be x >= 4 and x <= 10 central point is x = 7 on point is y = 7.0 for x = 7 off point is y = for x = 7 Condition Off point rule On point Off point y >= x <= y <= x > 0 Open, true 0 1 y <= x !Stack.isFull() Precision

19 What about complex types (classes) Some classes can be modeled the same as primitive types e.g. Money is a scalar type, its object has one abstract state (a valid amount) and many concrete primitive states (each amount within the legal range). Use state and abstract state invariant An abstract state invariant is a function that evaluates a state invariant expression and returns true or false e.g. isopen(), isclosed() Treat each state invariant as a domain boundary Abstract state on point Smallest possible change in any state variable change produces a state change Abstract state off point Valid state that is not boundary state and differs minimally Abstract state in point Any value combination that places an object of the class in a given abstract state, and is neither an on nor off point of that abstract state. 19

20 State Possible transitions In Point On Point Off Point Empty Loaded 0 () 0 1 Loaded Empty 1<x< Full 1<x< Full Loaded () MAXSTACK = Condition Off point rule On point Off point y >= x <= y <= x > 0 Open, true 0 1 y <= x !Stack.isFull() Precision

21 One on point and one off point for each domain boundary For each relational condition For each nonscalar type For each nonlinear boundaries Special case Equality condition One on point and two off points for each equality condition X == 10: on point is 10, off points are 9 and 11 State invariant One on point and at least one off point for each state invariant Condition for invariant is once true, once false Add expected results and in points for other values Each test case only has one off or on point Select in points for all other values in the test case Avoid to repeat in points (increase chance of finding bugs) Do not repeat identical tests for adjacent sub-domains Adjacent domains may share boundaries. Result Minimal test cases Input variables to excersise boundary conditions For any type of variable types Including abstract complex types (objects) 21

22 Intent Based on input/output analysis Context Appropriate for any method that implements one or more independent functions Constituent responsibilities should be identified and modeled as separate functions This approach is qualitative and may be worked by hand If the method selects one of many possible responses or has many constraints on parameter values, consider using Combinational Function Test patterns 22

23 Fault model Faults are related to value combinations of message parameters and instance variables These faults will result in missing or incorrect method output Strategy 1. Identify the testable functions of the MUT. 2. Identify all input and output parameters of each function. 3. Identify categories for each input parameter. 4. Partition each category into choices. 5. Identify constraints on choices. 6. Generate test cases by enumerating all choice combinations. 7. Develop expected results for each test case using an appropriate oracle 23

24 1. Identify the testable functions of the MUT Method may implement several functions Other functions may be side-effects of the primary function i.e. The current position of List object may be incremented as side-effect of returning the next element A function is considered independently testable if it meets three criteria: It can be invoked by setting message parameters to particular values and sending a message to the method its output can be observed by inspecting the values returned by the method, indirectly by using other class methods, or by using an invasive inspector its output can be differentiated from the output of another function or an incorrect function. 24

25 2. Identify all input and output parameters of each function At method scope, method interface arguments and abstract class state(s) determine the function s response. Class variables, globals, and system environmental variables should be modeled, if they can influence the output or maybe changed by the function call. 3. Identify categories for each input parameter Identify categories for each input parameter Categories do not overlap and must result in distinctly different output. Category is a subset of parameter values Determines a particular behavior or output Whose values are not included in any other category 25

26 4. Partition each category into choices A choice is a specific test value for a category Any reasonable criteria may be used to make choices. Choices for primitive types can be selected by suspicions, past bugs, or the Invariant Boundaries patterns. Should include both legal and illegal values 5. Identify constraints on choices Some choices may be mutually exclusive or inclusive. Practical reasons i.e too big complexity of generating a combination 26

27 6. Generate test cases by enumerating all choice combinations The test cases are identified by generating the cross-product of all the choices. Mutually inclusive or exclusive choices will result in some test cases being dropped from the cross-product set. Entry Criteria Small pop Exit Criteria Every combination is tested once Achieve branch coverage in the MUT The test suite should force each exception at least once 27

28 Consequences Identification of categories and choices is subjective - some bugs may not be revealed Many test cases for even moderately complex methods The size of a Category-Partition test suite is the product of the number of choices, minus the number of combinations excluded by constraints. The Invariant Boundaries pattern may be used to produced smaller test suite whose size is a sum of the number of choices plus one, rather than the product. A superclass Category-partition method test suite may be reused to test an overriding subclass method. Object getnextelement() throws NoPosition, EmptyList; Functions 28

29 Object getnextelement() throws NoPosition, EmptyList; Functions Return next element Object getnextelement() throws NoPosition, EmptyList; Functions Return next element Keep track of last position and wrap from last to first 29

30 Object getnextelement() throws NoPosition, EmptyList; Functions Return next element Keep track of last position and wrap from last to first Throw NoPosition and EmptyList exceptions if appropriate Inputs Outputs 30

31 Inputs Position of the last referenced element List state Outputs Element returned Incremented position pointer Categories and Choices Parameter Position of the last referenced element State of the list Category nth Element Special cases m elements Special cases Choices n=2 n=some x > 2, x < max n = max Undefined First Last, n < max m=some x > 2, x < max Empty Singleton Full (m = max) 31

32 Intent Design a test suite for a client of a polymorphic server that exercise all client bindings to the server Context When a method under test sends messages to overridden methods of a polymorphic server, These messages may be bound to one of several subclasses in the server class hierarchy. High confidence is not warranted for a client of a polymorphic server unless all the message bindings generated by the client are exercised Fault model Client fails to meet all preconditions for all possible bindings Unanticipated binding occurs possibly because of an incorrect construction of a pointer (i.e. Incorrect indexing into an array) Superclass is changed subclasses are rendered inconsistent because of the change 32

33 Account listtransactions() : void debit(value : double) : void account.debit(2.0); SavingsAccount listtransactions() : void debit(value : double) : void Precondition: debit > 500 GICAccount listtransactions() : void debit(value : double) : void Customer.report() { Account[] list = new Account(MAX); int index = savingsindex(); list[index] = getsavingsaccount();... index = gicindex(); list[index] = getgicaccount();... System.out.println("Savings"); index = getgicaccount(); // wrong function! list[index].listtransactions(); } 33

34 Account listtransactions() : void debit(value : double) : void Modify debit so that it takes a negative number as parameter SavingsAccount listtransactions() : void debit(value : double) : void account.debit(-2.0); GICAccount listtransactions() : void debit(value : double) : void Strategy 1. Determine the number of bindings for each message sent to a polymorphic server object 2. Test for all possible bindings 3. Test for run-time binding error 34

35 Entry Criteria Small pop. Minimal feasibility is assured by branch coverage within method Server class should be stable Exit Criteria Each binding with polymorphic server should be tried at least once (achieve branch coverage of extended message flow graph) Consequences A test suites that covers the extended message flow graph will reveal many bugs in the client s usage of server. Does not focus on other kinds of bugs and should be used with an appropriate responsibility-based patterns. Requires analysis of the server class hierarchy to determine all possible bindings. If the server class source or documentation is not available, this task cannot be done. 35

36 Robert V. Binder: Testowanie systemów obiektowych. Modele wzorce i narzdzia. WNT 2003 Code coverage tools for Java: Clover (commercial) JCoverage (commercial, but also GPL license) GroboUtils (MIT license) Hansel (BSD license) Thank You for your attention What is your general impression (1-6) Was it too slow or too fast What important did you learn during the lecture What to improve and how 36

Class Modality. Modality Types. Modality Types. Class Scope Test Design Patterns

Class Modality. Modality Types. Modality Types. Class Scope Test Design Patterns Class Scope Test Design Patterns Testing methods in isolation is not enough Instance variables act like global variables within a class Need to test intraclass interactions Message sequences Class Modality

More information

Błaej Pietrzak Goal. Two approaches. Process. If we limit testing to method scope

Błaej Pietrzak Goal. Two approaches. Process. If we limit testing to method scope Błaej Pietrzak blazej.pietrzak@cs.put.poznan.pl Class scope integration Design by Contract Invariant Boundaries pattern Non-modal class pattern FREE state model Quasi-modal class pattern Modal class pattern

More information

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing.

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing. Overview CS 619 Introduction to OO Design and Development ing! Preliminaries! All sorts of test techniques! Comparison of test techniques! Software reliability Fall 2012! Main issues: There are a great

More information

Integration Testing Qualidade de Software 2

Integration Testing Qualidade de Software 2 Integration Testing Integration Testing Software systems are built with components that must interoperate Primary purpose: To reveal component interoperability faults so that testing at system scope may

More information

Software Testing 1. Introduction

Software Testing 1. Introduction Software Testing 1. Introduction Chapter 1 1. Introduction (Based on Part I: Preliminaries of Testing Object-Oriented Systems) Challenge Test Adequacy (vs. Test Inadequacy) The V model Terminology Limits

More information

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)?

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)? Testing CMSC 433 Programming Language Technologies and Paradigms Spring 2007 Testing Feb. 15, 2007 Some slides adapted from FSE 98 Tutorial by Michal Young and Mauro Pezze Execute program on sample input

More information

door Sasa Berberovic

door Sasa Berberovic door Sasa Berberovic Overview Reusable Components Subsystems Reusable Components Reuse Mechanisms The Role of Testing in Reuse Reusing Test Suites Test Design Patterns Abstract Class Test Generic Class

More information

State-Based Testing Part B Error Identification. Generating test cases for complex behaviour

State-Based Testing Part B Error Identification. Generating test cases for complex behaviour State-Based Testing Part B Error Identification Generating test cases for complex behaviour Reference: Robert V. Binder Testing Object-Oriented Systems: Models, Patterns, and Tools Addison-Wesley, 2000,

More information

Why testing and analysis. Software Testing. A framework for software testing. Outline. Software Qualities. Dependability Properties

Why testing and analysis. Software Testing. A framework for software testing. Outline. Software Qualities. Dependability Properties Why testing and analysis Software Testing Adapted from FSE 98 Tutorial by Michal Young and Mauro Pezze Software is never correct no matter what developing testing technique is used All software must be

More information

Motivation State Machines

Motivation State Machines Motivation State Machines Generating test cases for complex behaviour Textbook Reading: Chapter 7 We are interested in testing the behaviour of object-oriented software systems Behaviour: Interactions

More information

Black Box Testing. EEC 521: Software Engineering. Specification-Based Testing. No Source Code. Software Testing

Black Box Testing. EEC 521: Software Engineering. Specification-Based Testing. No Source Code. Software Testing Black Box Testing EEC 521: Software Engineering Software Testing Black-Box Testing Test-Driven Development Also known as specification-based testing Tester has access only to running code and the specification

More information

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process Verification and Validation Assuring that a software system meets a user s needs Ian Sommerville 1995/2000 (Modified by Spiros Mancoridis 1999) Software Engineering, 6th edition. Chapters 19,20 Slide 1

More information

Three General Principles of QA. COMP 4004 Fall Notes Adapted from Dr. A. Williams

Three General Principles of QA. COMP 4004 Fall Notes Adapted from Dr. A. Williams Three General Principles of QA COMP 4004 Fall 2008 Notes Adapted from Dr. A. Williams Software Quality Assurance Lec2 1 Three General Principles of QA Know what you are doing. Know what you should be doing.

More information

Program Correctness and Efficiency. Chapter 2

Program Correctness and Efficiency. Chapter 2 Program Correctness and Efficiency Chapter 2 Chapter Objectives To understand the differences between the three categories of program errors To understand the effect of an uncaught exception and why you

More information

No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages

No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages No Source Code : Software Testing Black-Box Testing Test-Driven Development No access to source code So test cases don t worry about structure Emphasis is only on ensuring that the contract is met Specification-Based

More information

Lecture 20: SW Testing Presented by: Mohammad El-Ramly, PhD

Lecture 20: SW Testing Presented by: Mohammad El-Ramly, PhD Cairo University Faculty of Computers and Information CS251 Software Engineering Lecture 20: SW Testing Presented by: Mohammad El-Ramly, PhD http://www.acadox.com/join/75udwt Outline Definition of Software

More information

Software Testing. Testing: Our Experiences

Software Testing. Testing: Our Experiences Software Testing Testing: Our Experiences Test Case Software to be tested Output 1 Test Case Generation When to Stop? Test Case Software to be tested Verification Output No Enough? Test Coverage Yes A

More information

Topics in Software Testing

Topics in Software Testing Dependable Software Systems Topics in Software Testing Material drawn from [Beizer, Sommerville] Software Testing Software testing is a critical element of software quality assurance and represents the

More information

Testing. Unit, integration, regression, validation, system. OO Testing techniques Application of traditional techniques to OO software

Testing. Unit, integration, regression, validation, system. OO Testing techniques Application of traditional techniques to OO software Testing Basic ideas and principles Traditional testing strategies Unit, integration, regression, validation, system OO Testing techniques Application of traditional techniques to OO software Testing-11,

More information

17. Assertions. Outline. Built-in tests. Built-in tests 3/29/11. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen

17. Assertions. Outline. Built-in tests. Built-in tests 3/29/11. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen 17. Assertions Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen Outline Introduction (BIT, assertion, executable assertion, why?) Implementation-based vs responsability-based assertions Implementation

More information

17. Assertions. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen

17. Assertions. Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen 17. Assertions Jelle Slowack, Bart Smets, Glenn Van Loon, Tom Verheyen Outline Introduction (BIT, assertion, executable assertion, why?) Implementation-based vs responsability-based assertions Implementation

More information

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107 A abbreviations 17 abstract class 105 abstract data types 105 abstract method 105 abstract types 105 abstraction 92, 105 access level 37 package 114 private 115 protected 115 public 115 accessors 24, 105

More information

Lecture 15 Software Testing

Lecture 15 Software Testing Lecture 15 Software Testing Includes slides from the companion website for Sommerville, Software Engineering, 10/e. Pearson Higher Education, 2016. All rights reserved. Used with permission. Topics covered

More information

Decision tables. Combinational Models. Necessary Characteristics of the Implementation. Decision tables. Deriving decision tables

Decision tables. Combinational Models. Necessary Characteristics of the Implementation. Decision tables. Deriving decision tables ombinational Models Generating test cases when the test model is a decision table Textbook Reading: hapter 6 ecision tables Ideal representation for a test model for the following reasons: Straightforward

More information

Part 5. Verification and Validation

Part 5. Verification and Validation Software Engineering Part 5. Verification and Validation - Verification and Validation - Software Testing Ver. 1.7 This lecture note is based on materials from Ian Sommerville 2006. Anyone can use this

More information

Chapter 9. Software Testing

Chapter 9. Software Testing Chapter 9. Software Testing Table of Contents Objectives... 1 Introduction to software testing... 1 The testers... 2 The developers... 2 An independent testing team... 2 The customer... 2 Principles of

More information

People tell me that testing is

People tell me that testing is Software Testing Mark Micallef mark.micallef@um.edu.mt People tell me that testing is Boring Not for developers A second class activity Not necessary because they are very good coders 1 What is quality?

More information

Software Testing. Software Testing

Software Testing. Software Testing Software Testing Software Testing Error: mistake made by the programmer/ developer Fault: a incorrect piece of code/document (i.e., bug) Failure: result of a fault Goal of software testing: Cause failures

More information

Chapter 11, Testing. Using UML, Patterns, and Java. Object-Oriented Software Engineering

Chapter 11, Testing. Using UML, Patterns, and Java. Object-Oriented Software Engineering Chapter 11, Testing Using UML, Patterns, and Java Object-Oriented Software Engineering Outline Terminology Types of errors Dealing with errors Quality assurance vs Testing Component Testing! Unit testing!

More information

CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING

CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING 1 CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING Outline 2 Quiz Black-Box Testing Equivalence Class Testing (Equivalence Partitioning) Boundary value analysis Decision Table Testing 1 3 Quiz - 1

More information

Software Testing. Massimo Felici IF

Software Testing. Massimo Felici IF Software Testing Massimo Felici IF-3.46 0131 650 5899 mfelici@staffmail.ed.ac.uk What is Software Testing? Software Testing is the design and implementation of a special kind of software system: one that

More information

Testing3. State-based Testing

Testing3. State-based Testing Testing3 State-based testing Inheritance Testing interacting classes Communication diagrams Object relation graph (ORD) Regression testing GUI Testing 1 State-based Testing Natural representation with

More information

UNIT-4 Black Box & White Box Testing

UNIT-4 Black Box & White Box Testing Black Box & White Box Testing Black Box Testing (Functional testing) o Equivalence Partitioning o Boundary Value Analysis o Cause Effect Graphing White Box Testing (Structural testing) o Coverage Testing

More information

XVIII. Software Testing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

XVIII. Software Testing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini XVIII. Software Testing Laurea Triennale in Informatica Corso di Objective General discussion on Testing Testing Phases Approaches to testing Structural testing Functional testing Testing non functional

More information

10. Software Testing Fundamental Concepts

10. Software Testing Fundamental Concepts 10. Software Testing Fundamental Concepts Department of Computer Science and Engineering Hanyang University ERICA Campus 1 st Semester 2016 Testing in Object-Oriented Point of View Error Correction Cost

More information

Topic: Software Verification, Validation and Testing Software Engineering. Faculty of Computing Universiti Teknologi Malaysia

Topic: Software Verification, Validation and Testing Software Engineering. Faculty of Computing Universiti Teknologi Malaysia Topic: Software Verification, Validation and Testing Software Engineering Faculty of Computing Universiti Teknologi Malaysia 2016 Software Engineering 2 Recap on SDLC Phases & Artefacts Domain Analysis

More information

Assertions. Assertions - Example

Assertions. Assertions - Example References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 11/13/2003 1 Assertions Statements about input to a routine or state of a class Have two primary roles As documentation,

More information

UNIT-4 Black Box & White Box Testing

UNIT-4 Black Box & White Box Testing Black Box & White Box Testing Black Box Testing (Functional testing) o Equivalence Partitioning o Boundary Value Analysis o Cause Effect Graphing White Box Testing (Structural testing) o Coverage Testing

More information

Assertions, pre/postconditions

Assertions, pre/postconditions Programming as a contract Assertions, pre/postconditions Assertions: Section 4.2 in Savitch (p. 239) Specifying what each method does q Specify it in a comment before method's header Precondition q What

More information

Testing Object-Oriented Software. 22 November 2017

Testing Object-Oriented Software. 22 November 2017 Testing Object-Oriented Software 22 November 2017 Testing Object-Oriented Software 2 Problems in object-oriented testing [Binder] Each level in the class hierarchy creates a new context for inherited features:

More information

An Introduction to Systematic Software Testing. Robert France CSU

An Introduction to Systematic Software Testing. Robert France CSU An Introduction to Systematic Software Testing Robert France CSU Why do we need to systematically test software? Poor quality products can Inconvenience direct and indirect users Result in severe financial

More information

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development Reveal faults Goals of testing Correctness Reliability Usability Robustness Performance Top-down/Bottom-up Bottom-up Lowest level modules tested first Don t depend on any other modules Driver Auxiliary

More information

Principles of Testing and Analysis. COMP 4004 Fall Notes Adapted from Dr. A. Williams

Principles of Testing and Analysis. COMP 4004 Fall Notes Adapted from Dr. A. Williams Principles of Testing and Analysis COMP 4004 Fall 2008 Notes Adapted from Dr. A. Williams Software Quality Assurance Lec 3 1 Principles of Testing and Analysis Sensitivity Redundancy Restriction Partition

More information

Sample Question Paper. Software Testing (ETIT 414)

Sample Question Paper. Software Testing (ETIT 414) Sample Question Paper Software Testing (ETIT 414) Q 1 i) What is functional testing? This type of testing ignores the internal parts and focus on the output is as per requirement or not. Black-box type

More information

Introduction. Easy to get started, based on description of the inputs

Introduction. Easy to get started, based on description of the inputs Introduction Testing is about choosing elements from input domain. The input domain of a program consists of all possible inputs that could be taken by the program. Easy to get started, based on description

More information

Software Testing. 2. Models. 2. Models. Testing Approaches. Why Models? (in Testing) (Based on Part II: Models of Testing Object-Oriented Systems)

Software Testing. 2. Models. 2. Models. Testing Approaches. Why Models? (in Testing) (Based on Part II: Models of Testing Object-Oriented Systems) 2. Models (Based on Part II: Models of Testing Object-Oriented Systems) Software Testing 2. Models Models - Why? What? How? Combinational Models - Decision Tables: What? How? - Test Generation State Machines

More information

Software Engineering (CSC 4350/6350) Rao Casturi

Software Engineering (CSC 4350/6350) Rao Casturi Software Engineering (CSC 4350/6350) Rao Casturi Testing Software Engineering -CSC4350/6350 - Rao Casturi 2 Testing What is testing? Process of finding the divergence between the expected behavior of the

More information

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 11/10/2015

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 11/10/2015 Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm Rao Casturi 11/10/2015 http://cs.gsu.edu/~ncasturi1 Class announcements Final Exam date - Dec 1 st. Final Presentations Dec 3 rd. And

More information

References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 10/14/2004 1

References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 10/14/2004 1 References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 10/14/2004 1 Assertions Statements about input to a routine or state of a class Have two primary roles As documentation,

More information

Verification and Validation

Verification and Validation Chapter 5 Verification and Validation Chapter Revision History Revision 0 Revision 1 Revision 2 Revision 3 Revision 4 original 94/03/23 by Fred Popowich modified 94/11/09 by Fred Popowich reorganization

More information

15. Regression testing

15. Regression testing Outline 15. Regression testing Tom Verheyen, Jelle Slowack, Bart Smets, Glenn Van Loon Introduction - What, why, when, how - Regression faults - Test automation - Test suite maintenance - Reducing a test

More information

Software Engineering Fall 2014

Software Engineering Fall 2014 Software Engineering Fall 2014 (CSC 4350/6350) Mon.- Wed. 5:30 pm 7:15 pm ALC : 107 Rao Casturi 11/10/2014 Final Exam date - Dec 10 th? Class announcements Final Presentations Dec 3 rd. And Dec 8 th. Ability

More information

The testing process. Component testing. System testing

The testing process. Component testing. System testing Software testing Objectives To discuss the distinctions between validation testing and defect testing To describe the principles of system and component testing To describe strategies for generating system

More information

Basic Principles of analysis and testing software

Basic Principles of analysis and testing software Basic Principles of analysis and testing software Software Reliability and Testing - Barbara Russo SwSE - Software and Systems Engineering Research Group 1 Basic principles of analysis and testing As in

More information

1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake

1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake Sample ISTQB examination 1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake 2 Regression testing should

More information

What is software testing? Software testing is designing, executing and evaluating test cases in order to detect faults.

What is software testing? Software testing is designing, executing and evaluating test cases in order to detect faults. ϖοιδ τεσταδδανδχουντ() { ασσερ τεθυαλσ(1, ο.αδδανδχουντ(νεω ΑρραψΛιστ()); ϖοιδ τεσταδδανδχουντ() { ασσερ τεθυαλσ(1, ο.αδδανδχουντ(νεω ΑρραψΛιστ()); ιντ αδδανδχουντ(λιστ λιστ) { ρετυρν λιστ.σιζε(); ιντ

More information

Introduction To Software Testing. Brian Nielsen. Center of Embedded Software Systems Aalborg University, Denmark CSS

Introduction To Software Testing. Brian Nielsen. Center of Embedded Software Systems Aalborg University, Denmark CSS Introduction To Software Testing Brian Nielsen bnielsen@cs.aau.dk Center of Embedded Software Systems Aalborg University, Denmark CSS 1010111011010101 1011010101110111 What is testing? Testing Testing:

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

Testing and Debugging

Testing and Debugging Testing and Debugging Comp-303 : Programming Techniques Lecture 14 Alexandre Denault Computer Science McGill University Winter 2004 March 1, 2004 Lecture 14 Comp 303 : Testing and Debugging Page 1 Announcements...

More information

Software Testing. Lecturer: Sebastian Coope Ashton Building, Room G.18

Software Testing. Lecturer: Sebastian Coope Ashton Building, Room G.18 Lecturer: Sebastian Coope Ashton Building, Room G.18 E-mail: coopes@liverpool.ac.uk COMP 201 web-page: http://www.csc.liv.ac.uk/~coopes/comp201 Software Testing 1 Defect Testing Defect testing involves

More information

Software Testing Fundamentals. Software Testing Techniques. Information Flow in Testing. Testing Objectives

Software Testing Fundamentals. Software Testing Techniques. Information Flow in Testing. Testing Objectives Software Testing Fundamentals Software Testing Techniques Peter Lo Software Testing is a critical element of software quality assurance and represents the ultimate review of specification, design and coding.

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

POLYMORPHISM 2 PART Abstract Classes Static and Dynamic Casting Common Programming Errors

POLYMORPHISM 2 PART Abstract Classes Static and Dynamic Casting Common Programming Errors POLYMORPHISM 2 PART Abstract Classes Static and Dynamic Casting Common Programming Errors CSC 330 OO Software Design 1 Abstract Base Classes class B { // base class virtual void m( ) =0; // pure virtual

More information

POLYMORPHISM 2 PART. Shared Interface. Discussions. Abstract Base Classes. Abstract Base Classes and Pure Virtual Methods EXAMPLE

POLYMORPHISM 2 PART. Shared Interface. Discussions. Abstract Base Classes. Abstract Base Classes and Pure Virtual Methods EXAMPLE Abstract Base Classes POLYMORPHISM 2 PART Abstract Classes Static and Dynamic Casting Common Programming Errors class B { // base class virtual void m( ) =0; // pure virtual function class D1 : public

More information

Introduction to Dynamic Analysis

Introduction to Dynamic Analysis Introduction to Dynamic Analysis Reading assignment Gary T. Leavens, Yoonsik Cheon, "Design by Contract with JML," draft paper, http://www.eecs.ucf.edu/~leavens/jml//jmldbc.pdf G. Kudrjavets, N. Nagappan,

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 02: Basic Black-Box and White-Box Testing Techniques (Textbook Ch. 4 & 5) Spring 2018 Dietmar Pfahl email: dietmar.pfahl@ut.ee Structure of Lecture 2 Black-Box vs.

More information

Information System Design (IT60105)

Information System Design (IT60105) Information System Design (IT60105) Lecture 26 Object-Oriented System Testing Lecture #23 Procedural vs OO paradigms Why not Traditional Testing? Issues Methodology 2 Procedural Vs OO p Procedural Vs OO

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Examination Questions Time allowed: 1 hour 15 minutes

Examination Questions Time allowed: 1 hour 15 minutes Swedish Software Testing Board (SSTB) International Software Testing Qualifications Board (ISTQB) Foundation Certificate in Software Testing Practice Exam Examination Questions 2011-10-10 Time allowed:

More information

Terminology. There are many different types of errors and different ways how we can deal with them.

Terminology. There are many different types of errors and different ways how we can deal with them. Testing Terminology Reliability: The measure of success with which the observed behavior of a system confirms to some specification of its behavior. Failure: Any deviation of the observed behavior from

More information

Subclassing for ADTs Implementation

Subclassing for ADTs Implementation Object-Oriented Design Lecture 8 CS 3500 Fall 2009 (Pucella) Tuesday, Oct 6, 2009 Subclassing for ADTs Implementation An interesting use of subclassing is to implement some forms of ADTs more cleanly,

More information

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism Block 1: Introduction to Java Unit 4: Inheritance, Composition and Polymorphism Aims of the unit: Study and use the Java mechanisms that support reuse, in particular, inheritance and composition; Analyze

More information

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013!

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013! Testing Prof. Leon Osterweil CS 520/620 Spring 2013 Relations and Analysis A software product consists of A collection of (types of) artifacts Related to each other by myriad Relations The relations are

More information

MONIKA HEINER.

MONIKA HEINER. LESSON 1 testing, intro 1 / 25 SOFTWARE TESTING - STATE OF THE ART, METHODS, AND LIMITATIONS MONIKA HEINER monika.heiner@b-tu.de http://www.informatik.tu-cottbus.de PRELIMINARIES testing, intro 2 / 25

More information

Coding and Unit Testing! The Coding Phase! Coding vs. Code! Coding! Overall Coding Language Trends!

Coding and Unit Testing! The Coding Phase! Coding vs. Code! Coding! Overall Coding Language Trends! Requirements Spec. Design Coding and Unit Testing Characteristics of System to be built must match required characteristics (high level) Architecture consistent views Software Engineering Computer Science

More information

Safety SPL/2010 SPL/20 1

Safety SPL/2010 SPL/20 1 Safety 1 system designing for concurrent execution environments system: collection of objects and their interactions system properties: Safety - nothing bad ever happens Liveness - anything ever happens

More information

Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION

Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION Overview, Test specification and cases, Adequacy criteria, comparing criteria, Overview of test execution, From test case specification

More information

A Short Summary of Javali

A Short Summary of Javali A Short Summary of Javali October 15, 2015 1 Introduction Javali is a simple language based on ideas found in languages like C++ or Java. Its purpose is to serve as the source language for a simple compiler

More information

Use the scantron sheet to enter the answer to questions (pages 1-6)

Use the scantron sheet to enter the answer to questions (pages 1-6) Use the scantron sheet to enter the answer to questions 1-100 (pages 1-6) Part I. Mark A for True, B for false. (1 point each) 1. Abstraction allow us to specify an object regardless of how the object

More information

Input Space Partitioning

Input Space Partitioning Input Space Partitioning Instructor : Ali Sharifara CSE 5321/4321 Summer 2017 CSE 5321/4321, Ali Sharifara, UTA 1 Input Space Partitioning Introduction Equivalence Partitioning Boundary-Value Analysis

More information

Testing Object-Oriented Software. COMP 4004 Fall Notes Adapted from Dr. A. Williams

Testing Object-Oriented Software. COMP 4004 Fall Notes Adapted from Dr. A. Williams Testing Object-Oriented Software COMP 4004 Fall 2008 Notes Adapted from Dr. A. Williams Dr. A. Williams, Fall 2008 Software Quality Assurance Lec 9 1 Testing Object-Oriented Software Relevant characteristics

More information

Mutually Enhancing Test Generation and Specification Inference

Mutually Enhancing Test Generation and Specification Inference Mutually Enhancing Test Generation and Specification Inference Tao Xie David Notkin Department of Computer Science & Engineering University of Washington August 15th, 2003 Foundations of Software Engineering,

More information

Testing & Continuous Integration. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 20 03/19/2010

Testing & Continuous Integration. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 20 03/19/2010 esting & Continuous Integration Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 20 03/1/20 University of Colorado, 20 1 Goals 2 Review material from Chapter of Pilone & Miles esting

More information

There are three basic elements in object oriented programming: encapsulation, inheritance and polymorphism.

There are three basic elements in object oriented programming: encapsulation, inheritance and polymorphism. More on Object Oriented Programming Concepts Functional, structured programming often results in programs that describe a hierarchy of tasks to be performed. Object oriented design, however, results in

More information

Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems)

Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems) Principles of Software Construction: Objects, Design, and Concurrency (Part 2: Designing (Sub )Systems) More Analysis for Functional Correctness Jonathan Aldrich Charlie Garrod School of Computer Science

More information

Software Engineering Software Testing Techniques

Software Engineering Software Testing Techniques Software Engineering Software Testing Techniques 1 Testability Operability it it operates cleanly Observability the the results of each test case are readily observed Controllability the the degree to

More information

Testing: Test design and testing process

Testing: Test design and testing process Testing: Test design and testing process Zoltán Micskei Based on István Majzik s slides Dept. of Measurement and Information Systems Budapest University of Technology and Economics Department of Measurement

More information

Feasibility of Testing to Code. Feasibility of Testing to Code. Feasibility of Testing to Code. Feasibility of Testing to Code (contd)

Feasibility of Testing to Code. Feasibility of Testing to Code. Feasibility of Testing to Code. Feasibility of Testing to Code (contd) Feasibility of Testing to Code (contd) Feasibility of Testing to Code (contd) An incorrect code fragment for determining if three integers are equal, together with two test cases Flowchart has over 10

More information

Verification and Validation

Verification and Validation Verification and Validation Assuring that a software system meets a user's needs Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 1 Objectives To introduce software verification

More information

Aerospace Software Engineering

Aerospace Software Engineering 16.35 Aerospace Software Engineering Verification & Validation Prof. Kristina Lundqvist Dept. of Aero/Astro, MIT Would You...... trust a completely-automated nuclear power plant?... trust a completely-automated

More information

University of Utah School of Computing

University of Utah School of Computing University of Utah School of Computing CS 1410 / CS 2000 Study Notes December 10, 2011 This study guide is designed to help you prepare and study the appropriate material for the final exam. For the multiple

More information

VIRTUAL FUNCTIONS Chapter 10

VIRTUAL FUNCTIONS Chapter 10 1 VIRTUAL FUNCTIONS Chapter 10 OBJECTIVES Polymorphism in C++ Pointers to derived classes Important point on inheritance Introduction to virtual functions Virtual destructors More about virtual functions

More information

n Specifying what each method does q Specify it in a comment before method's header n Precondition q Caller obligation n Postcondition

n Specifying what each method does q Specify it in a comment before method's header n Precondition q Caller obligation n Postcondition Programming as a contract Assertions, pre/postconditions and invariants Assertions: Section 4.2 in Savitch (p. 239) Loop invariants: Section 4.5 in Rosen Specifying what each method does q Specify it in

More information

[IT6004-SOFTWARE TESTING] UNIT 2

[IT6004-SOFTWARE TESTING] UNIT 2 1. List the two basic Testing strategies. UNIT 2 Black box testing. White box testing. 2. What are the knowledge sources for Black box testing? Requirements Document specification Domain knowledge Defect

More information

Chapter 1: Principles of Programming and Software Engineering

Chapter 1: Principles of Programming and Software Engineering Chapter 1: Principles of Programming and Software Engineering Data Abstraction & Problem Solving with C++ Fifth Edition by Frank M. Carrano Software Engineering and Object-Oriented Design Coding without

More information

Using the code to measure test adequacy (and derive test cases) Structural Testing

Using the code to measure test adequacy (and derive test cases) Structural Testing Using the code to measure test adequacy (and derive test cases) Structural Testing Objectives To describe a second approach to testing which is geared to find program defects To explain the use of program

More information

Verification and Validation. Verification and validation

Verification and Validation. Verification and validation Verification and Validation Verification and validation Verification and Validation (V&V) is a whole life-cycle process. V&V has two objectives: Discovery of defects, Assessment of whether or not the system

More information

CSC Advanced Object Oriented Programming, Spring Specification

CSC Advanced Object Oriented Programming, Spring Specification CSC 520 - Advanced Object Oriented Programming, Spring 2018 Specification Specification A specification is an unambiguous description of the way the components of the software system should be used and

More information

Software Engineering and Scientific Computing

Software Engineering and Scientific Computing Software Engineering and Scientific Computing Barbara Paech, Hanna Remmel Institute of Computer Science Im Neuenheimer Feld 326 69120 Heidelberg, Germany http://se.ifi.uni-heidelberg.de paech@informatik.uni-heidelberg.de

More information

C# Programming for Developers Course Labs Contents

C# Programming for Developers Course Labs Contents C# Programming for Developers Course Labs Contents C# Programming for Developers...1 Course Labs Contents...1 Introduction to C#...3 Aims...3 Your First C# Program...3 C# The Basics...5 The Aims...5 Declaring

More information