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

Proposal: refac test implementation #144

Closed
szabo137 opened this issue Dec 15, 2024 · 1 comment · Fixed by #146
Closed

Proposal: refac test implementation #144

szabo137 opened this issue Dec 15, 2024 · 1 comment · Fixed by #146

Comments

@szabo137
Copy link
Member

szabo137 commented Dec 15, 2024

Currently, we test the interfaces in QEDbase.jl by (partially) using existing implementations of the interfaces, which live in QEDcore.jl. In my opinion, there are some issues with this approach:

  1. running the unit tests in QEDbase.jl puts the Julia session in a stage with circular dependencies. This is especially true, if one wants to test QEDbase.jl against a particular version of QEDcore.jl
  2. changes to either QEDbase.jl or QEDcore.jl are very painful, because in both directions, one needs to take care og the integration (strong dependence in the one, and weak dependence in the other direction)
  3. conventionally, it makes no sense tontest interfaces (and their interoperability) by using implementations outside of the testing environment of QEDbase.jl. The tests of the specific implementations belong to the package which provides them, e.g. QEDcore.jl

Suggested solution

Rewrite of the unit tests, especially the TestImplementation module. This shall fulfill the following requirements:

  • All interface in QEDbase.jl must get a flat and simple test implementation and unit tests to check them
  • the unit tests must only check behavior and properties, not correctness of the output
  • test implementations must only depend on other test implementations

Meeting these requirements should allow to drop QEDcore.jl as a test dependency. Moreover, this would solve all issues raised above.

@szabo137
Copy link
Member Author

This might allow an easier solution of #140

@szabo137 szabo137 mentioned this issue Dec 16, 2024
12 tasks
@AntonReinhard AntonReinhard linked a pull request Jan 2, 2025 that will close this issue
12 tasks
AntonReinhard added a commit that referenced this issue Jan 20, 2025
With this PR, I propose a major refactoring of the test implementation,
mostly to drop `QEDcore.jl` as a test dependency. See #144 for details.

## TODO (unit tests itself)

- [x] particle: check only particle properties
- [x] particle: implement and check `propagator` 
- [x] particle: implement and check `base_state`
- [x] process: moving parts that do not belong to processes (marked in
the code by `TODO`)
- [x] particle stateful: implement some tests
- [x] cross section: remove coordinate-based evaluation (is checked in
PSP tests)
- [x] core_compat: move to `QEDcore.jl`

## TODO (test implementation)

- [x] psp: make `TestPhaseSpacePoint(...,moms)` type-stable
- [x] psp: implement proper in- and out-psps
- [x] particle: implement massless particles
- [x] psl: implement failing PSL

## TODO (general)

- [x] consider testing everything for `(TestMomentum{T},
TestMomentumMutable{T})` where `T<:Union{Float16,Float32, Float64}` (not
just for `TestMomentum{Float64}`)


## Final remarks

Solves #144. 

Makes #140 easier to achive.

---------

Co-authored-by: Uwe Hernandez Acosta <[email protected]>
Co-authored-by: Anton Reinhard <[email protected]>
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 a pull request may close this issue.

1 participant