Chapter-5 (Testing Strategy)

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

Software Testing Strategies
Chapter 11, Testing, Part 2: Integration and System Testing
1 Integration Testing CS 4311 I. Burnstein. Practical Software Testing, Springer-Verlag, 2003.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 11: Integration- and System Testing.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
Integration testing Satish Mishra
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Illinois Institute of Technology
Outline Types of errors Component Testing Testing Strategy
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 11: Integration- and System Testing.
Software Testing & Strategies
Software Engineering Lecture 13 Software Testing Strategies 1.
Issues on Software Testing for Safety-Critical Real-Time Automation Systems Shahdat Hossain Troy Mockenhaupt.
Chapter 13 & 14 Software Testing Strategies and Techniques
System/Software Testing
Testing Chapter 11. Dealing with Errors Verification: –Makes assumptions –Doesn’t always deal with real environment Testing (this lecture) –Testing is.
Programinės Įrangos Testavimo Strategijos
ECE 355: Software Engineering
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Overview Integration Testing Decomposition Based Integration
SOFTWARE TESTING STRATEGIES CIS518001VA : ADVANCED SOFTWARE ENGINEERING TERM PAPER.
INT-Evry (Masters IT– Soft Eng)IntegrationTesting.1 (OO) Integration Testing What: Integration testing is a phase of software testing in which.
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
1 Software Engineering Muhammad Fahad Khan Software Engineering Muhammad Fahad Khan University Of Engineering.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
1 Chapter 7 Software Testing Strategies. 2 Software Testing Testing is the process of exercising a program with the specific intent of finding errors.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 11, Testing, Part 2: Integration and System Testing.
CSC 480 Software Engineering Test Planning. Test Cases and Test Plans A test case is an explicit set of instructions designed to detect a particular class.
1 Software Testing Strategies: Approaches, Issues, Testing Tools.
What is a level of test?  Defined by a given Environment  Environment is a collection of people, hard ware, software, interfaces, data etc.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Software Engineering By Germaine Cheung Hong Kong Computer Institute Lecture 7.
Chapter 11, Testing, Part 2: Integration and System Testing
Software Testing Strategies for building test group
Software Testing.
SOFTWARE TESTING Date: 29-Dec-2016 By: Ram Karthick.
Group mambers: Maira Naseer (BCS ).
Integration Testing.
Chapter 11, Testing, Part 2: Integration and System Testing
Chapter 11, Testing, Part 2: Integration and System Testing
Software Engineering: A Practitioner’s Approach, 6/e Chapter 13 Software Testing Strategies copyright © 1996, 2001, 2005 R.S. Pressman & Associates,
Levels Of Testing and Special Tests
Chapter 13 & 14 Software Testing Strategies and Techniques
Chapter 11, Testing, Part 2: Integration and System Testing
Applied Software Implementation & Testing
Lecture 09:Software Testing
Software System Integration
Verification and Validation Unit Testing
Higher-Level Testing and Integration Testing
Testing and Test-Driven Development CSC 4700 Software Engineering
Chapter 17 Software Testing Strategies
Chapter 10 – Software Testing
Integration Testing CS 4311
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
System Testing.
Chapter 17 Software Testing Strategies
Chapter 17 Software Testing Strategies
Chapter 17 Software Testing Strategies.
Chapter 17 Software Testing Strategies
Chapter 11: Integration- and System Testing
Chapter 11: Integration and System Testing
Chapter 17 Software Testing Strategies
CS410 – Software Engineering Lecture #11: Testing II
Integration Testing.
Software Testing Strategies
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

Chapter-5 (Testing Strategy) Chapter-17(Pressman)

Software Testing Strategy A Software Testing Strategy

Software Testing Steps High-order tests Integration test Unit test Testing direction code design requirements

Levels of Testing for Conventional Software i) Unit testing Concentrates on each component/function of the software as implemented in the source code ii) Integration testing Focuses on the design and construction of the software architecture iii) Validation testing Requirements are validated against the constructed software iv) System testing The software and other system elements are tested as a whole

Strategic Testing Issues Specify product requirements in a quantifiable manner before testing starts. Specify testing objectives explicitly. Identify the user classes of the software and develop a profile for each. Develop a test plan that emphasizes rapid cycle testing. Build robust software that is designed to test itself Use effective formal reviews as a filter prior to testing. Conduct formal technical reviews to assess the test strategy and test cases.

A Software Testing Strategy System Engineering Requirements Design Code Unit Test Integration Validation

