Giter VIP home page Giter VIP logo

quixbugs's People

Contributors

agb94 avatar chenaj avatar drrckln avatar furunkel avatar h4iku avatar jkoppel avatar martinezmatias avatar monperrus avatar sophiehye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

quixbugs's Issues

Some issues with the Java translations

Hi, for my own research I have unified some the test cases for the graph algorithms (i.e., use the Python test cases also for Java programs) and have come across some inconsistencies in the Java implementations.

1. Copying of Node Sets

It seems the Java implementations copy the node set.

public static Map<Node,Set<Node>> update(Map<Node,Set<Node>> groupByNode, Node vertex_u, Node vertex_v) {
Set<Node> vertex_u_span = new HashSet<>(groupByNode.get(vertex_u));
vertex_u_span.addAll(groupByNode.get(vertex_v));
groupByNode.put(vertex_u, vertex_u_span);
return groupByNode;
}

However, since equality is tested using == (object identity) this seems invalid?

if (groupByNode.get(vertex_u) != groupByNode.get(vertex_v)) {

The following makes all Python tests pass, so I wonder: why the copy constructor?

  public static Map<Node,Set<Node>> update(Map<Node,Set<Node>> groupByNode, Node vertex_u, Node vertex_v) {
      Set<Node> vertex_u_span = groupByNode.get(vertex_u);
      vertex_u_span.addAll(groupByNode.get(vertex_v));
      groupByNode.put(vertex_u, vertex_u_span);

      return groupByNode;
  }

2. Negative Weights

Some algorithms support negative weights/lengths. However, while the Python implementations use inf, in Java a magic integer constant is used:

final static int INF = 99999;

This causes a wrong result when summing weights here:

int update_length = Math.min(length_by_path.get(Arrays.asList(i,j)),
length_by_path.get(Arrays.asList(i,k)) + length_by_path.get(Arrays.asList(k,j)));

I fixed this by explicitly checking for INF when summing:

 int update_length = Math.min(length_by_path.get(Arrays.asList(i,j)), sumLengths(length_by_path.get(Arrays.asList(i,k)), length_by_path.get(Arrays.asList(k,j))));

where sumLengths is defined as:

static private int sumLengths(int a, int b) {
    if(a == INF || b == INF) {
        return INF;
    }
    return a + b;
}

Adding passing test cases

Hi,

Iā€™m a master student at COINSE, KAIST and developing a Genetic Improvement framework called PyGGI.

First of all, thanks for providing a multi-lingual program benchmark.

I am currently running an APR experiment on this benchmark and found that there are some faulty programs that have no passing test at all (ex. mergesort, bucketsort, shunting_yard, ā€¦). This makes it difficult to distinguish the original faulty program from even worse programs.

So, I've created several passing test cases for some of those programs by automatically generating inputs that satisfy the described input precondition and yield the same output on both correct and faulty program. To do so, I repeatedly mutated the original failing test inputs until finding such test inputs.

If you think this may help, I'd like to open a pull request which will add passing test inputs to the existing JSON files. Thank you!

License/Can I modify reuse this for research?

Hi, since there's no explicit licensing on the repository, I wanted to clarify if I'm permitted to modify (create a JavaScript version of the programs) and use it for my own purposes (my honours project).

I'm assuming the answer is rest, but I figured I'd ask to be sure - You never know :)

suggestion: activate Travis CI?

Hi, I've prepared a gradle build file that is compatible with Travis. It would ensure that everything compiles.

I'll create a pull request once the compilation errors are fixed in #1.

Could you activate Travis on this repo?

Infinite loop on bitcount not handled by tester.py

So the bug in bitcount.py is in that n^=n-1 creates an infinite loop in the program.
When tester.py executes this program with the line return getattr(fx,algo)(*args), the tester program itself does not return.

In my own use of the Quixbugs project, I am just setting a time out that determines the cause of failure to be an infinite loop after some reasonable period, but I thought it was worth mentioning here for others using the project.

Update Junit Test Generator

Integrate Matias work to existing Junit test generator, so that less or none manually fix is needed.
Update all the generated tests as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.