Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

1. Separation of immutable and mutable logic

Quite a lot of different people have been on the same trail of thought. Gary Bernhardt's formulation of a "functional core, imperative shell" seems to be the most voiced.

"Boundaries" - Gary Bernhardt

"Imperative shell" that wraps and uses your "functional core".. The result of this is that the shell has fewer paths, but more dependencies. The core contains no dependencies, but encapsulates the different logic paths. So we’re encapsulating dependencies on one side, and business logic on the other side. Or put another way, the way to figure out the separation is by doing as much as you can without mutation, and then encapsulating the mutation separately. Functional core — Many fast unit tests. Imperative shell — Few integration tests

There are only two roles of code - John Sonmez

All code can be classified into two distinct roles; code that does work (algorithms) and code that coordinates work (coordinators).

Object layer, valuelayer - Andy Matuschak

Great talk, but specifically on the separation of side-effects at the at the 27 minutes 53 seconds mark.

A Modern Architecture for FP - John A De Goes

Interpreters of the functional core

Hexagonal architecture - Alistair Cockburn

Hexagonal Architecture is an architecture defined by establishing a perimeter around the domain of your application and establishing adapters for input/output interactions. By establishing this isolation layer, the application becomes unaware of the nature of the things it's interacting with.

Create your application to work without either a UI or a database so you can run automated regression-tests against the application, work when the database becomes unavailable, and link applications together without any user involvement.

2. Test isolation - nomock

Growing Object-Oriented Software, Guided by Tests Without Mocks - Vladimir Khorikov

Test Isolation Is About Avoiding Mocks - Gary Bernhardt

To Kill a Mockingtest - Ken Scambler

Mocking is Tautological - Mark Sands

3. Blogs on Functional core, Imperative shell

"Functional core & Imperative shell" : OO design, and isolated tests without mocks

Business-Friendly Functional Programming, Part 2: Testability - Yang Bo

mokacoding - unit and acceptance testing, automation, productivity

Functional Core, Imperative Shell - Sean Hammond

BoochTek, LLC


Functional Programming in Ruby - Vitor Capela

Enemy of the State by Justin Spahr-Summers

Functional Programming in Swift - slide 55+

Test-Driven Development with Python - Harry Percival


programming, when stripped of all its circumstantial irrelevancies,
boils down to no more and no less than very effective thinking so as to avoid unmastered complexity,
to very vigorous separation of your many different concerns.
-- Dijkstra EDW512


This comment has been minimized.

Copy link

danielt1263 commented Apr 29, 2019

Another talk for the Test Isolation section:
Test Doubles Are a Scam - Matt Diephouse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.