{"action":"opened","issue":{"url":"https://api.github.com/repos/gcanti/tcomb/issues/263","repository_url":"https://api.github.com/repos/gcanti/tcomb","labels_url":"https://api.github.com/repos/gcanti/tcomb/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/gcanti/tcomb/issues/263/comments","events_url":"https://api.github.com/repos/gcanti/tcomb/issues/263/events","html_url":"https://github.com/gcanti/tcomb/issues/263","id":186962575,"number":263,"title":"Using tcomb types for generative testing","user":{"login":"jefffriesen","id":445733,"avatar_url":"https://avatars.githubusercontent.com/u/445733?v=3","gravatar_id":"","url":"https://api.github.com/users/jefffriesen","html_url":"https://github.com/jefffriesen","followers_url":"https://api.github.com/users/jefffriesen/followers","following_url":"https://api.github.com/users/jefffriesen/following{/other_user}","gists_url":"https://api.github.com/users/jefffriesen/gists{/gist_id}","starred_url":"https://api.github.com/users/jefffriesen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefffriesen/subscriptions","organizations_url":"https://api.github.com/users/jefffriesen/orgs","repos_url":"https://api.github.com/users/jefffriesen/repos","events_url":"https://api.github.com/users/jefffriesen/events{/privacy}","received_events_url":"https://api.github.com/users/jefffriesen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-03T01:41:21Z","updated_at":"2016-11-03T01:41:21Z","closed_at":null,"body":"We are so close to having [clojure.spec](https://clojure.org/about/spec)-like features in Javascript. What's missing is automatic generative testing that is created from types. `tcomb` has everything we need to do this AFAICT. \r\n\r\nI brought this up with the Jest team and Flow just doesn't have the type granularity to efficiently do generative testing automatically. https://github.com/facebook/jest/issues/2026 \r\n\r\nBut tcomb's refinement types do have the specificity for a test suite to automatically create a reasonable set of test inputs. Are there any generative testing libraries that leverage tcomb types? If not, doesn't this seem like a good next step?\r\n\r\nNone of these resources really address this:\r\n* https://medium.com/@joe_stant/runtime-introspection-of-flow-types-ddb7e5b042a5#.tvbw0r47e (uses Flow types without refinements)\r\n* http://jsverify.github.io (You have to write all of the test cases and can't leverage predefined types)\r\n* https://github.com/leebyron/testcheck-js (Similar issues as jsverify and also hasn't been maintained in a coupled years)\r\n\r\nI'll just say how awesome tcomb has been. Right now I have a fairly complex form-based app. I generate the form UI from an extended JSON schema. Using [tcomb-json-schema](https://github.com/gcanti/tcomb-json-schema) I generate tcomb refinement types (including form min & max). Using [tcomb-validation](https://github.com/gcanti/tcomb-validation) I validate the form. I'll probably even use [tcomb-react](https://github.com/gcanti/tcomb-react) for propTypes. Wouldn't it be awesome to get generative testing out of it as well?\r\n\r\nAre there technical limitations to this? Lack of interest? Lack of time?\r\n\r\nThanks!"}}
{"actor":{"display_login":"jefffriesen"}}