CXXGraph icon indicating copy to clipboard operation
CXXGraph copied to clipboard

Randomly Shuffling Access Ordering of Graphs

Open edogawashinichi opened this issue 1 year ago • 7 comments
trafficstars

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 avatar May 15 '24 04:05 edogawashinichi

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

edogawashinichi avatar May 15 '24 04:05 edogawashinichi

and more bugs I've found image

edogawashinichi avatar May 15 '24 04:05 edogawashinichi

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.

nolankramer avatar May 15 '24 04:05 nolankramer

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.

edogawashinichi avatar May 15 '24 05:05 edogawashinichi

Good Idea!

ZigRazor avatar May 15 '24 07:05 ZigRazor

@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

badumbatish avatar May 15 '24 07:05 badumbatish

@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

edogawashinichi avatar May 15 '24 13:05 edogawashinichi