Skip to content
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

Need unit tests with analytic solutions #67

Open
26 of 30 tasks
mikeingold opened this issue Sep 7, 2024 · 5 comments
Open
26 of 30 tasks

Need unit tests with analytic solutions #67

mikeingold opened this issue Sep 7, 2024 · 5 comments
Labels

Comments

@mikeingold
Copy link
Collaborator

mikeingold commented Sep 7, 2024

The current unit testing structure was aimed mainly at testing all possible combinations {f, G, IA} where f is the integral function name/alias, G is a Meshes.Geometry sub-type, and IA is an integration algorithm. In hindsight, the system I wrote for batching these tests was perhaps a little bit too clever for its own good. It also relies on Meshes.measure to produce correct answers for a unit-valued integrand.

As of 7-Sep-2024, we’re currently at about 77% code coverage per the Codecov report. Most of the gaps seem to be related to wrapper/convenience methods, i.e. ones that simply batch out to the core integration methods.

Ideas for a more robust test system:

  • Define more interesting test geometries with analytic solutions to check against
  • Evaluate whether TestItems.jl could be helpful here (edit: complete, update below)

Status of Unit Tests with Analytic Solutions

  • Ball (2D)
  • Ball (3D)
  • BezierCurve
  • Box (1D)
  • Box (2D)
  • Box (3D)
  • Box (4D)
  • Circle
  • Cylinder
  • CylinderSurface
  • Disk
  • Ellipsoid
  • Hexahedron
  • Line
  • ParameterizedCurve
  • Plane
  • Quadrangle
  • Ray
  • Ring
  • Rope
  • Segment
  • Sphere (2D)
  • Sphere (3D)
  • Tetrahedron
  • Torus
  • Triangle
  • Cone
  • ConeSurface
  • FrustumSurface
  • ParaboloidSurface
@mikeingold mikeingold pinned this issue Sep 7, 2024
@mikeingold
Copy link
Collaborator Author

I just merged #68 beginning an effort to restructure unit tests.

@JoshuaLampert
Copy link
Member

#73 continues this effort.

@JoshuaLampert
Copy link
Member

#78 implements a TestItems.jl workflow.

@mikeingold
Copy link
Collaborator Author

Status Update as of v0.14.0

Code coverage is "officially" up to 100% as of the v0.14.0 release. However, this only verifies that all lines of code within this package are exercised during the tests, not that all possible combinations of integral argument types produce correct results.

Work is still ongoing to convert old-style generated @testset's to new-style (combinations.jl) @testitem's.

@mikeingold mikeingold changed the title Inadequate unit test coverage Need unit tests with analytic solutions Sep 29, 2024
@mikeingold
Copy link
Collaborator Author

Status Update

As of #100 merging, the previous automatic test generation system (auto-tests.jl) has been completely removed in favor of a collection of TestItems.jl @testitems (combinations.jl).

Remaining work on this Issue:

  • Some @testitems still use a unit integrand (I.e. f(p) = 1.0) and fairly simple geometry constructions with benchmark integral value provided by Meshes.measure. These should be updated with more interesting functions and geometries with known analytics solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants