Next Meetup

BFPG Monthly Meetup
Appetite for dysfunction - Andrew McMiddlin Property based testing is an unreasonably effective technique for finding bugs and providing minimal test cases to reproduce those bugs. It achieves this by randomly generating inputs, providing those inputs to the software under test, and ensuring that the outputs uphold some desirable properties. Property based state machine testing extends this technique to more easily test stateful software, using state machines to model the application while ensuring that the model and application continue to agree. `hedgehog`, as its project page tells us, will eat all your bugs. More specifically, it is a Haskell library that provides excellent support for both of these styles of testing. Although `hedgehog` is a Haskell library, its usefulness is by no means limited to testing Haskell code. In fact, coupled with some other libraries and tools, it can be used to great effect when testing any software. Even something like... WordPress. WordPress, for anyone who hasn't investigated setting up a blog in the last 15 years, is a blogging platform implemented using PHP and MySQL. WordPress is not written in Haskell or anything resembling a functional programming language, its REST API is under specified, and it makes extensive use of JSON objects with fields that may or may not appear depending on the context in which the object is used. At first this might not appear to be a good candidate for testing with a typed, functional language. Appearances can be deceiving. Haskell and its ecosystem are well equipped to tackle this problem, bringing with them all of their usual benefits. You don't have to take my word for it either -- I've written the code. In this talk I will provide a tour of the tools and techniques I've employed to test WordPress. The main players are: `hedgehog` to perform state machine testing, including concurrency tests. `servant` to generate client request functions given a specification of the REST API. `dependent-map` to model the dynamic JSON objects. The final ingredient in this functional, testing cocktail is Nix. I will briefly show how NixOps and Nixpkgs provide a means to specify a test environment in a succinct and declarative manner, and then deploy that specification to a virtual machine for testing. Attendees should leave the talk with a high-level understanding of state machine testing and the tools and techniques that can be employed to test complex APIs not written in Haskell. All source code will be made publicly available under an open source licence after the talk. ----- Laws! - George Wilson Laws, laws, laws. It seems as though whenever we learn about a new abstraction in functional programming, we hear about its associated laws. Laws come up when we learn about type classes like Functors, Monoids, Monads, and more! Usually laws are mentioned and swiftly brushed past as we move on to examples and applications of whatever structure we're learning about. But not today. In this talk, we'll look more closely at laws themselves. Why should our abstractions have laws? We'll answer this question both by seeing powers we gain by having laws, and by seeing tragedies that can befall us without laws.

Data61/CSIRO Fortitude Valley

Level 2, T C Beirne Centre, 315 Brunswick Street, Fortitude Valley 4006 QLD · Brisbane

1 comment

Upcoming Meetups

Past Meetups (143)

What we're about

We're a group of passionate geeks looking to learn more about functional programming and how it can help us in our professional lives. Members range from absolute beginners through to advanced users. Everyone at any level is welcome to attend and/or speak.

Monthly meetups are sponsored and pizza is provided.

Lots of us hang out in the #bfpg IRC channel on Freenode, and are happy to answer questions, throw ideas around and generally banter.

Come along and bring your friends! We look forward to seeing you there.

The BFPG Organisers.

Members (838)

Photos (73)

Find us also at