question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clarify how to properly test compliance?

See original GitHub issue

I am new to Fantasy-Land and algebraic types in general, so please correct me if any of the following is incorrect or off-base.

One of the nicest things a specification can do is provide a compliance suite for implementers to confirm their work, if at all possible. As far as I can see, FL doesn’t quite include such a suite.

This repo includes a set of namespaced laws in curried function form (not all of the same type signature), which return booleans. That seems somewhat on the way towards a compliance suite, and indeed FL’s own test.js appears to check that the laws hold for its internal/example Id and Sum types.

It would seem to be possible for any implementer to import those laws in their own project and directly invoke the functions with correct arguments (as deduced from reading the source code) — which is perhaps the intent of the authors of this project. However, I wonder if it is not possible to provide something more cohesive, documented, straightforward, and foolproof?

For example, the Promises/A+ organization provides a compliance suite which can be run programmatically using a thin adapter module. The implementer does not need to know how to properly test their Promise library, just how to bridge their API to the expected API.

Is there any reason why FL cannot or would not follow suit (no wordplay intended)? I am just curious.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
davidchamberscommented, Apr 9, 2017

One thing to note is that the laws are not the totality of the spec, considering the spec requires additional constraints (e.g. “A value that implements the Ord specification must also implement the Setoid specification”).

Good point. This is actually encoded in sanctuary-type-classes. For example, this is the definition of Z.Monoid:

//# Monoid :: TypeClass
//.
//. `TypeClass` value for [Monoid][].
//.
//. ```javascript
//. > Monoid.test('')
//. true
//.
//. > Monoid.test(0)
//. false
//. ```
var Monoid = $('Monoid', [Semigroup], {empty: Constructor});

I’ve added an item to the to-do list in fantasyland/fantasy-laws#1:

  • Verify dependencies as discussed in fantasyland/fantasy-land#243
0reactions
glebeccommented, Feb 12, 2018

Given that I’m not actively looking at this project in any case, from an issue author perspective I am certainly okay with closing the issue. As to whether fantasy-laws satisfies the goals stated above, at first glance it looks sufficient, though I haven’t examined it exhaustively.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Implement a Compliance Testing Methodology To ...
Step 1: Create the Requirements Library · Step 2: Assess Your Compliance Risk · Step 3: Define Your Compliance Testing Methodology · Step...
Read more >
What Is Compliance Testing? The Effective Program Guide ...
Compliance testing, or conformance testing, is auditing for adherence to a policy, a rule, or a regulation. Compliance testing in auditing is ...
Read more >
5 Types of Testing Methods Used During Audit Procedures
Learn how inquiry, observation, examination, re-performance and computer-assisted audit techniques are used for SOC auditing.
Read more >
Measuring Compliance Program Effectiveness: A Resource ...
Perform assessment/audit to ensure the organization has established criteria to evaluate the acceptability of a candidate based on findings of ...
Read more >
Testing and Labeling Pertaining to Product Certification
Ensuring that a children's product tested for compliance with a children's product safety rule is subject to testing periodically and when ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found