Black Box Unit Testing 1209. What is black-box testing? Unit (code, module) seen as a black box No access to the internal or logical structure Determine.

Slides:



Advertisements
Similar presentations
Software Testing and Quality Assurance
Advertisements

Pairwise Testing. A case study (from Lee Copeland’ book) A web-based application has been written to work with eight different browsers – IE 5.0, 5.5,
Unit Testing CS 4311 Hans Van Vliet, Software Engineering, Principles and Practice, 3rd edition, John Wiley & Sons, Chapter 13.
Testing and Test Case Development A “primitive” method of testing, with NO test preparation, may include the following steps : – Initiate the system –
Black Box Testing Csci 565 Spring 2009.
Sentricon: How To Guide. How to Enter a New Sentricon Job First create a new service setup on the customer’s account.
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.
Testing in the Small (aka Unit Testing, Class Testing)
Testing Independent Options
Testing dan Implementasi Sistem materi 4
1 CODE TESTING Principles and Alternatives. 2 Testing - Basics goal - find errors –focus is the source code (executable system) –test team wants to achieve.
Tirgul 9 Amortized analysis Graph representation.
Software Testing and Quality Assurance
Testing an individual module
Chapter 18 Testing Conventional Applications
1 Software Testing and Quality Assurance Lecture 27 – Testing State Transition Diagrams.
Functional Testing.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Equivalence Class Testing
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 9 Functional Testing
Black Box Software Testing
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Test Design Techniques
Testing techniques, example
CS 325: Software Engineering March 31, 2015 Software Testing Black-Box Testing White-Box Testing Regression Testing.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Dynamic Black-Box Testing Part 2
Semester 1, 2003 Week 7 CSE9020 / 1 Software Testing and Quality Assurance With thanks to Shonali Krishnaswamy and Sylvia Tucker.
Chapter 8: Systems analysis and design
Test plans CSCI102 - Systems ITCS905 - Systems MCS Systems.
Let us start from the V-Model Verification Phases Requirements analysis System Design Architecture Design Module Design Coding Validation phases Unit.
Introduction Telerik Software Academy Software Quality Assurance.
CMSC 345 Fall 2000 Unit Testing. The testing process.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Black-Box Testing Techniques I Software Testing Lecture 4.
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.
Software Transition Testing Presented By: Varun Phanda
Black-Box Testing Techniques I
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
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.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Black-box Testing.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
Systems Life Cycle. Know the elements of the system that are created Understand the need for thorough testing Be able to describe the different tests.
Testing Independent Options Telerik Software Academy Software Quality Assurance.
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
Joey Paquet, 2000, Lecture 2 Lexical Analysis.
Testing in the Small (aka Unit Testing, Class Testing) 1209.
Test Case Designing UNIT - 2. Topics Test Requirement Analysis (example) Test Case Designing (sample discussion) Test Data Preparation (example) Test.
1. Black Box Testing  Black box testing is also called functional testing  Black box testing ignores the internal mechanism of a system or component.
Dynamic Testing.
Theory and Practice of Software Testing Chapter 14 Presman Software Testing Tactics BLACK BOX TESTING.
Software Engineering Testing. These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright.
Introduction to Domain Testing. 2 What is Domain Testing? Domain testing is: one of several software testing techniques designed to help you find bugs.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 10 Using Menus and Validating Input.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Dynamic Black-Box Testing Part 1 What is dynamic black-box testing? How to reduce the number of test cases using: Equivalence partitioning Boundary value.
Introduction to Domain Testing
Functional testing, Equivalence class testing
Testing dan Implementasi Sistem materi 4
Testing in the Small (aka Unit Testing, Class Testing)
Domain Testing Functional testing which tests the application by giving inputs and evaluating its appropriate outputs. system does not accept invalid and.
TESTING TOOLS MANUAL APPROACH BY J.ADI SESHU.
DeMorgan’s Theorem DeMorgan’s 2nd Theorem
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Computer Science Testing.
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.
Test Design Techniques Software Testing: IN3240 / IN4240
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Black Box Unit Testing 1209

What is black-box testing? Unit (code, module) seen as a black box No access to the internal or logical structure Determine if given input produces expected output. Input Output

Black Box Testing Test set is derived from requirements Goal is to cover the input space Lots of approaches to describing input space: –Equivalence Classes –Boundary Value Analysis –Decision Tables –State Transitions –Use Cases –...

Advantage and Disadvantage Advantage: Disadvantage: Need to define an efficient strategy to limit number of test cases

