APPROACHES TO SOFTWARE TESTING PROGRAM VERIFICATION AND VALIDATION



Similar documents
Software testing. Objectives

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

Module 10. Coding and Testing. Version 2 CSE IIT, Kharagpur

Software Testing. Definition: Testing is a process of executing a program with data, with the sole intention of finding errors in the program.

Software Testing. Quality & Testing. Software Testing

Software Engineering I: Software Technology WS 2008/09. Integration Testing and System Testing

Formal Software Testing. Terri Grenda, CSTE IV&V Testing Solutions, LLC

Software Testing Interview Questions

Chapter 11: Integrationand System Testing

Software Engineering. Software Testing. Based on Software Engineering, 7 th Edition by Ian Sommerville

Introduction to Computers and Programming. Testing

Chapter 8 Software Testing

Software Testing & Analysis (F22ST3): Static Analysis Techniques 2. Andrew Ireland

Chapter 11: Integration- and System Testing

Software Testing Strategies and Techniques

Testing and Inspecting to Ensure High Quality

Revolutionized DB2 Test Data Management

Module 10. Coding and Testing. Version 2 CSE IIT, Kharagpur

Different Approaches to White Box Testing Technique for Finding Errors

CSTE Mock Test - Part III Questions Along with Answers

Test Case Design Techniques

Presentation: 1.1 Introduction to Software Testing

Test case design techniques II: Blackbox testing CISS

Standard for Software Component Testing

Static Analysis of Dynamic Properties - Automatic Program Verification to Prove the Absence of Dynamic Runtime Errors

Test case design techniques I: Whitebox testing CISS

SOFTWARE ENGINEERING INTERVIEW QUESTIONS

QA Analysis of the WRF Program

1 White-Box Testing by Stubs and Drivers

Karunya University Dept. of Information Technology

Test case design techniques I: Whitebox testing CISS

CS 451 Software Engineering Winter 2009

R214 SPECIFIC REQUIREMENTS: INFORMATION TECHNOLOGY TESTING LABORATORY ACCREDITATION PROGRAM

Introduction to Automated Testing

Outline. 1 Denitions. 2 Principles. 4 Implementation and Evaluation. 5 Debugging. 6 References

Hitex Germany. White Paper. Unit Test of Embedded Software

How To Improve Software Quality

An Analysis on Objectives, Importance and Types of Software Testing

Metrics in Software Test Planning and Test Design Processes

Secure Software Programming and Vulnerability Analysis

Test Specification. Introduction

Testing of safety-critical software some principles

EVALUATING METRICS AT CLASS AND METHOD LEVEL FOR JAVA PROGRAMS USING KNOWLEDGE BASED SYSTEMS

Software Engineering. How does software fail? Terminology CS / COE 1530


Static Analysis for Software Verification. Leon Moonen

Software Engineering (Set-I)

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

Testing Introduction. IEEE Definitions

The Advantages of Block-Based Protocol Analysis for Security Testing

Compute Cluster Server Lab 3: Debugging the parallel MPI programs in Microsoft Visual Studio 2005

Logistics. Software Testing. Logistics. Logistics. Plan for this week. Before we begin. Project. Final exam. Questions?

Testing, Debugging, and Verification

Basic Testing Concepts and Terminology

Die wichtigsten Use Cases für MISRA, HIS, SQO, IEC, ISO und Co. - Warum Polyspace DIE Embedded Code-Verifikationslösung ist.

Introduction to Embedded Systems. Software Update Problem

SOFTWARE DEVELOPMENT STANDARD FOR SPACECRAFT

The V-model. Validation and Verification. Inspections [24.3] Testing overview [8, 15.2] - system testing. How much V&V is enough?

Static Analysis. Find the Bug! : Analysis of Software Artifacts. Jonathan Aldrich. disable interrupts. ERROR: returning with interrupts disabled

Chapter 7: Software Development Stages Test your knowledge - answers

Roadmap. Software Engineering. Software Engineering. Project Life Cycle. Database. Project Lifecycle

Acceptance Criteria. Software Engineering Group 6. 0/3/2012: Acceptance Criteria, v2.0 March Second Deliverable

