Skip to content

100% Test coverage all (?) distributions#1399

Open
JacobHass8 wants to merge 7 commits into
boostorg:developfrom
JacobHass8:distribution-test-coverage
Open

100% Test coverage all (?) distributions#1399
JacobHass8 wants to merge 7 commits into
boostorg:developfrom
JacobHass8:distribution-test-coverage

Conversation

@JacobHass8
Copy link
Copy Markdown
Contributor

@JacobHass8 JacobHass8 commented May 25, 2026

Added tests for the following distributions to get 100% test coverage.

  • arcsine
  • bernoulli (97%)
  • beta (99%)
    • In find_alpha and find_beta, there isn't an upper bound on the mean and variance. However, there should be.
  • binomial (98%)
  • cauchy
  • chi-squared (98%)

Here is the code coverage report for my information.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.46%. Comparing base (592063d) to head (f2b43c2).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1399      +/-   ##
===========================================
+ Coverage    95.35%   95.46%   +0.10%     
===========================================
  Files          825      825              
  Lines        68310    68412     +102     
===========================================
+ Hits         65139    65308     +169     
+ Misses        3171     3104      -67     
Files with missing lines Coverage Δ
include/boost/math/distributions/binomial.hpp 98.00% <100.00%> (+11.44%) ⬆️
test/test_arcsine.cpp 99.24% <100.00%> (+0.06%) ⬆️
test/test_bernoulli.cpp 100.00% <100.00%> (ø)
test/test_beta_dist.cpp 98.95% <100.00%> (+0.24%) ⬆️
test/test_binomial.cpp 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 592063d...f2b43c2. Read the comment docs.

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

@JacobHass8 JacobHass8 changed the title 100% Test coverage for arcsine distribution 100% Test coverage all (?) distributions May 26, 2026
@JacobHass8
Copy link
Copy Markdown
Contributor Author

JacobHass8 commented May 27, 2026

@jzmaddock (or @mborland) you had previously mentioned expanding the existing test coverage. Would this PR be helpful for that? I was just going to keep plugging along for every distribution. Most of the missing tests are for edge cases, or returning NaNs. I've also found a couple of boolean operations that weren't correct which I fixed. There have been a couple cases where something like this appeared (false == check_param1() && check_param2()) when it should have been (false == (check_param1() && check_param2())).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant