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

View File

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

View File

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

View File

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