Skip to content

Spec project: Bank Accountλ︎

A relatively simple bank account application with data and function specifications, including generative testing data and function instrumentation.

Hint::Under active developmentλ︎

Developed as part of the Practicalli study guide live broadcasts

Create deps.edn projectλ︎

Use Clojure CLI and clj-new

clojure -M:new app practicalli/banking-on-clojure

Hint::practicalli/banking-on-clojure repositoryλ︎

practicalli/banking-on-clojure repository contains the latest code to date for this project.

Outline design of projectλ︎

Data Specifications are created for

  • Customer Details ✔
  • Account holder ✔
  • Bank account
  • Multiple Bank accounts
  • Credit Card
  • Mortgage

Functions and specifications are created for

  • register-account-holder ✔
  • open-credit-account
  • open-savings-account
  • open-credit-card-account
  • open-mortgage-account
  • Make a payment
  • Send account notification
  • Check for overdraft

Development Workflowλ︎

  • Write a failing test ✔
  • write mock data ✔
  • write an function definition that returns the argument ✔
  • run tests - tests should fail ✔
  • write a spec for the functions argument - customer ✔
  • write a spec for the return value ✔
  • write a spec for relationship between args and return value
  • replace the mock data with generated values from specification ✔
  • update functions and make tests pass ✔
  • instrument functions
  • run specification checks

Images to add

Running tests that fail on a spec in CIDER spacemacs-cider-test-spec-fail-banking-on-clojure-project.png

Running tests that fail on a spec on CircleCI circle-ci-banking-on-clojure-spec-test-runner-fail-register-account-holder-did-not-conform-to-spec.png