Standard Glossary of Terms Used in Software Testing. Version 3.01

Glossary of Object Oriented Terms

IBM SPSS Direct Marketing 23

Visualizing Information Flow through C Programs

Analysis Of Source Lines Of Code(SLOC) Metric

Analysis / Design. Traditional Development. Process models. Common Methodologies. Common Approach. Analysis: DFD. Traditional Software Development 1

Stacks. Linear data structures

Testing. Chapter. A Fresh Graduate s Guide to Software Development Tools and Technologies. CHAPTER AUTHORS Michael Atmadja Zhang Shuai Richard

Software Metrics. Lord Kelvin, a physicist. George Miller, a psychologist

ISTQB Certified Tester. Foundation Level. Sample Exam 1

Best Practices for Verification, Validation, and Test in Model- Based Design

The Open University s repository of research publications and other research outputs

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

Design of automatic testing tool for railway signalling systems software safety assessment

CS 2112 Spring Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

Testing Overview and Black-Box Testing Techniques

A Static Analyzer for Large Safety-Critical Software. Considered Programs and Semantics. Automatic Program Verification by Abstract Interpretation

Computer Science 217

Chapter 1: Key Concepts of Programming and Software Engineering

Comprehensive Static Analysis Using Polyspace Products. A Solution to Today s Embedded Software Verification Challenges WHITE PAPER

Software Testing. Knowledge Base. Rajat Kumar Bal. Introduction

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Test Data Management Best Practice

Configuration Management: An Object-Based Method Barbara Dumas

Verification and Validation of Software Components and Component Based Software Systems

IBM SPSS Direct Marketing 22

TESSY -- An Overall Unit Testing Tool

Performance Based Evaluation of New Software Testing Using Artificial Neural Network

Software Error Analysis

MarshallSoft AES. (Advanced Encryption Standard) Reference Manual

Eliminate Memory Errors and Improve Program Stability

Basic Unix/Linux 1. Software Testing Interview Prep

Transcription:

1 APPROACHES TO SOFTWARE TESTING PROGRAM VERIFICATION AND VALIDATION Validation: Are we building the right product? Does program meet expectations of user? Verification: Are we building the product right? Does program conform to its specifications? Testing: The process of establishing the presence of faults. Debugging: The process of finding and removing faults. Bebugging: The process of estimating the number of bugs in a program 1

2 THE TESTING PROCESS Unit testing - Individual components are tested to see if they work correctly. Each component is considered a stand-alone entity. Module testing - A module is a collection of components which are interdependent. After each program unit has been tested, the interaction of these components when they interact must be tested. A module encapsulates related components and it should be possible to test a module as a stand-alone entity. Subsystem testing - Modules are put together to form subsystems. Subsystems may be designed and implemented by different software engineers. The most common problems occur in the interfaces of subsystems. 2

3 Integration testing - Subsystems must be integrated to make up the entire system. Problems usually are caused by unanticipated interactions between subsystems and components. Stress testing - Put an unnatural load on a system; perhaps exceed the number of transactions per second for the system. Acceptance testing - Test the system with real data (sometimes called alpha testing). Beta testing - Deliver product to a few customers or potential customers who agree to use the product and report errors. 3

4 TOP-DOWN AND BOTTOM-UP TESTING Top-down testing involves starting at the subsystem level with modules represented by stubs - objects which have the same interface as the module but are much simpler. After all subsystems are tested in a similar fashion, the stubs are replaced by the actual code and testing continues. Top-down testing should be used with top-down program development so that a module is tested as soon as it is coded. Bottom-up testing reverses this process. The components are tested individually; then components that make up a module are integrated and the module is tested. Finally, modules are integrated and the subsystem is tested. 4

5 Top-down testing has the advantage that a working (but limited) is available at an early stage of development. Provides a good psychological boost, and it demonstrates the feasibility of the system to management. Validation begins early in the development cycle. However, strict top-down testing can be difficult because program stubs that simulate lower levels of the system must be produced; also, realistic output may be difficult to produce. If bottom-up testing is used, drivers must be constructed for the lower level modules which present these modules with appropriate inputs. Test cases are reasonably easy to generate. However, no demonstrable program is available until the very last module has been tested. Also, high level design errors may not be detected until the late stages of system test. 5

