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

Similar documents
Software Testing. Minsoo Ryu. Hanyang University. Real-Time Computing and Communications Lab., Hanyang University

QUIZ #5 - Solutions (5pts each)

Verification and Validation

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

Chapter 9. Software Testing

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

Chapter 11, Testing, Part 2: Integration and System Testing

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

Lecture 26: Testing. Software Engineering ITCS 3155 Fall Dr. Jamie Payton

Software Engineering (CSC 4350/6350) Rao Casturi

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

Software Testing Strategies. Slides copyright 1996, 2001, 2005, 2009, 2014 by Roger S. Pressman. For non-profit educational use only

Software Engineering Fall 2014

Chapter 11, Testing, Part 2: Integration and System Testing

Object-Oriented Software Engineering Conquering Complex and Changing Systems. Chapter 9, Testing

What s Next INF 117 Project in Software Engineering

The Fundamental Testing Process in Practical or Company environment

Testing. Outline. What is this? Terminology. Erroneous State ( Error ) Algorithmic Fault

Lecture 15 Software Testing

Testing Objectives. Successful testing: discovers previously unknown errors

Software Testing Interview Question and Answer

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

Software Quality Assurance (SQA) Software Quality Assurance

SOFTWARE ENGINEERING IT 0301 Semester V B.Nithya,G.Lakshmi Priya Asst Professor SRM University, Kattankulathur

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

Testing Object-Oriented Applications. Slide Set to accompany. Software Engineering: A Practitioner s Approach, 7/e by Roger S.

Chapter 11, Testing, Part 2: Integration and System Testing

Software Testing. Massimo Felici IF

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation

Integration Testing Qualidade de Software 2

Program Correctness and Efficiency. Chapter 2

SOFTWARE ENGINEERING SOFTWARE VERIFICATION AND VALIDATION. Saulius Ragaišis.

Chapter 8 Software Testing. Chapter 8 Software testing

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS SOFTWARE ENGINEERING

Darshan Institute of Engineering & Technology for Diploma Studies

UNIT-2 Levels of Testing

Aerospace Software Engineering

(From Glenford Myers: The Art of Software Testing)

Sample Question Paper. Software Testing (ETIT 414)

! Is often referred to as verification and validation (V&V).

Testing & Debugging TB-1

Chap 2. Introduction to Software Testing

An Introduction to Systematic Software Testing. Robert France CSU

Introduction to Software Engineering

Testing Object-Oriented Applications. Slides copyright 1996, 2001, 2005, 2009 by Roger S. Pressman. For non-profit educational use only

Testing3. State-based Testing

Quote by Bruce Sterling, from: A Software Testing Primer, Nick Jenkins

SE 2730 Final Review

UNIT 1-SOFTWARE PROCESS AND PROJECT MANAGEMENT

Software Testing. Software Testing. in the textbook. Chapter 8. Verification and Validation. Verification Techniques

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

Verification and Validation. Verification and validation

Darshan Institute of Engineering & Technology Unit : 9

Testing: Test design and testing process

Topics in Software Testing

Bridge Course On Software Testing

Part 5. Verification and Validation

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan

Integration and Testing. Uses slides from Lethbridge & Laganiere, 2001

In this Lecture you will Learn: Testing in Software Development Process. What is Software Testing. Static Testing vs.

User-Centered Design Data Entry

Write perfect C code to solve the three problems below.

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Software Engineering Software Testing Techniques

Object-Oriented Design

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

ECE 462 Object-Oriented Programming using C++ and Java. Testing

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

Computational Systems COMP1209

How to Break Software by James Whittaker

door Sasa Berberovic

MONIKA HEINER.

VETRI VINAYAHA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Maintenance Phase. Maintenance Type

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

Literature. CHAPTER 5 Testing. When to Test? The Unified Process. When to Test?

Software Testing Techniques

CS6403 SOFTWARE ENGINEERING Year / Sem : II / IV Sub. Code &Subject : CS6403 SOFTWARE ENGINEERING QUESTION BANKWITH ANSWERS

CMPT Data and Program Organization

Object-Oriented Software Engineering Practical Software Development using UML and Java

Last Time: Object Design. Comp435 Object-Oriented Design. Last Time: Responsibilities. Last Time: Creator. Last Time: The 9 GRASP Patterns

Software Testing Strategies. Software Engineering: A Practitionerʼs Approach, 7/e by Roger S. Pressman

OO design. Classes, Responsibilities, Collaborations (CRC) 13/9/1999 COSC

Software Quality Assurance. David Janzen

TSW Reliability and Fault Tolerance

Software Testing CS 408

Modern Methods in Software Engineering. Testing.

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

Department of Electrical & Computer Engineering, University of Calgary. B.H. Far

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

CS 3 Introduction to Software Engineering. 3: Exceptions

CHAPTER 9 DESIGN ENGINEERING. Overview

CSE 374 Programming Concepts & Tools. Hal Perkins Fall 2015 Lecture 15 Testing

Low Level Design Activities. Implementation (Low Level Design) What is a Good Low Level Module? Black Box Aspects. Black box aspects White box aspects

Domain Modeling- 2. Generalization

Testing Object-Oriented Software. 22 November 2017

Software Design Models, Tools & Processes. Lecture 6: Transition Phase Cecilia Mascolo

Quality Assurance = Testing? SOFTWARE QUALITY ASSURANCE. Meaning of Quality. How would you define software quality? Common Measures.

Software Testing. An Overview

Exam Questions. Object-Oriented Design, IV1350. Maximum exam score is 100, grade limits are as follows. Score Grade 90 A 80 B 70 C 60 D 50 E

