Software Engineering TESTING Compiled by: Dr. S. Prem Kumar

Slides:



Advertisements
Similar presentations
Defect testing Objectives
Advertisements

1 Integration Testing CS 4311 I. Burnstein. Practical Software Testing, Springer-Verlag, 2003.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Software Failure: Reasons Incorrect, missing, impossible requirements * Requirement validation. Incorrect specification * Specification verification. Faulty.
ISBN Prentice-Hall, 2006 Chapter 8 Testing the Programs Copyright 2006 Pearson/Prentice Hall. All rights reserved.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Chapter 8 Testing the Programs Shari L. Pfleeger Joann M. Atlee 4th Edition.
Illinois Institute of Technology
Lecturer: Dr. AJ Bieszczad Chapter 87-1 How does software fail? Wrong requirement: not what the customer wants Missing requirement Requirement impossible.
Software Testing & Strategies
Bottom-Up Integration Testing After unit testing of individual components the components are combined together into a system. Bottom-Up Integration: each.
Software System Integration
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
CH08: Testing the Programs
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
Chapter 8 Testing the Programs Shari L. Pfleeger Joann M. Atlee
CS4311 Spring 2011 Verification & Validation Dr. Guoqiang Hu Department of Computer Science UTEP.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Software Testing.
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
Software Testing ©Dr. David A. Workman School of EE and Computer Science March 19, 2007.
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.
Testing Workflow In the Unified Process and Agile/Scrum processes.
Unit 7 Chapter 8 Testing the Programs. Unit 7 Requirements Read Chapters 8 and 9 Respond to the Unit 7 Discussion Board (25 points) Attend seminar/Take.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
Testing the programs In this part we look at classification of faults the purpose of testing unit testing integration testing strategies when to stop testing.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
ISBN Prentice-Hall, 2006 Chapter 8 Testing the Programs Copyright 2006 Pearson/Prentice Hall. All rights reserved.
1 Software Testing Strategies: Approaches, Issues, Testing Tools.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Chapter 8 Testing the Programs. Integration Testing  Combine individual comp., into a working s/m.  Test strategy gives why & how comp., are combined.
Chapter 8 Testing the Programs 8.1 Software Faults and Failures 1. Introduction  faults: A: definition: the problem caused by error B: cause: X: the software.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
Software Testing Strategies for building test group
Software Testing.
Group mambers: Maira Naseer (BCS ).
Software Testing.
Definition CASE tools are software systems that are intended to provide automated support for routine activities in the software process such as editing.
Rekayasa Perangkat Lunak Part-13
Chapter 9, Testing.
Software Testing Techniques
IS301 – Software Engineering V:
Verification and Testing
Verification and Validation Overview
Some Simple Definitions for Testing
Chapter 18 Software Testing Strategies
Chapter 13 & 14 Software Testing Strategies and Techniques
Introduction to Software Testing
Lecture 09:Software Testing
Chapter 8 Testing the Programs Shari L. Pfleeger Joann M. Atlee 4th Edition.
Software System Integration
Verification and Validation Unit Testing
Static Testing Static testing refers to testing that takes place without Execution - examining and reviewing it. Dynamic Testing Dynamic testing is what.
Testing the Programs 东华理工大学软件学院 李祥.
Chapter 10 – Software Testing
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Software Verification and Validation
Software Verification and Validation
Software Testing “If you can’t test it, you can’t design it”
Software Verification and Validation
CS410 – Software Engineering Lecture #11: Testing II
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:

Software Engineering TESTING Compiled by: Dr. S. Prem Kumar Professor & HOD CSE G. Pullaiah College of Engineering and Technology, Kurnool Source: These slides are designed and adapted from slides provided by Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009) by Roger Pressman and Software Engineering 9/e Addison Wesley 2011 by Ian Sommerville Department of Computer Science and Engineering

Testing the Programs

Contents Software Faults and Failures 2 Testing Issues 3 Unit Testing 4 Integration Testing 5 Testing Object Oriented Systems 6 Test Planning 7 Automated Testing Tools 8 When to Stop Testing 9 Information System Example 10 Real Time Example 11 What this Chapter Means for You Department of Computer Science and Engineering

Chapter 8 Objectives Types of faults and how to clasify them The purpose of testing Unit testing Integration testing strategies Test planning When to stop testing Department of Computer Science and Engineering Department of Computer Science and Engineering

1 Software Faults and Failures Why Does Software Fail? Wrong requirement: not what the customer wants Missing requirement Requirement impossible to implement Faulty design Faulty code Improperly implemented design Department of Computer Science and Engineering

1 Software Faults and Failures Why Does Software Fail? Wrong requirement: not what the customer wants Missing requirement Requirement impossible to implement Faulty design Faulty code Improperly implemented design Department of Computer Science and Engineering

1 Software Faults and Failures Why Does Software Fail? Wrong requirement: not what the customer wants Missing requirement Requirement impossible to implement Faulty design Faulty code Improperly implemented design Department of Computer Science and Engineering

1. Software Faults and Failures Objective of Testing Objective of testing: discover faults A test is successful only when a fault is discovered Fault identification is the process of determining what fault caused the failure Fault correction is the process of making changes to the system so that the faults are removed Department of Computer Science and Engineering

1. Software Faults and Failures Types of Faults Algorithmic fault Computation and precision fault a formula’s implementation is wrong Documentation fault Documentation doesn’t match what program does Capacity or boundary faults System’s performance not acceptable when certain limits are reached Timing or coordination faults Performance faults System does not perform at the speed prescribed Standard and procedure faults Department of Computer Science and Engineering

1 Software Faults and Failures Typical Algorithmic Faults An algorithmic fault occurs when a component’s algorithm or logic does not produce proper output Branching too soon Branching too late Testing for the wrong condition Forgetting to initialize variable or set loop invariants Forgetting to test for a particular condition Comparing variables of inappropriate data types Syntax faults Department of Computer Science and Engineering

1 Software Faults and Failures Orthogonal Defect Classification Fault Type Meaning Function Fault that affects capability, end-user interface, product interface with hardware architecture, or global data structure Interface Fault in interacting with other component or drivers via calls, macros, control, blocks or parameter lists Checking Fault in program logic that fails to validate data and values properly before they are used Assignment Fault in data structure or code block initialization Timing/serialization Fault in timing of shared and real-time resources Build/package/merge Fault that occurs because of problems in repositories management changes, or version control Documentation Fault that affects publications and maintenance notes Algorithm Fault involving efficiency or correctness of algorithm or data structure but not design Department of Computer Science and Engineering

1 Software Faults and Failures Sidebar 1 Hewlett-Packard’s Fault Classification Department of Computer Science and Engineering

1 Software Faults and Failures Sidebar 1 Faults for one Hewlett-Packard Division Department of Computer Science and Engineering

2 Testing Issues Testing Organization Module testing, component testing, or unit testing Integration testing Function testing Performance testing Acceptance testing Installation testing Department of Computer Science and Engineering

2 Testing Issues Testing Organization Illustrated Department of Computer Science and Engineering

2 Testing Issues Attitude Toward Testing Egoless programming: programs are viewed as components of a larger system, not as the property of those who wrote them Department of Computer Science and Engineering

2 Testing Issues Who Performs the Test? Independent test team avoid conflict improve objectivity allow testing and coding concurrently Department of Computer Science and Engineering

2 Testing Issues Views of the Test Objects Closed box or black box: functionality of the test objects Clear box or white box: structure of the test objects Department of Computer Science and Engineering

2 Testing Issues White Box Advantage free of internal structure’s constraints Disadvantage not possible to run a complete test Department of Computer Science and Engineering

2 Testing Issues Clear Box Example of logic structure Department of Computer Science and Engineering

2 Testing Issues Sidebar 2 Box Structures Black box: external behavior description State box: black box with state information White box: state box with a procedure Department of Computer Science and Engineering

2 Testing Issues Factors Affecting the Choice of Test Philosophy The number of possible logical paths The nature of the input data The amount of computation involved The complexity of algorithms Department of Computer Science and Engineering

3 Unit Testing Code Review Code walkthrough Code inspection Department of Computer Science and Engineering

3 Unit Testing Typical Inspection Preparation and Meeting Times Development Artifact Preparation Time Meeting Time Requirement Document 25 pages per hour 12 pages per hour Functional specification 45 pages per hour 15 pager per hour Logic specification 50 pages per hour 20 pages per hour Source code 150 lines of code per hour 75 lines of code per hour User documents 35 pages per hour Department of Computer Science and Engineering

3 Unit Testing Fault Discovery Rate Discovery Activity Fault Found per Thousand Lines of Code Requirements review 2.5 Design Review 5.0 Code inspection 10.0 Integration test 3.0 Acceptance test 2.0 Department of Computer Science and Engineering

3 Unit Testing Sidebar 3 The Best Team Size for Inspections The preparation rate, not the team size, determines inspection effectiveness The team’s effectiveness and efficiency depend on their familiarity with their product Department of Computer Science and Engineering

3 Unit Testing Proving Code Correct Formal proof techniques Symbolic execution Automated theorem-proving Department of Computer Science and Engineering

3 Unit Testing Proving Code Correct: An Illustration Department of Computer Science and Engineering

3 Unit Testing Testing versus Proving Proving: hypothetical environment Testing: actual operating environment Department of Computer Science and Engineering

3 Unit Testing Steps in Choosing Test Cases Determining test objectives Selecting test cases Defining a test Department of Computer Science and Engineering

3 Unit Testing Test Thoroughness Statement testing Branch testing Path testing Definition-use testing All-uses testing All-predicate-uses/some-computational- uses testing All-computational-uses/some-predicate- uses testing Department of Computer Science and Engineering

3 Unit Testing Relative Strengths of Test Strategies Department of Computer Science and Engineering

3 Unit Testing Comparing Techniques Fault discovery Percentages by Fault Origin Discovery Techniques Requirements Design Coding Documentation Prototyping 40 35 15 Requirements review 5 Design Review 55 Code inspection 20 65 25 Unit testing 1 Department of Computer Science and Engineering

3 Unit Testing Comparing Techniques (continued) Effectiveness of fault-discovery techniques Requirements Faults Design Faults Code Faults Documentation Faults Reviews Fair Excellent Good Prototypes Not applicable Testing Poor Correctness Proofs Department of Computer Science and Engineering

3 Unit Testing Sidebar 4 Fault Discovery Efficiency at Contel IPC 17.3% during inspections of the system design 19.1% during component design inspection 15.1% during code inspection 29.4% during integration testing 16.6% during system and regression testing 0.1% after the system was placed in the field Department of Computer Science and Engineering

4 Integration Testing Bottom-up Top-down Big-bang Sandwich testing Modified top-down Modified sandwich Department of Computer Science and Engineering

4 Integration Testing Terminology Component Driver: a routine that calls a particular component and passes a test case to it Stub: a special-purpose program to simulate the activity of the missing component Department of Computer Science and Engineering

4 Integration Testing View of a System System viewed as a hierarchy of components Department of Computer Science and Engineering

4 Integration Testing Bottom-Up Integration Example The sequence of tests and their dependencies Department of Computer Science and Engineering

4 Integration Testing Top-Down Integration Example Only A is tested by itself Department of Computer Science and Engineering

4 Integration Testing Modified Top-Down Integration Example Each level’s components individually tested before the merger takes place Department of Computer Science and Engineering

4 Integration Testing Bing-Bang Integration Example Requires both stubs and drivers to test the independent components Department of Computer Science and Engineering

4 Integration Testing Sandwich Integration Example Viewed system as three layers Department of Computer Science and Engineering

4 Integration Testing Modified Sandwich Integration Example Allows upper-level components to be tested before merging them with others Department of Computer Science and Engineering

4 Integration Testing Comparison of Integration Strategies Bottom- up Top- down Modified top-down Bing-bang Sandwich Modified sandwich Integration Early Late Time to basic working program Component drivers needed Yes No Stubs needed Work parallelism at beginning Medium Low High Ability to test particular paths Easy Hard Ability to plan and control sequence hard Department of Computer Science and Engineering

4 Integration Testing Sidebar 5 Builds at Microsoft The feature teams synchronize their work by building the product and finding and fixing faults on a daily basis Department of Computer Science and Engineering

5 Testing Object-Oriented Systems Questions at the Beginning of Testing OO System Is there a path that generates a unique result? Is there a way to select a unique result? Are there useful cases that are not handled? Department of Computer Science and Engineering

5 Testing Object-Oriented Systems Easier and Harder Parts of Testing OO Systems OO unit testing is less difficult, but integration testing is more extensive Department of Computer Science and Engineering

5 Testing Object-Oriented Systems Differences Between OO and Traditional Testing The farther the gray line is out, the more the difference Department of Computer Science and Engineering

6 Test Planning Establish test objectives Design test cases Write test cases Test test cases Execute tests Evaluate test results Department of Computer Science and Engineering

6 Test Planning Purpose of the Plan Test plan explains who does the testing why the tests are performed how tests are conducted when the tests are scheduled Department of Computer Science and Engineering

6 Test Planning Contents of the Plan What the test objectives are How the test will be run What criteria will be used to determine when the testing is complete Department of Computer Science and Engineering

7 Automated Testing Tools Code analysis Static analysis code analyzer structure checker data analyzer sequence checker Output from static analysis Department of Computer Science and Engineering

7 Automated Testing Tools (continued) Dynamic analysis program monitors: watch and report program’s behavior Test execution Capture and replay Stubs and drivers Automated testing environments Test case generators Department of Computer Science and Engineering

8 When to Stop Testing More faulty? Probability of finding faults during the development Department of Computer Science and Engineering

8 When to Stop Testing Stopping Approaches Coverage criteria Fault seeding detected seeded Faults = detected nonseeded faults total seeded faults total nonseeded faults Confidence in the software, C = 1, if n >N = S/(S – N + 1) if n ≤ N Department of Computer Science and Engineering

8 When to Stop Testing Identifying Fault-Prone Code Track the number of faults found in each component during the development Collect measurement (e.g., size, number of decisions) about each component Classification trees: a statistical technique that sorts through large arrays of measurement information and creates a decision tree to show best predictors A tree helps in deciding the which components are likely to have a large number of errors Department of Computer Science and Engineering

8 When to Stop Testing An Example of a Classification Tree Department of Computer Science and Engineering

9 Information Systems Example Piccadilly System Using data-flow testing strategy rather than structural Definition-use testing Department of Computer Science and Engineering

10 Real-Time Example The Ariane-5 System The Ariane-5’s flight control system was tested in four ways equipment testing on-board computer software testing staged integration system validation tests The Ariane-5 developers relied on insufficient reviews and test coverage Department of Computer Science and Engineering

11 What this Chapter Means for You It is important to understand the difference between faults and failures The goal of testing is to find faults, not to prove correctness Department of Computer Science and Engineering