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

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

Topics in Software Testing

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

An Introduction to Systematic Software Testing. Robert France CSU

10. Software Testing Fundamental Concepts

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

Aerospace Software Engineering

Software Engineering

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

Software Testing. Software Testing

Software Testing CS 408

Fault Localization Using Tarantula

CS 520 Theory and Practice of Software Engineering Fall 2018

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

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

Specification-Based Testing 1

The testing process. Component testing. System testing

Lecture 15 Software Testing

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

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

Software Testing. Testing: Our Experiences

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

Manuel Oriol, CHCRC-C, Software Testing ABB

An Empirical Study of the Effects of Test-Suite Reduction on Fault Localization

Chapter 10. Testing and Quality Assurance

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

MONIKA HEINER.

Software Quality Assurance. David Janzen

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

Visualization of Test Information to Assist Fault Localization

Testing & Debugging TB-1

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

Part 5. Verification and Validation

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

White Box Testing III

Verification and Validation. Verification and validation

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

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

International Journal of Computer Engineering and Applications, Volume XII, Special Issue, September 18, ISSN SOFTWARE TESTING

Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn. 4. Testing

Announcements. Testing. Announcements. Announcements

Quality Assurance in Software Development

Software Quality Assurance (SQA) Software Quality Assurance

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

Higher-order Testing. Stuart Anderson. Stuart Anderson Higher-order Testing c 2011

Empirical Evaluation of the Tarantula Automatic Fault-Localization Technique

SFWR ENG 3S03: Software Testing

Verification Black-box Testing & Testing in the Large

Testing: Test design and testing process

International Journal of Computer Engineering and Applications, Volume XII, Special Issue, April- ICITDA 18,

Verification and Validation

White-Box Testing Techniques III

QUIZ #5 - Solutions (5pts each)

1 Black Box Test Data Generation Techniques

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

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

Software Testing. Massimo Felici IF

Software testing. Ian Sommerville 2006 Software Engineering, 8th edition. Chapter 23 Slide 1

Chapter 8 Software Testing. Chapter 8 Software testing

Darshan Institute of Engineering & Technology for Diploma Studies

Certified Tester Foundation Level(CTFL)

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

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

Introduction to Dynamic Analysis

15. Regression testing

[IT6004-SOFTWARE TESTING] UNIT 2

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

c. Typically results in an intractably large set of test cases even for small programs

Test design techniques

Sample Exam Syllabus

Introduction to Problem Solving and Programming in Python.

Chapter 9. Software Testing

Equivalence Class Partitioning. Equivalence Partitioning. Definition and Example. Example set of classes

Extended Program Invariants: Applications in Testing and Fault Localization

Verification and Validation

Program Analysis. Program Analysis

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

People tell me that testing is

INTRODUCTION TO SOFTWARE ENGINEERING

Testing: Coverage and Structural Coverage

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

Subject Software Testing Structural Testing

Programming Embedded Systems

18-642: Testing Overview

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

Spectrum Mutant. Evaluating and Improving Fault Localization

EXAMINING THE CODE. 1. Examining the Design and Code 2. Formal Review: 3. Coding Standards and Guidelines: 4. Generic Code Review Checklist:

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

Topics. Software Testing Test Driven Development Black Box Testing Unit Testing White Box Testing Coverage Testing Software Debugging

Examining the Code. [Reading assignment: Chapter 6, pp ]

Black-box Testing Techniques

EECS 4313 Software Engineering Testing. Topic 01: Limits and objectives of software testing Zhen Ming (Jack) Jiang

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

CS261 Data Structures. Ordered Array Dynamic Array Implementation

CSCE 747 Software Testing and Quality Assurance

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

UNIT-4 Black Box & White Box Testing

Testing. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 13

Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur. Lecture 13 Path Testing

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

Transcription:

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

Context of Software Testing Verification & Validation Verification: checking that the software conforms to its specification. Validation: checking that the software meets the customer s expectations. more general Techniques of verification and validation Inspections static Automated code analysis Formal verification Software testing - dynamic 1 CS 490MT/5555 Software Methods and Tools

Definition of Software Testing Software testing is a fundamental technique used to determine errors. It executes the software using representative data samples and comparing the actual results with the expected results. 2 CS 490MT/5555 Software Methods and Tools

Software Test: Pass/Fail Given a software system S and a test case t: Test case t passes if the actual output for an execution of S with t is the same as the expected output for t; otherwise t fails. 3 CS 490MT/5555 Software Methods and Tools

How to generate test cases White-box testing structural, program-based testing Test cases are designed, selected, and run based on structure of the source code (control-flow coverage, data-flow coverage). Tests the nitty-gritty. Drawbacks: need access to source. Black-box testing functional, specification-based testing Test cases are designed, selected, and run based on specifications. Tests the overall system behavior. Drawbacks: less systematic. 4 CS 490MT/5555 Software Methods and Tools

What to test Unit test Testing individual modules. Integration test Testing the composition of modules. System (acceptance) test Testing the whole system against requirements specification. Regression test Retesting a modified program. 5 CS 490MT/5555 Software Methods and Tools

V-Model Develop Requirements Requirements Review Execute System Tests Develop System Tests System Test Review Design Design Review Execute Integration Tests Develop Integration Tests Integration Tests Review Code Code Review Execute Unit Tests Develop Unit Tests Unit Tests Review 6 CS 490MT/5555 Software Methods and Tools

