stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Mutation Tests clarity/src/vm/costs/mod.rs > compute_cost

Open ASuciuX opened this issue 9 months ago • 0 comments

Related #4587

The mutation testing highlighted there might be missing unit tests for compute_cost but there needs to be created a default for ExecutionCost to check it.

The steps for making sure the compute_cost function has its possible outcomes caught are:

  • [ ] create default for ExecutionCost
  • [ ] remove the skip header
  • [ ] check if mutation tests are caught for these cases:
    • [ ] run
    RUST_BACKTRACE=1 BITCOIND_TEST=1 cargo mutants -vV -F "replace compute_cost" -E ": replace .{1,2} with .{1,2} in " --baseline=skip --test-tool=nextest -- --run-ignored all --no-fail-fast --test-threads 1
    
    • It should display unviable
    unviable clarity/src/vm/costs/mod.rs:969:5: replace compute_cost -> Result<ExecutionCost> with Ok(Default::default()) in 52.3s build
    
    • [ ] Ok(Default::default()) -> displays caught instead of unviable when running the command
  • [ ] create tests if they aren't caught

ASuciuX avatar May 29 '24 12:05 ASuciuX