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

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

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

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

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

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

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

Software Engineering II Testing

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

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

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

Configuration & Build Management

Verification and Validation

Object Design II: Design Patterns

Software Testing Interview Question and Answer

Chapter 11, Testing Part 1: Unit Testing. <M. Cossentino>

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

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

Integration and Testing. Uses slides from Lethbridge & Laganiere, 2001

Testing & Debugging TB-1

Chapter 9. Software Testing

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

TDDD04: Integration and System level testing. Lena Buffoni

Verification and Validation. Verification and validation

Modern Methods in Software Engineering. Testing.

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

Chapter 9 Quality and Change Management

Pearson Education 2007 Chapter 9 (RASD 3/e)

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

Test Driven Development Building a fortress in a greenfield (or fortifying an existing one) Dr. Hale University of Nebraska at Omaha

Software Engineering Fall 2014

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

Software Testing. Testing: Our Experiences

Software Testing. Minsoo Ryu. Hanyang University. Real-Time Computing and Communications Lab., Hanyang University

Software Testing and Maintenance

Verification and Validation

Verification and Validation

Fault, Error, and Failure

Modern Systems Analysis and Design. Third Edition. Jeffrey A. Hoffer Joey F. George Joseph S. Valacich. Chapter 17 System Implementation

Agile Tester Foundation E-learning Course Outline

LEVELS OF TESTING AND SPECIAL TESTS

Test s in i g n III Week 16

Object-Oriented Software Engineering Practical Software Development using UML and Java

Software Testing Strategies. Slides copyright 1996, 2001, 2005, 2009, 2014 by Roger S. Pressman. For non-profit educational use only

Integration Testing Qualidade de Software 2

Software Testing. Integration Testing. Beat Fluri. software evolution & architecture lab

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

Darshan Institute of Engineering & Technology for Diploma Studies

Software Testing. Suppose you are asked:

Chapter 8 Software Testing. Chapter 8 Software testing

18-642: Testing Overview

Lecture 26: Testing. Software Engineering ITCS 3155 Fall Dr. Jamie Payton

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

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

UNIT OBJECTIVE. Understand what system testing entails Learn techniques for measuring system quality

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

Certified Tester Foundation Level(CTFL)

Lecture 15 Software Testing

Chapter 5, Analysis: Dynamic Modeling

Chap 2. Introduction to Software Testing

Bridge Course On Software Testing

Chapter 8, Object Design: Reuse and Patterns

Week 9 Implementation

An Introduction to Systematic Software Testing. Robert France CSU

Low Level Design Activities. Implementation (Low Level Design) What is a Good Low Level Module? Black Box Aspects. Black box aspects White box aspects

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

Continuous Prototyping: Unified Application Delivery from Early Design to Code

Software Testing CS 408

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS SOFTWARE ENGINEERING

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

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

Testing Objectives. Successful testing: discovers previously unknown errors

Computational Systems COMP1209

FAULT TOLERANCE. Fault Tolerant Systems. Faults Faults (cont d)

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

Test-driven development

ECE-492 SENIOR ADVANCED DESIGN PROJECT

Rational Software White paper

The requirements engineering process

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

Page 1. Dynamic Modeling. How do you find classes? Dynamic Modeling with UML. UML Interaction Diagrams. UML State Chart Diagram.

Chapter 5, Analysis: Dynamic Modeling

Digitized Engineering Notebook

Types of Software Testing: Different Testing Types with Details

PPSC Competitive Exam for the Post of System Analyst

Chapter 8, Design Patterns Visitor

Software Engineering (CSC 4350/6350) Rao Casturi

Ingegneria del Software Corso di Laurea in Informatica per il Management

CSE 374 Programming Concepts & Tools. Hal Perkins Fall 2015 Lecture 15 Testing

WHITEPAPER. Database DevOps with the Redgate Deployment Suite for Oracle

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

Continuous Integration / Continuous Testing

Software Testing part II (white box) Lecturer: Giuseppe Santucci

Software Quality Assurance (SQA) Software Quality Assurance

Topics in Software Testing

Introduction to Software Engineering: Analysis

Example of a Process in Use in an Organization

Testing: Test design and testing process

Transcription:

Object-Oriented Software Engineering Using UML, Patterns, and Java Chapter 11, Testing, Part 2: Integration and System Testing

Overview Integration testing Big bang Bottom up Top down Sandwich System testing Functional Performance Continuous Integration Acceptance testing Summary Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2

Integration Testing The entire system is viewed as a collection of subsystems (sets of classes) determined during the system and object design Goal: Test all interfaces between subsystems and the interaction of subsystems The integration testing strategy determines the order in which the subsystems are selected for testing and integration. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3

Why do we do integration testing? Unit tests only test the unit in isolation Many failures result from faults in the interaction of subsystems When Off-the-shelf components are used that cannot be unit tested Without integration testing the system test will be very time consuming Failures that are not discovered in integration testing will be discovered after the system is deployed and can be very expensive. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 4

Recall: Stubs and drivers Driver: A component, that calls the TestedUnit Controls the test cases Stub: A component, the TestedUnit depends on Partial implementation Returns fake values. Driver Tested Unit Stub Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 5

Recall: Taxonomy of Test Doubles There are 4 types of test doubles. All doubles try to make the SUT believe it is talking with its real collaborators: Dummy object: Passed around but never actually used. Dummy objects are usually used to fill parameter lists Fake object: A fake object is a working implementation, but usually contains some type of shortcut which makes it not suitable for production code (Example: A database stored in memory instead of a real database) Stub: Provides canned answers to calls made during the test, but is not able to respond to anything outside what it is programmed for Mock object: Mocks are able to mimic the behavior of the real object. They know how to deal with sequence of calls they are expected to receive. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 6

Example: A 3-Layer-Design A Spread A SheetView (Spreadsheet) Layer I B Entity Data B Model C Calculator C D Currency D Converter Layer II E F G BinaryFile XMLFile Currency E F G Storage Storage DataBase Layer III Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 7

Big-Bang Approach A Test A B C D Test B Test C Test D Test E Test F Test G E F G Test A, B, C, D, E, F, G The interfaces of each of the subsystems have not been tested yet à The diagnosis of what generates an error is very difficult Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 8

Top-down Testing Strategy Test the subsystems in the top layer first Then combine all the subsystems that are called by the tested subsystems and test the resulting collection of subsystems Do this until all subsystems are incorporated into the tests. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 9

Top-down Integration A B C D E F G Test A Test A, B, C, D Test A, B, C, D, E, F, G Layer I Layer I + II All Layers Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 10

Pros and Cons: Top-Down Integration Testing Pros: Test cases can be defined in terms of the functionality of the system (functional requirements) No drivers needed Cons: Stubs are needed Writing stubs is difficult: Stubs must allow all possible conditions to be tested Large number of stubs may be required, especially if the lowest level of the system contains many methods Some interfaces are not tested separately. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 11

Bottom-up Testing Strategy The subsystems in the lowest layer of the call hierarchy are tested individually Then the subsystems above this layer are tested that call the previously tested subsystems This is repeated until all subsystems are included. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 12

Bottom-up Integration A B C D Test E E F G Test B, E, F Test F Test C Test A, B, C, D, E, F, G Test G Test D,G Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 13

Pros and Cons: Bottom-Up Integration Testing Pro No stubs needed Useful for integration testing of the following systems Object-oriented systems Real-time systems Systems with strict performance requirements Con: Tests an important subsystem (the user interface) last Drivers are needed. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 14

Sandwich Testing Strategy Combines top-down strategy with bottom-up strategy The system is viewed as having three layers A target layer in the middle A layer above the target A layer below the target Testing converges at the target layer. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 15

