You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "zi peng (JIRA)" <ji...@apache.org> on 2019/08/07 17:29:00 UTC
[jira] [Created] (JCLOUDS-1508) Using test case inheritance to test
source code polymorphism cause difficult maintenance
zi peng created JCLOUDS-1508:
--------------------------------
Summary: Using test case inheritance to test source code polymorphism cause difficult maintenance
Key: JCLOUDS-1508
URL: https://issues.apache.org/jira/browse/JCLOUDS-1508
Project: jclouds
Issue Type: Test
Affects Versions: 2.1.2
Reporter: zi peng
There're 49 test cases extend from _BaseProviderMetadataTest_ with only _*slightly*_ parameters differences. This test design requires extra maintenance effort and might introduce errors due to the low maintainability.
Refactoring these tests is highly recommended because :
1) if adding additional test methods to base test, developers need to review all the child test cases to make sure the modification is valid to all of the child test cases, and that's 49 of them.
2) if any issue occurs to the parent tests, isolate issues will cost extra time.
3) it against "Don't Repeat Yourself" rule.
Suggestion: Using parameterized tests provided by the testing framework.
{code:java}
public class SkaliCloudMalaysiaProviderTest extends BaseProviderMetadataTest {
public SkaliCloudMalaysiaProviderTest() {
super(new SkaliCloudMalaysiaProviderMetadata(), new ElasticStackApiMetadata());
}
}{code}
{code:java}
public class GleSYSProviderTest extends BaseProviderMetadataTest {
public GleSYSProviderTest() {
super(new GleSYSProviderMetadata(), new GleSYSApiMetadata());
}
}{code}
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)