Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CollectionsBidiMapFuzzer.java Enhance Fuzzing Coverage and Inp…
…ut Variability for CollectionsBidiMapFuzzer (#12848) PR Description: In this PR improve fuzzing coverage handle more diverse input sizes, and ensure the `BidiMap` is freshly initialized for each test. The changes focus on improving the randomness of the fuzzed input, ensuring that each test runs with an independent map instance, and making the fuzzing more comprehensive by introducing variable-length strings. Changes Done in this: 1. **BidiMap Initialization Inside `runTest` Method**: - The `BidiMap` (`m_bidiMap`) is now instantiated inside the `runTest` method, ensuring that each fuzzing test operates on a fresh map instance. This avoids potential issues where the map state is carried over between tests, ensuring more accurate results. 2. **Handling Variable Size Strings**: - The fuzzed input strings are now consumed with random lengths between 5 and 15 characters (instead of always using a fixed size of 10). This change makes the fuzzing process more dynamic and tests the code against a wider range of string sizes, increasing the likelihood of uncovering edge cases. 3. **Improved Fuzzing Coverage**: - The use of variable-length strings is applied across all test cases in the `runTest` method (`put`, `get`, `getKey`, `removeValue`, `inverseBidiMap`). By introducing more variability in the input size, the test now covers a wider set of scenarios, ensuring a more thorough fuzzing process.
- Loading branch information