Logical Organization of Testing ( Not necessarily how it’s actually done! ) Component code Unit test Tested component Component code Unit test Integration test System test Integrated modules System in use Ensures that all components work together Component code Unit test Function test Quality test Acceptance test Installation test Ensure that each component works as specified Verifies that functional requirements are satisfied Verifies non-functional requirements Customer verifies all requirements Testing in user environment 7 7

COMPONENT/UNIT TESTING 8

Unit Testing Verification of the smallest unit in software - the module White box oriented Can be conducted in parallel for multiple modules Unit test cases designed based on source code – Test environment includes driver and/or stubs

Unit Test Environment interface local data structures driver interface local data structures Module boundary conditions independent paths error handling paths stub stub test cases RESULTS

Drivers and Stubs for Unit Testing A simple main program that accepts test case data, passes such data to the component being tested, and prints the returned results Stubs Serve to replace modules that are subordinate to (called by) the component to be tested It uses the module’s exact interface, may do minimal data manipulation, provides verification of entry, and returns control to the module undergoing testing Drivers and stubs both represent overhead Both must be written but don’t constitute part of the installed software product

Driver Module to be tested Stub …..

Stubs and drivers Driver: Stub: 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

Unit-testing Heuristics 1. Create unit tests as soon as object design is completed: Black-box test: Test the use cases & functional model White-box test: Test the dynamic model Data-structure test: Test the object model 2. Develop the test cases Goal: Find the minimal number of test cases to cover as many paths as possible 3. Cross-check the test cases to eliminate duplicates Don't waste your time! 4. Desk check your source code Reduces testing time 5. Create a test harness Test drivers and test stubs are needed for integration testing 6. Describe the test oracle Often the result of the first successfully executed test 7. Execute the test cases Don’t forget regression testing Re-execute test cases every time a change is made. 8. Compare the results of the test with the test oracle Automate as much as possible

INTEGRATION TESTING 15

Logical Organization of Testing ( Not necessarily how it’s actually done! ) Component code Unit test Tested component Component code Unit test Integration test System test Integrated modules System in use Ensures that all components work together Component code Unit test Function test Quality test Acceptance test Installation test Ensure that each component works as specified Verifies that functional requirements are satisfied Verifies non-functional requirements Customer verifies all requirements Testing in user environment 16 16

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. For the selection of the subsystems we use the system decomposition from System Design Kürzen? Tonspur: Übergang Unit Test zu Integration

Why do we do integration testing? Unit tests only test the unit in isolation Many failures result from faults in the interaction of subsystems Often many 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.

Integration testing Big bang Bottom up Top down Sandwich Continuous

Big-Bang Approach Test A Test B Test C Test A, B, C, D, Test D E, F, G This unit tests each of the subsystems, and then does one gigantic integration test, in which all the subsystems are immediately tested together. Don‘t try this!! Why: The interfaces of each of the subsystems have not been tested yet. Test E Test F Test G

Bottom-up Testing Strategy The subsystems in the lowest layer of the call hierarchy are tested individually Then the next subsystems are tested that call the previously tested subsystems This is repeated until all subsystems are included Drivers are needed.

Bottom-up Integration C E F G D B A B C D Test E E F G Test B, E, F Test F This unit tests each of the subsystems, and then does one gigantic integration test, in which all the subsystems are immediately tested together. Don‘t try this!! Why: The interfaces of each of the subsystems have not been tested yet. Test A, B, C, D, E, F, G Test C Test G Test D,G

Bottom Up Approach

Pros and Cons of Bottom-Up Integration Testing Tests the most important subsystem (user interface) last Drivers needed Pro No stubs needed Useful for integration testing of the following systems Object-oriented systems Real-time systems Systems with strict performance requirements.

Top-down Testing Strategy Test the top layer or the controlling subsystem 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 test Stubs are needed to do the testing.

Top-down Integration Test A, B, C, D, E, F, G Test A Test A, B, C, D This unit tests each of the subsystems, and then does one gigantic integration test, in which all the subsystems are immediately tested together. Don‘t try this!! Why: The interfaces of each of the subsystems have not been tested yet. Test A Test A, B, C, D Layer I Layer I + II All Layers

Integration Testing for Structural Software Top Down Integration A top module is tested with stubs B F G stubs are replaced one at a time, "depth first" C as new modules are integrated, some subset of tests is re-run D E

Pros and Cons of Top-down Integration Testing Test cases can be defined in terms of the functionality of the system (functional requirements) No drivers needed Cons 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.

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. How do you select the target layer if there are more than 3 layers? Heuristic: Try to minimize the number of stubs and drivers

