You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Ayush Saxena (Jira)" <ji...@apache.org> on 2023/08/25 08:31:01 UTC
[jira] [Commented] (HIVE-27645) Clean test cases by refactoring assertFalse(equals()) using assertNotEquals & @Test(excepted) using assertThrows
[ https://issues.apache.org/jira/browse/HIVE-27645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17758899#comment-17758899 ]
Ayush Saxena commented on HIVE-27645:
-------------------------------------
Committed to master.
Thanx [~taher-ghaleb] for the contribution!!!
> 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
> Assignee: Taher Ghaleb
> Priority: Minor
> Labels: pull-request-available
>
> 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)