Taher-Ghaleb opened a new pull request, #4625: URL: https://github.com/apache/hive/pull/4625
I am working on research that investigates test smell refactoring in which we identify alternative implementations of test cases, study how commonly used these refactorings are, and assess how acceptable they are in practice. The first smell is when inappropriate assertions are used, while there exist better alternatives. For example, in [TestJdbcDriver2.java](https://github.com/apache/hive/commit/04a9ddaa91c549a3c3041a45ab9871c4bc70f76d#diff-71a2f75f4a5dc07d285255a36e87deaab739ca7c486c2b1ddc3930f69f46783d), I refactored `assertFalse(queryId.equals(queryId1));` with `assertNotEquals(queryId, queryId1);`. The second smell is when exception handling can alternatively be implemented using assertion rather than annotation. For example, in [TestJdbcDriver2.java](https://github.com/apache/hive/commit/04a9ddaa91c549a3c3041a45ab9871c4bc70f76d#diff-71a2f75f4a5dc07d285255a36e87deaab739ca7c486c2b1ddc3930f69f46783d), I used `assertThrows(HiveSQLException.class, () -> {...});` instead of `@Test(expected = HiveSQLException.class)`. I would like to get your feedback on these particular test smells and their refactorings. Thanks in advance for your input. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
