Krakow Decompressed
(or 'What I learned @EuroClojure 2014')
Clojure Ireland
3rd Sept 2014, Dublin
Hit 'M' for overview of slides. Press 'M' again to exit.
Part 1.
Swagger & Prismatic Schema
To document & validate an API developed in Clojure
Define a data-type with Schema
Test a sample of valid data
Pass invalid data to Schema
Integrates several packages
Compojure & Ring (basic web-stack)
Prismatic Schema (to validate data-types)
ring-swagger (generate JSON to document an API)
Define data-type & set up routing...
Define an API endpoint...
Swagger UI
JavaScript to consume JSON to document an API.
Available for many languages (not just Clojure)
Alternatives to Compojure-api
Alternative to ring-swagger
Part 1 was inspired by...
"Schema & Swagger: making your Clojure web APIs more awesome", by Tommi Reiman.
Part 2.
JVM breakglass
A dynamic backdoor to diagnose a static (Java) system.
One-page tutorial-style guide to using JVM Breakglass
Part 2 was inspired by...
"JVM Break Glass - Using a Clojure REPL to troubleshoot live Java/JVM processes", by Mathieu Gauthron
Part 3.
"Generative testing" with test.check
Make assertions about your code
Let the test-library bombard your functions with generated test-data.
test.check reimplements QuickCheck (available for Erlang, Haskell)
Generators
generate random data, of a given type; starts off simply
Properties
for making general statements about data
Run tests against the sort function
Example of a bad property
Part 3 was inspired by...
"Generative testing with clojure.test.check", by Philip Potter
Videos from EuroClojure 2014
Call to Action
Document & Validate APIs with Schema & Swagger
Build an API with Compojure-api (or Octohipster)
Diagnose a static Java system with JVM-breakglass
Generate test data with test.check
/