General Black Box Process Analyze requirements Select valid and invalid inputs Determine expected outputs Construct tests Run tests Compare actual outputs to expected outputs

Equivalence Relations: Reflexive Symmetric Transitive

Equivalence classes: Basic Strategy Partition the input into equivalence classes Test a subset from each class

Basic strategy: Example:fact(n): if n =200 error if 0<=n<=20, exact value if 20<n<200, approximate value within.1%

Simple Example: Suppose you are building an airline reservation system. A traveler can be a child, an adult, or a senior. The price depends on the type of traveler. The seat reservation does not depend on the type of traveler. How many test cases are required for the reservation component and the billing component?

Finding equivalence classes: Identify restrictions for inputs and outputs in the specification If there is a continuous numerical domain, create one valid and two or three invalid classes (above, below, and NaN) If a number of values is required, create one valid and two invalid classes

Boundary Values: Programs that fail at interior elements of a class usually fail at the boundaries too. Test the boundaries.

Hints If a domain is a restricted set, check the boundaries. e.g., D=[1,10], test 0, 1, 10, 11 –It may be possible to test the boundaries of outputs, also. For ordered sets, check the first and last elements For complex data structures, the empty list, full lists, the zero array, and the null pointer should be tested

Boundary Value: in class Determine the boundary values for US Postal Service ZIP codes Determine the boundary values for a 15- character last name entry.

Decision Tables Construct a table (to help organize the testing) Identify each rule or condition in the system that depends on some input For each input to one of these rules, list the combinations of inputs and the expected results

Decision Table Example Test CaseC1 Student C2 Senior Result Discount? Theater ticket prices are discounted for senior citizens and students.

Pairwise Testing

Problem 1 From Lee Copeland, A Practitioner’s Guide to Software Test Design, Artech House Publishers, A web site must operate correctly with different browsers: IE 5, IE 6, and IE 7; Mozilla 1.1; Opera 7; and FireFox 2, 3, and 4. It must work using RealPlayer, MediaPlayer, or no plugin. It needs to run under Windows ME, NT, 2000, XP, and Vista, and 7.0 It needs to accept pages from IIS, Apache and WebLogic running on Windows NT, 2000, and Linux servers

Problem 2 A bank is ready to test a data processing system Customer types –Gold (i.e., normal) –Platinum (i.e., important) –Business –Non profits Account types –Checking –Savings –Mortgages –Consumer loans –Commercial loans States (with different rules): CA, NV, UT, ID, AZ, NM From Lee Copeland, A Practitioner’s Guide to Software Test Design, Artech House Publishers, 2004.

When given a large number of combinations: (options improve …) Give up and don’t test Test all combinations … miss targets, delay product launch, and go out of business Choose one or two cases

Orthogonal Arrays A 2-D array with the property –All pairwise combinations occur in every pair of columns Example: consider 3 variables (columns) with {a,b}, {1,2}, and (α,β) Aα 21Bβ 32Aβ 42Bα

Orthogonal Array Example Aα 21Bβ 32Aβ 42Bα Look at each pair of columns (1 and 2),( 1 and 3), and (2 and 3) Does each of the 4 pairings appear in each? (Yes, of course!)

Pairwise Testing Algorithm 1.Identify variables 2.Determine choices for each variable 3.Locate an orthogonal array 4.Map test cases to the orthogonal array 5.Construct tests

Example using Bank 1.Identify variables 2.Determine choices for each variable 3.Locate an orthogonal array 4.Map test cases to the orthogonal array 5.Construct tests

Locate an orthogonal array (look up on web)

Map Test Cases (30) CACheckGold CASavePlat CAMortBusi CAConsNonP NVCheckPlat NVSaveGold NVMortNonP NVConsBusi UTCheckBusi UTSaveNonP UTMortGold UTConsPlat IDCheckNonP IDSaveBusi IDMortPlat IDConsGold AZCommGold AZCheckPlat AZSaveBusi AZMortNonP NMCommPlat NMCheckGold NMSaveNonP NMMortBusi CACommBusi NVCommNonP UTCommGold IDCommPlat AZConsGold NMConsPlat

Pairwise Summary When the combination is large, test all pairs, not all combinations Studies indicate that most defects are single or double-mode effects –Can be found in pairing –Few defects require more than two modes Orthogonal arrays have the pairwise property and can be found or generated

State Transition Testing

Build STD of system or component Cover the STD

Example Res Made Paid Cancelled Non Pay Ticketed Cancelled Cust Used Cust Order/start timer Payment made Ticket Printed Time Expires Ticket Delivered Cancel/ refund Cancel

Use Case Testing