Software Testing. Testing: Our Experiences

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

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

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

Software Testing. Software Testing

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

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

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

Introduction to Dynamic Analysis

Testing & Debugging TB-1

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

Part I: Preliminaries 24

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

QUIZ #5 - Solutions (5pts each)

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

Verification Black-box Testing & Testing in the Large

CS 520 Theory and Practice of Software Engineering Fall 2018

Software Testing Interview Question and Answer

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

Testing & Symbolic Execution

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

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

Verification Overview Testing Theory and Principles Testing in Practice. Verification. Miaoqing Huang University of Arkansas 1 / 80

Ingegneria del Software Corso di Laurea in Informatica per il Management

Chapter 9 Quality and Change Management

Second assignment came out Monday evening. Find defects in Hnefetafl rules written by your classmates. Topic: Code Inspection and Testing

Pearson Education 2007 Chapter 9 (RASD 3/e)

Aerospace Software Engineering

Program Analysis. Program Analysis

Software Testing for Developer Development Testing. Duvan Luong, Ph.D. Operational Excellence Networks

Software Engineering (CSC 4350/6350) Rao Casturi

Lecture 15 Software Testing

Software Quality Assurance. David Janzen

Testing Process and Methods. CS 490MT/5555, Spring 2017, Yongjie Zheng

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

White Box Testing III

Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION

Testing. ECE/CS 5780/6780: Embedded System Design. Why is testing so hard? Why do testing?

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

Software Engineering Fall 2014

MTAT : Software Testing

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

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

Test Case Specifications and Test adequacy. Research Methods - Barbara Russo SwSE - Software and Systems Engineering

CMPSCI 521/621 Homework 2 Solutions

Software Testing. Testing 1

Chapter 10. Testing and Quality Assurance

Subject Software Testing Structural Testing

10. Software Testing Fundamental Concepts

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

Testing, Fuzzing, & Symbolic Execution

Software Testing CS 408

MONIKA HEINER.

An Introduction to Systematic Software Testing. Robert France CSU

Dataflow-based Coverage Criteria

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

Types of Software Testing: Different Testing Types with Details

Testing Role in Unified Approach Coverage: Structural/Coverage Model Based Test Generation from Model Checking (project) Interaction of

TDDD04: Integration and System level testing. Lena Buffoni

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

Properties of Criteria. 1. Applicability Property. Criteria

Written exam TDDD04 Software Testing

Testing: Coverage and Structural Coverage

Darshan Institute of Engineering & Technology for Diploma Studies

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

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

Testing: Test design and testing process

Manuel Oriol, CHCRC-C, Software Testing ABB

Testing Methods: White Box Testing II

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

Testing Objectives. Successful testing: discovers previously unknown errors

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

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

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

Testing! The material for this lecture is drawn, in part, from! The Practice of Programming (Kernighan & Pike) Chapter 6!

Software Design Fundamentals. CSCE Lecture 11-09/27/2016

Advanced Software Engineering: Software Testing

CSE 403: Software Engineering, Fall courses.cs.washington.edu/courses/cse403/16au/ Unit Testing. Emina Torlak

Testing! The material for this lecture is drawn, in part, from! The Practice of Programming (Kernighan & Pike) Chapter 6!

Course Wrap-Up. Software Testing and Verification. Stephen M. Thebaut, Ph.D. Prepared by. University of Florida

