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

Randomly Shuffling Access Ordering of Graphs #439

Open
edogawashinichi opened this issue May 15, 2024 · 7 comments
Open

Randomly Shuffling Access Ordering of Graphs #439

edogawashinichi opened this issue May 15, 2024 · 7 comments
Labels
CI/CD Continuous Integration/Continuous Development Issue enhancement New feature or request repo something about repo test Something about test

Comments

@edogawashinichi
Copy link
Contributor

Is your feature request related to a problem? Please describe.
issue433
issue408
Bug-free code is rare in medium and large projects.
Therefore, test coverage is extremely important.
Due to differences in operating systems, compilers, etc.,
the access order of graphs in test cases may also differ,
which may cause test cases to behave differently.

Describe the solution you'd like
By randomly shuffling the access order of the graph,
we can easily obtain a large number of equivalent test cases,
allowing us to find hidden bugs as much as possible.
So I propose to add a test class between the test case and the graph class to allow random access.

Describe alternatives you've considered
Open a test branch,and add this feature to it.

Additional context
Add any other context or screenshots about the feature request here.

@edogawashinichi
Copy link
Contributor Author

I have implemented the alternative locally.
You do have the opportunity to find more bugs each time you run the test cases.
image

@edogawashinichi
Copy link
Contributor Author

and more bugs I've found
image

@nolankramer
Copy link
Collaborator

This is a great idea - as long as we can always reproduce test cases by using the same seed. Fuzzing is a great way to ensure robust coverage and functionality.

@edogawashinichi
Copy link
Contributor Author

This is a great idea - as long as we can always reproduce test cases by using the same seed. Fuzzing is a great way to ensure robust coverage and functionality.

Yep, technically using the same seed is a precise and efficient way.
Currently the method I use is to save the vertex traversal ordering of the buggy test case.

@ZigRazor
Copy link
Owner

Good Idea!

@ZigRazor ZigRazor added enhancement New feature or request test Something about test repo something about repo CI/CD Continuous Integration/Continuous Development Issue labels May 15, 2024
@ZigRazor ZigRazor added this to the In-Depth Tests milestone May 15, 2024
@badumbatish
Copy link
Contributor

@edogawashinichi this must be what you're referring to in #433

I hope it's not too much to ask but would you please create a draft PR? would love to learn how to implement this

@edogawashinichi
Copy link
Contributor Author

@edogawashinichi this must be what you're referring to in #433

I hope it's not too much to ask but would you please create a draft PR? would love to learn how to implement this

Sure, I just implement a very rough test branch that help trace bugs caused by ordering.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD Continuous Integration/Continuous Development Issue enhancement New feature or request repo something about repo test Something about test
Projects
None yet
Development

No branches or pull requests

4 participants