Skip to content

Obtain more code coverage #711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 44 commits into
base: develop
Choose a base branch
from
Open

Obtain more code coverage #711

wants to merge 44 commits into from

Conversation

ckormanyos
Copy link
Member

This PR obtains more code coverage. But it is for later in 1.91 (not for today's 1.90).

@ckormanyos ckormanyos marked this pull request as draft July 3, 2025 14:23
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 99.89166% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.2%. Comparing base (3d32b38) to head (ccb113d).

Files with missing lines Patch % Lines
include/boost/multiprecision/cpp_dec_float.hpp 99.7% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop    #711     +/-   ##
=========================================
+ Coverage     94.7%   96.2%   +1.5%     
=========================================
  Files          296     297      +1     
  Lines        30881   31178    +297     
=========================================
+ Hits         29233   29967    +734     
+ Misses        1648    1211    -437     
Files with missing lines Coverage Δ
example/exercise_threading_log_agm.cpp 100.0% <100.0%> (ø)
include/boost/multiprecision/complex_adaptor.hpp 92.3% <100.0%> (+2.8%) ⬆️
include/boost/multiprecision/cpp_double_fp.hpp 100.0% <100.0%> (ø)
...nclude/boost/multiprecision/detail/default_ops.hpp 93.5% <100.0%> (+2.5%) ⬆️
...oost/multiprecision/detail/functions/constants.hpp 99.2% <100.0%> (ø)
...lude/boost/multiprecision/detail/functions/pow.hpp 99.4% <100.0%> (+4.7%) ⬆️
...ude/boost/multiprecision/detail/functions/trig.hpp 97.5% <ø> (+0.8%) ⬆️
test/git_issue_167.cpp 100.0% <100.0%> (+50.0%) ⬆️
test/git_issue_464.cpp 100.0% <100.0%> (ø)
test/test_arithmetic.hpp 99.7% <ø> (+0.4%) ⬆️
... and 16 more

... and 5 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 3d32b38...ccb113d. Read the comment docs.

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

@ckormanyos
Copy link
Member Author

Ok so I worked on coverage, mostly with focus on cpp_dec_float. That file is pretty well covered now, but missing 8 interesting lines. I'll let this one sit for a while.

I would like to improve the line coverage of the tests and then we can discuss which headers need more dedicated edge tests.

Let's just leave this as a draft until the action on 1.90 wraps up.

@ckormanyos
Copy link
Member Author

ckormanyos commented Jul 5, 2025

In cpp_dec_float going to nearly $99\%$ coverage was straightforward. Sure it needed a few hundred lines of dedicated test code.

I only found 1 bug, but harmless, in the area of negative infinity ($-\infty$). There were several areas having redundant or unclear lines. I cleared up (or subjectively think I celared up) a bunch of these sequences. Nothing really critical was found, and this shows how well this thing was tested to begin with. I'm really impressed with the test-suite.

@ckormanyos ckormanyos marked this pull request as ready for review July 15, 2025 16:45
@ckormanyos
Copy link
Member Author

ckormanyos commented Jul 15, 2025

Hi @jzmaddock and @mborland

Check it out, WE WILL NOT merge this until AFTER 1.89.

I have now marked this as ready for review. With this, I mean AFTER 1.89 gets out the door. But the scope of change is non-trivial.

So I saw a window of opportunity (timewise and energy-wise) to go for coverage. I got a solid $96.1\%$, which is good.

OK so there were some highlights.

  • I found a small handful of bugs in cpp_dec_float and in some special functions edge-cases.
  • I think that some infinity/NaN edge-cases in default_ops-pow were incorrect (also erfand erfc, maybe tgamma).
  • In general I think these things are more right now than earlier, but there is work to be done.
  • With this, I got the special-functions C99 thing to actually use signed-zero on cpp_bin_float to get lots of coverage lines. I think it is right-er than before, but not yet fully done.
  • I leaned heavily into cpp_dec_float and got under 10 lines missing in coverage. I hit this one, changed quite a bit actually. But my confidence is high here.
  • I did some trivial changes to complex_adaptor and its tests to gain lots of lines.
  • Along those lines, I got cpp_dec_float working with complex_adaptor, which was previously not the case since some eval_whatever functions were actually missing from this backend.
  • I got the test cases issue464 and issue167 actually working and contributing to coverage. These were simply exception-ing out previously.
  • I found redundant code in a few places like powfunctions and streamlined them.

Well, that's about it.

@ckormanyos
Copy link
Member Author

There is a lot of material within the scope of this PR. It might take a while to sift through it all and negotiate on the best (or better) fixes, as I might not have subjectively always chosen the right path.

But in general, I think this PR is intact. And we can start taking a serious look at it.

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