Recently, there has been a surge in Model-Driven Engineering (MDE), where code is automatically generated from a model. While this has certainly enabled non-technical people to become something of a programmer, it doesn’t necessarily make them good testers or good modelers. In mutation testing syntactic variations (mutants) are created from the source code and run against a test suite. Mutants that pass all the test cases in the suite are called alive, while mutants that fail at least one test case are called dead. Good testers are able to develop test suites that kill all mutants. This can also be applied to MDE, where the mutants are created on the models used for code generation.

Based on mutation testing on models, we introduce ModelDefenders, a gamified approach to teaching mutation testing in MDE. ModelDefenders is intended to be used as an educational tool where students learn to become better testers and modellers by evaluating and creating mutants on these models.

In ModelDefenders, students are assigned one of two roles: attacker or defender. Defenders are tasked with creating test cases that consist of a sequence of events and an expected outcome. The attacker is tasked with creating mutants on the models. Similar to mutation testing, the mutants (from the attacker) are run against the test case (from the defender). A mutant that successfully passes all test cases is said to be alive, a mutant that fails at least one test case is said to be killed. If a mutant survives, the attacker gains one point, while if the defender’s test cases have successfully killed a mutant, the defender gains one point. Other gamification elements that are part of ModelDefenders include badges, feedback and leaderboards.

ModelDefenders is currently still being developed as a web-based application. When the development comes to an end, it will be used by students in the classroom and experimental evaluations can be conducted to further improve the tool and measure a possible improvement of modelling skills for those students.

Many thanks to the CodeDefenders tool for being the main source of inspiration for this tool!

Articoli simili