{"id":29482852,"url":"https://github.com/haliliceylan/mut4slx","last_synced_at":"2025-07-15T02:02:27.911Z","repository":{"id":169889379,"uuid":"644449906","full_name":"haliliceylan/MUT4SLX","owner":"haliliceylan","description":"The Simulink Model Mutation Testing project provides a framework for generating mutants, and CSV file as an output. It utilizes the MATLAB environment to load the model, apply mutations, and collect outputs.","archived":false,"fork":false,"pushed_at":"2025-04-29T11:03:11.000Z","size":18753,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T13:39:39.346Z","etag":null,"topics":["ase2023","matlab","mutation-analysis","mutation-coverage","mutation-testing","publication-code","python","simulink","simulink-model","simulink-python"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haliliceylan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-23T14:37:46.000Z","updated_at":"2025-05-19T21:23:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"b167ae1f-4e0f-4ca0-904c-67388c750da2","html_url":"https://github.com/haliliceylan/MUT4SLX","commit_stats":null,"previous_names":["haliliceylan/mut4slx"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/haliliceylan/MUT4SLX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haliliceylan%2FMUT4SLX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haliliceylan%2FMUT4SLX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haliliceylan%2FMUT4SLX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haliliceylan%2FMUT4SLX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haliliceylan","download_url":"https://codeload.github.com/haliliceylan/MUT4SLX/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haliliceylan%2FMUT4SLX/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265386079,"owners_count":23756747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ase2023","matlab","mutation-analysis","mutation-coverage","mutation-testing","publication-code","python","simulink","simulink-model","simulink-python"],"created_at":"2025-07-15T02:01:54.953Z","updated_at":"2025-07-15T02:02:27.897Z","avatar_url":"https://github.com/haliliceylan.png","language":"HTML","readme":"# MUT4SLX\nThe MUT4SLX tool focuses on performing mutation testing on a model implemented in MATLAB/Simulink. It applies various mutation operators to the model and generates Simulink model mutants.\n\n\n## Description\n\nThe MUT4SLX tool provides a structured framework for systematically generating mutants and producing corresponding output files in CSV format. It leverages the MATLAB environment to load Simulink models, apply predefined mutation operators, and record the resulting outputs.\n\n# DEMO\n[![DEMO](http://img.youtube.com/vi/inud_NRGutc/0.jpg)](http://www.youtube.com/watch?v=inud_NRGutc)\n\n## Features\n\n- Mutant generation: Apply a set of predefined mutation operators to the Simulink model.\n- CVS output generation: Generate an CSV output summarizing the mutations.\n- HTML Report: Please note that the code used to generate this report is not open-sourced yet. [Open Report In Browser](https://rawcdn.githack.com/haliliceylan/MUT4SLX/4d3d570a058c539d058ae933ef03fac2bd6cdd7b/HelicopterSystem.html)\n\n## Licensing Information\n\nThis repository contains code and assets under different licenses:\nMake sure to review the specific license for each part of the code. Additionally, check out the example use cases with different licenses:\n\n- [Helicopter Control System (BSD 3-Clause \"New\" or \"Revised\" License)](https://github.com/wfpotter/DO178_Case_Study/blob/master/license.txt) \n- [Aircraft Elevator Control System (MIT License)](https://gitlab.com/DrishtiYadav/fimtool/-/blob/main/LICENSE)\n- [Automatic Transmission Controller System (MIT License)](https://gitlab.com/DrishtiYadav/fimtool/-/blob/main/LICENSE)\n\n## Getting Started\n\n```\nusage: MUT4SLX.py [-h] --model MODEL [--matlab-gui]\n\nSimulink model mutation tool.\n\noptional arguments:\n  -h, --help     show this help message and exit\n  --model MODEL  Name of the Simulink model in config file.\n  --matlab-gui   Show the MATLAB GUI.\n```\n\n### Prerequisites\n\n- MATLAB [version R2021b](https://nl.mathworks.com/products/matlab.html)\n- Python [version 3.9.16](https://www.python.org/downloads/)\n- Libraries: [matlab.engine](https://www.mathworks.com/help/matlab/matlab-engine-for-python.html)\n\n### Installation\n\n1. Clone the repository: `git clone https://github.com/haliliceylan/MUT4SLX.git`\n\n### Usage\n\n1. Modify the `model_files.json` file to specify the models and their configurations.\n2. Run the main script: `python MUT4SLX.py --model MODEL`\n3. View the generated CSV output: `open \u003cmodel_name\u003e.CSV`\n\n\n## Configuration File\n\nThe configuration file specifies various settings and parameters for using the MUT4SLX tool. It includes a list of mutant operators and configurations for different Simulink models. Let's break down each part of the configuration file:\n\n### Mutant Operators For Simulink\nThe `mutant_operators` section lists the available mutant operators. These operators are abbreviated with short names for convenience. Here are the mutant operators included in the configuration file:\n\n- `ROR`: Relational Operator Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/relationaloperator.html) to the definition of the relational operators in Matlab/Simulink.\nThe ROR operator changes the current value of the block with other different operators, such as changing \"==\" with \"~=, \u003c, \u003c=, \u003e=, \u003e\" operators.\n- `LOR`: Logical Operator Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/logicaloperator.html) to the definition of the logical operators in Matlab/Simulink.\nThe LOR operator changes the block's current value with other different operators, such as changing \"AND\" with \"OR, NAND, NOR, XOR\" operators.\n- `ASR`: Arithmetic Sign Replacement\nPlease refer (https://nl.mathworks.com/help/matlab/relational-operators.html) to the definition of the relational operators in Matlab/Simulink.\nThe ASR operator changes the block's current value with other different operators, such as changing \"==\" with \"~=, \u003c, \u003c=, \u003e=, \u003e\" operators.\n- `MMR`: Min-Max Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/minmax.html) to the definition of the logical operators in Matlab/Simulink.\nThe MMR operator changes the block's current value with other operators, such as changing \"MIN\" with \"MAX\" operators.\n- `ICR`: If Condition Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/if.html) to the definition of the If condition operators in Matlab/Simulink.\nThe ICR operator changes the block's current value with other operators, such as changing an if condition with \"1 == 1 (true), 1 == 0 (false)\" conditions.\n- `TOR`: Trigonometric Operator Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/trigonometricfunction.html) to the definition of the trigonometric operators in Matlab/Simulink.\nThe TOR operator changes the block's current value with other operators, such as changing \"sin\" operator with \"cos, tan, asin, acos , atan, sinh, \n cosh, tanh, asinh, acosh, atanh, cos + jsin\" operators.\n- `MOR`: Math Operator Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/mathfunction.html) to the definition of the Math operators in Matlab/Simulink.\nThe MOR operator changes the block's current value with other operators, such as changing \"exp\" operator with \"log, 10^u, log10, magnitude^2, square, conj, reciprocal, transpose, hermitian\" operators.\n- `PMR`: Product Multiplication Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/product.html) to the definition of the product multiplication types in Matlab/Simulink.\nThe PMR operator changes the block's current value with other operators, such as changing \"Element-wise(.*)\" type with \"Matrix(*)\" type.\n- `POR`: Product Operator Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/product.html) to the definition of the product block in Matlab/Simulink.\nThe POR operator changes the block's current value with other operators, such as changing \"2\" input types with \"* /, / *, //\" types.\n- `FIR`: For Index Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/foriterator.html) to the definition of the For iterator block in Matlab/Simulink.\nThe FIR operator changes the block's current value with other operators, such as changing \"Zero-based\" type with \"One-based\" type.\n- `FLR`: For Limit Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/foriterator.html) to the definition of the For iterator block in Matlab/Simulink.\nThe FLR operator changes the block's current value with other operators, such as changing the current \"x\" limit value with \"x*2\" limit value.\n- `UDO`: Unit Delay Operation\nPlease refer (https://nl.mathworks.com/help/simulink/slref/unitdelay.html) to the definition of the unit delay block in Matlab/Simulink.\nThe UDO operator changes the block's current value with other operators, such as changing \"Columns as channels (frame based)\" value with \"Elements as channels (sample based)\" value.\n- `SCR`: Switch Criteria Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/switch.html) to the definition of the switch block in Matlab/Simulink.\nThe SCR operator changes the block's current value with other operators, such as changing \"u2 \u003e= Threshold\" value with \"u2 ~= 0\" value.\n- `STR`: Switch Threshold Replacement\nPlease refer (https://nl.mathworks.com/help/simulink/slref/switch.html) to the definition of the switch block in Matlab/Simulink.\nThe STR operator changes the block's current value with other operators, such as changing the current \"x\" threshold value with \"x+10\" value.\n- `CR`: Constant Replacement\n  Please refer (https://nl.mathworks.com/help/simulink/slref/constant.html) to the definition of the constant block in Matlab/Simulink.\nThe CR operator changes the block's current value with other operators, such as changing the current \"x\" value with \"x+1, x+10, x+100, x-1, x-10, x-100\" values.\n\n```json\n{\n  \"mutant_operators\": [\n    \"ROR\",\n    \"LOR\",\n    \"ASR\",\n    \"MMR\",\n    \"ICR\",\n    \"TOR\",\n    \"MOR\",\n    \"PMR\",\n    \"POR\",\n    \"FIR\",\n    \"FLR\",\n    \"UDO\",\n    \"SCR\",\n    \"STR\",\n    \"CR\"\n  ],\n```\n\nThese operators are used during the mutation process to generate modified versions of the Simulink models for testing.\n\n### Mutant Operators For Stateflow\nNote: The Stateflow extension has not yet been included in the current version of MUT4SLX. We will release this version soon.\n- `LOM`: Logical Operation Mutation\nPlease refer (https://nl.mathworks.com/help/stateflow/ug/operations-for-stateflow-data.html) to the definition of the logical operators in Matlab/Stateflow.\nThe LOI operator changes the current value of the logical operator with another different operator, such as changing the \"\u0026\u0026\" with the \"||\" operator.\n- `ROM`: Relational Operation Mutation\nPlease refer (https://nl.mathworks.com/help/stateflow/ug/operations-for-stateflow-data.html) to the definition of the relational operators in Matlab/Stateflow.\nThe ROI operator changes the current value of the relational operator with other different operators, such as changing \"\u003e\" with \"\u003c, \u003e=, \u003c=, ==, ~=\" operators.\n- `BOM`: Bitwise Operation Mutation\nPlease refer (https://nl.mathworks.com/help/stateflow/ug/operations-for-stateflow-data.html) to the definition of the relational operators in Matlab/Stateflow.\nThe BOI operator changes the current value of the bitwise operator with other different operators, such as changing \"\u0026\" with \"|, ^, ~\" operators.\n- `MOM`: Math Operation Mutation\nPlease refer (https://nl.mathworks.com/help/stateflow/ug/operations-for-stateflow-data.html) to the definition of the relational operators in Matlab/Stateflow.\nThe MOI operator changes the current value of the math operator with other different operators, such as changing \"+\" with \"-, *, /\" operators.\n- `NOM`: Non-bitwise Operation Mutation\nPlease refer (https://nl.mathworks.com/help/stateflow/ug/operations-for-stateflow-data.html) to the definition of the relational operators in Matlab/Stateflow.\nThe NOI operator changes the current value of the non-bitwise operator with an empty character, such as deleting \"!\" operator.\n- `CCM`: Control Chart Mutation\nPlease refer (https://nl.mathworks.com/help/stateflow/ug/using-temporal-logic-in-state-actions-and-transitions.html) to the definition of the control charts in Matlab/Stateflow.\nThe CCI operator changes the current value of the after operator in a control chart with other possible values, such as changing the current \"x\" value with \"x+1, x+10, x+100, x-1, x-10, x-100\" values.\n- `CDM`: Control chart Duration Mutation\nPlease refer (https://nl.mathworks.com/help/stateflow/ug/using-temporal-logic-in-state-actions-and-transitions.html) to the definition of the control charts in Matlab/Stateflow.\nThe CDI operator changes the current value of the duration operator in a control chart with other possible values, such as changing the current \"x\" value with \"x+1, x+10, x+100, x-1, x-10, x-100\" values.\n- `TOM`: Transition Order Mutation\nPlease refer (https://nl.mathworks.com/help/stateflow/ug/execution-order-for-parallel-states.html) to the definition of the execution order in Matlab/Stateflow.\nThe TOI operator changes the execution in a model with other possible orders, such as changing the current \"1-2-3\" value with \"1-3-2, 2-3-1, 2-1-3, 3-1-2, 3-2-1\" orders.\n\n### Model Configurations\nThe configuration file provides settings for different Simulink models. Each model has a unique key, which is used as a reference for specifying the model when running the mutation testing tool. Here are the model configurations included in the file:\n\nThe \"Heli\" section represents a specific configuration for the \"Helicopter Control System\" Simulink model. The attributes within this section are:\n\n```json\n  \"Heli\": {\n    \"model\": \"HelicopterSystem\",\n    \"cd\": \"matlab_workspace/heli\",\n    \"project\": \"heli.prj\",\n    \"system\": \"HelicopterSystem\",\n    \"test\": \"HeliLoopTest\"\n  },\n```\n- `model`: Specifies the main Simulink model to start the mutation process, in this case, \"HelicopterSystem.\"\n- `cd`: Indicates the relative path of the project directory where the Simulink model is located. It is generally found under the \"matlab_workspace\" directory with the \"heli\" subdirectory.\n- `project`: If the Simulink model depends on a MATLAB project, you can specify the project file using this attribute. In this case, it is \"heli.prj.\"\n- `system`: Specifies the system name of the main model. It can also accept a full path, allowing the mutation process to start from that path and explore its sub-paths.\n- `test`: Currently, this attribute is not usable in the current version. However, you can refer to the demo for the full behavior. It represents the test file name for this Simulink model.\n\nSimilarly, the configuration sections for other Simulink models like \"sf_aircraft,\" \"Aircraft,\" and \"AutotransModel\" follow a similar structure, specifying their respective models, directories, systems, and test files if applicable.\n\n**Please note that the actual values used in the configuration file, such as model names and paths, are examples provided for demonstration purposes. You should replace them with the appropriate values based on your specific Simulink projects and file structures.**\n\n## File Structure\n\n- `MUT4SLX.py`: This is the main script for performing mutant generation and provides a command-line interface for the tool.\n- `model_files.json`: This configuration file specifies the models and their details required to run the MUT4SLX tool.\n- `matlab_workspace/`: This directory contains all MATLAB models and related files.\n- `tests/`: This directory contains the smoke tests for the tool.\n- `HelicopterSystem.html`: This is a detailed report on the execution of the Helicopter System mutants. Please note that the code used to generate this report is not open-sourced yet. [Open Report In Browser](https://rawcdn.githack.com/haliliceylan/MUT4SLX/4d3d570a058c539d058ae933ef03fac2bd6cdd7b/HelicopterSystem.html)\n- `HelicopterSystem_mutants.csv`: This CSV file contains information about all the possible mutants generated for the Helicopter System.\n- `LICENSE`: This file contains the license information for the repository.\n- `MutationClasses.py`: This file contains the implementation of all mutant operators used by the tool.\n- `README.md`: This file, which you are currently reading, provides detailed information about the repository.\n- `Replication-Package.md`: This file contains information about the replication package for the project.\n- `config_reader.py`: This file includes the implementation of the configuration reader class.\n- `.gitignore`: This file specifies the files and directories that should be ignored by the Git version control system.\n\nOther supporting files and directories may be present as well.\n\n## Example Use Cases\n\n### Example use case with Helicopter Control System\n(https://github.com/wfpotter/DO178_Case_Study)\n\n### Example use case with Aircraft Elevator Control System\n(https://gitlab.com/DrishtiYadav/fimtool/-/tree/main/Aircraft_fault_injector/sf_aircraft_model)\n\n### Example use case with Automatic Transmission Controller System\n(https://gitlab.com/DrishtiYadav/fimtool/-/tree/main/Autotrans_fault_injector/cav_benchmark)\n\n## Testing\n\nTo run the tests for this project, you can use the following command:\n\n```\nmake test # or pytest\n```\n\n### Cite This\n\n1. Ceylan, H. I., Kilincceker, O., Beyazit, M., \u0026 Demeyer, S. (2023, September). MUT4SLX: Fast Mutant Generation for Simulink. In 2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE) (pp. 2086-2089). IEEE.\n2. Nuyens, S., Ceylan, H. I., Kilincceker, O., Beyazit, M., \u0026 Demeyer, S. (2024, March). MUT4SLX: Extensions for Mutation Testing of Stateflow Models. In 2024 IEEE International Conference on Software Analysis, Evolution and Reengineering-Companion (SANER-C) (pp. 215-218). IEEE.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaliliceylan%2Fmut4slx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaliliceylan%2Fmut4slx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaliliceylan%2Fmut4slx/lists"}