Giter Site home page Giter Site logo

Testing features about neohaskell HOT 3 OPEN

NickSeagull avatar NickSeagull commented on June 15, 2024
Testing features

from neohaskell.

Comments (3)

moodmosaic avatar moodmosaic commented on June 15, 2024 1

test: Run tests

With this command we may also be able to support property-based tests.

Discoverability

We should be able to execute as a test any function that meets the following criteria:

  • The function is public.
  • The function name starts with test_ (configurable).
  • If a public function named beforeEach is present it can be executed before each test is run.
type prefix arguments semantics
concrete test_ no single execution with concrete values
property test_ yes multiple executions with randomly generated concrete values (smaller values)
fuzz test_ yes multiple executions with randomly generated concrete values (biased)*

*Also configurable.


For the biased case, depending on the underlying testing library (QuickCheck, hedgehog, falsify), there may exist a command that overrides the scope and shrinking of generated values so the tests can run in 'fuzz' mode. For example:

  • test: Run tests
  • fuzz: Run tests (biased)

from neohaskell.

moodmosaic avatar moodmosaic commented on June 15, 2024 1

Yes! I have been using doctest even in F# in the past and I agree with your thoughts around it.

from neohaskell.

NickSeagull avatar NickSeagull commented on June 15, 2024

This looks awesome!

One of the things that I was thinking to promote was the usage of doctests. Many times folks skip writing tests because it is an additional task to do, and an afterthought in some way.

My hypothesis is that if we teach folks to describe and document their functions, as well as giving an example, we start getting a bit of test coverage, which is better than nothing.

On top of that, now with GitHub Copilot, writing a good documentation, along with examples (doc tests) the implementation of any code becomes much easier.

They also support property based testing, which is cool

from neohaskell.

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.