Sandwich Testing Strategy B C D Test A E F G Test A,B,C, D Test E Test A, B, C, D, E, F, G Anpassen Test B, E, F Test F Test D,G Test G

Pros and Cons of Sandwich Testing Top and Bottom Layer Tests can be done in parallel Problem: Does not test the individual subsystems and their interfaces thoroughly before integration Solution: Modified sandwich testing strategy

Modified Sandwich Testing Strategy Test in parallel: Middle layer with drivers and stubs Top layer with stubs Bottom layer with drivers Top layer accessing middle layer (top layer replaces drivers) Bottom accessed by middle layer (bottom layer replaces stubs).

Modified Sandwich Testing B C D Test A Test A,C Test C E F G Test B Test A, B, C, D, E, F, G Test E Test B, E, F Test F Test D Test D,G Test G

Continuous/smoke Testing Continuous build: Build from day one Test from day one Integrate from day one System is always run able Requires integrated tool support: Continuous build server Automated tests with high coverage Tool supported refactoring Software configuration management Issue tracking.

Smoke Testing Software components already translated into code are integrated into a build. A series of tests designed to expose errors that will keep the build from performing its functions are created. The build is integrated with the other builds and the entire product is smoke tested daily using either top-down or bottom integration.

Continuous Testing Strategy Spread SheetView Layer I B C D Data Model Calculator Currency Converter Layer II SCRUM Scheibe vom Brot XXXX E F G BinaryFile Storage XMLFile Storage Currency DataBase Layer III + Cells + Addition Sheet View + File Storage

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. .

Validation Testing A series of black box tests that demonstrate conformity with requirements Test that software functions as expected by customer Test plan and details can be based on software requirements specification

Logical Organization of Testing ( Not necessarily how it’s actually done! ) Component code Unit test Tested component Component code Unit test Integration test System test Integrated modules System in use Ensures that all components work together Component code Unit test Function test Quality test Acceptance test Installation test Ensure that each component works as specified Verifies that functional requirements are satisfied Verifies non-functional requirements Customer verifies all requirements Testing in user environment 39 39

System Testing A series of tests to fully exercise a computer-based system Verify that all system elements have been properly integrated and perform allocated functions Software is one element to be integrated Software engineer to anticipate potential interfacing problems

System Testing Functional Testing Performance Testing Validates functional requirements Performance Testing Validates non-functional requirements Acceptance Testing Validates clients expectations When we are system testing, we are testing all subsystems together. The requirements have a large impact on the quality of system testing: The more explicit the requirements, the easier they are to test. We distinguish the following types of system testing Let’s walk through each of these system testing types

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. Essentially the same as black box testing Unit test cases can be reused, but in end user oriented systems new test cases have to be developed as well. .

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? Push the (integrated) system to its limits.

Types of Performance Testing Stress/load 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, maintain- ability & availability Recovery testing Test system’s response to presence of errors or loss of data Human factors testing Test with end users. Stress Testing Stress limits of system (maximum # of users, peak demands, extended operation) 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 Security testing Try to violate security requirements

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 Majority of all bugs in software is typically found by the client after the system is in use, not by the developers or testers. Therefore two kinds of additional tests: Alpha test Beta test: … One disadvantage: Potential customers might get discouraged

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

Test Team Test Team Professional Tester Analyst System Designer User too familiar Programmer with code Analyst System Designer Test User Team Configuration Management Specialist

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.

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): Control structures Test branches, loops, ... Data structures Test records fields, arrays, ... 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. Rauslassen?

High Order Testing Validation testing System testing Focus is on software requirements System testing Focus is on system integration Alpha/Beta testing Focus is on customer usage Recovery testing forces the software to fail in a variety of ways and verifies that recovery is properly performed Security testing verifies that protection mechanisms built into a system will, in fact, protect it from improper penetration Stress testing executes a system in a manner that demands resources in abnormal quantity, frequency, or volume Performance Testing test the run-time performance of software within the context of an integrated system

Regression Testing Conducted after a change Regression test aims to verify whether new faults are introduced 51

Regression testing Selective re-testing of a system or component to verify that modifications have not caused unintended effects Can be conducted at each of the test levels: unit, integration, system Modifications Changed Version X+1 Version X 52

Regression Testing regression test is not a separate level of but may refer to the retesting of a unit, integration and system after modification, in order to ascertain that the change has not introduced new faults