Top Banner
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
23

Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Dec 13, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

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

Page 2: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Database - applications

• extraction source data• changing values of source data• transformation of input data• loading data • changing in the target some data

Extract

Change

TransformLoad

Change

Source Target

Page 3: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Problem

Cartesian product

combinatorial explosion

problem of analyzing test results

Page 4: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Goal

• cover all branches of the functionality• test set → min

Ideally• one test data set per one functionality branch

Page 5: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Hierarchy of combinators

field1 field2 field3 field4

Cartesian product

Cartesian product

All X with any YAll Y with any X

X Y

Page 6: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Comparison of the toolsDTM Data Generator

Turbo Data

DB Monster

Agenda HTDGen Pinery

generation for one field

random

from tables

from libraries

auto incremental

random by a mask

dependent tables

user procedures

generation for many fields

combinators

hierarchy of different combinators

Page 7: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Method description

Model ofthe SUT

Catalogue ofrequirements

Documentation analysis

Formalization of

requirements

Formulation coveragecriteria

Normativedocuments

Generationof test data

CRITERIA

- …- …- …- …

Coveragecriteria

Testset

Page 8: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

ExampleBank credit system

• the client type (V, U)• the credit type (A, B) bonus or penalty• the repaid sum

Page 9: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Model ofthe SUT

Catalogue ofrequirements

Documentation analysis

Formalization of

requirements

Formulation coveragecriteria

Normativedocuments

Generationof test data

CRITERIA

- …- …- …- …

Coveragecriteria

Testset

Page 10: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

1. Requirements elicitation

Monthly  ≤  Repay  ≤  Debt

VIP USUAL

Repay < Monthly

USUAL VIP

Repay > Debt

Loan ‘A’ Loan ‘B’ Loan ‘A’ Loan ‘B’

A

Penalty0

Penalty3%

Bonus 2%

Bonus 5%

Bonus 1%

Refund

B

e-mail is specified

Notification

Page 11: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Model ofthe SUT

Catalogue ofrequirements

Documentation analysis

Formalization of

requirements

Formulation coveragecriteria

Normativedocuments

Generationof test data

CRITERIA

- …- …- …- …

Coveragecriteria

Testset

Page 12: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

MP  ≤  P  ≤  D

“V” “U”

P < MP

“U” “V”

P > D

“A” “B” “A” “B”

A

0 -3% +2%+5% +1% refund

B

e-mail

Notification

MP to be pay

D debt

P repaid

CL client type (V, U)

CR credit type (A, B)

E e-mail

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.

2. Formalization of requirements

Page 13: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Model ofthe SUT

Catalogue ofrequirements

Documentation analysis

Formalization of

requirements

Formulation coveragecriteria

Normativedocuments

Generationof test data

CRITERIA

- …- …- …- …

Coveragecriteria

Testset

Page 14: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

3. Formulation of coverage criteria The division rules for parameter P

•MP = D

•MP < DMP=D

P<MP P>MPP=MP

MP<P<DP<MP P>D

P=MP P=D

Page 15: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

The division rules for parameters CL and CR

•P < MP → 2 subsets (CL)

•MP ≤ P ≤ D → 4 subsets (CL × CR)

•P > D → 1 set MP  ≤  P  ≤  D

“V” “U”

P < MP

“U” “V”

P > D

“A” “B” “A” “B”

A

0 -3% +2%+5% +1% refund

Page 16: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

The division rules for the parameter E

•2 subsets (empty, non-empty)

B

e-mail

Notification

Page 17: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Independent aspects

MP  ≤  P  ≤  D

“V” “U”

P < MP

“U” “V”

P > D

“A” “B” “A” “B”

A

0 -3% +2%+5% +1% 0

B

e-mail

Notification

Page 18: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Model ofthe SUT

Catalogue ofrequirements

Documentation analysis

Formalization of

requirements

Formulation coveragecriteria

Normativedocuments

Generationof test data

CRITERIA

- …- …- …- …

Coveragecriteria

Testset

Page 19: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

4. Generation of test data

Description ofDB scheme

Configuration

PineryTest set

Test setTest set

Test set

Page 20: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

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" };– ….

Page 21: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

• Constraints on combination method for several fields– combinator( CREDITS ) =

Diagonal( Depend( Depend( Product(MP, D), P), Product(CL, CR) ),

E );

MP  ≤  P  ≤  D

“V” “U”

P < MP

“U” “V”

P > D

“A” “B” “A” “B”

A

0 -3% +2%+5% +1% 0

B

e-mail

Notification

Page 22: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Results

• Our method: 22 tuples• Cartesian product: 64 tuples

Economy increases if• possible values of fields ↗• number of independent aspects ↗

Page 23: Test data generation for covering functionality of database applications Authors: Sergey Zelenov, Vitaly Omelchenko, Evgeny Kostychev Institute for System.

Thank you !