Software testing.

Slides:



Advertisements
Similar presentations
Software testing.
Advertisements

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.
©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.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
©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.
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 Defect testing l Testing programs to establish the presence of system defects.
©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.
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.
Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim.
©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.
©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)
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
©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.
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.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Defect testing Testing programs to establish the presence of system defects.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Chapter 9 Software Testing
Validation & Verification
Software Engineering (CSI 321)
IS301 – Software Engineering V:
Chapter 7 Software Testing.
Lecture 09:Software Testing
Testing and Test-Driven Development CSC 4700 Software Engineering
Software testing.
Software Testing & Quality Management
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
CS310 Software Engineering Dr.Doaa Sami Khafaga
Software Testing “If you can’t test it, you can’t design it”
Defect testing Testing programs to establish the presence of system defects.
Chapter 7 Software Testing.
Presentation transcript:

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 test cases

Topics covered System testing Component testing Test case design

Basic definitions A failure is an unacceptable behaviour exhibited by a system The frequency of failures measures the reliability An important design objective is to achieve a very low failure rate and hence high reliability. A failure can result from a violation of an explicit or implicit requirement A defect is a flaw in any aspect of the system that contributes, or may potentially contribute, to the occurrence of one or more failures could be in the requirements, the design and the code It might take several defects to cause a particular failure An error is a slip-up or inappropriate decision by a software developer that leads to the introduction of a defect

What is efect testing fi Testing is: tllé f OcesS of exei•cising :i progi-.i in finding ei-row-s

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

Types of testing - Integration Gesture Interface testing StieSS téSt$J1@ Object-oiieuted (OO) testioe XP Autom.xte5 testing Res;lessioii testing ACCé]3lIlllCC: IC:Sll11£t Monkey testing

Statistics: Defect Distribution in SW Life Cycle Defect Distributrion in Software Processes Others 10% Code "SW Life Cycle' O Requirements e Design O Code o Others Requirements 56% Design 27%

Testing Veñfıcation Validation Testing = Verifıcation + Validation Verifıcañon: Static Testing (no run) Vafidañon: Dynamic Testùıg @un code)

Who ests the oftware Independent tester - tu›‹lcı s î rıłt‹is ?lte «ystet11

The testing process System Testing: Involves integrating components to create a system or sub- system. May involve testing an increment to be delivered to the customer. Integration testing - the test team have access to the system source code. The system is tested as components are integrated. Release testing - the test team test the complete system to be delivered as a black-box.

Testing phases

Testing process goals Validation testing Defect testing To demonstrate to the developer and the system customer that the software meets its requirements; A successful test shows that the system operates as intended. Defect testing To discover faults or defects in the software where its behaviour is incorrect or not in conformance with its specification; A successful test is a test that makes the system perform incorrectly and so exposes a defect in the system.

The software testing process

Test data and test cases T Inputs to test the system Test casc• ’Test scenario T Inputs to test the system T and the predicted outputs includes.•

Testing policies Only exhaustive testing can show a program is free from defects. However, exhaustive testing is impossible. Testing policies define the approach to be used in selecting system tests: All functions accessed through menus should be tested; Combinations of functions accessed through the same menu should be tested; Where user input is required, all functions must be tested with correct and incorrect input.

Exhaus ive estin loop < 20 X paths and we execute it would take 3,170

System testing Involves integrating components to create a system or sub-system. May involve testing an increment to be delivered to the customer. Two phases: Integration testing - the test team have access to the system source code. The system is tested as components are integrated. Release testing - the test team test the complete system to be delivered as a black-box.

Integration testing

Incremental integration testing Recall: XP Continuous Integration of: Stories + (Acceptance & Unit Tests)

Top-down integration testing

Bottom-up integration testing Level N-1 Level N-1 Level N-1 Test drivers Te s seq u ting ence Level N Level N Level N Level N Level N Test drivers

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.

Black-box testing

Black-box testing Testers provide the system with inputs and observe the outputs They can see none of: The source code The internal data Any of the design documentation describing the system’s internals

Black-box testing

Black-box testing

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 input series several times; Force invalid outputs to be generated; Force computation results to be too large or too small.

Use cases Use cases can be a basis for deriving the tests for a system. They help identify operations to be tested and help design the required test cases. From an associated sequence diagram, the inputs and outputs to be created for the tests can be identified. Use cases and sequence diagram can be used during both integration and release testing.

Component testing Component or unit testing is the process of testing individual components in isolation. It is a defect testing process. Components may be: Individual functions or methods within an object; Object classes with several attributes and methods; Composite components with defined interfaces used to access their functionality.

Object class testing Complete test coverage of a class involves Testing all operations associated with an object; Setting and interrogating all object attributes; Exercising the object in all possible states. Inheritance makes it more difficult to design object class tests as the information to be tested is not localised.

Object class testing

Interface testing

Interface testing

Partition testing

Interfaces types

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: Requirements-based testing; Partition testing; Structural testing. Path testing

Requirements based testing A general principle of requirements engineering is that requirements should be testable. Requirements-based testing is a validation testing technique where you consider each requirement and derive a set of tests for that requirement.

LIBSYS requirements The user shall be able to search either all of the initial set of databases or select a subset from it. The system shall provide appropriate viewers for the user to read documents in the document store. 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.

LIBSYS tests Initiate user search for searches for items that are known to be present and known not to be present, where the set of databases includes 1 database. Initiate user searches for items that are known to be present and known not to be present, where the set of databases includes 2 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 2 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 searches for items that are known to be present and known not to be present.

Partition testing Input data and output results often fall into different classes where all members of a class are related. Each of these classes is an equivalence partition or domain where the program behaves in an equivalent way for each class member. Test cases should be chosen from each partition.

Equivalence partitioning

Equivalence partitioning

Equivalence partitioning

Equivalence partitioning

Equivalence partitioning: Example

Equivalence partitioning: Example

Equivalence partitioning: Example

Structural testing Sometime called white-box testing. Derivation of test cases according to program structure. Knowledge of the program is used to identify additional test cases. Objective is to exercise all program statements (not all path combinations).

Structural testing: White-box testing

Structural testing: White-box testing

Binary search - equiv. partitions Pre-conditions satisfied, key element in array. Pre-conditions satisfied, key element not in array. Pre-conditions unsatisfied, key element in array. Pre-conditions unsatisfied, key element not in array. Input array has a single value. Input array has an even number of values. Input array has an odd number of values.

Binary search equiv. partitions

Binary search - test cases Input array (T) 17 17 17, 21, 23, 29 9, 16, 18, 30, 31, 41, 45 17, 18, 21, 23, 29, 38, 41 17, 18, 21, 23, 29, 33, 38 12, 18, 21, 23, 32 21, 23, 29, 33, 38 Key (Key) Output (Found, L) 17 true, 1 0 false, ?? 45 true, 7 23 true, 4 21 true, 3 25 false, ??

Path testing The objective of path testing is to ensure that the set of test cases is such that each path through the program is executed at least once. The starting point for path testing is a program flow graph that shows nodes representing program decisions and arcs representing the flow of control. Statements with conditions are therefore nodes in the flow graph.

Program flow graphs

Cyclomatic complexity

Binary search flow graph

Independent paths

Key points Testing can show the presence of faults in a system; it cannot prove there are no remaining faults. Component developers are responsible for component testing; system testing is the responsibility of a separate team. Integration testing is testing increments of the system; release testing involves testing a system to be released to a customer.

Key points Use experience and guidelines to design test cases in defect testing. Equivalence partitioning is a way of discovering test cases - all cases in a partition should behave in the same way. Structural analysis relies on analysing a program and deriving tests from this analysis.