Transcription:

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, CS431 F06, BG Ryder/A Rountev 1 Motivation People are not perfect We make errors in design and code Goal of testing: given some code, uncover as many errors are possible Important and expensive activity Not unusual to spend 30-40% of total project effort on testing For critical systems (e.g., flight control): cost can be several times the cost of all other activities combined Testing-11, CS431 F06, BG Ryder/A Rountev 2 1

What is the goal of testing? Testing - process of executing a program to find errors Successful test causes the program to FAIL Can t expect goal to be demonstration that program is error-free Testing can validate not verify! Testing-11, CS431 F06, BG Ryder/A Rountev 3 A Way of Thinking Design and coding are creative Testing is destructive The primary goal is to break the software Very often the same person does both coding and testing Need split personality : when you start testing, become paranoid and malicious Surprisingly hard to do: people don t like finding out that they made mistakes Testing-11, CS431 F06, BG Ryder/A Rountev 4 2

Testing Objectives Testing is a process of executing software with the intent of finding errors Good testing has a high probability of finding as-yet-undiscovered errors Successful testing discovers unknown errors If did not find any errors, need to ask whether our testing approach is good Testing-11, CS431 F06, BG Ryder/A Rountev 5 Basic Definitions Test case specifies Inputs + pre-test state of the software Expected results (outputs and state) Black-box testing: ignores the internal logic of the software Given this input, was the output correct? White-box testing: uses knowledge of the internal structure of the software e.g. write tests to cover internal paths Testing-11, CS431 F06, BG Ryder/A Rountev 6 3

But Testing All Paths is impossible Assume we have 100 LOC in C 2 nested loops (from 1-20 times each) W/I inner loop have 4 if-then-else constructs which yields 10 14 posisble paths If we assume a processor can develop a test case, execute it and evaluate it in 1 millisecond, then working 24/7, the processor would take 3170 YEARS to test this program Testing-11, CS431 F06, BG Ryder/A Rountev 7 Testing Principles Test must have an expected output Programmer should not test their own code or it becomes proofreading Need to thoroughly inspect all test results Test cases needed for the invalid and unexpected values as well as for the expected and valid conditions Must look to see if a program fails to do what it is supposed to do, and if it does what it is not supposed to do Testing-11, CS431 F06, BG Ryder/A Rountev 8 4

Testing Principles Save tests for a regression suite Don t plan testing assuming no errors will be found Probability of more errors in a section of code is proportional to the number of errors already found in that section Errors cluster -- very unintuitive, but observable Good testing is creatively and intellectually challenging Testing-11, CS431 F06, BG Ryder/A Rountev 9 Traditional Testing Strategies Unit testing: per component Can be done for multiple components in parallel What s tested? Interface, local data structures, boundary conditions, independent paths, error handling paths Which errors found? Computation problems, loop errors, bad error messages May require test driver to run component under test (CUT) and stubs for components it calls Stubs provide minimal functionality Drivers and stubs are overhead to test process Testing-11, CS431 F06, BG Ryder/A Rountev 10 5

Traditional Testing Strategies Integration testing: Systematically combining components while checking for interface errors Big Bang vs Incremental Top down Move down through control hierarchy of modules; can do depth-first or breadth-first Replace each stub by a component as testing progresses downwards Difficult if processing in lower components necessary to test upper components - makes stubs complicated to build Testing-11, CS431 F06, BG Ryder/A Rountev 11 Traditional Testing Strategies Bottom up Begin testing with modules at bottom of hierarchy and work way upwards Avoids need for stubs Gather lower components into clusters which can be tested by a driver Regression testing Save representative selection of tests to make sure functionality is not changed when code is changed Testing-11, CS431 F06, BG Ryder/A Rountev 12 6

Traditional Testing Strategies Validation testing Checks software behaves as user expects; conformity to requirements May involve alpha and/or beta test releases System testing To fully exercise the system to fully check integration of all elements (including HW platform) Types: recovery testing, security testing, stress testing, performance testing Testing-11, CS431 F06, BG Ryder/A Rountev 13 OO Testing Techniques Unit testing Class testing Check the state behavior and operations encapsulated in the class Can apply usual white-box testing techniques to methods in the class Integration testing Thread-based testing Integrate set of classes needed to respond to one input or event for the system Use regression tests to make sure no side effects are introduced Use-based testing Construct system by testing classes that use very few, if any server classes; continue to test classes dependent upon them, as go up the uses hierarchy layers Testing-11, CS431 F06, BG Ryder/A Rountev 14 7

OO Testing Techniques Drivers may simulate the UI or to test groups of classes; Stubs may be necessary if not all classes are written Cluster testing To find problems in collaborations of bad interactions or improper specifications Testing-11, CS431 F06, BG Ryder/A Rountev 15 Applicability of Traditional Techniques Fault-based testing Faults looked for during integration include bad operation calls or message connections Unexpected result, wrong message used, incorrect invocation Look for faults in the caller, not the callee Test cases and Inheritance Subclass methods need to be tested independently from superclass methods they override Inherited superclass methods may need to be retested when calling overriding subclass methods (for subclass objects) Testing-11, CS431 F06, BG Ryder/A Rountev 16 8

Applicability of Traditional Techniques Scenario-based testing Based on use cases Often more complex than fault-based tests, because they exercise multiple subsystems Testing surface structure Corresponds to black-box testing; observable structure by end-users Testing deep structure Corresponds to white-box testing which covers the control-flow or data-flow structure of the program Testing-11, CS431 F06, BG Ryder/A Rountev 17 How to know when to stop testing? Decide based on some test-case design methodology Only can use for some test phases When detect some pre-defined number of errors Can use predictive models for estimation Examine number of errors found per unit of time Decide if need to continue based on slope of graph In reality -- RUN OUT OF TIME Testing-11, CS431 F06, BG Ryder/A Rountev 18 9