Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCOM4 realization issue #519

Open
iMaks99 opened this issue Apr 22, 2021 · 0 comments
Open

LCOM4 realization issue #519

iMaks99 opened this issue Apr 22, 2021 · 0 comments

Comments

@iMaks99
Copy link

iMaks99 commented Apr 22, 2021

Referring to “Class Cohesion Metrics for Software Engineering: A Critical Review” by Habib Izadkhah, Maryam Hooshyar, that noted as a resource that they used during development, we can discover that LCOM4 counts number of directly or indirectly connected components. This definition excludes possibility of having negative results, however, jPeek returns a noticeable number of negative results. This is the reason why we consider LCOM4 results as unreliable. LCOM4 expands the area of connections between two methods by adding internal calls of one method inside another as an indirect connection. It would probably lead to performance improvement in classes without attributes. As an example, this class has 4 methods, 1 attribute and 6 pairs. jPeek returned -0.6667 value.

package ma.glasnost.orika.test.generics;
 
import java.util.Objects;
 
public abstract class GenericCollectionsTestCase$Person {
    private String name;
 
    public GenericCollectionsTestCase$Person() { }
 
    public String getName() {
        return this.name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public boolean equals(Object that) {
        return Objects.equals(this.name, ((GenericCollectionsTestCase$Person)that).name);
    }
 
    public int hashCode() {
        return Objects.hash(new Object[]{this.name});
    }
} 

It is possible because of normalization were made, but its unclear why result is negative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants