Skip to content
This repository has been archived by the owner on Aug 26, 2023. It is now read-only.

Commit

Permalink
Implement meta-mutants
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 8701315
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Thu Mar 10 13:55:56 2022 +0100

    Make number of allocated globals for saved parameters adaptive

commit b26afdc
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Thu Mar 10 13:11:50 2022 +0100

    Refactoring

commit 025fc9e
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Thu Mar 10 12:58:07 2022 +0100

    Refactor meta-mutant implementation

commit a621c12
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Mon Mar 7 16:33:43 2022 +0100

    Add configuration option for meta-mutants

commit 5ce4b3c
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Mon Mar 7 14:42:07 2022 +0100

    Update dependencies

commit 6427ec7
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Sun Mar 6 19:15:55 2022 +0100

    Meta mutants mostly work now

commit a5191e8
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Sun Mar 6 14:38:22 2022 +0100

    More work toward meta-mutants

commit f5682e1
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Thu Mar 3 10:14:04 2022 +0100

    Checkpoint

commit 968579d
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Wed Mar 2 16:47:42 2022 +0100

    Some preliminary refactoring necessary for meta-mutants

commit 5c0c8d2
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Wed Feb 23 19:46:18 2022 +0100

    Start implementation of mutate_all function

commit 8f52921
Author: Lukas Wagner <lwagner94@posteo.at>
Date:   Wed Feb 23 16:10:37 2022 +0100

    Add check_mutant_id api function, add unique mutant id, add result_type for operators
  • Loading branch information
Lukas Wagner committed Mar 10, 2022
1 parent d09a39d commit 0b1dba3
Show file tree
Hide file tree
Showing 18 changed files with 2,199 additions and 734 deletions.
193 changes: 141 additions & 52 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ clap = {version = "3.0.0", features=["cargo", "derive"]}
object = { version = "0.28.1", features = ["read", "wasm"]}
addr2line = "0.17.0"
gimli = "0.26.1"

toml = "0.5.0"
serde = { version = "1.0", features = ["derive"] }

colored = "2.0.0"
log = "0.4.0"
env_logger = "0.9.0"
num_cpus = "1.13.1"
indicatif = {version = "0.16.2", features = ["rayon"]}
rand = "0.8.4"

syntect = "4.6.0"

handlebars = "4.2.0"
md5 = "0.7.0"
concat-idents = "1.1.3"
chrono = "0.4.19"
atomic-counter = "1.0.1"
dyn-clone = "1.0.4"

[dev-dependencies]
tempfile = "3.3.0"
quickcheck = "1.0.3"
pretty_assertions = "1.0.3"
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,17 @@ for any hints on what compiler options to use.
Defaults to `true`.

```toml
coverage_based_execution = false
coverage_based_execution = true
```

- `meta_mutant`:
If `meta_mutant` is enabled, a single mutant containing all mutations will be generated.
During execution, mutations are activated by setting a flag. The benefit
of this is that only a single mutant needs to be compiled by the WebAssembly runtime,
and thus the execution time is reduced significantly.
Defaults to `true`.
```toml
meta_mutant = true
```


Expand Down Expand Up @@ -377,6 +387,7 @@ for any hints on what compiler options to use.
timeout_multiplier = 4.0
map_dirs = [["testdata/count_words/files", "files"],]
coverage_based_execution = true
meta_mutant = true

[filter]
allowed_functions = ["^count_words"]
Expand Down
1 change: 1 addition & 0 deletions src/cliarguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pub enum CLICommand {
/// Path to the wasm module
wasmfile: String,
},

/// Create new configuration file.
NewConfig {
/// Path to the new configuration file
Expand Down
13 changes: 13 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ pub struct EngineConfig {
/// line was never executed in the baseline run.
/// Defaults to true
coverage_based_execution: Option<bool>,

/// If true, a single mutant containing all mutations will be generated.
/// During execution, mutations are activated by setting a flag
/// Defaults to true.
meta_mutant: Option<bool>,
}

impl EngineConfig {
Expand All @@ -64,6 +69,11 @@ impl EngineConfig {
pub fn coverage_based_execution(&self) -> bool {
self.coverage_based_execution.unwrap_or(true)
}

/// Generate a single meta-mutant
pub fn meta_mutant(&self) -> bool {
self.meta_mutant.unwrap_or(true)
}
}

/// Configuration regarding report generation
Expand Down Expand Up @@ -214,10 +224,12 @@ mod tests {
timeout_multiplier = 10
map_dirs = [["a/foo", "b/bar"], ["abcd", "abcd"]]
coverage_based_execution = false
meta_mutant = false
"#,
)?;
assert_eq!(config.engine().timeout_multiplier(), 10.0);
assert!(!config.engine().coverage_based_execution());
assert!(!config.engine().meta_mutant());
assert_eq!(
config.engine().map_dirs(),
[
Expand Down Expand Up @@ -281,6 +293,7 @@ mod tests {
)?;
assert_eq!(config.engine().timeout_multiplier(), 2.0);
assert!(config.engine().coverage_based_execution());
assert!(config.engine().meta_mutant());
assert_eq!(config.engine().map_dirs(), []);
assert_eq!(config.filter().allowed_files(), None);
assert_eq!(config.filter().allowed_functions(), None);
Expand Down
Loading

0 comments on commit 0b1dba3

Please sign in to comment.