6 TESTING TECHNIQUES In principle, testing of a program should be exhaustive. Every statement in the program should be exercised and every possible path combination through the program should be executed at least once. In practice, this is not reasonable in a program which contains loops as the number of paths is usually very large. Some guidelines - 1) Testing a system's capabilities is more important than testing its components. Test for errors that will stop the users from completing their jobs and not for irritations. 2) Testing old capabilities is more important than testing new ones. Don't break a working system. 3) Testing typical situations is more important than testing boundary value cases. 6

7 TEST CASES AND TEST DATA Test cases and test data are not the same thing. Test data are the inputs that have been devised to test the system; test cases are input and output specifications plus a statement of the function under test. Consider the testing of a simple routine to search a table of integers to determine if some given integer is present in that table. Assume the routine is called as S:= Search(AnArray, InValue) 7

8 If AnArray has an element equal to InValue, the index of that element in AnArray is returned by Search, otherwise -1 is returned. Assume the programming language Search is written in checks the types of parameters and number of parameters. Also assume the intrinsic function FIRST and LAST return the upper and lower bounds of the array, and that the language (and operating system) will detect out-of-bounds array indices. Test cases for Search(An Array, InValue): (1) Array size of 1, element in array. (2) Array size of 1, element not in array. (3) Empty array. (4) Even size array, element first element in array. (5) Even size array, element last element in array. (6) Even size array, element not in array. (7) Odd size array, element first element in array. 8

9 (8) Odd size array, element last element in array. (9) Odd size array, element not in array. (10) Even size array, element in array, not first or last. (11) Odd size array, element in array, not first or last. Test cases for these situations: (1) Array is a single value equal to required value. Input:AnArray = 17; InValue = 17 Output: function returns 1 (2) Array is a single value not equal to required value. Input: AnArray = 17; InValue = 0 Output: function returns -1...... (5) The array size is even and the last value is the required value Input: AnArray = 17, 18, 21, 23; InValue = 23 9

10 Output: function returns 4...... (10) The array size is even and the element is neither the first nor last Input: AnArray = 17, 23, 29, 35, 41, 45; InValue = 23 Output: function returns 2 This testing is called black-box'' testing because the tester is provided only with a description of the routine and does not have access to the routine. 10

11 The apparently arbitrary set of test cases were determined by the following heuristics: (1) Search programs are most likely to go wrong when the key element is either the first or last element in the array. (2) Programmers often don't consider situations where there are an unusual number of elements (zero or one) in the collection. (3) Search routines often behave differently depending on whether the number of values in the array is even or odd. 11

12 EQUIVALENCE PARTITIONING The form of input classification for determining the test inputs for the above search routine is called equivalence partitioning. If a program does not display an erroneous output for one member of a class, it should not do so for any member of that class. The equivalence class must be identified by using the program specification or user documentation and by the tester using experience to predict which classes of input value are likely to detect errors. For example, if a specification says that four to eight values are to be input, equivalence classes are less than four, between four and eight, and more than eight. Output equivalence classes should also be considered and input values that generate outputs at the boundary of each output class should be chosen as test input. For example, say a program is 12

13 designed to produce between three and six outputs, with each output lying in the range 1000-2500. Test input should be selected which produces 3 values of 1000, 3 of 2500, 6 of 1000, and 6 of 2500. Furthermore, input should be selected so that erroneous output values would result if that input were processed as correct input. The input should attempt to force the program to produce less than three values, more than six values, values less than 1000 and values greater than 2500 Suppose a procedure converts a string of digits to a 16-bit, two's complement integer. Each input can have up to 6 characters; if less than six characters, then blanks pad to the left. If an input is negative, a minus sign occupies the position immediately to the left of the most significant digit. Assume the input is a member of an array and that compiler checking will guarantee that no more than 6 characters will be input without generating an error. The 13

14 compiler will also check for any other invalid parameter types or values. 14

15 Equivalence Classes Identifier Type Class C1 Input 1-5 non-blank characters C2 Input 6 non-blank characters C3 Input Empty C4 Input Single minus sign, no characters C5 Input Minus sign as most significant character C6 Input Digit as most significant character C7 Input Left padded with non-blank and not 0 C8 Input Left padded with 0 C9 Input Digit as significant character but with invalid characters in number C10 Input Gap between minus sign and number C11 Output Negative integers >= Minint and < 0 C12 Output Zero C13 Output Positive integers > 0 and <= Maxint 15

16 Test Cases Number Input Expected Output Classes Tested. 1 bbbbb1 1 C1,C6,C13 2 000001 1 C2,C6,C8 3 bbbb-1-1 C5,C11 4-00001 -1 C2,C5,C8 5 000000 0 C2,C12 6 bbbbb0 0 C6,C12 7 b32767 32767 C1,C6,C13 8 032767 32767 C2,C13 9-32768 -32768 C2,C5,C11 10 b32768 Invalid Input C1,C13 11-32769 Invalid Input C2,C5,C11 12 123456 Invalid Input C2 13 xxxxx1 Invalid Input C7 14 xxxx-1 Invalid Input C7 15 bbbbbb Invalid Input C3 16 bbb2x1 Invalid Input C9 17 bbb2-1 Invalid Input C9 18 bbb-b1 Invalid Input C10 19 bbbbb- Invalid Input C4 16

17 STRUCTURAL TESTING Black-box testing is the name given to testing when the tester is presented with the specification of the component being tested and uses this to derive test cases. The advantage is the tester does not need source code and need not understand the program being tested. The disadvantage is that the tester cannot get clues from the program about which test inputs best exercise the program. Another approach called white-box, glass-box, or structural testing relies on the tester having knowledge of the program to derive test data. The starting point for structural testing is to derive a program flow graph that shows all possible execution paths for a program so that test cases for each path can be designed. 17

18 The maximum number of independent paths in a program is equal to the programs cyclomatic number. An independent path is one which traverses at least one new edge in the flow graph. The tester must still discover a set of appropriate independent paths. This metric must be used carefully because it does not guarantee that the right test data is used or that a good'' set of independent paths are tested. It also doesn't address data driven programs well. Consider a program represented by a flow chart and a more abstract version represented by a flow graph. The discussion and example on pages 189-196 of the Galin text demonstrates this transformation well. The flow graph in that example is: 18

19 1 VG) = # Regions = 6 2 V(G) = Edges Nodes + 2 = 21-17+2 = 6 V(G) = Binary Decisions + 1 = % + 1 = 6 6 3 5 8 4 7 9 10 12 11 13 15 14 16 17 19

20 TESTING REAL-TIME SYSTEMS Real-time systems are systems where the processes comprising the system must respond to events under time constraints. The testing of real-time systems is particularly critical because the reliability requirements of these systems are usually greater than the requirements for systems which are not time critical. Real-time systems are normally made up from a number of distinct cooperating processes and they are often interrupt driven. Real-time systems are especially difficult to test because of the subtle interactions that may arise among the various processes in the system. System errors may be time dependent, arising only when the system processes are in a particular state; that state may 20

21 be difficult to reproduce. These states normally arise because of parallel processes. One way to control integration and system testing is to identify threads'' of execution where an input is transformed by a number of processes in turn to produce an output. Once threads are tested, new event tests should be created to test for simultaneously occurring events 21

22 STATIC PROGRAM VERIFICATION (INCLUDES INSPECTIONS) Static verification techniques do not require the program to be executed. Rather, they are concerned with examining the source code of a program and detecting faults in the code before execution. It has been reported that static verification can find 60% of the errors in a program before the program is executed. Static program analysers are software tools that scan the source text of a program and detect possible faults and anomalies. They do not require that a program be executed. Some faults that can be checked are: Unreachable code Unconditional branches into loops Undeclared variables Parameter type mismatches 22

23 Parameter number mismatches Uncalled functions and procedures Variables used before initiation Non-usage of function results Possible array bound violations Misuse of pointers 23