Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim.

Slides:



Advertisements
Similar presentations
Software Engineering COMP 201
Advertisements

Software testing.
Defect testing Objectives
การทดสอบโปรแกรม กระบวนการในการทดสอบ
Chapter 10 Software Testing
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Software Engineering, COMP201 Slide 1 Software Testing Lecture 28 & 29.
Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Final Project Account for 40 pts out of 100 pts of the final score 10 pts from.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 22 & 23 Slide 1 Verification and Validation.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing 2.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Software Engineering Software Testing.
CS 425/625 Software Engineering Software Testing
- Testing programs to establish the presence of system defects -
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 22Slide 1 Verification and Validation u Assuring that a software system meets a user's.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 23 Slide 1 Software testing Slightly adapted by Anders Børjesson.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Integration testing l Tests complete systems or subsystems composed of integrated.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Testing phases. Test data Inputs which have been devised to test the system Test cases Inputs to test the system and the predicted outputs from these.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Software testing techniques 3. Software testing
Prof. Mohamed Batouche Software Testing.
Software Engineering Chapter 23 Software Testing Ku-Yaw Chang Assistant Professor Department of Computer Science and Information.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Chapter 20 Software Testing.
Chapter 8 – Software Testing Lecture 1 1Chapter 8 Software testing The bearing of a child takes nine months, no matter how many women are assigned. Many.
CSC 480 Software Engineering Lecture 14 Oct 16, 2002.
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
1 Software testing. 2 Testing Objectives Testing is a process of executing a program with the intent of finding an error. A good test case is in that.
1 Software Defect Testing Testing programs to establish the presence of system defects.
Csi565: Theory and Practice of Software Testing Introduction Spring 2009.
This chapter is extracted from Sommerville’s slides. Text book chapter
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
CSC 480 Software Engineering Lecture 15 Oct 21, 2002.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Chapter 8 Lecture 1 Software Testing. Program testing Testing is intended to show that a program does what it is intended to do and to discover program.
Software process model from Ch2 Chapter 2 Software Processes1 Requirements Specification Design and Implementation ValidationEvolution.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
Chapter 5 – Software Testing & Maintenance (Evolution) 1.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Test case design l Involves designing the test cases (inputs and outputs) used.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Finding Software Faults: Testing Process.
Lecturer: Eng. Mohamed Adam Isak PH.D Researcher in CS M.Sc. and B.Sc. of Information Technology Engineering, Lecturer in University of Somalia and Mogadishu.
Lecture 2 Software Testing 2.1 System Testing 2.2 Component Testing ( Unit testing ) 2.3 Test Case Design 2.4 Test Automation.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Defect testing Testing programs to establish the presence of system defects.
Chapter 9 Software Testing
IS301 – Software Engineering V:
Chapter 8 – Software Testing
Chapter 18 Software Testing Strategies
Software testing.
Software testing strategies 2
Testing and Test-Driven Development CSC 4700 Software Engineering
Software testing.
Software Testing “If you can’t test it, you can’t design it”
Chapter 7 Software Testing.
Presentation transcript:

Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim

Topics Covered  System Testing  Component Testing  Test Case Design

The Testing Process  Component testing  Testing of individual program components  Usually the responsibility of the component developer (except sometimes for critical systems)  Tests are derived from the developer’s experience  System testing  Testing of groups of components integrated to create a system or sub-system  The responsibility of an independent testing team  Tests are based on a system specification

Defect Testing  The goal of defect testing is to discover defects in programs  A successful defect test is a test which causes a program to behave in an anomalous way  Tests show the presence not the absence of defects

The Software Testing Process

System Testing  Involves integrating components to create a system or sub-system  In an iterative development process, it is concerned with testing an increment to be delivered to the customer  In a waterfall process, it is concerned with testing the entire system  For most complex systems, there are two distinct phases  Integration testing  Release testing

Integration Testing  Involves building a system from its components and testing the resultant system for problems that arise from component interactions  Top-down integration  Develop the overall skeleton of the system first and then add components to it  Bottom-up integration  Integrate infrastructure components that provide common services, such as network and database access, and then add the functional components  To simplify error localization, components should be integrated incrementally

Incremental Integration Testing

Release Testing  The process of testing a release of a system that will be distributed to customers  Primary goal is to increase the supplier’s confidence that the system meets its requirements  Release testing is usually black-box or functional testing  Based on the system specification only  Testers do not have knowledge of the system implementation

Testing Guidelines  Testing guidelines are hints for the testing team to help them choose tests that will reveal defects in the system  Choose inputs that force the system to generate all error messages  Design inputs that cause buffers to overflow  Repeat the same input or series of inputs numerous times  Force invalid outputs to be generated  Force computation results to be too large or too small

Performance Testing  Part of release testing may involve testing the emergent properties of a system, such as performance and reliability  Performance tests usually involve planning a series of tests where the load is steadily increased until the system performance becomes unacceptable