Let s get them summarized a little bit Unit Test Integration Test System Test Regression Test White-box test Black-box test 7 CS 490MT/5555 Software Methods and Tools

Important Activities in Software Testing Test Data (Test Case) Generation Input White-box: structure coverage. Black-box: specification based. Expected Output Test Oracle: the tester or an external mechanism that can accurately decide whether or not the output produced by a program is correct. Non-testable. No oracle: for example, to test a program that calculates the total volume of water on earth. Have oracle, but hard to decide: for example, to test a program that sorts an integer array whose size is over 1,000. Localizing fault based on test results 8 CS 490MT/5555 Software Methods and Tools

Testing Techniques Test Data Generation Ostrand, T. J. and Balcer, M. J. 1988. The category-partition method for specifying and generating fuctional tests. Commun. ACM 31, 6 (Jun. 1988), 676-686. Fault Localization Jones, J. A., Harrold, M. J., and Stasko, J. 2002. Visualization of test information to assist fault localization. In Proceedings of the 24th international Conference on Software Engineering (Orlando, Florida, May 19-25, 2002). ICSE '02. ACM, New York, NY, 467-477. 9 CS 490MT/5555 Software Methods and Tools

Fault Localization Using Visualization Technique Intuition Statements that are primarily executed by failed test cases are more suspicious than statements that are primarily executed by passed test cases. 10 CS 490MT/5555 Software Methods and Tools

Fault Localization Using Visualization Technique Input (S: a software system; t: test case; T: test suite) The source code for S The pass/fail results for executing S with each t in T The code coverage of executing S with each t in T The code coverage for t consists of the source code statements that are executed when S is run with t. Output Suspicious score for each executed source code statement Visualization of the source code in which the individual statements are colored according to their participation in the testing 11 CS 490MT/5555 Software Methods and Tools

Fault Localization Using Visualization Technique The following five slides are provided by Prof. James A. Jones. 12 CS 490MT/5555 Software Methods and Tools

3,3,5 1,2,3 3,2,1 5,5,5 5,3,4 2,1,3 mid() { int x,y,z,m; 1: read( Enter 3 numbers:,x,y,z); 2: m = z; 3: if (y<z) 4: if (x<y) 5: m = y; 6: else if (x<z) 7: m = y; // bug 8: else 9: if (x>y) 10: m = y; 11: else if (x>z) 12: m = x; 13: print( Middle number is:, m); } Pass Status P P P P P F 0.5 0.5 0.5 0.6 0.0 0.7 0.8 0.0 0.0 0.0 0.0 0.0 0.5 13

Fault Localization Using Visualization Technique 14 CS 490MT/5555 Software Methods and Tools

Fault Localization Using Visualization Technique 15 CS 490MT/5555 Software Methods and Tools

Fault Localization Using Visualization Technique 16 CS 490MT/5555 Software Methods and Tools

Fault Localization Using Visualization Technique 17 CS 490MT/5555 Software Methods and Tools

Category-Partition Method for Generating Functional Tests Goal The tests are executed for all of the systems functions The tests are designed to maximize the chances of finding errors in the software. Testing boundary conditions, special cases, error handlers, and cases where inputs and the system environment interact in potentially dangerous ways. Approach Partition the input domain of a function being tested, and then select test data from each class of the partition. The idea is: all elements within an equivalence class are essentially the same for the purpose of testing. 18 CS 490MT/5555 Software Methods and Tools

Category-Partition Method for Generating Functional Tests Specific Steps of Category-Partition Method Decompose functional specification into functional units that can be tested independently. Identifying categories based on parameters and environment conditions. Parameters are the explicit inputs to a functional unit Environment conditions are characteristics of the system s state at the time of executing a functional unit A category is a major property or characteristic of a parameter or environment condition. Partition each category into distinct choices. Determine constraints among the choices. Generate testing specifications. 19 CS 490MT/5555 Software Methods and Tools

Category-Partition Method for Generating Functional Tests Rule of Thumb Choose test cases on the boundaries of the partitions plus cases close to the mid-point of the partition. While the categories are derived entirely from information in the specification, the choices can be based on The specification The tester s past experience Knowledge about the system 20 CS 490MT/5555 Software Methods and Tools

Category-Partition Method for Generating Functional Tests Example: Search procedure Search (Key : ELEM ; T: ELEM_ARRAY; Found : out BOOLEAN; L: out ELEM_INDEX) ; Pre-condition The array has at least one element T FIRST <= T LAST Post-condition The element is found and is referenced by L ( Found and T (L) = Key) or The element is not in the array ( not Found and not (exists i, T FIRST >= i <= T LAST, T (i) = Key )) 21 CS 490MT/5555 Software Methods and Tools

Category-Partition Method for Generating Functional Tests Category Partitions for Search Number of occurrences of key in the sequence none, exactly one (assuming no duplicates in the sequence) Position of key in the sequence first element, middle element, last element Sequence size single value, many values 22 CS 490MT/5555 Software Methods and Tools

Category-Partition Method for Generating Functional Tests 23 CS 490MT/5555 Software Methods and Tools

Facts About Testing Testing can only show the presence of errors, not their absence. Automatic test cases generation is impossible. A major problem that arises during integration testing is localizing errors. 24 CS 490MT/5555 Software Methods and Tools