This is a tool to generate mutants for Prolog exercise task sample solutions and to check them against a test suite configuration. With the tool, the test cases can be modified dynamically, in order to kill mutants and make sure that an adequate test suite is reached.
Usage of the tool is described in an article at WLP 2022.
Install Node.js 18 or 20 (including npm) and stack.
git clone --recursive https://github.com/fmidue/prolog-mutator.git
to pull the repository including the server backend.cd prolog-mutator/react-app
npm install
in the project directory (react-app
, also for the following commands) to install all the JavaScript dependencies.npm run server-install
to install the server locally, along with its Haskell dependencies.npm run server
to run the server at port 8080.npm run start
(again inreact-app
) to start the web application at port 3000. If it doesn't open automatically, open http://localhost:3000 to view it in the browser.
If steps 4 and 5 are not working, run the following commands in the prolog-test-server
directory instead:
stack build
stack run
- Upload
Config file
andSolution file
to the respective fields. - Click on the
Test Current Location
button to send a request to the server to check if the solution passes the test suite. - A result card will show the response:
Success ok
orNo. (with explaination)
. Additionally, editor fields for configuration and solution file will be shown, and a list of mutation operators. At this stage, you can modify the editor fields and re-test the pair. - Make changes to the mutation options and click on
Start Mutation
to generate mutants, and see the test result of each mutant in a table. - Click on a table entry to see the code diff as well as the mutant code with test feedback. Changes can be made to the mutant code for
Re-test Mutant
. To change the test cases, modify the configuration editor above the mutation options.