Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
|
Thanks for the PR. I'm not going to merge it at the moment because it's not clear to me that this is an improvement... reducing duplication is generally good, but not as much so in tests where some amount of duplication can make the expected behavior more clear in each test case. But I'll leave it open for the moment because it's possible this could benefit from reducing duplication to some extent. |
As part of a research project at the University of Waterloo, we are exploring automatic test refactoring tools and submitting vetted proposed refactorings upstream. These refactorings make it easier to add additional related tests and should help with the maintainability of the tests.
These are all automated refactorings, but we have checked every case and made sure that all the test cases still pass successfully.
If it helps, we can also propose a test case that uses these refactored methods. We explained each of the four refactoring cases briefly below.
Test method pair "testRead_partialArray()" and "testRead_partialArray_sliceLarger()" only differ in an int value (8 vs 10). We create parametrized "jimfsInputStreamTestTestRead_partialTemplate(int i1)" method, which allows you to add similar test cases with different argument i1.
Test method pairs "testNormalizeNfc_pattern()" and "testNormalizeNfd_pattern()", and "testNormalizeNfcCaseFoldAscii_pattern()" and "testNormalizeNfdCaseFoldAscii_pattern()", only differ in a PathNormalization (NFC vs NFD). We create parametrized "pathNormalizationTestTestNormalizeCaseFoldAscii_patternTemplate(PathNormalization pathNormalization1)" and "pathNormalizationTestTestNormalizeTemplate(PathNormalization pathNormalization1)" methods.
Test method pair "testWindows_relativePathsWithDriveRoot_unsupported()" and "testWindows_absolutePathOnCurrentDrive_unsupported()" only differ in two strings ("C:" vs "\foo\bar" and "C:foo\bar" vs "\"). We create parametrized "public void windowsPathTypeTestTestTemplate(String string1, String string2)" method.