Testcover.com 1 Embedded Functions in Combinatorial Test Designs George B. Sherwood Copyright © 2015 Testcover.com, LLC. All rights reserved.

Slides:



Advertisements
Similar presentations
BODY MASS INDEX (B.M.I.).
Advertisements

CH 27. * Data were collected on 208 boys and 206 girls. Parents reported the month of the baby’s birth and age (in weeks) at which their child first crawled.
Enumerated data type & typedef. Enumerated Data Type An enumeration consists of a set of named integer constants. An enumeration type declaration gives.
ENUMERATED, typedef. ENUMERATED DATA TYPES An enumeration consists of a set of named integer constants. An enumeration type declaration gives the name.
Line Efficiency     Percentage Month Today’s Date
Unit Number Oct 2011 Nov 2011 Dec 2011 Jan 2012 Feb 2012 Mar 2012 Apr 2012 May 2012 Jun 2012 Jul 2012 Aug 2012 Sep (3/4 Unit) 7 8 Units.
What is Body Mass Index (BMI) What is Body Mass Index (BMI)
10 May 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Formal.
Today Q1Q3Q1Q3Q1Q3Q1Q3Q1Q Beta Oct 15 Meeting May 1 Version 2 Jan 10 Presentation May 1 Testing 2.1 Nov 1 Checkpoint Jan 1.
Milestone 2 Aug 19 Milestone 4 Oct 22 Milestone 6 Dec 15 Milestone 9 Feb 26 Milestone 1 Aug 2 Milestone 3 Sep 27 Milestone 5 Nov 30 Milestone.
Today’s Agenda  Reminder: HW #1 Due next class  Quick Review  Input Space Partitioning Software Testing and Maintenance 1.
Measuring adult BMI using the Active People Survey Caroline Hancock | SEPHIG 26 March 2014.
Testcover.com 1 Functional Dependence and Equivalence Class Factors in Combinatorial Test Designs George B. Sherwood Copyright © 2014 Testcover.com, LLC.
How to Calculate Your Body Mass Index (BMI)
Chapter 2 Section 2.1 Sets and Set Operations. A set is a particular type of mathematical idea that is used to categorize or group different collections.
Non Leap YearLeap Year DateDay NumberMod 7Day NumberMod 7 13-Jan Feb Mar Apr May Jun Jul
Today Week Major Milestone Milestone 1 Jan 15 Milestone 2 Feb 20 Milestone 3 Mar 20 Milestone 4 Apr 25 Milestone 5 May 25 Milestone 6.
Basic View Main Menus Sub Menus 9-Aug-01 8-Aug-01 7-Aug-01 6-Aug-01
How to Calculate Your Body Mass Index (BMI)
Jan 2016 Solar Lunar Data.

The 6 steps of data collection:
Q1 Jan Feb Mar ENTER TEXT HERE Notes
George B. Sherwood Testcover.com

Project timeline # 3 Step # 3 is about x, y and z # 2
Average Monthly Temperature and Rainfall


2017 Jan Sun Mon Tue Wed Thu Fri Sat
Timeline PowerPoint Template

FOMEMA Sales Review Clinic Management Meeting
This Presentation Pack is brought to you by
Gantt Chart Enter Year Here Activities Jan Feb Mar Apr May Jun Jul Aug
Q1 Q2 Q3 Q4 PRODUCT ROADMAP TITLE Roadmap Tagline MILESTONE MILESTONE
Free PPT Diagrams : ALLPPT.com


Step 3 Step 2 Step 1 Put your text here Put your text here
Calendar Year 2009 Insure Oklahoma Total & Projected Enrollment
MONTH CYCLE BEGINS CYCLE ENDS DUE TO FINANCE JUL /2/2015
Jan Sun Mon Tue Wed Thu Fri Sat
©G Dear 2008 – Not to be sold/Free to use
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ITEM 1 ITEM 2 ITEM 3
Electricity Cost and Use – FY 2016 and FY 2017

Independent Variables
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Q1 Q2 Q3 Q4 PRODUCT ROADMAP TITLE Roadmap Tagline MILESTONE MILESTONE
Free PPT Diagrams : ALLPPT.com

Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Objective - To make a line graph.
Belem Climate Data Table
Text for section 1 1 Text for section 2 2 Text for section 3 3
Text for section 1 1 Text for section 2 2 Text for section 3 3
Factoring if/else code
Text for section 1 1 Text for section 2 2 Text for section 3 3
Project timeline # 3 Step # 3 is about x, y and z # 2
TIMELINE NAME OF PROJECT Today 2016 Jan Feb Mar Apr May Jun

Q1 Q2 Q3 Q4 PRODUCT ROADMAP TITLE Roadmap Tagline MILESTONE MILESTONE
Pilot of revised survey
Change Management E2E Roadmap
Presentation transcript:

Testcover.com 1 Embedded Functions in Combinatorial Test Designs George B. Sherwood Copyright © 2015 Testcover.com, LLC. All rights reserved.

Testcover.com 2 This talk is about: Conforming to constraints in combinatorial test designs A feature to improve usability and adoption of combinatorial testing by practitioners Embedded functions using a general-purpose programming language – Combination functions to define constraints for test case generation – Substitution functions to evaluate expected equivalence class(es) of test cases Ongoing project to assess usability and performance Copyright © 2015 Testcover.com, LLC. All rights reserved.

Test model terms 3 There are k test factors, e.g. configurations & inputs A test case has 1 value for each factor (i.e. a k -tuple) A strength- t design ( t ≤ k ) includes all required t -tuples of test factor values A partition includes the allowed combinations ( t -tuples) for 1 test case generation instance An equivalence class includes combinations for 1 class of expected results A partition’s test cases can exercise 1 or more equivalence classes Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved.

Valid inputs 4 k -tuple Valid configuration 1 Valid configuration 2 Valid configuration 3 Invalid configuration 4 Invalid configuration 5 Valid inputs 1 Valid inputs 2 Valid inputs 3 Valid inputs 4 t -tuple Testcover.com 4 Why are constraints needed? To cover all required configurations To cover all required input combinations To cover required tuples for different classes of results Copyright © 2015 Testcover.com, LLC. All rights reserved. All 3 situations can cause masking: A required t’ -tuple (with t’ ≤ t ) is missing from the test cases for a class of results Constraints are needed to cover all required tuples Test factors Configurations Inputs k -tuple Invalid inputs 5 Invalid inputs 6 t -tuple?

Functionally dependent test factor values 5 Constraints can be described using functionally dependent test factor values Functional dependence: 1 or more values of a dependent factor are identified by those of other, determinant factors Determinant factors’ values → dependent factor values Example: The last day of any month is identified by the month and its year Month, Year → Last day values l = number of determinant factors ( l = 2 in this example) Use Direct Product Block (DPB) notation with or without embedded combination functions Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved.

Calendar Example without last_day function Month Day Year #ok All good dates jan feb mar apr may jun jul aug sep oct nov dec long month last day jan mar may jul aug oct dec short month last day apr jun sep nov feb last day feb leap day feb Direct Product Block (DPB) Notation 6 Valid calendar dates example with boundary checking Factor values are on separate lines All combinations in a block are allowed Partition of multiple blocks includes union of their allowed combinations Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved. Fixed values form

Direct Product Block (DPB) Notation 7 Month, Year → Last day values Factors renamed as variables for function arguments: $month $year Day values: 1 10 last_day($month,$year) 5 blocks now represented by only 1 block Calendar Example without last_day function Month Day Year #ok All good dates jan feb mar apr may jun jul aug sep oct nov dec long month last day jan mar may jul aug oct dec short month last day apr jun sep nov feb last day feb leap day feb Calendar Example with last_day function $month Day $year #ok All good dates jan feb mar apr may jun jul aug sep oct nov dec 1 10 last_day($month,$year) Fixed values formFunctionally dependent form Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved.

