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

Unique differences aren't counted correctly #72

Open
beatngu13 opened this issue Jan 30, 2019 · 1 comment
Open

Unique differences aren't counted correctly #72

beatngu13 opened this issue Jan 30, 2019 · 1 comment
Labels
refactoring Restructure or improve existing code

Comments

@beatngu13
Copy link
Contributor

Quite often, there are more unique differences than "normal" differences.

These normal differences are counted via ActionReplayResult#getElementDifferences(), whereas the unique differences are counted via ActionReplayResult#getUniqueDifferences(). As can been seen, getElementDifferences() simply uses StateDifferences#getNonEmptyDifferences(), but getUniqueDifferences() calls getElementDifferences() and "unwraps" the contained differences (which can be different types).

If we assume that all possible differences of an element are wrapped inside an ElementDifference, then getUniqueDifferences() contains at least the number of differences as getElementDifferences(). But if a single element has multiple differences, e.g., two attribute changes, then getUniqueDifferences() leads to more differences than getElementDifferences().

This is confusing because one expects "unique" to be less than "normal". So, we should probably adapt the naming scheme. For instance:

  • getElementDifferences() => getElementDifferences() since it returns the list of differences of all elements that have changed.
  • getUniqueDifferences() => getAllDifferences() since it unwraps each ElementDifference into one or more AttributesDifference, IdentifyingAttributesDifference, DurationDifference or InsertedDeletedElementDifference.
@beatngu13 beatngu13 added the bug Something isn't working label Jan 30, 2019
@martin-v martin-v added refactoring Restructure or improve existing code and removed bug Something isn't working labels Mar 27, 2019
@beatngu13
Copy link
Contributor Author

@martin-v isn't this a bug as existing functionality is broken? We want to improve the external quality, not just the internal one. So why refactoring instead of the bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Restructure or improve existing code
Development

No branches or pull requests

2 participants