Skip to content

Conversation

@JerrettDavis
Copy link
Owner

Add ExperimentFramework.Data and ExperimentFramework.Science packages for rigorous A/B testing with proper statistical methods.

ExperimentFramework.Data:

  • Outcome recording (binary, continuous, count, duration)
  • Thread-safe in-memory storage with aggregation
  • Decorator-based automatic collection

ExperimentFramework.Science:

  • Statistical tests (t-test, chi-square, Mann-Whitney U, ANOVA)
  • Effect size calculators (Cohen's d, odds ratio, relative risk)
  • Power analysis and sample size calculation
  • Multiple comparison corrections (Bonferroni, Holm, Benjamini-Hochberg)
  • Hypothesis builder with pre-registration support
  • Publication-ready reports (Markdown, JSON)

Also includes:

  • Scientific sample application
  • Comprehensive user guide documentation
  • Documentation audit fixes for API accuracy

…al analysis

Add ExperimentFramework.Data and ExperimentFramework.Science packages for
rigorous A/B testing with proper statistical methods.

ExperimentFramework.Data:
- Outcome recording (binary, continuous, count, duration)
- Thread-safe in-memory storage with aggregation
- Decorator-based automatic collection

ExperimentFramework.Science:
- Statistical tests (t-test, chi-square, Mann-Whitney U, ANOVA)
- Effect size calculators (Cohen's d, odds ratio, relative risk)
- Power analysis and sample size calculation
- Multiple comparison corrections (Bonferroni, Holm, Benjamini-Hochberg)
- Hypothesis builder with pre-registration support
- Publication-ready reports (Markdown, JSON)

Also includes:
- Scientific sample application
- Comprehensive user guide documentation
- Documentation audit fixes for API accuracy
@codecov-commenter
Copy link

codecov-commenter commented Dec 26, 2025

Codecov Report

❌ Patch coverage is 87.36644% with 201 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@a0c58ae). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ta/Decorators/OutcomeCollectionDecoratorFactory.cs 7.27% 51 Missing ⚠️
...entFramework.Science/Reporting/MarkdownReporter.cs 76.83% 41 Missing ⚠️
...ExperimentFramework.Science/Power/PowerAnalyzer.cs 78.72% 20 Missing ⚠️
...imentFramework.Science/Statistics/ChiSquareTest.cs 82.29% 17 Missing ⚠️
...erimentFramework.Science/Statistics/PairedTTest.cs 81.53% 12 Missing ⚠️
...mentFramework.Data/Storage/InMemoryOutcomeStore.cs 90.90% 10 Missing ⚠️
...ntFramework.Science/Analysis/ExperimentAnalyzer.cs 88.37% 10 Missing ⚠️
...mework.Science/Models/Snapshots/EnvironmentInfo.cs 0.00% 9 Missing ⚠️
...mentFramework.Science/Statistics/TwoSampleTTest.cs 88.40% 8 Missing ⚠️
...imentFramework.Data/ExperimentBuilderExtensions.cs 25.00% 6 Missing ⚠️
... and 8 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main       #5   +/-   ##
=======================================
  Coverage        ?   90.38%           
=======================================
  Files           ?       86           
  Lines           ?     2652           
  Branches        ?      388           
=======================================
  Hits            ?     2397           
  Misses          ?      255           
  Partials        ?        0           
Flag Coverage Δ
unittests 90.38% <87.36%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive scientific experimentation capabilities to ExperimentFramework through two new packages (ExperimentFramework.Data and ExperimentFramework.Science). The implementation provides rigorous A/B testing infrastructure with proper statistical methods, power analysis, effect size calculation, and publication-ready reporting.

Key changes include:

  • Statistical testing framework (t-test, chi-square, Mann-Whitney U, ANOVA)
  • Effect size calculators with confidence intervals (Cohen's d, odds ratio, relative risk)
  • Power analysis and sample size calculation
  • Multiple comparison corrections (Bonferroni, Holm, Benjamini-Hochberg)
  • Thread-safe outcome data collection and storage
  • Hypothesis builder with pre-registration support
  • Publication-ready report generation (Markdown and JSON)

Reviewed changes

Copilot reviewed 67 out of 67 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
src/ExperimentFramework.Data/ New package for outcome data collection and storage with thread-safe in-memory implementation
src/ExperimentFramework.Science/ New package providing statistical tests, effect size calculators, power analysis, and reporting
tests/ExperimentFramework.Tests/Science/ Comprehensive test coverage for statistical methods including edge cases
samples/ExperimentFramework.ScientificSample/ Complete sample application demonstrating scientific experimentation workflow
docs/user-guide/statistical-analysis.md Detailed documentation with examples and best practices
samples/README.md Updated samples documentation with scientific sample information

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 81 out of 81 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 81 out of 81 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Code Coverage

Summary
  Generated on: 12/26/2025 - 06:41:10
  Coverage date: 12/26/2025 - 06:41:03
  Parser: Cobertura
  Assemblies: 8
  Classes: 94
  Files: 86
  Line coverage: 89.4%
  Covered lines: 2372
  Uncovered lines: 280
  Coverable lines: 2652
  Total lines: 10744
  Branch coverage: 77.4% (771 of 995)
  Covered branches: 771
  Total branches: 995
  Method coverage: 91.5% (420 of 459)
  Full method coverage: 82.3% (378 of 459)
  Covered methods: 420
  Fully covered methods: 378
  Total methods: 459

ExperimentFramework                                                           93.4%
  ExperimentFramework.Activation.ActivationEvaluator                          93.1%
  ExperimentFramework.Activation.SystemTimeProvider                            100%
  ExperimentFramework.Decorators.BenchmarkDecoratorFactory                     100%
  ExperimentFramework.Decorators.DecoratorPipeline                             100%
  ExperimentFramework.Decorators.ErrorLoggingDecoratorFactory                  100%
  ExperimentFramework.Decorators.TimeoutDecoratorFactory                       100%
  ExperimentFramework.ExperimentBuilder                                       74.3%
  ExperimentFramework.ExperimentBuilderExtensions                              100%
  ExperimentFramework.ExperimentFrameworkBuilder                               100%
  ExperimentFramework.ExperimentLoggingBuilder                                 100%
  ExperimentFramework.ExperimentRegistry                                       100%
  ExperimentFramework.KillSwitch.ExperimentDisabledException                   100%
  ExperimentFramework.KillSwitch.InMemoryKillSwitchProvider                    100%
  ExperimentFramework.KillSwitch.KillSwitchDecoratorFactory                    100%
  ExperimentFramework.KillSwitch.NoopKillSwitchProvider                        100%
  ExperimentFramework.KillSwitch.TrialDisabledException                        100%
  ExperimentFramework.Metrics.MetricsDecoratorFactory                          100%
  ExperimentFramework.Metrics.NoopExperimentMetrics                            100%
  ExperimentFramework.Models.BehaviorRule                                      100%
  ExperimentFramework.Models.Experiment                                        100%
  ExperimentFramework.Models.ExperimentRegistration                             75%
  ExperimentFramework.Models.SelectionModeExtensions                           100%
  ExperimentFramework.Models.SelectionRule                                     100%
  ExperimentFramework.Models.ServiceExperimentDefinition<T>                    100%
  ExperimentFramework.Models.Trial                                             100%
  ExperimentFramework.Naming.DefaultExperimentNamingConvention                 100%
  ExperimentFramework.Naming.ExperimentSelectorName                            100%
  ExperimentFramework.RuntimeExperimentProxy<T>                               81.8%
  ExperimentFramework.Selection.Providers.BooleanFeatureFlagProvider           100%
  ExperimentFramework.Selection.Providers.BooleanFeatureFlagProviderFactory    100%
  ExperimentFramework.Selection.Providers.ConfigurationValueProvider            80%
  ExperimentFramework.Selection.Providers.ConfigurationValueProviderFactory    100%
  ExperimentFramework.Selection.SelectionModeAttribute                         100%
  ExperimentFramework.Selection.SelectionModeProviderBase                      100%
  ExperimentFramework.Selection.SelectionModeProviderFactory<T>                100%
  ExperimentFramework.Selection.SelectionModeRegistry                          100%
  ExperimentFramework.ServiceCollectionExtensions                             99.1%
  ExperimentFramework.ServiceExperimentBuilder<T>                             89.8%
  ExperimentFramework.Telemetry.NoopExperimentTelemetry                        100%
  ExperimentFramework.Telemetry.OpenTelemetryExperimentTelemetry               100%
  ExperimentFramework.Validation.TrialConflictDetector                        98.8%
  ExperimentFramework.Validation.TrialConflictException                        100%
  ExperimentFramework.Variants.VariantFeatureManagerAdapter                    100%

ExperimentFramework.Data                                                      74.3%
  ExperimentFramework.Data.Decorators.OutcomeCollectionDecoratorFactory          0%
  ExperimentFramework.Data.ExperimentBuilderExtensions                           0%
  ExperimentFramework.Data.Models.ExperimentOutcome                              0%
  ExperimentFramework.Data.Models.OutcomeAggregation                          94.1%
  ExperimentFramework.Data.Models.OutcomeQuery                                   0%
  ExperimentFramework.Data.Recording.OutcomeRecorder                           100%
  ExperimentFramework.Data.Recording.OutcomeRecorderOptions                    100%
  ExperimentFramework.Data.ServiceCollectionExtensions                         100%
  ExperimentFramework.Data.Storage.InMemoryOutcomeStore                       90.9%
  ExperimentFramework.Data.Storage.NoopOutcomeStore                            100%

ExperimentFramework.FeatureManagement                                          100%
  ExperimentFramework.FeatureManagement.ExperimentBuilderExtensions            100%
  ExperimentFramework.FeatureManagement.ServiceCollectionExtensions            100%
  ExperimentFramework.FeatureManagement.VariantFeatureFlagProvider             100%

ExperimentFramework.Metrics.Exporters                                         99.3%
  ExperimentFramework.Metrics.Exporters.OpenTelemetryExperimentMetrics         100%
  ExperimentFramework.Metrics.Exporters.PrometheusExperimentMetrics           99.2%

ExperimentFramework.OpenFeature                                                100%
  ExperimentFramework.OpenFeature.ExperimentBuilderExtensions                  100%
  ExperimentFramework.OpenFeature.OpenFeatureProvider                          100%
  ExperimentFramework.OpenFeature.ServiceCollectionExtensions                  100%

ExperimentFramework.Resilience                                                 100%
  ExperimentFramework.Resilience.CircuitBreakerDecoratorFactory                100%
  ExperimentFramework.Resilience.CircuitBreakerOpenException                   100%
  ExperimentFramework.Resilience.CircuitBreakerOptions                         100%
  ExperimentFramework.Resilience.ResilienceBuilderExtensions                   100%

ExperimentFramework.Science                                                   88.8%
  ExperimentFramework.Science.Analysis.ExperimentAnalyzer                     88.3%
  ExperimentFramework.Science.Builders.EndpointBuilder                         100%
  ExperimentFramework.Science.Builders.HypothesisBuilder                       100%
  ExperimentFramework.Science.Builders.SuccessCriteriaBuilder                  100%
  ExperimentFramework.Science.Corrections.BenjaminiHochbergCorrection          100%
  ExperimentFramework.Science.Corrections.BonferroniCorrection                 100%
  ExperimentFramework.Science.Corrections.HolmBonferroniCorrection             100%
  ExperimentFramework.Science.EffectSize.CohensD                               100%
  ExperimentFramework.Science.EffectSize.EffectSizeExtensions                  100%
  ExperimentFramework.Science.EffectSize.OddsRatio                             100%
  ExperimentFramework.Science.EffectSize.RelativeRisk                          100%
  ExperimentFramework.Science.Models.Hypothesis.Endpoint                         0%
  ExperimentFramework.Science.Models.Hypothesis.HypothesisDefinition             0%
  ExperimentFramework.Science.Models.Results.StatisticalTestResult            66.6%
  ExperimentFramework.Science.Models.Snapshots.EnvironmentInfo                   0%
  ExperimentFramework.Science.Power.PowerAnalyzer                             78.7%
  ExperimentFramework.Science.Reporting.JsonReporter                          88.8%
  ExperimentFramework.Science.Reporting.MarkdownReporter                      72.8%
  ExperimentFramework.Science.ServiceCollectionExtensions                      100%
  ExperimentFramework.Science.Snapshots.InMemorySnapshotStore                 90.1%
  ExperimentFramework.Science.Statistics.ChiSquareTest                        79.1%
  ExperimentFramework.Science.Statistics.MannWhitneyUTest                     97.3%
  ExperimentFramework.Science.Statistics.OneWayAnova                          98.4%
  ExperimentFramework.Science.Statistics.PairedTTest                          81.5%
  ExperimentFramework.Science.Statistics.TwoSampleTTest                       88.4%

ExperimentFramework.StickyRouting                                             92.5%
  ExperimentFramework.StickyRouting.ExperimentBuilderExtensions                100%
  ExperimentFramework.StickyRouting.ServiceCollectionExtensions                100%
  ExperimentFramework.StickyRouting.StickyRoutingProvider                     86.6%
  ExperimentFramework.StickyRouting.StickyTrialRouter                          100%

@JerrettDavis JerrettDavis merged commit ddf0e85 into main Dec 26, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants