Skip to content

move mutation management to marauders - #1

Open
alpaylan wants to merge 1 commit into
marcbrooker:mainfrom
alpaylan:main
Open

alpaylan wants to merge 1 commit into
marcbrooker:mainfrom
alpaylan:main

Conversation

@alpaylan

@alpaylan alpaylan commented Mar 7, 2026

Copy link
Copy Markdown

Marauders is a source level mutation management tool, so I think especially for a long-running version of morris, it would make sense to use something with some persistence. Here's a rundown of how it works with a mock test in the library:

Before (original base file):

  pub fn add(a: i32, b: i32) -> i32 {
      a + b
  }

We get a morris mutation:

  {
    "file_path": "src/lib.rs",
    "line_number": 2,
    "original_line": "    a + b",
    "mutated_line": "    a - b",
    "description": "mock handoff mutation"
  }

After construction (mutation block inserted):

  pub fn add(a: i32, b: i32) -> i32 {
      /*| morris_plan_0001 */
      a + b
      /*|| morris_plan_0001_1 */
      /*|
      a - b
      */
      /* |*/
  }

After set (marauders set --variant morris_plan_0001_1):

  pub fn add(a: i32, b: i32) -> i32 {
      /*| morris_plan_0001 */
      /*|
      a + b
      */
      /*|| morris_plan_0001_1 */
      a - b
      /* |*/
  }

After unset (marauders unset --variant morris_plan_0001_1):

  pub fn add(a: i32, b: i32) -> i32 {
      /*| morris_plan_0001 */
      a + b
      /*|| morris_plan_0001_1 */
      /*|
      a - b
      */
      /* |*/
  }

There's also a feature in Marauders for inserting multiple mutants at the same time (so you don't pay for recompilation many times, it's guarded under syntax-rust-functional so we can also add that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant