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

test.check + core.logic: Generating the tests. And the solutions. [pt-BR]

test.check + core.logic: Generating the tests. And the solutions. [pt-BR]

#clojure #core.logic #test.check

Nicolás Berger

June 25, 2015
Tweet

More Decks by Nicolás Berger

Other Decks in Programming

Transcript

  1. Meetup clj-sp Test.check + core.logic Gerando os testes. E as

    soluções Nicolás Berger @nicoberger Buzzlabs
  2. Core.logic • Implementação do miniKanren: “an embedded DSL for logic

    programming” • “kanren”: “relação” em japonês • Programação declarativa → WHAT not HOW “Separate the search algorithm from the logical construction”
  3. test.check • Já geramos as soluções, vamos gerar os testes

    • Property-based testing • Generate → Run → Shrink Do not write the tests. Generate them!
  4. Exemplos de core.logic • Puzzles (sudoku, who owns the zebra?)

    • Árvore genealógica • Knapsack • Malware & threat analysis (threatgrid) • Static code analyzer (kibit) • Type inferencer (lambda calculus)
  5. Links / Referencias • John Hughes - Testing the Hard

    Stuff and Staying Sane https://www.youtube.com/watch?v=zi0rHwfiX1Q • David Nolen https://skillsmatter.com/skillscasts/3553-the-refined-clojurist • Zebra puzzle: https://github.com/swannodette/logic-tutorial#zebras • https://github.com/jonase/kibit • https://github.com/frenchy64/Logic-Starter/wiki • http://minikanren.org/ • http://yellerapp.com/posts/2015-04-13-effective-test-check.html • http://www.philandstuff.com/slides/2014/euroclojure.html • http://blog.guillermowinkler.com/blog/2015/04/12/verifying-state-machine-behavior-us ing-test-dot-check/ • http://stackoverflow.com/questions/28467011/what-are-the-main-technical-difference s-between-prolog-and-minikanren-with-resp