(See related materials in textbook.) CSE 435: Software Engineering (slides adapted from Ghezzi et al & Stirewalt

Program Testing and Analysis: Manual Testing Prof. Dr. Michael Pradel Software Lab, TU Darmstadt

Testing, Module To Object, Reusability

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

Testing. Prof. Clarkson Fall Today s music: Wrecking Ball by Miley Cyrus

Chapter 8 Software Testing. Chapter 8 Software testing

Mind Q Systems Private Limited

Shree.Datta Polytechnic College,Dattanagar, Shirol. Class Test- I

Software Engineering G Session 12 - Main Theme Software Verification, Validation, and Quality. Dr. Jean-Claude Franchitti

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

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

(From Glenford Myers: The Art of Software Testing)

Program Verification! Goals of this Lecture! Words from the Wise! Testing!

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

Software Testing

Certified Tester Foundation Level(CTFL)

Software Engineering Theory. Lena Buffoni (slides by Kristian Sandahl/Mariam Kamkar) Department of Computer and Information Science

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

COPYRIGHTED MATERIAL. Index

Software Testing. Software Testing. in the textbook. Chapter 8. Verification and Validation. Verification and Validation: Goals

Structural Testing. (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1

Transcription:

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 Real Testing Example Test Cases {1,3,2} {1,2,3} {3,2,3} {} {-1, -2} Just a list. A sorted list. Repeated entry. Empty list. Negative Sorting numbers. Program SPECS: Takes a list of numbers; returns a sorted list. {1, {2, {-2, {} 2, 3, -1} 3} Output 2

Test Case Generation Automated Testing Test Case Software to be tested Verification Output No Enough? Test Coverage Yes Automated Testing Test Case Generator Test Case Software to be tested Test Specs Output Verifier OR Test Oracle Coverage Evaluator 3

Testing the New Version Original Test Cases Original Software Modified Software New Test Cases Regression Testing Original Test Cases Original Software Modified Software New Test Cases 4

What is Testing? Process of determining whether a task has been correctly carried out [Schach 96] Goals of testing Reveal Faults Correctness Reliability Usability Robustness Performance Conflicting Goals? Types of Testing Execution-based Testing Non-execution based Testing Discussion 5

Execution-based Testing Generating and Executing Test Cases on the Software Types of Execution-based Testing Testing to Specifications Black-box Testing Testing to Code Glass-box (White-box) Testing Black-box Testing Discussion: MAC/ATM Machine Example Specs Cannot withdraw more than $300 Cannot withdraw more than your account balance Balance x Software 6

White-box Testing 1 2 3 4 5 6 Example x: 1..1000; Generate test cases to cover each statement INPUT-FROM-USER(x); If (x <= 300) { INPUT-FROM-FILE(BALANCE); If (x <= BALANCE) GiveMoney x; else Print You don t have $x in your account!! } else Print You cannot withdraw more than $300 ; Eject Card; Discussion Which is superior? Each technique has its strengths Use both 7

Determining Adequacy Statement coverage Branch coverage Path coverage All-def-use-path coverage Surprise Quiz Determine test cases so that each print statement is executed at least once begin input(x); if (x < 100) print Line 1 ; else { if (x < 50) print Line 2 else print Line 3 ; } if x<100 x>=100 1 x>=100 if x>=100 x<50 x>=50 2 3 end 8

Non-execution Based Walkthroughs Manual simulation by team leader Inspections Developer narrates the reading Key Idea Review by a team of experts: Syntax checker? Code Readings Formal Verification of Correctness Very Expensive Justified in Critical Applications Semi-formal: Some Assertions Simulation Integration with system hardware is central to the design Model the external hardware Model the interface Examples Discussion 9

Boundary-value Analysis Partition the program domain into input classes Choose test data that lies both inside each input class and at the boundary of each class Select input that causes output at each class boundary and within each class Also known as stress testing Testing Approaches Top-down Bottom-up Big Bang Unit testing Integration testing Stubs System testing 10

Mutation Testing Errors are introduced in the program to produce mutants Run test suite on all mutants and the original program Test Case Generation Test Input to the Software Some researchers/authors also define the test case to contain the expected output for the test input 11

Category-partition Method Key idea Method for creating functional test suites Role of test engineer Analyze the system specification Write a series of formal test specifications Automatic generator Produces test descriptions Steps Decompose the functional specification into functional units Characteristics of functional units They can be tested independently Examples A top-level user command Or a function Decomposition may require several stages Similar to high-level decomposition done by software designers May be reused, although independent decomposition is recommended 12

Steps Examine each functional unit Identify parameters Explicit input to the functional unit Environmental conditions Characteristics of the system s state Test Cases Specific values of parameters And environmental conditions Steps Test cases are chosen to maximize chances of finding errors For each parameter & environmental condition Find categories Major property or characteristic Examples Browsers, Operating Systems, array size For each category Find choices» Examples: (IE 5.0, IE 4.5, Netscape 7.0), (Windows NT, Linux), (100, 0, -1) 13

Steps Develop Formal Test Specification for each functional unit List of categories Lists of choices within each category Constraints Automatically produces a set of test frames Consists of a set of choices AI Planning Method Key Idea Input to Command-driven software is a sequence of commands The sequence is like a plan Scenario to test Initial state Goal state 14

Example VCR command-line software Commands Rewind If at the end of tape Play If fully rewound Eject If at the end of tape Load If VCR has no tape Preconditions & Effects Rewind Precondition: If at end of tape Effects: At beginning of tape Play Precondition: If at beginning of tape Effects: At end of tape Eject Precondition: If at end of tape Effects: VCR has no tape Load Precondition: If VCR has no tape Effects: VCR has tape 15

Preconditions & Effects Rewind Precondition: end_of_tape Effects: end_of_tape Play Precondition: end_of_tape Effects: end_of_tape Eject Precondition: end_of_tape Effects: has_tape Load Precondition: has_tape Effects: has_tape Initial and Goal States Initial State end_of_tape Goal State end_of_tape Plan? Rewind 16

Initial and Goal States Initial State end_of_tape & has_tape Goal State has_tape Plan? Play Eject Test Coverage & Adequacy How much testing is enough? When to stop testing Test data selection criteria Test data adequacy criteria Stopping rule Degree of adequacy Test coverage criteria Objective measurement of test quality 17

Preliminaries Test data selection What test cases Test data adequacy criteria When to stop testing Examples Statement Coverage Branch coverage Def-use coverage Path coverage Goodenough & Gerhart [ 75] What is a software test adequacy criterion Predicate that defines what properties of a program must be exercised to constitute a thorough test, i.e., one whose successful execution implies no errors in a tested program 18

Uses of test adequacy Objectives of testing In terms that can be measured For example branch coverage Two levels of testing First as a stopping rule Then as a guideline for additional test cases Categories of Criteria Specification based All-combination criterion choices Each-choice-used criterion Program based Statement Branch Note that in both the above types, the correctness of the output must be checked against the specifications 19

Others Random testing Statistical testing Interface based 20