Wodel applied to UML Class Diagrams. [UML Class Diagrams Ecore]

Adds a redundant constraint to the CD [uco1]:

    cd = select one ClassDiagram where {^constraints <> null}
    c = select one Constraint in cd->^constraints
    deep clone c in cd->^constraints

Adds an extraneous constraint to the CD [uco2]:

    create Constraint with {type = one Class, id = random-string(1, 4)}

Adds a redundant association to the CD [uas1]:

    cd = select one ClassDiagram where {relations is typed Association}
    a = select one Association in cd->relations
    deep clone a in cd->relations

Adds a redundant derived association to the CD [uas2]:

    cd = select one ClassDiagram where {relations is typed Association}
    a1 = select one Association in cd->relations
    a2 = select one Association in cd->relations where {src = a1->tar}
    a3 = create Association in cd->relations with {
        name = random-string(1, 4),
        src = a1->src, tar = a2->tar,
        copy(nsrc, a1.nsrc), copy(ntar, a2.ntar),
        derived = true
    }

Adds an extraneous association to the CD [uas3]:

    create Association
        with {src = one Class, tar = one Class, name = random-string(1, 4)}

Adds an extraneous derived association to the CD [uas4]:

    create Association
        with {src = one Class, tar = one Class, name = random-string(1, 4), derived = true}

Adds a redundant generalization to the CD [uge1]:

    cl = select one Class where {super <> null and super->super <> null}
    sup1 = select one Class in cl->super where {super <> null}
    sup2 = select one Class in sup1->super where {self <> cl->super}
    modify cl with {super = sup2}

Adds an extraneous generalization to the CD [uge2]:

    c1 = select one Class where {super <> null}
    s = select all Class in closure(c1->super)
    c2 = select one Class where {self <> s}
    modify c1 with {super = c2}

Adds a redundant class to the CD [ucl1]:

    cd = select one ClassDiagram where {classes is typed Class}
    c = select one Class in cd->classes
    deep clone c in cd->classes

Adds an extraneous class to the CD [ucl2]:

    create Class with {name = random-string(1, 4)}

Adds a redundant association class to the CD [ucl3]:

    cd = select one ClassDiagram where {classes is typed AssociationClass}
    ac = select one AssociationClass in cd->classes
    clone ac in cd->classes

Adds an extraneous association class to the CD [ucl4]:

    create AssociationClass with {name = random-string(1, 4)}

Adds a redundant attribute to a Class [uat1]:

    c = select one Class where {features is typed Attribute}
    att = select one Attribute in c->features
    deep clone att in c->features

Adds an extraneous attribute to a Class [uat2]:

    create Attribute with {type = one Class, name = random-string(1, 4)}

Adds a redundant operation to a Class [uop1]:

    c = select one Class where {features is typed Operation}
    op = select one Operation in c->features
    deep clone op in c->features

Adds an extraneous operation to a Class [uop2]:

    create Operation with {type = one Class, name = random-string(1, 4)}

Adds a redundant parameter to an Operation [upa1]:

    op = select one Operation where {params <> null}
    p = select one Parameter in op->params
    clone p in op->params

Adds an extraneous Parameter to an Operation [upa2]:

    create Parameter with {name = random-string(1, 4)}

Changes the constraint by deleting the references to a class Attribute [wco1]:

    remove one PathElementCS where {pathName = one Attribute}

Changes the Attribute data type in the constraint [wco2]:

    p = select one PathElementCS where {pathName = one Attribute}
    a = select one Attribute in p->pathName
    modify a with {type = other Class}

Change the constraint by deleting the calls to specific operation [wco3]:

    remove one OperationCS

Changes an arithmetic operator for another and supports binary operators: "add", "subtract", "multiply", "divide" [wco4]:

    modify one IntLiteralExpCS with {op in ['add', 'subtract', 'multiply', 'divide']}

Changes the constraint by adding the conditional operator "not" [wco5]:

    inv = select one InvariantCS where {exp <> null}
    create LogicExpCS in inv->exp with {op = 'not'}

Changes a conditional operator "and" for a conditional operator "or" [wco6a]:

    modify one BooleanExpCS where {op = 'and'} with {op = 'or'} 

Changes a conditional operator "or" for a conditional operator "and" [wco6b]:

    modify one BooleanExpCS where {op = 'or'} with {op = 'and'}

Changes the constraint by deleting the conditional operator "not" [wco7]:

    remove one LogicExpCS where {op = 'not'}

Changes a relational operator for another operators: "lt" , "lte", "gt" , "gte", "equals", "distinct" [wco8]:

    modify one BooleanExpCS where {op in ['lt', 'lte', 'gt', 'gte', 'equals', 'distinct']}
        with {op in ['lt', 'lte', 'gt', 'gte', 'equals', 'distinct']}

Changes a constraint by deleting a unary arithmetic operator ("negative") [wco9]:

    modify one IntLiteralExpCS where {op = 'negative'} with {op = ''}

Interchange the members (src and tar) of an Association [was1]:

    modify one Association with {swapref(src, tar)}

Changes the association type (association, aggregation, composition, dependency) [was2]:

    retype one [Association, Aggregation, Composition, Dependency]
         as [Association, Aggregation, Composition, Dependency]

Changes the tar multiplicity of an Association (i.e. *, 0..1, 1..1, 1..*) [was3]:

    modify one Association with {ntar in ['*', '0..1', '1..1', '1..*']}

Changes the Generalization member ends [wge]:

    modify one Class with {super = other Class}

Changes visibility kind of the Class [wcl1]:

    modify one Class with {visibility in {public, private, protected, package}}

Changes Class by an Association Class [wcl2]:

    retype one Class as AssociationClass
        with {association = one Association}

Changes Association Class for a Class [wcl3]:

    retype one AssociationClass as Class

Changes the Class feature "abstract" to true [wcl4]:

    modify one Class where {abstract = false} with {abstract = true}

Changes the Attribute feature "derived" to true [wat1]:

    modify one Attribute where {derived = false} with {derived = true}

Changes the Attribute property "derived" to false [wat2]:

    modify one Attribute where {derived = true} with {derived = false}

Changes the Attribute data type [wat3]:

    modify one Attribute with {type = other NamedElement}

Changes the Attribute visibility property [wat4]:

    modify one Attribute with {visibility in {public, private, protected, package}}

Changes the order of the parameters [wop1]:

    op = select one Operation where {params <> null}
    p = select one Parameter in op->params
    modify op with {params -= p, params += p}

Changes the visibility kind of an operation [wop2]:

    modify one Operation with {visibility in {public, private, protected, package}}

Changes the data type returned by operation [wop3]:

    modify one Operation with {type = other NamedElement}

Changes the Parameter data type [wpa]:

    modify one Parameter with {type = other NamedElement}

Deletes a constraint [mco]:

    remove one Constraint

Deletes an Association [mas]:

    remove one Association

Deletes a Generalization relation [mge]:

    l = select one Class where {super <> null}
    remove one Class from c->super	

Deletes the class [mcl]:

    c = select one Class
    remove all Relation where {src = c or tar = c}
    remove all Operation where {type = c}
    remove all Feature where {type = c}
    remove all AssociationClass where {association = null}
    remove c

Deletes an Attribute [mat]:

    remove one Attribute

Deletes the operation [mop]:

    remove one Operation

Deletes a Parameter from an Operation [mpa]:

    remove one Parameter

Here you can download all these examples of Wodel applied to UML Class Diagrams.
UML Class Diagrams samples .zip
UML Class Diagrams samples .tar.gz

Acknowledgements

This work has been funded by the Spanish Ministry of Science (RTI2018-095255-B-I00, project "MASSIVE") and the R&D programme of Madrid (P2018/TCS-4314, project "FORTE").