Combination functions 8 <?php function last_day($month,$year) { $mo_num=array('jan'=>1,'feb'=>2,'mar'=>3,'apr'=>4,'may'=>5,'jun'=>6, 'jul'=>7,'aug'=>8,'sep'=>9,'oct'=>10,'nov'=>11,'dec'=>12); return(cal_days_in_month(CAL_GREGORIAN,$mo_num[$month],(int)$year)); } ?> last_day($month,$year) is a combination function Combination functions return dependent values for all allowed combinations of determinant factor values Generator uses these fixed values to construct test cases last_day($month,$year) needs to return the last day for any month in the years PHP built-in function cal_days_in_month is reused: Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved.

Why PHP? 9 Other languages can support embedded functions Prevalence: millions of programmers – Free, open source – Easy to learn Support for user-defined (embedded) functions Hundreds of built-in functions, for reuse as needed Good performance without explicit compilation Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved.

Constraint simplification 10 Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved. Constraints: Items in different positions must be different Factor values may be NULL (unused) Equivalence classes are target UML leaf states to avoid masking Simplification for nonemptyCart to nonemptyCart transition: Without combination functions: 33 blocks With 7 combination functions: 3 blocks Average function length: 7 lines

Shopping cart state diagram 11 Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved.

Test Factor Test Factor Values Combination Functions Indication $newItemNULLItem to place in cart $n1 2 3Number of items in cart $delChk[0]0 1f_delChkDelete box checked in cart position 0 $item[0]itemA itemB itemC f_itemItem in cart position 0 $qty[0]1 2 10f_qtyQuantity of item in cart position 0 $newQ[0] f_newQNew quantity shown in cart position 0 $delChk[1]0 1 NULLf_delChkDelete box checked in cart position 1 $item[1]itemA itemB itemC NULL f_itemItem in cart position 1 $qty[1] NULLf_qtyQuantity of item in cart position 1 $newQ[1] NULLf_newQNew quantity shown in cart position 1 $delChk[2]0 1 NULLf_delChkDelete box checked in cart position 2 $item[2]itemA itemB itemC NULL f_itemItem in cart position 2 $qty[2] NULLf_qtyQuantity of item in cart position 2 $newQ[2] NULLf_newQNew quantity shown in cart position 2 $i0 1 2 NULLf_iCart position for event $q NULLQuantity for event statenonemptyCartSource state eventCHECK($i) QTY($i,$q) UPDATE f_event_CHECK f_event_QTY Trigger to target state 12 Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved. Shopping cart test factors Test factors: – Program variables Indexed for cart position NULL values as needed – Current state nonemptyCart – Event (trigger) CHECK QTY UPDATE Combination functions – Composite functions as needed – Same function for each indexed factor in each block

Substitution functions 13 A substitution function returns a value for each test case after test case generation A substitution function value can be determined by its test case factor values Substitution functions for equivalence classes can identify the expected class for each test case – To evaluate expected equivalence classes automatically – To enable equivalence class coverage assessment – To check pre-generation equivalence class analysis Why equivalence classes? Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved.

Testcover.com 14 Body mass index report requirements R1. Input data for patient database table: Age in years Weight in pounds Height in inches Sex (female, male) Intake in kilocalories per day R2. Compute & store body mass index: BMI = 703 x Weight / Height 2 Copyright © 2015 Testcover.com, LLC. All rights reserved. R3. Age ≥ 65: Generate Medicare report R4. Age < 20 Generate Child report: Girl, percentile from female BMI-age table Boy, percentile from male BMI-age table R5. Age ≥ 20 Generate Adult report: Underweight, BMI < 18.5 Normal, 18.5 ≤ BMI < 25.0 Overweight, 25.0 ≤ BMI < 30.0 Obese, 30.0 ≤ BMI

