### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# Informatics 43 week 8 notes IN4MATX

UCI

GPA 3.9

### View Full Document

## 8

## 0

## Popular in INTRO SOFTWARE ENGR

## Popular in Department

This 44 page Class Notes was uploaded by Apurva on Monday May 23, 2016. The Class Notes belongs to IN4MATX at University of California - Irvine taught by NAVARRO, E. in Fall 2015. Since its upload, it has received 8 views.

## Similar to IN4MATX at UCI

## Reviews for Informatics 43 week 8 notes

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 05/23/16

Informatics 43 LECTURE 8-1 EMILY NAVARRO Last Time • Many failures are caused by a lack of good quality assurance (QA) practices • QA = All activities designed to measure and improve quality in a product • Validation & verification • Testing is the most common QA activity • Different levels: unit/functional/system • Goal: find and fix failures/faults/errors • Can never be exhaustive • Can never prove a system’s correctness • All software has bugs! Today’s Lecture • Black-box (Specification-based)Testing • Homework 2 Today’s Lecture • Black-box (Specification-based)Testing • Homework 2 Two Overall Testing Approaches • Black box testing • Specification-based testing • White box testing • Structural testing Black-box/Specification- Based Testing Black-box/Specification- Based Testing • Use specificationsto derive test cases • Choose test cases that guarantee a wide range of coverage • Typical values • Boundary values • Special cases • Invalid input values Equivalence Class Partitioning • Divide the input into several classes that are considered “equivalent” for the purposes of finding errors • If it fails/passes for one member of the class, it is likelyto fail/pass forall members • Classes are determined by • Looking at the requirements specification • Tester’s intuition • Classes • should cover the complete input domain • should never overlap Boundary Value Analysis • Experiencehas shown that many errors are made at the “boundaries” rather than under normal conditions • E.g., confusion between< and <= • Boundary value analysis uses the same classes as equivalencepartitioning, but tests at the boundaries of the classes, rather than just any element from the class Equivalence Class Partitioning/Boundary Value Analysis: A Systematic Approach 1. Identify the set of all possible inputs (to what is being tested), aka “domain” 2. Identify a basis for subdividing the set of inputs • Possible bases • Size/magnitude • Structure • Correctness • Your creative thinking Equivalence Class Partitioning/Boundary Value Analysis: A Systematic Approach (cont.) 3. Use this basis to divide the set of all possible inputs into classes/subdomains 4. From each subdomain, select[a] representative(s) to be [a] test case input(s) • One test case may suffice 5. Test foreach subdomain • “Normal” values • Boundary or edge input values (Boundary Value Analysis) Example: quizAverage • Input: A list of numbers (integers) • Scores must be between 0 and 100 (inclusive) • Output: a single number which is the average of the numbers on the input list, not countingthe lowest number on the list. Example: quizAverage 1. Identify the set of all possible inputs (to what is being tested) 2. Identify a basis for subdividing the set of inputs 3. Use this basis to divide the set of all possible inputs intosubdomains 4. From each subdomain, select[a] representative(s) to be[a] test case input(s) Example: quizAverage 1. Identify the set of all possible inputs (to what is being tested) The set of all lists of integers 2. Identify a basis for subdividing the set of inputs 3. Use this basis to divide the set of all possible inputs intosubdomains 4. From each subdomain, select[a] representative(s) to be[a] test case input(s) Example: quizAverage 1. Identify the set of all possible inputs (to what is being tested) The set of all lists of integers 2. Identify a basis for subdividing the set of inputs length of the list, position of minimum score, number of minima, magnitude of numbers 3. Use this basis to divide the set of all possible inputs intosubdomains 4. From each subdomain, select[a] representative(s) to be[a] test case input(s) Example: quizAverage 1. Identify the set of all possible inputs (to what is being tested) The set of all lists of integers 2. Identify a basis for subdividing the set of inputs length of the list, position of minimum score, number of minima, magnitude of numbers 3. Use this basis to divide the set of all possible inputs intosubdomains 0 elements,1, 2-10, 11+, first, middle,last, 1, a few, all, 0-33, 34-66, 67-100, mixed 4. From each subdomain, select[a] representative(s) to be[a] test case input(s) Example: quizAverage 1. Identify the set of all possible inputs (to what is being tested) The set of all lists of integers 2. Identify a basis for subdividing the set of inputs length of the list, position of minimumscore, number of minima, magnitude of numbers 3. Use this basis to divide the set of all possible inputs into subdomains 0 elements, 1, -10, 11+, first, middle, last, 1, a few, all, 0-33, 34-6, 67-100, mixed 4. From each subdomain, select [a] representative(s) to be [a] test case input(s) [], [87.3],[90,95,85 ],[80,81,82,83,84,85,86,87,88,89,90,91], [80,87,88,89],[87,88,80,89],[87,88,89,80], [80,87,88,89],[87,86,86,88],[88,88,88,88], Possible Basis: List Length • Input domain: all possible lists of integer numbers • Subdomains • Empty list [] • One element [87] • Small (two to ten elements) [90,95,85] • Large (eleven+ elements) [80,81,82,83,84,85,86,87,88,89,90,91] Possible Basis: Position of Minimum Score • Input domain: all possible lists of integer numbers • Subdomains • Smallest element first [80,87,88,89] • Smallest element in middle [87,88,80,89] • Smallest element last [87,88,89,80] Possible Basis: Number of Minima • Input domain: all possible lists ofinteger numbers • Subdomains • One minimum [80,87,88,89] • A few minima [87,86,86,88] • All minima [88,88,88,88] Possible Basis: Magnitude of Numbers • Input domain: all possible lists of integer numbers • Subdomains • Small (0-33) [0,4,15,5,33] • Medium (33-66) [47, 43, 58, 60, 34] • Large (67-100) [100, 67] • Mixed [0, 35, 99] Testing Matrix Basis Test case Subdomain Expected Actual (input) output output quizAverage 1 Basis: List length Test case Subdomains Expected Actual (input) output output Empty One Small Large () x 0.0 99999! (87) x 87.0 crashes! (90,95,85) x 92.5 92.5 (80,81,82,83, 84,85,86,87, x 86.0 86.0 88,89,90,91) quizAverage 2 Basis: Position of minimum Test case Subdomains Expected Actual (input) output output First Middle Last (80,87,88,89) x 88.0 88.0 (87,88,80,89) x 88.0 88.0 (99,98,0,97,96) x 97.5 97.5 (87,88,89,80) x 88.0 88.0 quizAverage 3 Basis: Number of minima Test case Subdomains Expected Actual (input) output output One Several All (80,87,88,89) x 88.0 88.0 (87,86,86,88) x 87.0 87.0 (99,98,0,97,0) x 73.5 98.0 (88,88,88,88) x 88.0 88.0 quizAverage 4 Basis: Magnitude of numbers Test case Subdomains Expected Actual (input) output output 0-33 34-66 67-100 Mixed (0,4,15,5,33) x 14.25 14.25 (47,43,58,60,34) x 52 52 (100,67) x 100 100 (0, 35, 99) x 67 67 Example: Hotel Management System • Consider a hotel management system that takes phone numbers as inputwhile gathering data about the guest • Imagine we want to test the “input phone number” function of the system • Specification: Should give a descriptive error message if • input is less than 10 digits • input is more than 20 digits • input contains no-numeric characters • What are the properties about phone numbers that we can exploit to create “valuable”partitions? Input Phone Number 1 Basis: length of input Subdomains Test Case Input Data Expected Output Too small (<10 3334444 error digits) 333-4447 error Too large (>20 283948582930900445554 error digits) Valid small 01-8849394858 ok 15 digits long) Valid large 61-82833333849573849 ok 20 digits long) Input Phone Number 2 Basis: content of input Subdomains Test Case Input Data Expected Output Contains only 2938485938 Ok numeric 283948574859384739 ok characters Contains non- 1234b8983 Error numeric Gieoi!^%@ error characters (but not (,),-,#,*,+,: Contains (,),- (949)824-6300 error ,#,*,+,: Input Phone Number 3 Basis: position of invalid characters Subdomains Test Case Input Data Expected Output beginning (9498246300 error middle 949824-6300 error end 9498246300- error No invalid 9498246300 ok characters Multiple places (949)824-6300- error Example: Email • Imagine we are testing the login functionalityof an emailprogram • Input: username, password • Output: login successful or error message • Two users: • Mary; maryspassword • Joe; joespassword • What possible bases can we use to divide our testing into partitions ? Login Basis: whether or not the password matches Subdomains Test Case Input Data Expected Output Password Mary, maryspassword ok matches user Password Mary, joespassword error matches another user Password Mary, nopassword error matches no user Example: Room Scheduler System • Imagine we are testing a classroom scheduler program that handles M-F scheduling for five classrooms • Room capacities • Room A: 500 • Room B: 300 • Room C: 100 • Room D: 50 • Room E: 20 • All classes are 1-hour long, once per week, and can be scheduled between8am-10pm Example: Room Scheduler System • Input • The current schedule • The number of students in the class to be scheduled • The desired time of the class to be scheduled • Output • A list of available rooms that can hold the number of students, ordered from most appropriate (number of students is as close as possible to room capacity without going over) to least appropriate Example: Room Scheduler System • Example Room capacities • Input: Room A: 500 Room B: 300 • {Currentschedule: Room C: 100 • Room A: M-F:8-11am, 2-4pm Room D: 50 • Room B: T-F: 9-10am, 5-8pm Room E:20 • Room C: F:10am -3pm • Room D: M-F:8am-10pm • Room E: M-F:10am-5pm, 8pm-10pm; • Num students: 73 • Desired time: W 5-6pm} • Expectedoutput: {Room C, Room A} Example: Room Scheduler System • What possible bases can we use to divide our testing into partitions ? • Fullness of schedule • Number of students in the class to be scheduled • Desired time Schedule Room 1 Basis: Fullness of schedule Subdomains Test Case Input Data Expected Output Empty schedule EMPTY_SCHEDULE, 150, T Room B, Room A 5-6pm Partially full SCHEDULE_A, 73, W 5-6pm Room C, Room A schedule Full schedule FULL_SCHEDULE, 425, F - No rooms available 10am Schedule Room 2 Basis: Class size Subdomains Test Case Input Data Expected Output Invalid input SCHEDULE_A, -5, T 5-6pm Error Small (0-20) SCHEDULE_A, 3, M 2-3pm Room C, Room B Medium (21 - SCHEDULE_A, 25, M 2-3pm 199) Large (200-500) SCHEDULE_A, 250, T 1-2pm Room B, Room A SCHEDULE_A, 500, M 8-9pm Room A Over capacity SCHEDULE_A, 50000, F 3-4pm Error Schedule Room 3 Basis: Desired time Subdomains Test Case Input Data Expected Output Morning SCHEDULE_A, 55, W 8-9am Afternoon SCHEDULE_A, 400, T 1-2PM Evening SCHEDULE_A, 250, M 6- 7PM Summary • Black box testing uses specifications to derive test cases • We use equivalenceclass partitioning and boundary value analysis to choose test cases that guarantee a wide range of coverage • Typical values, boundary values, special cases, invalid input Today’s Lecture • Black-box (Specificatio-based)Testing • Homework2 Homework 2 • You will be designing test cases for HMM using a black-box/specification -based approach • You will be provided with a specification upon which to base your testing • Your document will mainly consist of testing matrices • Homework 2 is posted • Deadline is Tuesday, May 24, 11:55pm to EEE What are some possible bases for HW2? • UC1 • Length of description • Zip code length • Zip code value • Platform • UC2 • Size of TA list / number of available Tas • Number of TAs equidistant from customer • Distance between customer and closest TA • Number ofTas whose expertise match the device/platform of the ticket Next Time • White-box (Structural)Testing

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "When you're taking detailed notes and trying to help everyone else out in the class, it really helps you learn and understand the material...plus I made $280 on my first study guide!"

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.