Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including pertestimate with all npm packages installed. Try it out:

var pertestimate = require("pertestimate")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

pertestimate v0.1.0

⏳ Turn those off-the-cuff estimates into something more flexible using the PERT technique

pertestimate

Give more accurate estimates using the PERT technique

npm XO code style Build Status Codecov branch

The PERT technique of task estimation is a trivariate estimate taking into account the best and worst possible scenarios to give a weighted average. It is also possible to calculate the standard deviation, which represents the level of confidence in the estimate.

Install

npm install --save pertestimate

Usage

pertestimate(guesstimates [, callback(results)]);

The first argument is an object with your best 'guesstimates'.

{
    best: 3,   // [Number]: The best possible outcome you can imagine, given nothing goes wrong.
    guess: 10,  // [Number]: Your initial estimate, given based on your experience.
    worst: 20   // [Number]: The worst possible outcome, given everything goes wrong.
}

The second argument is an optional callback function which receives an object containing the calculated estimate and standard deviation.

Examples

const pertestimate = require('pertestimate');

const guesstimates = {
    best: 3,
    guess: 10,
    worst: 20
}

pertestimate(guesstimates);
// --> {estimate: 10.5, deviation: -2.8333333333333335}

pertestimate(guesstimates, res => `Around ${res.estimate}, with a standard deviation of ${res.deviation}. So, most likely somewhere between ${Math.ceil(res.estimate + res.deviation)} and ${Math.ceil(res.estimate - res.deviation)}.`);
// --> "Around 10.5, with a standard deviation of -2.8333333333333335. So, most likely somewhere between 8 and 14."
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free