Testcover.com 15 Why equivalence classes? Equivalence classes group test factor combinations by similar expected results Classes help insure test design coverage Example: The Medicare, Child and Adult reports each have multiple, valid equivalence classes Equivalence classes are functionally dependent Input, configuration values → result → equivalence class Report classes can be expressed as 3 functions ReportValid equivalence classes Medicare noyes Child nogirlboy Adult nounderweightnormaloverweightobese Copyright © 2015 Testcover.com, LLC. All rights reserved.

Equivalence class considerations 16 Partitions are associated with 1 or more equivalence classes, based on test models and goals Required equivalence classes must be reached: – Either t ≥ l in a multi-class partition, with l -tuples for all required classes – Or the partition is constrained to 1 class, with l -tuples for that class Class boundaries are frequently locations of programming errors Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved. Age, Weight, Height→ Adult classes3 Examples: l Age→ Medicare classes1 Age, Sex→ Child classes2

Age, Weight, Height→ Adult classes(Nondeterminant: Sex, Intake) Each class may be associated with other factors according to its nondeterminant strength s – Either s = t – l + 1 in a multi-class partition – Or s = t + 1 in a single-class partition To test all classes with their nondeterminant factors: – Either use s ≥ 2 ( t ≥ 4 in this example) in a multi-class partition – Or use a lower strength in single-class partitions Equivalence class associations 17 Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved. Age, Weight, Height→ Adult classes31 Examples with strength t = 3: ls Age→ Medicare classes13 Age, Sex→ Child classes22

Test cases with equivalence classes evaluated Input factorsEquivalence class factors Test CaseAgeWeightHeightSexIntakeMedicareChildAdult female 2000 nogirlno male 3000 noboyno male 2000 noboyno female 3000 nogirlno female 2000 nogirlno male 3000 noboyno female 2000 no normal male 3000 no normal female 3000 no underweight male 2000 no obese female 2000 no overweight male 3000 no overweight female 2000 yesnonormal male 3000 yesnonormal female 3000 yesnounderweight male 2000 yesnoobese female 2000 yesnooverweight male 3000 yesnooverweight Test cases with equivalence classes evaluated Input factorsEquivalence class factors Test CaseAgeWeightHeightSexIntakeMedicareChildAdult female 2000 nogirlno male 3000 noboyno male 2000 noboyno female 3000 nogirlno female 2000 nogirlno male 3000 noboyno female 2000 no normal male 3000 no normal female 3000 no underweight male 2000 no obese female 2000 no overweight male 3000 no overweight female 2000 yesnonormal male 3000 yesnonormal female 3000 yesnounderweight male 2000 yesnoobese female 2000 yesnooverweight male 3000 yesnooverweight Test cases with equivalence classes evaluated Input factorsEquivalence class factors Test CaseAgeWeightHeightSexIntakeMedicareChildAdult female 2000 nogirlno male 3000 noboyno male 2000 noboyno female 3000 nogirlno female 2000 nogirlno male 3000 noboyno female 2000 no normal male 3000 no normal female 3000 no underweight male 2000 no obese female 2000 no overweight male 3000 no overweight female 2000 yesnonormal male 3000 yesnonormal female 3000 yesnounderweight male 2000 yesnoobese female 2000 yesnooverweight male 3000 yesnooverweight 18 Testcover.com Copyright © 2015 Testcover.com, LLC. All rights reserved. Equivalence class substitution functions Substitution functions help assess equivalence class coverage

Testcover.com 19 Embedded functions A feature to improve usability and adoption of combinatorial testing by practitioners Uses a general-purpose programming language for – Combination functions to define constraints for test case generation – Substitution functions to evaluate expected equivalence class(es) of test cases Ongoing project to assess usability and performance Copyright © 2015 Testcover.com, LLC. All rights reserved.