Giter VIP home page Giter VIP logo

probabilistic-forecast's Introduction

probabilistic-forecast

Jira plugin for probabilistic forecasting. (Currently just a command line script.)

Type Coverage GitHub Workflow Status deepcode

dependencies Status devDependencies Status peerDependencies Status

Example Output

Let's say you have a ticket ADE-166 some way down your backlog. Let's say that ticket is in project ADE and the ID of the Jira board (kanban) is 74. ADE-166 represents the completion of a feature that you're interested in. You want to know when that feature will be ready. Here's what you do:

$ JIRA_HOST="example.com" \
> JIRA_TICKET_ID="ADE-166" \
> JIRA_BOARD_ID="74" \
> JIRA_USERNAME=${JIRA_USERNAME} \
> JIRA_PASSWORD=${JIRA_PASSWORD} \
> npm run start
Connecting to Jira and getting board 74.
Counting tickets ahead of ADE-166 in board 74...
There are 86 tickets in board 74 that are either in progress or still to do. Of those, 30 tickets are ahead of ADE-166 in priority order.
Project interval is 2 weeks
The team's past performance will be measured based on tickets in project(s) ADE that have been resolved in the last 5 project intervals (70 days of history will be considered in total).
Resolved 2 tickets in project interval 1:
<snip>
Resolved 2 tickets in project interval 2:
<snip>
Resolved 7 tickets in project interval 3:
<snip>
Resolved 5 tickets in project interval 4:
<snip>
Resolved 11 tickets in project interval 5:
<snip>
1 bug ticket created for every 6.8 non-bug tickets.
1 new non-bug ticket created for every 0.7941176470588235 tickets resolved.
If the team continues to create new tickets at this rate, we predict the 31 outstanding tickets will have grown to 75 tickets by the time they have all been completed.
Running 1000 simulations...
Amount of time required to ship 31 to 75 tickets (and the number of simulations that arrived at that result):
126 days, 0% confidence (5 simulations)
140 days, 3% confidence (29 simulations)
154 days, 8% confidence (53 simulations)
168 days, 19% confidence (111 simulations)
182 days, 35% confidence (158 simulations)
196 days, 50% confidence (146 simulations)
210 days, 65% confidence (152 simulations)
224 days, 78% confidence (128 simulations)
238 days, 87% confidence (93 simulations)
252 days, 93% confidence (56 simulations)
266 days, 97% confidence (43 simulations)
280 days, 98% confidence (14 simulations)
294 days, 99% confidence (8 simulations)
308 days, 99% confidence (4 simulations)
We are 87% confident all 31 to 75 tickets will take no more than 238 days to complete.

Other Environment Variables

  • NUM_WEEKS_OF_HISTORY
    • The number of weeks of Jira history to use for the simulations and other predictions.
    • Default: 10
  • CONFIDENCE_PERCENTAGE_THRESHOLD
    • The prediction with likelihood just above this level is highlighted in the output.
    • Default: 80
  • NUM_SIMULATIONS
    • The number of rounds of Monte Carlo simulation to perform.
    • Default: 1000
  • TICKET_TARGET
    • Will predict how long the team will take to complete this many tickets from the current in-progress tickets. This number will be adjusted to account for the rate of new tickets being created. Ignored if JIRA_TICKET_ID and JIRA_BOARD_ID are set.
    • Default: 60
  • BUG_RATIO
    • Override the rate of bugs being discovered.
    • Will expect 1 bug ticket to be created for every $BUG_RATIO stories created.
    • Optional
  • DISCOVERY_RATIO
    • Override the rate of new story tickets being created.
    • Will expect 1 story to be created for every $DISCOVERY_RATIO stories resolved.
    • Optional
  • TIME_LENGTH
    • The amount of time for each project interval.
    • Default: 2
  • TIME_UNIT
    • The unit of the project interval time. Can only be days or weeks at this stage.
    • Default: weeks

Install

nvm use
npm ci

Run

JIRA_TICKET_ID="ADE-166" JIRA_HOST="example.com" JIRA_TICKET_ID="ADE-166" JIRA_BOARD_ID=74 JIRA_USERNAME=foo JIRA_PASSWORD=bar npm run start

See example-run.sh to run interactively.

Debug

NODE_OPTIONS="--inspect-brk" JIRA_HOST="example.com" JIRA_TICKET_ID="ADE-166" JIRA_BOARD_ID=74 JIRA_USERNAME=foo JIRA_PASSWORD=bar npm run start

Then open Chrome dev tools and click the NodeJS icon.

Before Pushing

npm run format && npm run type-coverage

See Also

probabilistic-forecast's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

probabilistic-forecast's Issues

Remove "sprints"

Somewhat related to #1, we want to remove the concept of sprints from our output for kanban/lean Jira projects. We should instead just refer to "days"/"weeks"/"fortnights"/"months".

Graphs

When it prints out the predictions, after each result line, also print a line that shows the confidence percentage and cumulative confidence percentage graphically so you end up with overlapping bar charts.

I don't think I can show what the terminal colours would be in this example, so I'm using symbols to illustrate. Also, the bars should probably be a lot longer than I'm showing here. Maybe as long as the terminal window can fit.

2 sprints (4 weeks), 30% confidence (predicted by 296 simulations)
██████░30%░░░░░░░░░░
3 sprints (6 weeks), 68% confidence (predicted by 351 simulations)
████████▒38%▒▒░68%░░
4 sprints (8 weeks), 96% confidence (predicted by 248 simulations)
██████▒28%▒▒▒▒▒▒▒▒▒░96%
5 sprints (10 weeks), 99% confidence (predicted by 25 simulations)
█▒3%▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 99%
6 sprints (12 weeks), 100% confidence (predicted by 10 simulations)
0%▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 100%

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update actions/setup-node action to v4
  • Update dependency node to v20
  • Update dependency prettier to v3
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/node.js.yml
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • jira-client 6.21.1
  • @types/jira-client 6.21.1
  • prettier 2.6.2
  • ts-node 10.1.0
  • type-coverage 2.21.1
  • typescript 4.7.3
nvm
.nvmrc
  • node 16.15.1

  • Check this box to trigger a request for Renovate to run again on this repository

Determine whether introduced work has actually delayed work

When performing sprint-based forecasting, it is reasonably simple to determine whether introduced work delayed other work - there is a clear signal that work was brought into a sprint and then other work was prioritised over it.

Outside sprints, we can consider other signals that indicate a ticket was intended to be completed:

  1. top X of backlog
  2. a particular (perhaps project specific) status

Print the dates for each sprint (or week or custom time interval)

In output like

Resolved 2 tickets in sprint 1.
Resolved 3 tickets in sprint 2.
Resolved 7 tickets in sprint 3.
Resolved 5 tickets in sprint 4.
Resolved 10 tickets in sprint 5.

The numbers in "sprint 1", "sprint 2", etc. aren't meaningful to the user. Let's change it to print the date ranges instead. That would also be useful when you're running the script regularly and saving the results so you can see how accurate the predictions were and whether they're getting better or worse.

For example:

Resolved 2 tickets in sprint 2021-03-01 to 2021-03-14.
Resolved 3 tickets in sprint 2021-02-15 to 2021-03-01.
...

Originally posted by @kn-ad in #2 (comment)

Add support for scrum boards?

My memory is foggy, but I think this only works with kanban boards (JIRA_BOARD_ID). We should see what it would take to expand this to support both kanban and scrum boards.

Add option to exclude tickets that were closed with little or no effort

There are a few scenarios where a ticket gets closed with little or no effort. Examples include:

  • Tickets closed as duplicates
  • "wont fix" tickets
  • Tickets that were accidentally fixed elsewhere
  • Tickets that are no longer relevant for whatever reason
  • Tickets that have no time logged against them

We should add an option to exclude these tickets when evaluating past performance (velocity, ticket close rate, etc).

The assumption here would be that the ticket being inquired about (the target ticket) and all tickets ahead of it in priority order do not fall into this little/no effort category, so there is no value in including such tickets for forecasting. Including them would give us an artificially high forecast.

Expand beyond forecasting just single tickets

Currently we force users to provide a single ticket as the target for forecasting. It would be good to expand this to other things.
Examples: "when will all tickets in epic x be done?", "when will all tickets with label y be done?"

Expand model to consider resource allocation / leave calendars / etc

The model currently assumes that tomorrow's velocity will be the same as yesterday's. It might be useful to teach it to understand common reasons why this might not be true:

  • team size changes (new team member, existing team member leaving)
  • resource allocation changes (existing team member moving from 100% allocation to 50%, or vice versa)
  • upcoming (predictable) leave (annual, public holidays, etc)

You could start with allowing the user to specify this stuff manually, and then build on it by tapping into leave calendars and the like.

exclude tickets with a fix version

If a ticket has a fix version it will no longer appear on the kanban even if it's still in progress.

I'm not sure how tickets end up in this zombie state, but I've seen it happen more than once.

Such tickets are currently included in our in-progress + to-do ticket list, even though we shouldn't consider them truly in progress or to do (because no scrum master is going to be considering them and nobody is going to be working on them).

We should update our JQL to exclude these.

Tweak messaging when no bugs are created

Technically true, but probably on the confusing side:

1 bug ticket created for every Infinity non-bug tickets.

Replace it with something along these lines?

Bug tickets never created.

or

No bug tickets created.

Support multi-project boards

We currently assume all work is happening in a single project (Jira key). There are some cases where a board contains tickets from multiple projects. We should probably support this.

Introduce some sensitivity to ticket types and/or team member affinity

Currently, all tickets are treated the same (the simulation draws no distinction between ticket type or size or complexity or story points or time estimates or anything else).

This is done for a good (if perhaps surprising) reason: tickets spend the vast majority of their lives in "waiting" states (backlog, waiting for QA, waiting for UAT, waiting for deployment, etc). For this reason, the size of individual tickets doesn't have a meaningful impact on delivery time (or so the reasoning goes). Another argument is that this liberates our forecasting from estimating (e.g. story pointing) which is subjective...

I tend to agree with all that, and it certainly makes our forecasting algorithm simpler, but I can't help feeling like there are certain projects and certain team arrangements where this forecasting breaks down. Consider an example where you have a highly heterogeneous team, consisting of specialists with non-overlapping skills. There are going to be tickets that can only be worked on by certain people on the team. This ticket-person "affinity" may or may not be made explicit (via a label or some other categorization). This means that naively using our team velocity could lead us to incorrect forecasts. In such an arrangement we might get better results if we instead use the velocity of individuals (or groups of similarly shaped specialists).

This would complicate our model significantly, so it may or may not be worth it.

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.