CHAPTER 9 - PART 2 Software Testing Strategies. Lesson Outlines ■ White box testing – Data processing and calculation correctness tests – Correctness.

Slides:



Advertisements
Similar presentations
Software testing - strategies
Advertisements

Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Software Testing Technique. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves.
Software Testing. Quality is Hard to Pin Down Concise, clear definition is elusive Not easily quantifiable Many things to many people You'll know it when.
Chapter 14 Testing Tactics
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.
David Woo (dxw07u).  What is “White Box Testing”  Data Processing and Calculation Correctness Tests  Correctness Tests:  Path Coverage  Line Coverage.
Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Published by Addison-Wesley.
OHT 9.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Definitions and objectives Software testing strategies Software test.
Software engineering for real-time systems
OHT 9.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Definitions and objectives Software testing strategies Software test.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
16/27/2015 3:38 AM6/27/2015 3:38 AM6/27/2015 3:38 AMTesting and Debugging Testing The process of verifying the software performs to the specifications.
BASIS PATH TESTING ● By Tom McCabe ● McCabe, T., "A Software Complexity Measure," IEEE Trans. Software Engineering, vol. SE-2, December 1976, pp
Testing an individual module
OHT 3.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 The need for comprehensive software quality requirements Classification.
Unit Testing CS 414 – Software Engineering I Don Bagert Rose-Hulman Institute of Technology January 16, 2003.
OHT 9.1 Galin, SQA from theory to implementation © Pearson Education Limited 2004 Chapter 9.3 Software Testing Strategies.
SOFTWARE TESTING WHITE BOX TESTING 1. GLASS BOX/WHITE BOX TESTING 2.
Software Testing Introduction. Agenda Software Testing Definition Software Testing Objectives Software Testing Strategies Software Test Classifications.
Issues on Software Testing for Safety-Critical Real-Time Automation Systems Shahdat Hossain Troy Mockenhaupt.
SOFTWARE QUALITY ASSURANCE Maltepe University Faculty of Engineering SE 410.
Path testing Path testing is a “design structural testing” in that it is based on detailed design & the source code of the program to be tested. The methodology.
Introduction to Computer Technology
Testing Dr. Andrew Wallace PhD BEng(hons) EurIng
A Complexity Measure THOMAS J. McCABE Presented by Sarochapol Rattanasopinswat.
Software Systems Verification and Validation Laboratory Assignment 3
CMSC 345 Fall 2000 Unit Testing. The testing process.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
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.
Agenda Introduction Overview of White-box testing Basis path testing
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
White-box Testing.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
Software quality factors
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Software Testing White Box Testing. Agenda What is White Box Testing Correctness Tests and Path Coverage Correctness Tests and Line Coverage McCabe Cyclomatic.
CSC 480 Software Engineering Testing - I. Plan project Integrate & test system Analyze requirements Design Maintain Test units Implement Software Engineering.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Software Construction Lecture 19 Software Testing-2.
Software Testing and Quality Assurance 1. What is the objectives of Software Testing?
Theory and Practice of Software Testing
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Agent program is the one part(class)of Othello program. How many test cases do you have to test? Reversi [Othello]
White Box Testing by : Andika Bayu H.
Cyclomatic complexity (or conditional complexity) is a software metric (measurement). Its gives the number of indepented paths through strongly connected.
CHAPTER 9 - PART 1 Software Testing Strategies. Lesson Outlines Definitions and objectives Software testing strategies Software test classifications White.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Testing Integral part of the software development process.
Software Testing.
White-Box Testing Pfleeger, S. Software Engineering Theory and Practice 2nd Edition. Prentice Hall, Ghezzi, C. et al., Fundamentals of Software Engineering.
Software Testing.
Software Quality Assurance Software Quality Factor
Software Engineering (CSI 321)
Quality Management Perfectqaservices.
Data Coverage and Code Coverage
Structural testing, Path Testing
WHITEBOX TESTING APPROACH
Types of Testing Visit to more Learning Resources.
White Box Testing.
Unit# 9: Computer Program Development
Software Testing (Lecture 11-a)
Chapter 2- Visual Basic Schneider
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 Testing “If you can’t test it, you can’t design it”
By: Lecturer Raoof Talal
Unit III – Chapter 3 Path Testing.
Presentation transcript:

CHAPTER 9 - PART 2 Software Testing Strategies

Lesson Outlines ■ White box testing – Data processing and calculation correctness tests – Correctness tests and path coverage – Correctness tests and line coverage – McCabe’s cyclomatic complexity metrics – Software qualification and reusability testing – Advantages and disadvantages of white box testing

Classification According to Testing Concept Two main philosophies of testing: –One deals with internal structure of the software –The other deals with produced outputs given inputs. –IMHO, you definitely need both because they test the software from two entirely different perspectives!

Definitions Black Box (Functionality) testing: Identifies bugs only according to software malfunctioning as they are revealed in its erroneous outputs. –If outputs okay, BB Testing disregards internal paths taken, calculations and any processing. –This is somewhat of an oversimplification, but it is still essentially true.

Definitions White Box (Structural) testing: Examines internal paths program execution follows in order to identify bugs. –Often called ‘glass box testing’. –Investigates the correctness of the code structure. –Checks out the application in considerable detail – but with a cost.

White Box and Black Box Testing for classes of tests Black Box testing : * We will look at these. –* Output correctness tests –* Documentation tests –* Availability (reaction time) tests –* Reliability tests –* Stress tests (load tests and durability tests) –* Software system security tests –Training usability tests –Operational usability tests –Flexibility tests –Testability tests –Portability tests –Software interoperability tests –Equipment interoperability tests

White Box and Black Box Testing for classes of tests White Box Testing : –* Data processing and calculations correctness tests –* Software qualification tests –* Reusability tests Both white box and black box testing: –* Maintainability tests

White Box Testing - Overview White box testing requires verification of every program statement / comment in your code –Can be very long and painstaking ( دقيق ) ! Calculation Correctness Test Cases are developed to test each computation and the path to the computation. –Used to determine the proper path sequence of steps that compute. Software Qualification Checks out compliance and standards. Maintainability checks out internal structure for maintenance Reusability tests the reuse ability in a local software library.

White Box Testing: In more Detail: Data Processing and Calculation Correctness ■Path coverage Path coverage is measured as percentage of all possible program paths included in planned testing. ■Line coverage Line coverage is measured by the percentage of program code lines included in planned testing.

Correctness Tests and Path Coverage Note: every path (if-then-else; do-while, etc.) is a ‘different’ path with different values. We’d like to tests all paths. Total number of paths is countably infinite. If one calculates the number of paths in a non-trivial routine, the number of test cases required is huge and very impractical ( غير عملي ). Except for some special security applications, we will use alternative strategies: line coverage.

Correctness Tests and Line Coverage Desirable to test every line of code at least once during testing. Define degree of coverage as the number of lines executed over the number of executable lines available. Let’s consider a program flow chart to make our point. –a diamond is a decision; –a rectangle consists of imperatives and connections to conditional statements. –Edges represent sequences of sections Let’s consider a program flow graph, with sections of code to replace one or more flow chart rectangles.

Imperial Taxi Service Computations ■ ITS taxi fares for one-time passengers are calculated as follows: 1.Minimal fare: $2. This fare covers the distance traveled up to 1000 yards and waiting time (stopping for traffic lights or traffic jams, etc.) of up to 3 minutes. 2.For every additional 250 yards or part of it: 25 cents. 3.For every additional 2 minutes of stopping or waiting or part thereof: 20 cents. 4.One suitcase: 0 change; each additional suitcase: $1. 5. Night supplement: 25%, effective for journeys between 9pm - 6am. ■ Regular clients are entitled to a 10% discount and are not charged the night supplement.

S ≤ 1S >1 Yes WT ≤ 3 WT > 3 D ≤ Charge the minimal fare 2 Distance 5 Waiting time 14 Night journey? 11 Regular client? Print receipt. 8 No.of suitcases 910 D > No Yes Taxi Service - Flow chart - Path Coverage In planning, a flowchart and a flow graph were developed. Note: five decisions enter into planning for path testing… Twenty-four different paths may be executed to have full coverage. Means we need to prepare 24 different test cases.

Program flow graph But, if we only insist on ‘line coverage,’ we can get full line coverage with three tests: So, we have three test cases compared with 24! Savings goes up exponentially with programs of greater complexity.

Program Flow Graph McCabe’s cyclomatic complexity metrics also give an upper limit to the number of test cases needed for full line coverage. McCabe used graph theory to arrive at a minimum number of tests to ensure full line coverage based on a program flow graph. Any path must have at least one edge not in another path. McCabe developed his cyclomatic complexity based on ‘regions’ in the graph R1 R2 R3 R5 R4

R1 R2 R3 R5 R4 R6 for full line coverage According to McCabe, the V(G) can be computed in any of three ways each of which is based on the program’s flow graph: V(G) = R // nbr of regions V(G) = E – N + 2 edges – nodes ( = 6) V(G) = P + 1 (nbr of decisions + 1) (5 + 1 = 6) Result: max nbr of independent paths Number of paths has been used to indicate overall program complexity McCabe – Maximum Number of Independent Paths for Full Line Coverage.

Advantages of White Box Testing ■Direct determination of software correctness as expressed in the processing paths statement by statement, including algorithms. Were they correctly defined and coded?? Logic errors?? Must carefully design test cases!! ■Allows performance of line coverage follow up. We have software that identifies lines not yet executed are available. percent execute, phantom paths… ■Ascertains quality of coding work and its adherence to coding standards.

Disadvantages of White Box Testing ■The vast resources utilized, much more those required for black box testing of the same software package. ■The inability to test software performance in terms of availability (response time), reliability, load durability, etc. ■Book cites that white box testing should be limited to modules of high risk and high cost of failure – whatever that means! ■After programs have been maintained over the years, these general testing strategies are too simplistic.