Stress Testing  Exercises the system beyond its maximum design load. Stressing the system often causes defects to come to light  Stressing the system tests failure behaviour. Systems should not fail catastrophically. Stress testing checks for unacceptable loss of service or data  Stress testing is particularly relevant to distributed systems that can exhibit severe degradation as a network becomes overloaded

Component Testing  Component or unit testing is the process of testing individual components in isolation  It is a defect testing process so its goal is to expose faults in these components  There are different types of component that may be tested at this stage:  Individual functions or methods within an object  Object classes with several attributes and methods  Composite components made up of several different objects or functions. They have a defined interface that is used to access their functionality

Object Class Testing  Object class testing should include:  The testing in isolation of all operations associated with the object  The setting and interrogation of all attributes associated with the object  The exercise of the object in all possible states. This means that all events that cause a state change in the object should be simulated  Inheritance makes it more difficult to design object class tests as the information to be tested is not localized

Interface Testing  Objectives are to detect faults due to interface errors or invalid assumptions about interfaces  Particularly important for object-oriented development as objects are defined by their interfaces B C Test cases A

Interface Errors  Interface misuse  A calling component calls some other component and makes an error in its use of its interface (e.g. parameters in the wrong order)  Interface misunderstanding  A calling component misunderstands the specification of the interface of the called component and makes assumptions about the behaviour of the called component  Timing errors  The called and the calling components operate at different speeds and out-of-date information is accessed

Interface Testing Guidelines  Design tests so that parameters to a called procedure are at the extreme ends of their ranges  Always test pointer parameters with null pointers  Design tests which cause the component to fail  Use stress testing in message passing systems  In shared memory systems, vary the order in which components are activated

Test Case Design  Involves designing the test cases (inputs and outputs) used to test the system  The goal of test case design is to create a set of tests that are effective in validation and defect testing  Design approaches  Requirement-based testing  Partition testing  Structural testing

Requirement-Based Testing  A general principle of requirement engineering is that requirements should be testable  Requirement-based testing is a validation testing technique where we consider each requirement individually and derive a set of tests for that requirement

LIBSYS Requirements 1. The user shall be able to search either all of the initial set of databases or select a subset from it 2. The system shall provide appropriate viewers for the user to read documents in the document store 3. Every order shall be allocated a unique identifier (ORDER_ID) that the user shall be able to copy to the account’s permanent storage area

Tests For LIBSYS Requirement 1  Initiate user searches for items that are known to be present and known not to be present, where the set of databases includes one database  Initiate user searches for items that are known to be present and known not to be present, where the set of databases includes two databases  Initiate user searches for items that are known to be present and known not to be present, where the set of databases includes more than two databases  Select one database from the set of databases and initiate user searches for items that are known to be present and known not to be present  Select more than one database from the set of databases and initiate user searches for items that are known to be present and known not to be present

Partition Testing  Input data and output results of a program usually fall into a number of different classes that have common characteristics such as positive numbers, negative numbers, and menu selections  Programs normally behave in a comparable way for all members of a class  Because of this equivalent behaviour, these classes are sometimes called equivalent partitions or domains  Test cases should be chosen from each partition

Equivalence Partitioning (1/2)

Equivalence Partitioning (2/2)

Search Routine Specification procedure Search (Key : ELEM; T: SEQ of ELEM; Found : in out BOOLEAN; L : in out ELEM_INDEX); Pre-condition -- the sequence 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 sequence (not Found and not (exists i, T’FIRST <= i <= T’LAST, T(i) = Key))

Testing Guidelines (Sequences)  Test with sequences of zero length  Test with sequences which have only a single value  Use different sequences of different sizes in different tests  Derive tests so that the first, middle and last elements of the sequence are accessed

Search Routine – Input Partitions

Structural Testing (1/2)  The tests are derived from knowledge of the software’s structure and implementation  This testing is sometimes called ‘white-box’, ‘glass-box’ testing or ‘clear-box’ testing to distinguish it from black- box testing  Understanding the algorithm used in a component can help us identify further partitions and test cases

Structural Testing (2/2)

Path Testing (1/2)  Path testing is a structural testing strategy whose objective is to exercise every independent execution path through a component or a program  If every independent path is executed, then all statements in the component must have been executed at least once  Furthermore, all conditional statements are tested for both true and false cases

Path Testing (2/2)  The starting point for path testing is a program flow graph that is a skeletal model of all paths through the program  A flow graph consists of nodes representing decisions and edges showing flow of control  The flow graph is constructed by replacing program control statements with equivalent diagrams

Flow Graph For Binary Search

Independent Paths  1, 2, 8, 9  1, 2, 3, 8, 9  1, 2, 3, 4, 5, 7, 2, …  1, 2, 3, 4, 6, 7, 2, …  Test cases should be derived so that all of these paths are executed  A dynamic program analyzer may be used to check that paths have been executed