Property-Based Testing in a Screencast Editor
Minimum price
Suggested price

Property-Based Testing in a Screencast Editor

Case Studies from Komposition

About the Book

This is a short book on using property-based testing (PBT) within Komposition, a screencast editor.

First, this book introduces the system under test (SUT), Komposition. Next, it goes into PBT and highlights some challenges in testing properties of an application like Komposition. Finally, the main part of the book is compromised of case studies. Each case study covers increasingly complex components and how they are tested. It includes this author's personal reflections, what bugs the tests have found, and what still remains to be improved.

This is not a tutorial on PBT, but rather a collection of motivating examples. That said, you should be able to follow along without prior knowledge of PBT.

For example, it explains how using PBT helped find and fix bugs in the specification and implementation of Komposition's video classifier. Those were bugs that would be very hard to find using example-based tests or using a static type system.

This book is based on articles published on While the content is mostly the same, there are few changes bringing it up-to-date. Also, if you've already enjoyed the articles, you might want support my work by purchasing this book. Finally, you might enjoy a nicely typeset PDF, or an EPUB book, over a web page.

To post a review, go to

About the Author

Oskar Wickström
Oskar Wickström

After some years of musical education, Oskar Wickström began his journey into the world of software. He’s now working remotely from the Swedish countryside, mostly focusing on functional programming, software architecture, and testing. He writes technical articles at, maintains various open source projects, and produces screencasts at In his spare time, he enjoys long bike rides and working on his acoustic guitar compositions.

Table of Contents

1 Introduction

   1.1 Komposition

   1.2 Property-Based Testing

   1.3 Properties of the Ugly Parts

2 Case Study: Timeline Flattening

   2.1 The Hierarchical Timeline

   2.2 Timeline Flattening

   2.3 Timeline Flattening Property Tests

   2.4 Still Frames Used

   2.5 Properties: Flattening Equivalences

   2.6 Missing Properties

   2.7 A Missing Feature

   2.8 Summary

3 Case Study: Video Scene Classifcation

   3.1 Classifying Scenes in Imported Video

   3.2 Manually Testing the Classifier

   3.3 Video Classification Properties

   3.4 Testing Still Segment Minimum Length

   3.5 Sidetrack: Why generate the output?

   3.6 Testing Moving Segment Time Spans

   3.7 Summary

4 Case Study: Integration Testing

   4.1 A History of Two Stacks

   4.2 Refactoring with Property-Based Integration Tests

   4.3 Undo/Redo Tests

5 Summary

   5.1 Property-Driven Development

   5.2 PBT in Komposition

Authors have earned$9,882,857writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub