(lean) add the problem solving day

This commit is contained in:
Julien Calixte
2023-07-23 21:45:56 +02:00
parent eaec93c071
commit 3d686fa2ac
4 changed files with 56 additions and 30 deletions

View File

@@ -7,6 +7,14 @@ import { onMounted } from 'vue'
const featureStore = useFeatureStore() const featureStore = useFeatureStore()
onMounted(() => featureStore.initBoard()) onMounted(() => featureStore.initBoard())
const problemSolving20Percent = () => {
if (featureStore.meta.totalDays % 5 === 0) {
featureStore.nextDay('problem-solving')
} else {
featureStore.nextDay('pull')
}
}
</script> </script>
<template> <template>
@@ -19,8 +27,9 @@ onMounted(() => featureStore.initBoard())
<div> <div>
<button @click="featureStore.nextDay('push')">push system</button> <button @click="featureStore.nextDay('push')">push system</button>
<button @click="featureStore.nextDay('pull')">pull system</button> <button @click="featureStore.nextDay('pull')">pull system</button>
<button @click="featureStore.nextDay('turn-off')"> <button @click="problemSolving20Percent">pull and problem solving</button>
next day without new feature <button @click="featureStore.nextDay('problem-solving')">
problem solving
</button> </button>
Total days: {{ featureStore.meta.totalDays }} Total days: {{ featureStore.meta.totalDays }}
</div> </div>

View File

@@ -6,34 +6,39 @@ import { pickRandomElement, popNElement, shuffleArray } from '@/utils'
const MAX_FEATURES = 30 const MAX_FEATURES = 30
const hasQualityIssue = ( const hasQualityIssue = ({
complexity: number, complexity,
tasksInParallel,
daysWithProblemSolving
}: {
complexity: number
tasksInParallel: number tasksInParallel: number
): boolean => { daysWithProblemSolving: number
let probabilityOfQualityIssue = 0 }): boolean => {
let probabilityOfGoodQuality = 1
switch (complexity) { switch (complexity) {
case 1: case 1:
probabilityOfQualityIssue = 0.97 probabilityOfGoodQuality = 0.97
case 2: case 2:
probabilityOfQualityIssue = 0.93 probabilityOfGoodQuality = 0.93
break break
case 3: case 3:
probabilityOfQualityIssue = 0.88 probabilityOfGoodQuality = 0.88
break break
case 4: case 4:
probabilityOfQualityIssue = 0.82 probabilityOfGoodQuality = 0.82
break break
case 5: case 5:
probabilityOfQualityIssue = 0.75 probabilityOfGoodQuality = 0.75
break
default:
probabilityOfQualityIssue = 0.65
break break
} }
// learnings
probabilityOfGoodQuality =
probabilityOfGoodQuality + (1.2 * daysWithProblemSolving) / 100
let multiplicator = 1 let multiplicator = 1
switch (tasksInParallel) { switch (tasksInParallel) {
@@ -47,11 +52,13 @@ const hasQualityIssue = (
multiplicator = 1.1 multiplicator = 1.1
case 5: case 5:
multiplicator = 1.15 multiplicator = 1.15
default: case 6:
multiplicator = 1.25 multiplicator = 1.25
default:
multiplicator = 1.4
} }
return Math.random() > probabilityOfQualityIssue / multiplicator return Math.random() > probabilityOfGoodQuality / multiplicator
} }
export const newBoard = () => shuffleArray(features) export const newBoard = () => shuffleArray(features)
@@ -76,13 +83,15 @@ export const nextDay = ({
features, features,
initialStep, initialStep,
steps, steps,
strategy strategy,
daysWithProblemSolving
}: { }: {
backlog: Feature[] backlog: Feature[]
features: Feature[] features: Feature[]
steps: FeatureStep[] steps: FeatureStep[]
initialStep: number initialStep: number
strategy: Strategy strategy: Strategy
daysWithProblemSolving: number
}): Feature[] => { }): Feature[] => {
features.forEach((feature) => { features.forEach((feature) => {
const isFeatureLive = feature.step === 0 && feature.status === 'done' const isFeatureLive = feature.step === 0 && feature.status === 'done'
@@ -120,12 +129,13 @@ export const nextDay = ({
} }
if ( if (
hasQualityIssue( hasQualityIssue({
feature.complexity, complexity: feature.complexity,
features.filter( tasksInParallel: features.filter(
(f) => f.status === 'doing' && f.step === feature.step (f) => f.status === 'doing' && f.step === feature.step
).length ).length,
) daysWithProblemSolving
})
) { ) {
feature.step = Math.min(4, feature.step + 1) feature.step = Math.min(4, feature.step + 1)
feature.qualityIssue++ feature.qualityIssue++
@@ -167,8 +177,6 @@ export const nextDay = ({
} }
} }
} }
case 'turn-off':
break
} }
} }

View File

@@ -11,16 +11,18 @@ type State = {
backlog: Feature[] backlog: Feature[]
meta: { meta: {
totalDays: number totalDays: number
daysWithProblemSolving: number
strategy: Record<Strategy, number> strategy: Record<Strategy, number>
} }
} }
const resetMeta = (): State['meta'] => ({ const resetMeta = (): State['meta'] => ({
totalDays: 0, totalDays: 0,
daysWithProblemSolving: 0,
strategy: { strategy: {
push: 0, push: 0,
pull: 0, pull: 0,
'turn-off': 0 'problem-solving': 0
} }
}) })
@@ -39,15 +41,22 @@ export const useFeatureStore = defineStore('feature', {
this.meta = resetMeta() this.meta = resetMeta()
}, },
nextDay(strategy: Strategy) { nextDay(strategy: Strategy) {
this.meta.totalDays++
this.meta.strategy[strategy]++
if (strategy === 'problem-solving') {
this.meta.daysWithProblemSolving++
return
}
this.features = nextDay({ this.features = nextDay({
backlog: this.backlog, backlog: this.backlog,
features: this.features, features: this.features,
steps: this.steps, steps: this.steps,
initialStep: this.steps[0].stepIndex, initialStep: this.steps[0].stepIndex,
strategy strategy,
daysWithProblemSolving: this.meta.daysWithProblemSolving
}) })
this.meta.totalDays++
this.meta.strategy[strategy]++
} }
}, },
getters: { getters: {

View File

@@ -1 +1 @@
export type Strategy = 'push' | 'pull' | 'turn-off' export type Strategy = 'push' | 'pull' | 'problem-solving'