public void Story_refinement() { var historicalStoryRefinementsA = new[] { 1, 2, 3 }; var historicalStoryRefinementsB = new[] { 10, 20, 30 }; var randomNumbers = new Queue <int>(new[] { 2, 1, 0, 2, 1, 0 }); var sut = new SoftwareDeliverySimulation(3, maxNumber => randomNumbers.Dequeue()); var result = sut.SimulateIssuesDerivedFromStories(historicalStoryRefinementsA, historicalStoryRefinementsB); Assert.Equal(new[] { 23, 31, 12 }, result); }
public void Forecast_10_stories_with_single_issue_forecast() { DateTime START_DATE = new DateTime(2019, 11, 18); const int NUMBER_OF_STORIES = 10; var issues = IssueRepository.Import().ToArray(); var issuesPerStory = issues.IssuesPerStory(); var sut = new SoftwareDeliverySimulation(); var issueSimulationresult = sut.SimulateIssuesDerivedFromStories( Enumerable.Range(1, NUMBER_OF_STORIES).Select(_ => issuesPerStory).ToArray() ); var issueDistribution = Statistics.Distribution(issueSimulationresult); _testOutputHelper.WriteLine("issues from stories forecast"); var deDE = new CultureInfo("de-DE"); foreach (var x in issueDistribution.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)}"); } _testOutputHelper.WriteLine("delivery forecast"); var number_of_issues = issueDistribution.First(x => x.percentile > 80.0).value; _testOutputHelper.WriteLine($"Number of issues selected: {number_of_issues}"); var tp = issues.BusinessDayThroughputs(); var deliverySimulationresult = sut.SimulateIssueDeliveryBasedOnThroughput(START_DATE, number_of_issues, tp); var distribution = Statistics.Distribution(deliverySimulationresult); 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)}"); } }