check.statem: Generating Test Programs

One of the most interesting parts of generative testing (aka QuickCheck). Is state machine testing. The original purpose I built Fox was to explore state machine testing. In particular, the talk from John Hughes video was inspirational to exploring this further: In short, John makes a case: dynamically generating state machines to detect errors that is more effective and economical than traditional example based tests. There’s lots of work managing example based tests that can be better solved with generative testing. ...

January 5, 2020 · 6 min

Generative Testing

It’s no secret that I’ve been interested in testing. Most of the work I’ve done are around example-based testing. While useful, it’s interesting to look at other communities for inspiration. I’m specifically fascinated in the functional programming community. Generative testing in particular. It was popularized in the early 2000s by a famous implementation in Haskell, QuickCheck. In short, generative testing is allows you specify properties your software should have. Then the testing library generates test cases. It’s an alternative path the functional community has taken when it comes to testing. This becomes evident since testing functional code becomes mostly boilerplate management: ...

January 31, 2015 · 3 min

Parsing JSON in Objective-C - Part 2

Note: This previously was on Pivotal Labs blog. In the previous article, we used TDD to parse JSON into our Person model and refactored the code under test. In part 2, we’re going to refactor the code further to be more reusable and extendable. All the code in this article will also be in the same repository. Redesign The refactorings in the previous article were fairly straightforward and mechanical. Ultimately, we’ll need to break apart different concerns of this code. One approach would be to start with some questions: ...

November 8, 2014 · 9 min

Parsing JSON in Objective-C - Part 1

This post was original written on the Pivotal Labs Blog. JSON parsing is a frequent task for clients interfacing with any recent web API. Those web services frequently vary in quality: Is the API following a RESTful design pattern? Is it providing an object graph or just a single/collection of objects in the JSON response? What are the data types of the fields being returned? Can they be relied upon? How much work are clients duplicating to work around the server (e.g. - Performance, Business Logic, etc.)? If you have full control of the resulting API endpoints, then it is easy to build or fix the API to your client’s specific needs. Controlling the incidental complexity can be challenging for APIs you do not control, or which have to support a variety of clients. ...

October 24, 2014 · 9 min