Testing Overview References: Pressman, Software Engineering: a Practitioner’s Approach, McGraw Hill Pfleeger, Software Engineering, Theory and Practice,

Slides:



Advertisements
Similar presentations
Object Oriented Analysis And Design-IT0207 iiI Semester
Advertisements

Test Design and Documentation. Test Design Test design is to ensure that all requirements are met through a series of test procedures, increasing the.
1 Integration Testing CS 4311 I. Burnstein. Practical Software Testing, Springer-Verlag, 2003.
Testing and Quality Assurance
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Practical Testing Techniques. Verification and Validation Validation –does the software do what was wanted? “Are we building the right system?” –This.
10 Software Engineering Foundations of Computer Science ã Cengage Learning.
1 Software Engineering Lecture 11 Software Testing.
Developer Testing and Debugging. Resources Code Complete by Steve McConnell Code Complete by Steve McConnell Safari Books Online Safari Books Online Google.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Lab/Sessional -CSE-374. SYSTEM DEVELOPMENT LIFE CYCLE.
Software Testing. Overview Definition of Software Testing Problems with Testing Benefits of Testing Effective Methods for Testing.
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Outline Types of errors Component Testing Testing Strategy
Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
System Testing There are several steps in testing the system: –Function testing –Performance testing –Acceptance testing –Installation testing.
ECE 355: Software Engineering
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
111 Testing Overview CS 4311 Frank Tsui, Orland Karam, and Barbara Bernal, Essential of Software Engineering, 3rd edition, Jones & Bartett Learning. Sections.
Software Testing. Definition To test a program is to try to make it fail.
1 Software Testing (Part-II) Lecture Software Testing Software Testing is the process of finding the bugs in a software. It helps in Verifying and.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
CS4311 Spring 2011 Verification & Validation Dr. Guoqiang Hu Department of Computer Science UTEP.
CMSC 345 Fall 2000 Unit Testing. The testing process.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
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 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Testing Workflow In the Unified Process and Agile/Scrum processes.
Agenda Introduction Overview of White-box testing Basis path testing
1 Chapter 22 Developer Testing. 2 introduction Testing is the most popular quality-improvement activity Testing is the most popular quality-improvement.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
Neil Ghani Software testing. 2 Introduction In a perfect world all programs fully verified testing thus redundant Back in the real.
TESTING LEVELS Unit Testing Integration Testing System Testing Acceptance Testing.
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
What is Testing? Testing is the process of finding errors in the system implementation. –The intent of testing is to find problems with the system.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
Software Engineering Lecture # 1.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Software Engineering Saeed Akhtar The University of Lahore.
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.
Software Quality Assurance and Testing Fazal Rehman Shamil.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
System Testing 12/09. Hierarchy of Testing Testing Program Testing Top Down Bottom Up Integration TestingUnit Testing System Testing Big Bang Sandwich.
What is a software? Computer Software, or just Software, is the collection of computer programs and related data that provide the instructions telling.
Testing Overview References: Pressman, Software Engineering: a Practitioner’s Approach, McGraw Hill Pfleeger, Software Engineering, Theory and Practice,
Software Testing Strategies for building test group
Software Testing.
SOFTWARE TESTING OVERVIEW
Software Testing Techniques
Software engineering – 1
Chapter 13 & 14 Software Testing Strategies and Techniques
Applied Software Implementation & Testing
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Lecture 09:Software Testing
Testing Overview References:
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 Testing “If you can’t test it, you can’t design it”
Chapter 11: Integration- and System Testing
System analysis and design
UNIT-4 BLACKBOX AND WHITEBOX 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:

Testing Overview References: Pressman, Software Engineering: a Practitioner’s Approach, McGraw Hill Pfleeger, Software Engineering, Theory and Practice, Prentice Hall J. McGregor and D. Sykes. A Practical Guide to Testing Object-Oriented Software, Addison-Wesley, I. Burnstein. Practical Software Testing, Springer-Verlag,

Question How do you know your software works correctly?

Question How do you know your software works correctly? Answer: Try it.

Question How do you know your software works correctly? Answer: Try it. Example: I have a function of one integer input. I try f(6). It returns 35. –Is my program correct? Groups of 3 1 minute

Question How do you know your software works correctly? Answer: Try it. Example: I have a function of one integer input. I try f(6). It returns 35. –My function is supposed to compute n*6-1. Is it correct? –Is my program correct? Groups of 3 1 minute

Goals of testing: I want to show that my program is correct: it generates the right answer for every input. Can we write tests to show this? Groups of 3 1 minute

Goals of testing: Can we prove a program is correct by testing? Yes, if we can test it exhaustively: every combination of inputs in every environment.

How long will it take? Consider X+Y for 32-bit integers. How many test cases are required? How long will it take? –1 test per second: –1,000 tests per second: –1,000,000 per second: Groups of 3

How Long? Consider X+Y for 32-bit integers. How many test cases are required?  2 32 * 2 32 = 2 64 =10 19  (The universe is 4*10^17 seconds old) How long will it take?  1 test per second:580,000,000,000 years  1,000 tests per second: 580,000,000 years  1,000,000 per second: 580,000 years

Example 2 A B C A loop returns to A We want to count the number of paths The maximum number of iterations of the loop is 20 How many?

Example 2 A B C Suppose the loop does not repeat: Only one pass executes 5 distinct paths

Example 2 A B C Suppose the loop repeats exactly once 5*5=25 distinct paths If it repeats at most once, 5 + 5*5

Example 2 A B C What if it repeats exactly n times?

Example 2 A B C What if it repeats exactly n times? 5 n paths

Example 2 A B C What if it repeats at most n times? ∑5 n = 5 n + 5 n-1 + … + 5 N=20, ∑5 n = years at 1,000,000 tests per second

Example 3 Consider testing a Java compiler? How many inputs are needed to test every input?

Limits of testing: You can’t test it completely. You can’t test all valid inputs. You can’t test all invalid inputs. You really can’t test edited inputs. You can’t test in every environment. You can’t test all variations on timing. You can’t even test every path. (path, set of lines executed, start to finish)

Why Bother?

Goals of testing: Identify errors. –Make errors repeatable (when do they occur) –Localize errors (where are they) The purpose of testing is to find problems in programs so they can be fixed.

Cost Testing accounts for between 30 and 90% of the total cost of software Microsoft employs one tester for each developer We want to reduce the cost –Increase test efficiency: #defects found/test –Reduce the number of tests –Find more defects How? Organize!

Levels of Software Testing Unit/Component testing Integration testing System Testing Acceptance Testing Installation Testing

Levels of Software Testing Unit/Component testing –Verify implementation of each software element –Trace each test to detailed design Integration testing System Testing Acceptance Testing Installation Testing

Levels of Software Testing Unit/Component testing Integration testing –Combine software units and test until the entire system has been integrated –Trace each test to high-level design System Testing Acceptance Testing Installation Testing

Levels of Software Testing Unit/Component testing Integration testing System Testing –Test integration of hardware and software –Ensure software as a complete entity complies with operational requirements –Trace test to system requirements Acceptance Testing Installation Testing

Levels of Software Testing Unit/Component testing Integration testing System Testing Acceptance Testing – Determine if test results satisfy acceptance criteria of project stakeholder –Trace each test to stakeholder requirements Installation Testing

Levels of Software Testing Unit/Component testing Integration testing System Testing Acceptance Testing Installation Testing –Perform testing with application installed on its target platform

Testing Phases: V-Model Requirements Specification System Specification System Design Detailed Design Unit code and Test Sub-system Integration test System Integration test Acceptance Test Service Acceptance Test Plan System Integration Test Plan Sub-system Integration Test Plan

Hierarchy of Testing Testing Program Testing Top Down Bottom Up Integration TestingUnit Testing System Testing Big Bang Sandwich Black Box White Box Function Performance Reliability Availability Acceptance Testing Properties Security Equivalence Boundary Decision Table State Transition Use Case Domain Analysis Control FlowData Flow Usability Documentation Portability Capacity Ad hoc Benchmark Pilot Alpha Beta

The problem with testing There’s no way to know in general if a test criterion is consistent.

Who Tests? Professional testers: Organize and run tests Analysts: involved in system requirements definition and specification System designers: understand proposed solution and solution’s constraints Implementers: Understand constraints associated with implementation Configuration management representative: arranges for changes to be made consistently across all artifacts

A good test: Has a reasonable probability of catching an error Is not redundant Is neither too simple nor complex Reveals a problem Is a failure if it doesn’t reveal a problem

Competent Programmer Hypothesis “We assume, as an article of faith, that the programmers are well trained, well supplied with the proper tools, and competent.”

Ad hoc Testing Most popular approach Sometimes called –“exploratory” –“unstructured” –“random” –“1401 testing”

Ad hoc Testing Most popular approach Sometimes called –“exploratory” –“unstructured” –“random” –“1401 testing” Random testing is actually different: ad hoc is rarely random. It is likely that there is some structure, but the structure is informal and based on experience, thus difficult to describe.

Ad Hoc Testing Simple example (Kaner): “The program is designed to add two numbers, which you enter. Each number should be one or two digits. The program will echo your entries, then print the sum. Press after each number. To start the program, type ADDER.”

Simple example 2: Step 1. start with simple, obvious test. Type ADDER, 2, 3 and see what happens. There might be lots of things to note. Do things line up? Is there adequate advice? Step 2. Make notes about what else can be tested. After the obvious ones, start constructing a formal test series.

Simple example 3: Step 3. Look for boundary conditions: Cases: , , , , , 9+9, 0+0, 0+23, Use each digit at least once. Test things likely to fail (boundaries) largest single digit, large second number, large first number if it passes 2+3, you expect it to pass 3+4. In some sense, they are the same.

Simple example 4: Step 4. Do some “on the fly” testing. Run with whatever feels right. Keep track of these tests. How about the invalid side of boundaries: , <> + <>, , control keys, etc. Step 5. summarize what you know about it. This is for your own use. Write a problem report for each bug.

Simple example 5: Step 6. Think of hidden boundaries. What about single byte signed numbers: Look at sums greater than 127 (which we already did, but look for strange results here.) Testing for valid or invalid characters: test “0”(48), “/”(47), “9”(57), “:”(58) and so on. Next cycle, review responses to problem reports and see what’s been done.

Automate testing Do whenever possible. Design it for this. “A century ago the steam locomotive reached it’s peak. Fifty years before that intercity stagecoaches pulled by teams of horses had an outrider on the first horse to stabilize the team. Manual testing to me is like having such a rider at the front of a speeding locomotive.” Beizer.

Advice View testing as part of the development process Buy a tool and use it Testing is the last line of defense: Errors indicate there is a problem with the development process

Closing words “Testing is our last line of defense against bugs, not the first or only line of defense. When a bug is found by testing, it means that earlier phases of our software development process are wanting.” “I don’t see testing actually disappearing because the remaining bugs are always subtler and nastier.” –Bezier