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

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

Chapter 8 Software Testing. Chapter 8 Software testing

Chapter 8 Software Testing. Chapter 8 So-ware tes0ng

Chapter 8 Software Testing

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

Lecture 15 Software Testing

Software testing. Objectives. Contents

Modern Methods in Software Engineering. Testing.

Part 5. Verification and Validation

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

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 Engineering Fall 2014

Recap on SDLC Phases & Artefacts. Topic: Software Verification, Validation and Testing Software Engineering

The testing process. Component testing. System testing

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

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

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

Darshan Institute of Engineering & Technology for Diploma Studies

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

CS 424 Software Quality Assurance & Testing LECTURE 3 BASIC CONCEPTS OF SOFTWARE TESTING - I

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

Chapter 9. Software Testing

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

MONIKA HEINER.

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

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

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

Write perfect C code to solve the three problems below.

Testing is executing a system in order to identify any gaps, errors, or missing requirements in contrary to the actual requirements.

Aerospace Software Engineering

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

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

Software Quality Assurance. David Janzen

An Introduction to Systematic Software Testing. Robert France CSU

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

LECTURE 8 TEST DESIGN TECHNIQUES - I

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

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

Comparison Study of Software Testing Methods and Levels- A Review

Software Engineering

Testing: Test design and testing process

[IT6004-SOFTWARE TESTING] UNIT 2

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

The Importance of Test

People tell me that testing is

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

Software Testing. Software Testing

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

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

Lecture 3. Black- box Tes3ng

Verification and Validation

Software Engineering I. Chapters 8 & 9. SW Testing & Maintenance. Slide 1. 12/17/2017 SW Testing and Maintenance

Software Testing Interview Question and Answer

Software Quality Assurance & Testing

Requirements Engineering: Specification & Validation. Software Requirements and Design CITS 4401 Lecture 18

Theme 2 Program Design and Testing

Software Testing. Testing: Our Experiences

Software Testing. 1. Testing is the process of demonstrating that errors are not present.

Sample Exam Syllabus

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS SOFTWARE ENGINEERING

Black-box Testing Techniques

Equivalence Class Partitioning and Boundary Value Analysis -Black Box Testing Techniques

Verification and Validation

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

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

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

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

Ontology Summit 2013: Ontology Evaluation Across the Ontology Lifecyle Track B: Extrinsic Aspects of Ontology Evaluation

Types of Dynamic System Testing. Testing Practice. Lecture 9

Darshan Institute of Engineering & Technology Unit : 9

Test Design Techniques ISTQB (International Software Testing Qualifications Board)

Ch 4: Requirements Engineering. What are requirements?

Chapter 10. Testing and Quality Assurance

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

Chapter 3: Dynamic Testing Techniques

Deliver robust products at reduced cost by linking model-driven software testing to quality management.

Verification and Validation. Verification and validation

WHY TEST SOFTWARE?...

Objectives. Chapter 19. Verification vs. validation. Topics covered. Static and dynamic verification. The V&V process

Verification, Testing, and Bugs

1: Specifying Requirements with Use Case Diagrams

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

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

Part B R&D Project Plans. R&D Project Plan for Project 1. Project Title: Travelogix Wholesale System Project Manager: Date: 30/09/2012.

Testing. Topics. Types of Testing. Types of Testing

Ingegneria del Software Corso di Laurea in Informatica per il Management

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

