230 likes | 367 Views
Test data generation for covering functionality of database applications . Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System Programming at the Russian Academy of Sciences Moscow, Russian Federation . Target. Source. Extract. Load. Transform.
E N D
Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System Programming at the Russian Academy of Sciences Moscow, Russian Federation
Target Source Extract Load Transform Database - applications Change Change extraction source data changing values of source data transformation of input data loading data changing in the target some data
Problem Cartesian product combinatorial explosion problem of analyzing test results
Goal • cover all branches of the functionality • test set → min Ideally • one test data set per one functionality branch
Hierarchy of combinators X Y field1 field2 field3 field4 Cartesian product Cartesian product All X with any Y All Y with any X
Documentation analysis Formalization of requirements Formulation coverage criteria Generation of test data Normative documents Catalogue of requirements Coverage criteria Model of the SUT Test set CRITERIA - … - … - … - … Method description
ExampleBank credit system • the client type (V, U) • the credit type (A, B) bonus or penalty • the repaid sum
Documentation analysis Formalization of requirements Formulation coverage criteria Generation of test data Normative documents Catalogue of requirements Coverage criteria Model of the SUT Test set CRITERIA - … - … - … - …
A 1. Requirements elicitation Repay< Monthly Repay > Debt Monthly ≤ Repay ≤ Debt VIP USUAL VIP USUAL Loan‘B’ Loan‘A’ Loan‘B’ Loan‘A’ Penalty0 Penalty3% Bonus 5% Bonus 2% Bonus 1% Refund B e-mail is specified Notification
Documentation analysis Formalization of requirements Formulation coverage criteria Generation of test data Normative documents Catalogue of requirements Coverage criteria Model of the SUT Test set CRITERIA - … - … - … - …
A 2. Formalization of requirements P< MP P > D MP ≤ P ≤ D “V” “U” “U” “V” “B” “B” “A” “A” A.I P<MP && CL="V" => penalty 0; P<MP && CL="U" => penalty 3%; A.II.1 MP≤P≤D && (CL="V" && CR="B" || CL="U" && CR="A") => bonus 2%; A.II.2 MP≤P≤D && CL="V" && CR="A" => bonus 5%; A.II.3 MP≤P≤D && CL="U" && CR="B" => bonus 1%; A.III P>D => refund. B. E≠"" => notification. refund -3% +5% 0 +2% +1% B e-mail Notification
Documentation analysis Formalization of requirements Formulation coverage criteria Generation of test data Normative documents Catalogue of requirements Coverage criteria Model of the SUT Test set CRITERIA - … - … - … - …
3. Formulation of coverage criteria The division rules for parameter P • MP = D • MP < D P=MP P>MP P<MP P=D P=MP MP=D P>D P<MP MP<P<D
A P< MP P > D MP ≤ P ≤ D The division rules for parameters CL and CR • P < MP → 2 subsets (CL) • MP ≤ P ≤ D → 4 subsets (CL × CR) • P > D → 1 set “V” “U” “U” “V” “B” “B” “A” “A” refund -3% +5% 0 +2% +1%
The division rules for the parameter E • 2 subsets (empty, non-empty) B e-mail Notification
A P< MP P > D MP ≤ P ≤ D Independent aspects “V” “U” “U” “V” “B” “B” “A” “A” 0 -3% +5% 0 +2% +1% B e-mail Notification
Documentation analysis Formalization of requirements Formulation coverage criteria Generation of test data Normative documents Catalogue of requirements Coverage criteria Model of the SUT Test set CRITERIA - … - … - … - …
4. Generation of test data Description of DB scheme Pinery Test set Test set Test set Test set Configuration
Configuration of Pinery • Constraints on values of one field • MP = { 6 }; • D = { 6, 30 }; • E = { "", "…@…" }; • P[MP<D] = {MP-1, MP, (MP+D)/2, D, D+1}; • P[MP=D] = {MP - 1, D, D + 1}; • CL[ P<MP ] = { "V", "U" }; • CR[ P<MP ] = { "A" }; • ….
A P< MP P > D MP ≤ P ≤ D “V” “U” “U” “V” “B” “B” “A” “A” 0 -3% +5% 0 +2% +1% • Constraints on combination method for several fields • combinator( CREDITS ) = Diagonal( Depend( Depend( Product(MP, D), P), Product(CL, CR) ), E ); B e-mail Notification
Results • Our method: 22 tuples • Cartesian product: 64 tuples Economy increases if • possible values of fields ↗ • number of independent aspects ↗