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

Analysis of Specimin vs Perses #11

Merged
merged 3 commits into from
Aug 1, 2024
Merged

Analysis of Specimin vs Perses #11

merged 3 commits into from
Aug 1, 2024

Conversation

kelloggm
Copy link

@kelloggm kelloggm commented Aug 1, 2024

@M3CHR0M4NC3R, we'll need a similar analysis for each bug that we want to discuss in the paper (this analysis doesn't go into the paper directly, but it needs to appear in the supporting material). Can you do this for NA-323? Or, if you're busy working on the other bugs, can you provide me with the Perses NA-323 output so that I can do this myself?

@M3CHR0M4NC3R
Copy link

I don't think I can make a commit to this pr, but this is what I added

NA-323

Specimin Output:

package com.cogvio.time;

import java.time.Clock;
import java.time.Instant;
import java.time.ZoneId;

public final class MutableClock extends Clock {

    private Instant instant;

    private ZoneId zone;

    private MutableClock(final Instant instant, final ZoneId zone) {
        this.setZone(zone);
        this.setInstant(instant);
    }

    public void setInstant(final Instant instant) {
        throw new Error();
    }

    public void setZone(final ZoneId zone) {
        throw new Error();
    }

    public ZoneId getZone() {
        throw new Error();
    }

    public MutableClock withZone(final ZoneId newZone) {
        throw new Error();
    }

    public Instant instant() {
        throw new Error();
    }
}

Perses Output:

package com.cogvio.time;

import java.time.Instant;
import java.time.ZoneId;

class MutableClock {
  Instant instant;
  ZoneId zone;

  MutableClock() {}
}

Line counts using same formatting:

  • Specimin: 27
  • Perses: 8

Differences:

  • Perses doesn't include clock
  • Perses removes "public final" before "class" in class declaration and removes "extends"
  • Perses removes "private" from variable declarations
  • Perses removes arguments for MutableClock()
  • Specimin replaces the body of the setters and getters with "throw new Error();" while perses removes them entirely

@kelloggm
Copy link
Author

kelloggm commented Aug 1, 2024

I don't think I can make a commit to this pr

Not directly, but you should be able to open a PR of your own that targets this branch. If you're having trouble with that, though, I can commit this for you.

Either way, this is really helpful - I'll add some text to the paper about it.

Sam Lenz and others added 2 commits August 1, 2024 16:58
@kelloggm kelloggm changed the title Analysis of CF-4614 (Specimin vs Perses) Analysis of Specimin vs Perses Aug 1, 2024
@kelloggm kelloggm merged commit 00bca22 into main Aug 1, 2024
3 checks passed
@kelloggm kelloggm deleted the analysis-of-differences branch August 1, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants