Skip to content
0:00 / 0:00

#clojure#clojurescript#property-basedtesting

Keynote: The Power of Toys | David Nolen | Lambda Days 2022

Code Sync

15K subscribers • 68 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by David Nolen
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

5.3K views4 years ago2 recommendations

Programming languagesSoftware designLisp and ClojureSoftware architectureTesting

David Nolen explains how building a simplified toy model of a system with immutable values simplifies testing and composition.

The Power of Toys | David Nolen | Tools for Thought ABSTRACT At Vouch we build digital keys and fleet management for the automotive industry. While unit tests are valuable for verifying some properties of the system, global properties of our blockchain-based solution are quite challenging to rigorously test with traditional testing methods. The most trivial idea behind functional programming - orienting programs around immutable values rather than stateful objects - naturally guided us towards building a toy model of the system in which all state of interest is lifted into a single value. Now we have building blocks that always compose - each part snaps together regardless of the ordering. Sprinkle on some property-based testing and we can generate complex scenarios of interaction impractical to write by hand, including showing that upgrading / downgrading the source code of the deployed system will always lead to coherence. Many of these ideas were pulled together from toy examples found in educational functional programming texts. Toys can indeed be far more powerful than they appear! • Follow us on social: Twitter: twitter.com/LambdaDays LinkedIn: linkedin.com/company/lambda-days • Looking for a unique learning experience? Attend the next Code Sync conference near you! See what’s coming up at: codesync.global • SUBSCRIBE TO OUR CHANNEL youtube.com/channel/UC47eUBNO8KBH_V8AfowOWOw

Why it's here

2 people recommend this

What people say. Recommended for its insights on system composition and using a single-state world approach in Clojure.

Moments people linked to

u/eval2020in r/Clojure • Recommends

The Power of Toys | David Nolen | Lambda Days 2022

u/maxw85in r/Clojure • Recommends

On “Noob's conceptual question”

Most of our functions follow the convention that it receives a map, adds one entry or more and returns the map (never changes an existing entry). Thereby you can stack the functions like Lego blocks. Regrettably, I don't have an open source example ready. But the Readme of this deprecated library should give you an idea: https://github.com/simplemono/world I first learned about the approach here:  link to this video
3View on Reddit

u/maxw85in r/Clojure • Recommends

On “Thinking about system composition”

Great article 👍 I also prefer to define the start order manually. Your approach of using `reduce` to assemble the system map reminds me of the `world` approach described by David Nolen here: link to this video I also like the idea to merge the system map with the request map before it is passed to the ring handler.

u/maxw85in r/Clojure • Recommends

On “Clojure presentation/video recommendations”

link to this video