kowainik / kowainik/containers-backpack

Discuss separation on unit tests and property-based tests

Open
#39 0 comments 0 reactions 0 assignees View on GitHub
question test
Dominant language
Haskell
Stars
32
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Some tests introduced in #34 are unit tests and some are property-based tests. It would be really nice to somehow separate tests. For example, this one is unit test:

https://github.com/kowainik/containers-backpack/blob/c84b22f7551bd34183ac76ff20dd4e4fa4cd6f48/containers-contrib-readonly/src/Map/Contrib/Laws.hs#L21-L22

But this looks like property-based test:

https://github.com/kowainik/containers-backpack/blob/c84b22f7551bd34183ac76ff20dd4e4fa4cd6f48/containers-contrib-readonly/src/Map/Contrib/Laws.hs#L65-L72

I would love to have 3 test-suites:

1. test-suite for unit tests
2. test-suite for property tests
3. One test suite that combines them all.

My proposal is to use `hspec` for unit tests. QuickCheck can be used now for property-based tests.

Contributor guide

Open the contributing guide

Research direction

Start with containers-contrib-readonly/src/Map/Contrib/Laws.hs, comparing the unit-test example at lines 21-22 with the property-based example at lines 65-72. Review how the current tests are organized, then define separate hspec unit and QuickCheck property suites plus a combined suite; done means all three suites run as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.