Skip to content
Donatello Santoro edited this page Sep 28, 2020 · 5 revisions

Input

Dependencies

// FD: Zip -> City
e1: person(ssn: $ssn1, name: $n1, surname: $s1, city: $c1, zip: $z1), 
person(ssn: $ssn2, name: $n2, surname: $s2, city: $c2, zip: $z2), 
    $z1 == $z2, $c1 != $c2 -> #fail.

Clean Database

tid, ssn, name, surname, city, zip (integer)
t1, 123, Jon, Snow, The Wall, 100
t2, 123, Jon, Snow, Winterfell, 101
t3, 345, Ed, Stark, Winterfell, 101

Configuration

<vioGenQuery id="e1">
    <comparison>(c1 != c2)</comparison>
    <percentage>1.0</percentage> 
</vioGenQuery>

...

<dirtyStrategies>
        <defaultStrategy>
            <strategy chars="*" charsToAdd="3">TypoAddString</strategy>
        </defaultStrategy> 
        <attributeStrategy>
            <attribute table="person" name="city">
                <strategy>TypoActiveDomain</strategy>
            </attribute>
            <attribute table="person" name="surname">
                <strategy>TypoSwitchValue</strategy>
            </attribute>
        </attributeStrategy>
</dirtyStrategies>

Note:

  • Dirty strategies must contain a single attributeStrategy tag. Inside this tag multiple attribute can be specified, as the example above.
  • Table and attribute name should be in lowercase
Possible Dirty Strategies
  • <strategy chars="*" charsToAdd="3">TypoAddString</strategy>: Add three '*' in a random position. Eg: 3.city: Winterfell -> Win*ter*fe*ll
  • <strategy chars="*" charsToAdd="3">TypoAppendString</strategy>: Add three '*' at the end. Eg: 3.city: Winterfell -> Winterfell***
  • <strategy charsToRemove="3">TypoRemoveString</strategy>: Remove three random chars. Eg: 3.city: Winterfell -> Witefel
  • <strategy charsToSwitch="3">TypoSwitchValue</strategy>: Switch three times a char with its neighbor. Eg: 3.city: Winterfell -> iWntreflel
  • <strategy>TypoActiveDomain</strategy>: use another value from active domain. Eg: 3.city: Winterfell -> The Wall
  • <strategy>TypoRandom</strategy>: random choose one of the previous strategy