Ingegneria del Software II academic year: Course Web-site: [

CSE 403 Lecture 13. Black/White-Box Testing. Reading: Software Testing: Principles and Practices, Ch. 3-4 (Desikan, Ramesh)

Testing & Debugging TB-1

Chapter 9 Quality and Change Management

Examination Questions Time allowed: 1 hour 15 minutes

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

Software Testing. An Overview

Pearson Education 2007 Chapter 9 (RASD 3/e)

Testing & Continuous Integration. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 20 03/19/2010

Software Testing. Massimo Felici IF

Software testing A.A. 2018/2019

YourStore A GUIDE TO

Transcription:

Software Testing in the textbook Software Testing Chapter 8 Introduction (Verification and Validation) 8.1 Development testing 8.2 Test-driven development 8.3 Release testing 8.4 User testing 1 2 Verification and Validation Verification: - The software should conform to its specification (the functional and non-functional requirements). "Are we building the product right. Validation: - The software should do what the customer really requires. "Are we building the right product. Requirements don t always reflect real wishes and needs of customers and users 3 Verification Techniques Static verification - Inspections, reviews - Analyze static system representations to discover problems - Applies to: specifications, design models, source code, test plans Dynamic verification - Testing - The system is executed with simulated test data - Check results for errors, anomalies, and data regarding non-functional requirements. 4

Requirements specification System prototype Verification Techniques Verification at different stages in the software process Software architecture Inspections UML design models 5 Database schemas Program Testing Testing Concepts Failure - Deviation between the specification and the actual behavior of the system. Fault (aka bug or defect ) - A design or coding mistake that may cause abnormal behavior (with respect to specifications) Test case - set of inputs and expected results that exercises a system (or part) with the purpose of detecting faults Testing - the systematic attempt to find faults in a planned way in the implemented software. 6 Test cases Black-box and White-box testing Test cases should contain the following: Name - Explains what is being tested Input - Set of input data and/or commands and/or actions Expected results - Output or state or behavior that is correct for the given input. Different kinds of test cases: Black-box tests - focus on input/output behavior of the software - are not based on how the software is structured or implemented. White-box tests: - focus on the internal structure of the software - an internal perspective of the system is used to design test cases. - goal: test all parts of code in the software 7 8

Test stubs and drivers How to test units/components in isolation: test driver - code that simulates the part of the system that calls the component under test. - often provides the input for a given test case - this code is in a function that is executed during the test test stub - code that simulates a component that is called by the tested component - must support the called component s interface, and return a value of the appropriate type. Testing Activities/Methods For each kind of testing activity we consider: Who performs the tests? - Developers, independent testing team, users, customers What are the constraints of the tests? - test a certain part of the system? - test the system at a certain point in the process? How are the test-cases developed? - where does the data come from? - what data to use? - what functionality is tested? 9 10 Software testing activities: Who performs the test? 8.1 Development testing: - developers test the system during development 8.3 Release testing: - a separate testing team tests a complete version of the system before it is released to users. 8.4 User testing: - Customers and users (or potential users) of a system test the system in their own environment. 8.1 Development testing Which parts are tested? Unit testing - individual program units (i.e. classes) are tested Component testing - system components (composed of individual units) are tested to make sure the contained units interact correctly. System testing - the system components are integrated and the system is tested as a whole. 11 12

Unit testing Unit testing: - individual program units are tested in isolation - focus is on testing functionality of the units Goal: complete test coverage of a class: - Testing all operations associated with an object - Setting and interrogating all object attributes - Exercising the object in all possible states Why focus on such small units? - reduces complexity of overall test activities - makes it easier to pinpoint faults - different objects can be tested concurrently Unit testing: How are test cases developed? Partition (or equivalence) testing: - identify groups of inputs that have common characteristics and should be processed the same way by the system Guideline based testing - use guidelines that reflect the kinds of errors programmers often make Path testing - exercise all possible paths through the code at least once State-based testing - define sequences of events to force all possible transitions. 13 14 Partition testing Divide the set of all possible input data of a software unit into partitions - program should behave similarly for all data in a given partition - Determine partitions from specifications Design one test case for each partition, using test input from the given partition. - If the partition is a range, also test boundary values. Enables good test coverage with fewer test cases. Partition testing: example Function returning the number of days in a month: int getnumdaysinmonth(int month, int year); Partition month value year value Month with 31 days, non-leap years 7 (July) 1901 Months with 31 days, leap years 7 (July) 1904 Months with 30 days, non-leap years 6 (June) 1901 Month with 30 days, leap year 6 (June) 1904 Month with 28 or 29 days, non-leap year 2 (February) 1901 Month with 28 or 29 days, leap year 2 (February) 1904 15 16

Guideline-based testing Choose test cases based on previous experience of common programming errors For example: - Choose inputs that force the system to generate all error messages - Repeat the same input or series of inputs numerous times - Try to force invalid outputs to be generated - Force computation results to be too large or too small. - Test sequences/lists using one element zero elements different sizes in different tests 17 Path testing Exercise all possible paths through the code at least once - a white-box testing technique - convert code to control-flow (or UML activity) diagram - choose input data so that each path through diagram is executed Example: Make sure that at least one test case forces each oval to execute: one with valid password one with invalid password one that requires a change one that doesn t require a change 18 State-based testing Define sequences of events to force all possible transitions in a UML state diagram - Identify sequences of state transitions to be tested - Write test cases that generates the event sequences to cause these transitions. - Verify that the program ends up in the expected state. sequences from the diagram on the next slide: - Shutdown -> Running-> Shutdown - Configuring-> Running-> Testing -> Transmitting -> Running - Running-> Collecting-> Running-> Summarizing -> Transmitting -> Running 19 State-based testing: example (weather station) shutdown() remotecontrol() reportstatus() restart() Shutdown Running Testing reconfigure() powersave() Configuring Operation configuration done clock Collecting Controlled collection done Shutdown -> Running-> Shutdown is tested with a call to restart() followed by a call to shutdown(), then check the state 20 transmission done Summarizing reportweather() Transmitting test complete weather summary complete

Component testing Interface (component) testing Component testing - System components (composed of individual units) are tested to make sure the units interact correctly. - The functionality of these objects is accessed through the defined component interface. Component testing is demonstrating that the component interface behaves according to its specification. - Assuming the subcomponents (objects) have already been unit-tested A Test cases C B Small empty boxes represent the interface 21 22 System testing System testing - the components in a system are integrated and the system is tested as a whole. Checks that: - components are compatible, - components interact correctly - components transfer the right data at the right time across their interfaces. Tests the interactions between components. 8.3 Release testing Release Testing - testing a particular release of a system that is intended for use outside of the development team. Similar to system testing, but - Tested by a team other than developers. - Focus is on demonstrating system meets requirements. Primary goal: convince the supplier of the system that it is good enough for use. Black-box testing process where tests are derived from the system specification. 23 24

System and Release testing: How are test cases developed? Use case-based testing: - use the use-cases developed during requirements engineering to develop test cases. Scenario testing - use scenarios (user stories) developed during requirements engineering to develop test cases. Requirements-based testing - examine each requirement in the SRS and develop one or more tests for it. Use case-based testing: example Use case name PurchaseTicket Entry condition Flow of events The Passenger is standing in front of ticket Distributor. The Passenger has sufficient money to purchase ticket. 1. The Passenger selects the number of zones to be traveled. If the Passenger presses multiple zone buttons, only the last button pressed is considered by the Distributor. 2. The Distributor displays the amount due. 3. The Passenger inserts money. 4. If the Passenger selects a new zone before inserting sufficient money, the Distributor returns all the coins and bills inserted by the Passenger. 5. If the passenger inserted more money than the amount due, the Distributor returns excess change. 6. The Distributor issues tickets. 7. The Passenger picks up the change and the ticket. Exit condition The Passenger has the selected ticket. 25 26 Developing the test from the use case: The PurchaseTicket use case describes the normal interaction between the Passenger actor and the Distributor. Three features of the Distributor are likely to fail and should be tested: 1. The Passenger may press multiple zone buttons before inserting money, in which case the Distributor should display the amount of the last zone. 2. The Passenger may select another zone button after beginning to insert money, in which case the Distributor should return all money inserted by the Passenger. 3. The Passenger may insert more money than needed, in which case the Distributor should return the correct change. 27 Purchase Ticket use case test case Test case name PurchaseTicket_Common Case Entry condition Flow of events Exit condition The Passenger is standing in front of ticket Distributor. The Passenger has two $5 bills and three dimes. 1.The Passenger presses in succession the zone buttons 2, 4, 1, and 2. 2.The Distributor displays in succession $1.25, $2.25, $0.75, and $1.25. 3.The Passenger inserts a $5 bill. 4.The Distributor returns three $1 bills and three quarters and issues a 2- zone ticket. 5.The Passenger repeats steps 1-4 using his second $5 bill. 6.The Passenger repeats steps 1-3 using four quarters and three dimes. The Distributor issues a 2-zone ticket and returns a nickel. 7.The Passenger selects zone 1 and inserts a dollar bill. The Distributor issues a 1-zone ticket and returns a quarter. 8.The Passenger selects zone 4 and inserts two $1 bills and a quarter. The Distributor issues a 4-zone ticket. 9.The Passenger selects zone 4. The Distributor displays $2.25. The Passenger inserts a $1 bill and a nickel, and selects zone 2. The Distributor returns the $1 bill and the nickel and displays $1.25. The Passenger has three 2-zone tickets, one 1-zone ticket, and one 4-zone ticket. 28

Scenario testing A scenario is a story that describes one way in which the system might be used - Longer than an interaction To use a scenario for release testing: - tester assumes role of user, acting out scenario - may make deliberate mistakes (as part of the scenario) - takes note of problems (slow response, errors, etc.) Tests several requirements and interactions at once, in combination. See example in book: Figure 8.10, section 8.3.2 Requirements-based testing Example requirements from MHC-PMS system: 1. If a patient is recorded as being allergic to any particular medication, then prescription of that medication shall result in a warning message being issued to the system user. 2. The system shall allow the prescriber to override an allergy warning by providing a reason why this has been ignored and the prescription will succeed. If no reason is provided, the prescription will fail. 29 30 Requirements-based testing Some tests developed to test the previous requirement: 1. Set up a patient record with no known allergies. Prescribe medication for allergies that are known to exist. Check that a warning message is not issued by the system, and that the prescription succeeds. 2. Set up a patient record with a known allergy. Prescribe the medication to that the patient is allergic to, and check that the warning is issued by the system. Accept the warning and make sure the prescription fails. 3. Set up a patient record with a known allergy. Prescribe the medication to that the patient is allergic to, and check that the warning is issued by the system. Provide a reason overruling the warning and make sure the prescription succeeds. 31 8.4 User testing User testing: - Customers and users (or potential users) of a system test the system in their own environment. Essential even when comprehensive system and release testing have been carried out. - Influences from the user s working environment have a major effect on the reliability, performance, usability and robustness of a system. - These cannot be replicated in a testing environment. 32

Types of user testing Alpha testing - Users of the software work with the development team to test the software at the developer s site. - generic or custom software Beta testing - A release of the software is made available to users to allow them to experiment and to report problems - generic or custom software Acceptance testing - Customers test a system to decide whether or not it is ready to be accepted from the system developers. - acceptance implies payment is due, may require negotiation. - custom software. 33