This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-12
Channels
- # aleph (1)
- # aws (2)
- # babashka (44)
- # beginners (178)
- # biff (12)
- # calva (22)
- # chlorine-clover (60)
- # cider (1)
- # clj-kondo (9)
- # cljdoc (6)
- # cljs-dev (37)
- # cljss (2)
- # clojure (43)
- # clojure-europe (3)
- # clojure-finland (23)
- # clojure-italy (1)
- # clojure-nl (4)
- # clojure-norway (3)
- # clojure-spec (56)
- # clojure-uk (148)
- # clojuredesign-podcast (1)
- # clojurescript (11)
- # conjure (5)
- # core-async (22)
- # cursive (9)
- # datascript (5)
- # datomic (4)
- # duct (8)
- # emotion-cljs (2)
- # figwheel-main (15)
- # fulcro (53)
- # graalvm (68)
- # helix (2)
- # jackdaw (1)
- # kaocha (9)
- # lambdaisland (1)
- # malli (10)
- # meander (2)
- # news-and-articles (1)
- # observability (12)
- # off-topic (17)
- # pathom (1)
- # pedestal (25)
- # practicalli (1)
- # protojure (4)
- # re-frame (2)
- # reagent (57)
- # reitit (1)
- # releases (2)
- # shadow-cljs (69)
- # specter (6)
- # tools-deps (10)
- # vim (16)
- # vscode (4)
- # yada (3)
This was similar to the idea of using codeq to check which function change and run the test calling the function. Especially for pure functions it makes sense.
But yeah it would be great!
@aviflax I think you hit a pretty specific edge case, I wouldn't worry about it too much
Clojure is to some extent statically analyzable, that's what e.g. Cursive does, because functions generally are not polymorphic. In Ruby every method call is polymorphic, you never know what implementation gets called unless you know the runtime type. Clojure does have polymorphism as well though, through multimethods, protocols, interfaces, proxy/reify, so you have the same problem there. Plus we have macros. So in practice you only get so far with static analysis.
There's an alternative approach where you adopt conventions to make it clear which tests test a certain function, this is what Mutant does (https://github.com/mbj/mutant/blob/master/docs/mutant-rspec.md#test-selection). When you are doing mutation testing you need to be able to narrow down the number of tests to run, otherwise it becomes impossibly slow, so Mutant expects that you name your tests in such a way that it can determine which class/method is being tested. In Clojure we could use metadata for this.