Sandwich Testing Strategy A B C D Test A Test E Test A,B,C, D E F G Test F Test G Test B, E, F Test D,G Target Layer Test A, B, C, D, E, F, G Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 16

Pros and Cons of Sandwich Testing Pro: Top and bottom layer tests can be done in parallel Con: Does not test the individual subsystems and their interfaces thoroughly before integration Solution: Modified sandwich testing strategy. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 17

Modified Sandwich Testing Strategy A B C D Phase 1: Three integration tests in parallel Top layer test with stubs for lower layers Middle layer test with drivers and stubs Bottom layer test with drivers for upper layers Phase 2: Two more integration tests in parallel Top layer accessing middle layer (top layer replaces the drivers) Bottom layer accessed by middle layer (bottom layer replaces the stubs). E F G Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 18

Modified Sandwich Testing Strategy A B C D Phase 1: Three integration tests in parallel Top layer test with stubs for lower layers Middle layer test with drivers and stubs Bottom layer test with drivers for upper layers E F G A Driver-A Stub-B Stub-C Stub-D B C D Driver-B Driver-D Stub-E Stub-F Stub-G E F G Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 19

Modified Sandwich Testing (Phase 1) A B C D Test A Test B, C,D E F G Test E Test F Test G Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 20

Modified Sandwich Testing Strategy A B C D Phase 2: Two more integration tests in parallel Top layer accessing middle layer (top layer replaces the drivers) Bottom layer accessed by middle layer (bottom layer replaces the stubs). E F G A B C D B C D E F G Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 21

Modified Sandwich Testing (Phase 2) Top layer accessing middle layer (top layer replaces driver of phase 1 middle layer test B,C,D) A B C D Test A Test B, C,D Test A,B, C,D E F G Bottom layer accessed by middle layer (bottom layer replaces stubs for E and F) Test E Test B, E, F Test F Bottom layer accessed by middle layer (bottom layer replaces stub for G) Test G Test D,G Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 22

Modified Sandwich Testing (Final) Top layer accessing middle layer (top layer replaces driver of phase 1 middle layer test B,C,D) A B C D Test A Test B, C,D Test A,B, C,D E F G Bottom layer accessed by middle layer (bottom layer replaces stubs for E and F) Test E Test B, E, F Test A, B, C, D, E, F, G Test F Bottom layer accessed by middle layer (bottom layer replaces stub for G) Test G Test D,G Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 23

Risks in Integration Testing Strategies Risk #1: The higher the complexity of the software system, the more difficult is the integration of its components Risk #2: The later integration occurs in a project, the bigger is the risk that unexpected faults occur Bottom up, top down, sandwich testing (Horizontal integration strategies) don t do well with risk #2 Continous integration addresses these risks by building as early and frequently as possible Additional advantages: There is always an executable version of the system Team members have a good overview of the project status. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 24

Continuous Testing Strategy (Vertical Integration) A Spread SheetView Layer I B Data Model C Calculator D Currency Converter Layer II E BinaryFile Storage F XMLFile Storage G Currency DataBase Layer III Sheet View + Cells + Addition + File Storage Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 25

Definition Continuous Integration Continuous Integration: A software development technique where members of a team integrate their work frequently, usually each person integrates at least daily, leading to multiple integrations per day. Each integration is verified by an automated build which includes the execution of tests - regres to detect integration errors as quickly as possible. Source: http://martinfowler.com/articles/continuousintegration.html Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 26

Steps in Integration Testing 1. Based on the integration strategy, select a component to be tested. Unit test all the classes in. the component. 2. Put selected component together; do any preliminary fix-up necessary to make the integration test operational (drivers, stubs) 3. Test functional requirements: Define test cases that exercise all uses cases with the selected component 4. Test subsystem decomposition: Define test cases that exercise all dependencies 5. Test non-functional requirements: Execute performance tests 6. Keep records of the test cases and testing activities. 7. Repeat steps 1 to 7 until the full system is tested. The primary goal of integration testing is to identify failures with the (current) component configuration. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 27

