示例#1
0
        public void Story_delivery()
        {
            /*
             * Stories:
             *     1: 1 issue
             *     2: 2
             *     3: 3
             *     4: 4
             *  dark: 1
             *
             *  TP:
             *     30.9.    0
             *     1.10.    1
             *     2.10.    2
             *     3.10.    3
             *     (4.10.
             *     5.10.)
             *     6.10.
             *     7.10.    4
             *     => [0,1,2,3,4]
             */
            var historicalData = new[] {
                new Issue(new DateTime(2019, 10, 1), new DateTime(2019, 10, 3), null, "1", false),
                new Issue(new DateTime(2019, 9, 30), new DateTime(2019, 10, 7), null, "2", false),
                new Issue(new DateTime(2019, 10, 2), new DateTime(2019, 10, 3), null, "3", false),
                new Issue(new DateTime(2019, 9, 30), new DateTime(2019, 10, 1), null, "", false),
                new Issue(new DateTime(2019, 10, 2), new DateTime(2019, 10, 4), null, "2", false),
                new Issue(new DateTime(2019, 10, 1), new DateTime(2019, 10, 2), null, "3", false),
                new Issue(new DateTime(2019, 10, 3), new DateTime(2019, 10, 7), null, "4", false),
                new Issue(new DateTime(2019, 10, 2), new DateTime(2019, 10, 3), null, "3", false),
                new Issue(new DateTime(2019, 10, 2), new DateTime(2019, 10, 7), null, "4", false),
                new Issue(new DateTime(2019, 10, 3), new DateTime(2019, 10, 7), null, "4", false),
                new Issue(new DateTime(2019, 9, 30), new DateTime(2019, 10, 2), null, "4", false),
            };
            var randomNumbers = new Queue <int>(new[]
            {
                // Simulate issues derived from stories
                0, 1,
                2, 3,
                // => [1+2=3, 3+4=7]

                // Simulate issue delivery
                // 3 issues to deliver
                0, 1, 2, // 3 days - 1
                2, 3,    // 2 days - 1

                // 7 issues to deliver
                1, 2, 3, 1,         // 4 days - 1
                1, 1, 1, 1, 1, 1, 1 // 9 days due to weekend - 1
            });
            var sut = new SoftwareDeliverySimulation(2, maxNumber => randomNumbers.Dequeue());

            var result = sut.SimulateStoryDeliveryBasedOnThroughput(new DateTime(2019, 10, 1), 2, historicalData);

            Assert.Empty(randomNumbers);
            Assert.Equal(new[] { 2, 1, 3, 8 }, result);
        }
示例#2
0
        public void Forecast_10_stories_for_all_issue_forecasts()
        {
            DateTime  START_DATE        = new DateTime(2019, 11, 18);
            const int NUMBER_OF_STORIES = 10;

            var issues = IssueRepository.Import().ToArray();

            var sut = new SoftwareDeliverySimulation();
            var simulationresult = sut.SimulateStoryDeliveryBasedOnThroughput(START_DATE, NUMBER_OF_STORIES, issues);
            var distribution     = Statistics.Distribution(simulationresult);

            var deDE = new CultureInfo("de-DE");

            foreach (var x in distribution.OrderBy(o => o.value))
            {
                _testOutputHelper.WriteLine($"{x.value}\t{x.frequency}\t{x.probability.ToString("0.000", deDE)}\t{x.percentile.ToString("0.0", deDE)}");
            }
        }