This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-03
Channels
- # admin-announcements (2)
- # arachne (1)
- # architecture (6)
- # boot (316)
- # cider (7)
- # cljsrn (7)
- # clojure (169)
- # clojure-argentina (3)
- # clojure-belgium (1)
- # clojure-canada (4)
- # clojure-india (1)
- # clojure-russia (39)
- # clojure-spec (27)
- # clojure-uk (55)
- # clojurescript (213)
- # css (1)
- # cursive (20)
- # datavis (2)
- # datomic (52)
- # devcards (3)
- # dirac (78)
- # emacs (20)
- # events (1)
- # funcool (3)
- # hoplon (15)
- # jobs-rus (2)
- # om (57)
- # onyx (82)
- # overtone (1)
- # re-frame (10)
- # reagent (1)
- # ring-swagger (46)
- # spacemacs (7)
- # specter (31)
- # spirituality-ethics (1)
- # sql (43)
- # test-check (1)
- # testing (4)
- # untangled (30)
You could imagine a not-too-different clojure where special forms are namespaced and excludable
I'm curious what people think about the differences/benefits/relationships between: - Generative Property Based Testing - Pairwise Testing In particular is anyone combining the two... It seems to me that you could/should use generative tests to provide instance data within certain equivalence classes of values and then use pairwise testing to generate arguments as test pairs to apply to the function under test.
@borkdude: not I, but I've written some evolutionary music programs, and I think that'd be a really cool approach -- evolve organisms whose phenotype is a spec & generate music from the spec.
http://gigasquidsoftware.com/blog/2016/07/18/genetic-programming-with-clojure-dot-spec/
@eggsyntax: thanks for the read!
Anyone using spec to parse and validate tabular data?
@alexmiller: Should I fill a ticket to have :conform-keys
be turned into :conform-keys?
(option in map-of), also :distinct
-> :distinct?
, there are possibly other bool options like these in spec, didn't check all of them
lopalghost: not yet - but I totally plan too
lopalghost: I think specs and their regexes etc are a natural fit for validating columns/rows of data
@rickmoynihan: I've been using it to read unfriendly excel spreadsheets, it's really helpful Was wondering what sort of approaches people might be taking
@mpenet you can, not sure on the likelihood of that changing
lopalghost: I plan on doing the same thing - as it seems a natural fit... curious to hear about your experiences though
is clojure.spec/conform meant to be used in production code (and not only when developing/testing/instrumenting)? For spec/assert it is mentioned explicitly that is should be a no-op and disabled in production, same as with instrumenting and such. Does the same hold for spec/conform? Will the run-time impact be to high to use spec/conform generously everywhere?
it has the benefit of e.g. automatically classifying multiple options for you (s/or) via a map key
also, you don’t care about expensive there because a) you’re doing it once b) the alternative is potentially consuming random garbage and having it break somewhere down the road
thanks, I hadn't considered the "one time" aspect of using conform. I was thinking of using conform multiple times on the same value but that doesn't work as conform will most likely transform the value
For a couple of maps I want to specify, there are some derived values therein which I’d like to specify (and generate) correctly. For example {:a 1 :b 2 :a+b 3}
. This is easy to express with (s/and (s/keys …) #(some-predicate))
but of course the generator essentially never passes the such-that filter
Has anyone found any good patterns for this situation?
donaldball: running the default generator through gen/fmap
would make it easy enough to overwrite key like the one you showed
I don't think clojure.spec makes it easy to modify a generator though
I’ve kinda settled on having two specs, one which specifies the map with only independent values, and another which specifies the map including derived values
gen/fmap
should help in that case too
Yea, it’s not hard to add on, I’m just wondering if anyone else has been writing specs for maps with internal value consistency requirements and, if so, if there’s a declarative approach to expressing them