Taher Ghaleb created HIVE-27645: ----------------------------------- Summary: Clean test cases by refactoring assertFalse(equals()) using assertNotEquals & @Test(excepted) using assertThrows Key: HIVE-27645 URL: https://issues.apache.org/jira/browse/HIVE-27645 Project: Hive Issue Type: Improvement Reporter: Taher Ghaleb
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, {{{_}assertNotEquals(x, y){_};}} is more appropriate to use instead of {_}{{assertFalse(x.equals(y));}}{_}. The second smell is when exception handling can alternatively be implemented using assertion rather than annotation. For example, _{{{}assertThrows({}}}{{{}Exception{}}}{{{}.class, () -> \{...});{}}}_ is more appropriate to use instead of {{{}_@Test(expected = Exception.class)_{}}}. While there could be several cases like this, we aim in this pull request to get your feedback on these particular test smells and their refactorings. Thanks in advance for your input. -- This message was sent by Atlassian Jira (v8.20.10#820010)