Software Testing.

Slides:



Advertisements
Similar presentations
2017/3/25 Test Case Upgrade from “Test Case-Training Material v1.4.ppt” of Testing basics Authors: NganVK Version: 1.4 Last Update: Dec-2005.
Advertisements

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.
Testing and Quality Assurance
Software Testing Testing.
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.
Developer Testing and Debugging. Resources Code Complete by Steve McConnell Code Complete by Steve McConnell Safari Books Online Safari Books Online Google.
Black box testing  Black box tests focus on the input/output behavior of the component  Black-box tests do not deal with the internal aspects of the.
Informatics 43 – April 30, What is a test case? An input to a system, and the correct output. An “input” may be complex. Example: – What is an input.
Software Testing. Testing Levels (McConnel) Unit Testing Single programmer involved in writing tested code Component Testing Multiple programmers involved.
Software Testing and Quality Assurance
CS 425/625 Software Engineering Software Testing
Testing HCI Usability Testing. Chronological order of testing Individual program units are built and tested (white-box testing / unit testing) Units are.
Testing an individual module
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Verificarea şi Validarea Sistemelor Soft Tem ă Laborator 2 Testare Black Box Dat ă primire laborator: Lab 2 Dat ă predare laborator: Lab 2,3.
BY: GARIMA GUPTA MCA FINAL YEAR WHAT IS SOFTWARE TESTING ? SOFTWARE TESTING IS THE PROCESS OF EXECUTING PROGRAMS OR SYSTEM WITH THE INTENT.
Lecture 6 Software Testing and jUnit CS140 Dick Steflik.
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
TESTING.
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.
Testing Especially Unit Testing. V-model Wikipedia:
Neil Ghani Software testing. 2 Introduction In a perfect world all programs fully verified testing thus redundant Back in the real.
Testing Testing Techniques to Design Tests. Testing:Example Problem: Find a mode and its frequency given an ordered list (array) of with one or more integer.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
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.
Software Engineering 2004 Jyrki Nummenmaa 1 BACKGROUND There is no way to generally test programs exhaustively (that is, going through all execution.
CPSC 873 John D. McGregor Session 9 Testing Vocabulary.
Chapter 8 Testing. Principles of Object-Oriented Testing Å Object-oriented systems are built out of two or more interrelated objects Å Determining the.
Software Quality Assurance and Testing Fazal Rehman Shamil.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
Software engineering - 2 Section 8. QUIZ Show how it is possible to determine the height of a tall building with the aid of a barometer.
Software Testing By Souvik Roy. What is Software Testing? Executing software in a simulated or real environment, using inputs selected somehow.
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.
CPSC 372 John D. McGregor Module 8 Session 1 Testing.
Section 2.4 Software Testing. 2.4 Software Testing The process of executing a program with data sets designed to discover errors Software testing is one.
Software Testing Kobla Setriakor Nyomi Faculty Intern (Programming II)
Functional testing, Equivalence class testing
Software Testing.
Software Testing.
Domain Testing Functional testing which tests the application by giving inputs and evaluating its appropriate outputs. system does not accept invalid and.
Software Testing.
Rekayasa Perangkat Lunak Part-13
Decision Table Testing
John D. McGregor Session 9 Testing Vocabulary
Black Box Testing PPT Sources: Code Complete, 2nd Ed., Steve McConnell
Software engineering – 1
Some Simple Definitions for Testing
Chapter 13 & 14 Software Testing Strategies and Techniques
Types of Testing Visit to more Learning Resources.
John D. McGregor Session 9 Testing Vocabulary
Chapter 9: Class Tournament
UNIT-4 BLACKBOX AND WHITEBOX TESTING
John D. McGregor Session 9 Testing Vocabulary
Testing and Test-Driven Development CSC 4700 Software Engineering
Software Engineering Lecture #13.
Software Engineering Lecture #12.
Software testing.
CS240: Advanced Programming Concepts
Software Testing & Quality Management
Informatics 43 – April 28, 2016.
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”
Java & Testing.
CSE 1020:Software Development
TYPES OF TESTING.
CS410 – Software Engineering Lecture #11: Testing II
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Software Testing

Testing Levels (McConnel) Unit Testing Single programmer involved in writing tested code Component Testing Multiple programmers involved in writing test code Integration Testing Testing two or more independently developed, interacting modules together Regression Testing Use a set of tests that can be rerun when changes are made to the system

Testing Transparency White-box Testing Black-box Testing Tester has access to the code Black-box Testing Tester has no access to the code Relies on functional descriptions

Test Plan Test plan consists of a set of tests and the expected results

Code coverage What parts of the code are actually executed by a test? Statement coverage What combinations of sections of code are executed by a test? Conditional Coverage (all conditions are evaluated as true at least once and as false at least once)

Boundary Values Identify equivalence classes Array declaration example: Good test cases usually test the boundary values of inputs Empty strings Max number of array elements

Finding Equivalence Classes: C++ Array Declaration Input Condition Valid Equivalence classes Invalid Equivalence classes Size of array name <255 chars (1) >255 truncates to 255 (3) <0 char (2) Array name Has letters (4), has digits(5), has underscore(6) Has something else (7) Number of dimensions Has 1 dimension (8) Has a lot of dimensions(9) Has 0 dimensions Spaces Spaces between name and bracket (10), Spaces between brackets(11), No spaces between name and bracket (12), No spaces between brackets(13) Spaces within name (14)

Boundary-Value Analysis Successful test cases frequently include values that are “directly on, above or beneath the edges of input equivalence classes and output equivalence classes.” (Myers) Each edge of an equivalence class is subject to test Result space is considered as well as input space

Boundary-Value Analysis (Myers) Write test cases for the ends of input ranges Input range is [-1.0, 1.0] Write cases for -1.0, 1.0, -1.0001, 1.0001 Number of possible inputs is [1,255] Write cases for 0, 1, 255, 256 Write test cases for the ends of output ranges Calculated SS Tax (FICA) is [$0,$6621.60] Write cases that yield results: $0, $.01, $6621.60 , and $6621.61 Number of possible output is [1,255] Write cases for 0,1 255, 256 outputs Use “your ingenuity” to search for other boundary conditions. Boundaries are not always so obvious

When to write tests? “All in all, I think test-first programming is one of the most beneficial software practices to emerge during the past decade…” Steve McConnell If you have to write tests eventually anyway, why not write them first so they can be useful longer. Detect bugs earlier Think more about requirements Think more about how others will use your code

Research Results on Tests Two studies 80% of errors are found in 20% of the classes 50% of errors are found in 5% of classes Most of the cost of a system might be represented by a very small amount of code. Error prone routines should be redesigned and/or re- implemented

Characterizing Errors 85% corrected within a single routine Three most common causes of errors Thin-domain knowledge Fluctuating/Conflicting Requirements Communication/Coordination Breakdown Almost always the programmer’s fault Typos/Spelling errors are very common Three most expensive errors involved the change of a single character ($1.6 Billion, $900 Million, $245 Million) Misinterpretation of Design 85% of errors can be fixed in a few hours It pays to know where you make errors (personal process) and where your project makes errors

Number of Errors to Expect Industry average is estimated at 1-25 errors per 1000 lines of code MS Applications Division gets 10-20/1000 lines in in-house tests: .5/1000 in released code. Space shuttle claims 0 defeats in 500,000 lines of code

Unit Tests Unit tests test an individual class or module We use unit tests in TDD Unit tests need to work independently from other parts of the system Unit tests need to be fast Unit tests typically test one thing The software under unit test may rely on other components in the systems. These components might be unavailable/undesirable during testing. They might be under development They might be unreliable They might be too slow

Definitions (Art of Unit Testing, by Roy Osherove) An external dependency is an object in your system that your code under test interacts with, and over which you have no control. A stub is a controllable replacement for an existing dependency (or collaborator) in the system. By using a stub, you can test your code without dealing with the dependency directly. Stubs are one instance of a class of tools called fakes. Fakes can provide a wide range of aids in testing. s.

Definitions (Art of Unit Testing, by Roy Osherove) A mock object is a fake object in the system that decides whether the unit test has passed on failed. It does so by verifying whether the object under test interacted as expected with the fake object. There’s usually no more than one mock per test. Numerous software frameworks are available to support the use of fakes Moq, Rhino Mocks, Microsoft Fakes