Code Monkey home page Code Monkey logo

priority_test's Introduction

PriorityTest

Build Status Dependency Status

DESCRIPTION

PriorityTest is a gem that delivers fast feedback for your tests by prioritizing them. It prioritizes tests based on two assumptions discovered by Kent Beck in his tool JUnit Max:

Test run times generally follow a power law distribution - lots of very short tests and a few very long ones. This means that by running the short tests first you can get most of the feedback in a fraction of the runtime of the whole suite.

Failures are not randomly distributed. A test that failed recently is more likely to fail than one that has run correctly a bazillion times in a row. By putting recently failed (and newly written) tests first in the queue, you maximize the information density of that critical first second of feedback.

PriorityTest inherits from these two assumptions with a simple algorithm and prioritizes your tests by looking at the test running history.

ALGORITHM

PriorityTest captures and stores your test running hisotry. Before each test runs, it looks back X number of the previous test results to calculate the test's Degree of Significant (DoS). It then prioritizes the running order of all the tests based on each test's DoS. Two factors determines a test's DoS: test run time and recent failure times.

INSTALLATION

RubyGems

[sudo] gem install priority_test

RSpec

In your Gemfile, insert the following line:

gem 'priority_test'

In spec_helper.rb, require the RSpec adapter:

require 'priority_test/rspec'

USAGE

Getting help:

$ pt -h
Usage: pt <test-framework> [options] [files or directories]

Test framework:
  * rspec

Options:
        --priority                   Filter and run priority tests
    -h, --help                       Show help
    -v, --version                    Show version

Run tests in priority order:

$ pt rspec spec/a_spec

Filter and run priority tests:

$ pt rspec spec/a_spec --priority

Directly passing arguments to RSpec:

$ pt rspec spec/a_spec --priority -fp

Run tests in a Rake task:

$ rake spec PT_OPTS="--priority"

LICENSE

See LICENSE.

priority_test's People

Contributors

owenthereal avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

azimim

priority_test's Issues

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.