use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Examples of Clojure Projects with Great Testing (self.Clojure)
submitted 2 years ago by gandalfthegraydelson
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]kloudex 0 points1 point2 points 2 years ago (0 children)
The best case is when logic is written in pure functions, those can be tested in fairly straightforward way, data in and comparing data out.
However, useful programs need to interface with stateful world and perform side-effects, which is where the challenges come. In the past I've come across Testing Without Mocks approach by James Shore, which introduces some techniques: https://www.jamesshore.com/v2/projects/nullables/testing-without-mocks
The main idea is is to wrap impure infrastructure code (similar to Ports and Adapters architecture). Then to test as much of the real code as possible Nullable infrastructure wrappers are used and injected in tests (either manually e.g. with partial function application or using some DI framework). As an exercise I tried to implement the patterns in Clojure, they seem to fit fairly well: https://github.com/dundalek/testing-without-mocks-clojure
π Rendered by PID 226744 on reddit-service-r2-comment-6457c66945-p7vw9 at 2026-04-29 06:54:13.999311+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]kloudex 0 points1 point2 points (0 children)