Git Product home page Git Product logo

Comments (6)

linuswagner avatar linuswagner commented on May 28, 2024

Possible workaround: use exceptions or assert instead of booleans to make the test fail

from rascal.

jurgenvinju avatar jurgenvinju commented on May 28, 2024

This is an excellent idea; and a duplicate of the ancient #1010

from rascal.

jurgenvinju avatar jurgenvinju commented on May 28, 2024

I think the compiler can just interpret the existing boolean operators differently. There is no need for an API like JUnit.assertEqual or something. If I write test f(int a, int b) = a + b == b + a it is already clear that I am asserting that both sides of the == are equal.

from rascal.

linuswagner avatar linuswagner commented on May 28, 2024

I think the compiler can just interpret the existing boolean operators differently.

Yes, for equality that works perfectly. But depending on how complex the tests get, we are still in trouble:

  • what do we do when only partial matches are relevant, for example in a string?
  • what do we do if a test requires more than one comparison? For example, testing a list usually requires to check its size and its elements. Checking for equality would again merge both cases into one

from rascal.

jurgenvinju avatar jurgenvinju commented on May 28, 2024

There are limits with what we can do, indeed. However if we bring it up too the level of junit asserts, (equals, unequals, booleans) with proper diffs, we are already much richer than what we have now (false).

Also input minimisation (random or brute force or heuristically) would help a lot.

from rascal.

jurgenvinju avatar jurgenvinju commented on May 28, 2024

The next step would be to bring in a theory of pattern matching and parsing; i.e if a match fails we could explain why or produce a smaller test case that also fails for the same reason.

from rascal.

Related Issues (20)

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.