Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Creating and evolving contracts with Clojure.sp...

kapil
January 12, 2019

Creating and evolving contracts with Clojure.spec @ Helpshift

I talk about how we used Clojure.spec @ Helpshift to create and evolve contracts between Frontend apps and Backend servers.

kapil

January 12, 2019
Tweet

More Decks by kapil

Other Decks in Programming

Transcript

  1. CREATING AND EVOLVING CONTRACTS WITH CLOJURE.SPEC A new way to

    do develop with Client app teams @KapilReddy Principal Engineer
  2. CURRENT DEV CYCLE • Product requirements document • Backend Engineer

    + Frontend Engineer write contracts • Backend Engineer + Frontend Engineer start work in parallel
  3. CURRENT DEV CYCLE • Product requirements document • Backend Engineer

    + Frontend Engineer write contracts • Backend Engineer + Frontend Engineer start work in parallel • Integrate and test contracts/flows when both pieces are ready
  4. PAIN POINTS • Verification of contracts not automated • Client

    app team is blocked by backend team to verify if things are working
  5. PAIN POINTS • Verification of contracts not automated • Client

    app team is blocked by backend team to verify if things are working • Integration is late in dev process
  6. PAIN POINTS • Verification of contracts not automated • Client

    app team is blocked by backend team to verify if things are working • Integration is late in dev process • Contract documentation can diverge not always up- to-date
  7. HOW/WHERE TO CONTRACT? • Contracts with clients - JS +

    Android + iOS • All clients talk to Clojure code
  8. HOW/WHERE TO CONTRACT? • Contracts with clients - JS +

    Android + iOS • All clients talk to Clojure code • Clojure.spec to the rescue!
  9. MOCKING POST REQUEST • Writes need to be persisted for

    certain UI flows to be testable • Atom to the rescue!
  10. MOCKING POST REQUEST • Writes need to be persisted for

    certain UI flows to be testable • Atom to the rescue! • Mocking CRUD operation is straightforward
  11. MOCKING POST REQUEST • Writes need to be persisted for

    certain UI flows to be testable • Atom to the rescue! • Mocking CRUD operation is straightforward • Gotcha! - It can become a rabbit hole
  12. PAIN POINTS • Verification of contracts not automated • Client

    app team is blocked by backend team to verify if things are working • Integration is late in dev process • Contract documentation can diverge not always up- to-date
  13. PAIN POINTS • Verification of contracts not automated • Client

    app team is blocked by backend team to verify if things are working • Integration is late in dev process • Contract documentation can diverge not always up- to-date
  14. PAIN POINTS • Verification of contracts not automated • Client

    app team is blocked by backend team to verify if things are working • Integration is late in dev process • Contract documentation can diverge not always up- to-date
  15. PAIN POINTS • Verification of contracts not automated • Client

    app team is blocked by backend team to verify if things are working • Integration is late in dev process • Contract documentation can diverge not always up- to-date
  16. PAIN POINTS • Verification of contracts not automated • Client

    app team is blocked by backend team to verify if things are working • Integration is late in dev process • Contract documentation can diverge not always up- to-date
  17. NEW DEV CYCLE • Product requirements document • Backend Engineers

    write contracts in Clojure + Spec with help from Frontend engineers • Both start work in parallel • Both checkpoint and verify against Spec • Integrate and test flows when both pieces are ready