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

Fix some issues and add more tests #58

Merged
merged 13 commits into from
Aug 15, 2024
Merged

Fix some issues and add more tests #58

merged 13 commits into from
Aug 15, 2024

Conversation

ashkjones
Copy link
Collaborator

Fixes #55, fixes #56, and fixes #57

Added tests for Sequences, Patterns, and Windows. The tests are not fully exhaustive but I think I checked the important functions. I tried to separate out File writing/reading from program logic/calculation methods.

I also fixed a filtering error I had missed on place on my last PR.

Separated longer methods into multiple methods. Changed variable names to be be more distinct and readable. Removed unused lines of code. Made function accept interfaces list or map to shorten the definition. Underlying implementation is not changed.
equals now returns true if the data entries have the same headers and data. This is useful for testing
need to add more tests once Analysis class is done
I was terribly misguided when I first wrote the tests. The new initialization of objects should reduce the byte code and increase testing/building speeds
Last pattern was not included in a sequence. Also set the minimums to always be positive to prevent breaking the looping constraints or index out of bounds. Changed the names of variables in Analysis class to make it more clear what sequences are being handled. Used List.of in Analysis class becuase it is structurally immutable (which is safer when not expecting the list to be modified in place)
maybe not the most exhaustive list of tests, but should be able to catch major mistake if the class is edited. Also, it appears the the PPF divisor is number of patterns of the same length. This appears to be desired behavior based on the commit message 9759aff
made methods smaller to make testing easier. Moved getting baseline outside event window method to reduce the number of dependencies in a single method
…gain.

Removed unnecessary file reads to make testing easier and code more modular.
@ashkjones ashkjones merged commit 8c96390 into main Aug 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant