Code Monkey home page Code Monkey logo

elixir-streamdata-examples's Introduction

Property-Based Testing In Elixir

This demo is based around StreamData v0.5.0, an Elixir library for property-based testing and test data generation. Elixir version 1.13.0 is used for all examples.

It's structured in 3 parts. Each provides it's own README for more information.

  • 01_hello_world shows very basic usage and setup.
  • 02_parallel_merge_sort provides the main examples in the slides of the presentation and compares approaches.
  • 03_json_parser implements a JSON-Parser as show case. It uses more advanced data generation for testing. First serializable data is generated, then it is feed in a tokenizer that produces JSON, then whitespace between tokens is added. The generated JSON-string is feed into the parser. It is checked if the parser matches the initial serializable data.

For creation of this project these resources were mainly used:

  1. StreamData v0.5.0 Documentation. Retrieved January 23, 2022, from https://hexdocs.pm/stream_data/StreamData.html
  2. Hébert Fred. (2019). Property-based testing with proper, Erlang, and elixir: Find bugs before your users do. The Pragmatic Bookshelf. https://propertesting.com/
  3. Leopardi, A. (2017, October 31). Streamdata: Property-based testing and data generation (Blog Post). Retrieved January 23, 2022, from https://elixir-lang.org/blog/2017/10/31/stream-data-property-based-testing-and-data-generation-for-elixir/
  4. Claessen, K., & Hughes, J. (2000). QuickCheck. Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming - ICFP '00. https://doi.org/10.1145/351240.351266
  5. Arts, T., Hughes, J., & Johansson, J. (2006). Testing telecoms software with quviq QuickCheck. Proceedings of the 2006 ACM SIGPLAN Workshop on Erlang - ERLANG '06. https://doi.org/10.1145/1159789.1159792

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.