Code Monkey home page Code Monkey logo

necessist's Introduction

Necessist

Runs tests with statements removed to help identify unnecessary statements

Setup

cd necessist
cargo build --workspace
source env.sh

Usage

  1. Checkout a clean copy of your target repository. This is important!
  2. cd target-repo
  3. necessist_instrument.sh
  4. cargo necessist

By default, necessist outputs to the console. Passing --sqlite causes necessist to instead output to a sqlite database. A tool like sqlitebrowser can then be used to filter/sort the results.

Output

Result Meaning (With the statement removed...) Silenced with
passed The tests built and passed. n/a
timed-out The tests built but timed-out. See below.
failed The tests built but failed. See below.
nonbuildable The tests did not build. -qq
skipped See below. -q
inconclusive An internal error (e.g., rust-lang/rust#75734) prevented necessist from removing the statement. n/a

Silencing timed-out and failed results

  • Passing -qqq silences timed-out and failed results for all statements except local (let) bindings.
  • Passing -qqqq silences timed-out and failed results entirely.

Skipped statements

Necessist will not attempt to remove a statement if any of the following conditions apply.

  • The statement is an invocation of a whitelisted macro.
  • --skip-calls regex is passed and the statement is a function call, macro invocation, or method call matching regex.
  • --skip-controls is passed and the statement is a break or continue.
  • --skip-locals is passed and the statement is a local (let) binding.

Whitelisted macros

  • assert
  • assert_eq
  • assert_ne
  • panic
  • unimplemented
  • unreachable

References

  • Groce, A., Ahmed, I., Jensen, C., McKenney, P.E., Holmes, J.: How verified (or tested) is my code? Falsification-driven verification and testing. Autom. Softw. Eng. 25, 917โ€“960 (2018). A preprint is available here. See Section 2.3.

necessist's People

Contributors

disconnect3d avatar smoelius avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.