System Testing Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 28

System Testing Functional Testing Validates functional requirements Performance Testing Validates non-functional requirements Acceptance Testing Validates clients expectations Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 29

Functional Testing Goal: Test functionality of system Test cases are designed from the requirements analysis document (better: user manual) and centered around requirements and key functions (use cases) The system is treated as black box Unit test cases can be reused, but new test cases have. to be developed as well. Note: previously used unit tests have been performed using drivers/stubs. Now the integrated system is tested Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 30

Performance Testing Goal: Try to violate non-functional requirements Test how the system behaves when overloaded. Can bottlenecks be identified? (First candidates for redesign in the next iteration) Try unusual orders of execution Call a receive() before send() Check the system s response to large volumes of data If the system is supposed to handle 1000 items, try it with 1001 items. What is the amount of time spent in different use cases? Are typical cases executed in a timely fashion? Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 31

Types of Performance Testing Stress Testing Stress limits of system Volume testing Test what happens if large amounts of data are handled Configuration testing Test the various software and hardware configurations Compatibility test Test backward compatibility with existing systems Timing testing Evaluate response times and time to perform a function Security testing Try to violate security requirements Environmental test Test tolerances for heat, humidity, motion Quality testing Test reliability, maintainability & availability Recovery testing Test system s response to presence of errors or loss of data Human factors testing Test with end users. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 32

Acceptance Testing Goal: Demonstrate system is ready for operational use Choice of tests is made by client Many tests can be taken from integration testing Acceptance test is performed by the client, not by the developer. Alpha test: Client uses the software at the developer s environment. Software used in a controlled setting, with the developer always ready to fix bugs. Beta test: Conducted at client s environment (developer is not present) Software gets a realistic workout in target environment Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 33

Testing has many activities Establish the test objectives Design the test cases Write the test cases Test the test cases Execute the tests Evaluate the test results Change the system Do regression testing Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 34

Test Team Analyst Professional Tester Programmer too familiar with code User Test Team System Designer Configuration Management Specialist Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 35

The 4 Testing Steps 1. Select what has to be tested Analysis: Completeness of requirements Design: Cohesion Implementation: Source code 2. Decide how the testing is done Review or code inspection Proofs (Design by Contract) Black-box, white box, Select integration testing strategy (big bang, bottom up, top down, sandwich) 3. Develop test cases A test case is a set of test data or situations that will be used to exercise the unit (class, subsystem, system) being tested or about the attribute being measured 4. Create the test oracle An oracle contains the predicted results for a set of test cases The test oracle has to be written down before the actual testing takes place. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 36

Guidance for Test Case Selection Use analysis knowledge about functional requirements (black-box testing): Use cases Expected input data Invalid input data Use design knowledge about system structure, algorithms, data structures (white-box testing): Use implementation knowledge about algorithms and datastructures: Force a division by zero If the upper bound of an array is 10, then use 11 as index. Control structures Test branches, loops,... Data structures Test records fields, arrays,... Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 37

Summary Testing is still a black art, but many rules and heuristics are available Testing consists of Unit testing Integration testing System testing Acceptance testing Testing has its own lifecycle Recommended practice: Continous integration Allows frequent integration during development (instead of after development). Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 38

Additional Reading Martin Fowler, Continous Integration, 2006 http://martinfowler.com/articles/ continuousintegration.html Paul M. Duvall, Steve Matyas and Andrew Glover Continuous Integration: Improving Software Quality and Reducing Risk, Addison Wesley 2007 Frameworks for Continous Integration CruiseControl (Open Source) http://cruisecontrol.sourceforge.net/ Hudson from Kohsuke Kawaguchi (Free Software) http://weblogs.java.net/blog/kohsuke/archive/ 2009/08/announcing_sun.html Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 39