eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.28k stars 721 forks source link

Test Smell: it is not a good practice to write the return statement in test cases #15746

Open TestSmell opened 2 years ago

TestSmell commented 2 years ago

Hi!

I notice that you write the return statement in some test cases. For example,

image

Generally, the purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. Therefore, I think the return statement should be written in test code with the ''@Test'' annotation method. In addition, there are no assertions in this test case and it is invoked by another method named ''createAndCheckValueType()''. I would like to know if is it really a useful test case? Whether something wrong is in this test case? Thanks.

smlambert commented 2 years ago

https://github.com/TestSmell - are you a 17 day old bot?

TestSmell commented 2 years ago

No. We are just conducting a study. We summarize several new/candidate test smells from discussion in StackOverflow and design the corresponding detector to detect them. We identify candidate test smells from GitHub projects using our detector. We then sent detected candidate test smells to developers of real-world projects to investigate whether they also think it is not a good practice in testing. At least these detected test methods can be improved. Thanks.