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

Lay out tests following the same structure as Yampa #217

Closed
ivanperez-keera opened this issue May 21, 2022 · 4 comments
Closed

Lay out tests following the same structure as Yampa #217

ivanperez-keera opened this issue May 21, 2022 · 4 comments

Comments

@ivanperez-keera
Copy link
Owner

Understanding which parts of Yampa are tested and which ones are not is generally hard.

There are (at least) two non-exclusive ways to achieve this. We could use some coverage metrics to understand how much of the implementation is covered by the tests. Alternatively, we could just make it trivial to compare a module and their corresponding tests, to determine that indeed unit tests for each published element are included.

I'd like to implement the second, as a simple, lightway approach at keeping tests organized and helping identify which elements of the interface remain to be tested. Therefore, the goal would be to open each module under yampa-test/tests/Test, compare it with its corresponding module under yampa/src/, and organize elements in the yampa-test module following the same order as in yampa.

As a side effect of this process, it would also be good to identify which elements of the interface are not covered by tests.

@ivanperez-keera ivanperez-keera added this to the (+1) milestone May 21, 2022
ivanperez-keera added a commit that referenced this issue May 21, 2022
Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of Basic in
the same order and with the same haddock section separators as they have
in Yampa's counterpart.
@ivanperez-keera
Copy link
Owner Author

I've added one such change here: https://github.com/ivanperez-keera/Yampa/tree/develop-tests-orgModules

As you can see, the only thing I'm doing is changing the order of definitions in the module, changing the order of tests to match, and adding haddock separators.

I used vi -d to open this module and Yampa's yampa/src/FRP/Yampa/Basic.hs side by side and compare.

Also, if anyone decides to do this, look at the commit message. You can probably get away with copying the same message, and changing the module name.

@ivanperez-keera
Copy link
Owner Author

Notes on Test.FRP.Yampa.Basic:

  • Elements not tested in FRP.Yampa.Basic:
    (-->), (-:>), (>--), (-=>), (>=-)
  • There is a prop_insert not listed under tests.
  • One function prop has no signature.

@ivanperez-keera
Copy link
Owner Author

ivanperez-keera commented May 22, 2022

Notes on Test.FRP.Yampa.Conditional:

  • Elements not tested:
    pause.

Notes on Test.FRP.Yampa.Delays:

  • Elements not tested individually:
    pre (but iPre is defined in terms of it and is being tested), fby.
  • Functions prop, prop_always_equal has no signature.

Notes on Test.FRP.Yampa.EventS:

  • Elements not tested individually:
    delayEvent, delayEventCat, iEdge, edgeTag, edgeJust, notYet

Notes on Test.FRP.Yampa.Hybrid:

  • Elements no tested individually:
    accumHold, dAccumHold.

Notes on Test.FRP.Yampa.Integration:

  • Elements not tested individually:
    integral, imIntegral, iterFrom.
  • Function prop has no signature.

ivanperez-keera added a commit that referenced this issue May 22, 2022
…217.

Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of
Conditional in the same order and with the same haddock section
separators as they have in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 22, 2022
Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of Delays in
the same order and with the same haddock section separators as they have
in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 22, 2022
Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of EventS in
the same order and with the same haddock section separators as they have
in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 22, 2022
Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of Hybrid in
the same order and with the same haddock section separators as they have
in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 22, 2022
…217.

Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of
Integration in the same order and with the same haddock section
separators as they have in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 23, 2022
Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of Hybrid in
the same order and with the same haddock section separators as they have
in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 23, 2022
…217.

Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of
Integration in the same order and with the same haddock section
separators as they have in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 23, 2022
…#217.

Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of
InternalCore in the same order and with the same haddock section
separators as they have in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 23, 2022
Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of Loop in
the same order and with the same haddock section separators as they have
in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 23, 2022
Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of Scan in
the same order and with the same haddock section separators as they have
in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 23, 2022
…217.

Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of Simulation
in the same order and with the same haddock section separators as they
have in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 23, 2022
Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of Switches
in the same order and with the same haddock section separators as they
have in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 23, 2022
Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of Task in
the same order and with the same haddock section separators as they have
in Yampa's counterpart.
ivanperez-keera added a commit that referenced this issue May 23, 2022
Understanding which parts of Yampa are tested and which ones are not is
generally hard. To facilitate keeping track of which elements are tested
and which ones are not, this commit organizes the elements of Time in
the same order and with the same haddock section separators as they have
in Yampa's counterpart.
@ivanperez-keera ivanperez-keera self-assigned this May 23, 2022
@ivanperez-keera
Copy link
Owner Author

ivanperez-keera commented May 30, 2022

Notes on Test.FRP.Yampa.InternalCore:

  • Elements not (directly) tested:
    • Time
    • DTime
    • SF(..)
    • SF'(..)
    • Transition
    • sfTF'
    • sfId
    • sfConst
    • sfArrG
    • sfSScan
    • FunDesc(..)
    • fdFun
    • arrPrim
    • arrEPrim
    • epPrim

Notes on Test.FRP.Yampa.Random:

  • Module does not exist.

Notes on Test.FRP.Yampa.Arrow:

  • Module does not exist.

Notes on Test.FRP.Yampa.Event:

  • Module does not exist.

Notes on Test.FRP.Yampa.Simulation:

  • Elements not (directly) tested:
    • ReactHandle
    • reactInit
    • react
    • embedSynch (tested in combination with embed)
    • deltaEncode (tested in combination with embed)
    • deltaEncodeBy
    • FutureSF
    • evalAtZero
    • evalAt
    • evalFuture

Notes on Test.FRP.Yampa.Switches:

  • Elements not (directly) tested:
    • par
    • pSwitch
    • dpSwitch
    • rpSwitch
    • drpSwitch
    • parZ
    • pSwitchZ
    • dpSwitchZ
    • drpSwitchZ
    • parC

Notes on Test.FRP.Yampa.Task:

  • Elements not (directly) tested:
    • runTask_
    • taskToSF
    • constT

ivanperez-keera added a commit that referenced this issue May 30, 2022
The unit tests for the ArrowLoop interface were in issue #217 placed in
Test.FRP.Yampa.Loop. However, the ArrowLoop instance is defined in
FRP.Yampa.InternalCore, so those tests must be moved.

This commit moves all tests pertaining to the ArrowLoop interface to the
end of InternalCore, matching the order in which the instance is defined
in the corresponding Yampa module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant