Monilnarang opened a new pull request, #3510:
URL: https://github.com/apache/amoro/pull/3510

   Aim:
   
   Improve the test code by avoiding code duplication, improving 
maintainability, and enhancing readability. By converting the test into a 
parameterized unit test, we reduce boilerplate code, make it easier to extend 
by simply adding new input values, and improve debugging by clearly identifying 
which test case fails instead of searching through individual assertions.
   
   ## Why are the changes needed?
   - The same method call to `parseBytes` are repeated multiple times with 
different inputs in the test `testParseBytes` making it harder to maintain and 
extend.
   - When any of these test fails, JUnit only shows which type of assertion 
failed, but not which specific input caused the failure.
   - Adding new test cases requires copying and pasting new assertion instead 
of simply adding new data.
   
   ## Brief change log
   Parameterized `testParseBytes`
   This reduces duplication, allows easy extension by simply adding new value 
sets, and makes debugging easier as it clearly indicates which test failed 
instead of requiring a search through individual assertions.
   
   Test report after changes: 
   <img width="451" alt="Screenshot 2025-04-12 at 10 11 53 AM" 
src="https://github.com/user-attachments/assets/ff03e166-efc0-4c9d-92b3-049f457a5c2a";
 />
   
   
    
   
   ## How was this patch tested?
   
   - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
   
   - [x] Add screenshots for manual tests if appropriate
   
   - [x] Run test locally before making a pull request
   
   ## Documentation
   
   - Does this pull request introduce a new feature? (yes / no)
   No
   - If yes, how is the feature documented? (not applicable / docs / JavaDocs / 
not documented)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to