13.10.2023
12:05 - 12:50

Track
Processes & Workflows

Salon 9

Nikhil Barthwal
Facebook

Testing Complex Systems using properties based techniques

This talk is about Property testing, a testing technique where an assertion is made on invariant properties of output. Classical testing strategy involves testing if specific expected output is generated for specific input. Typically, developers implement test cases where this input is supplied and assertions are made on generated output. However, for complex systems the number of input/output pairs becomes too large to be practically implemented as separate test cases.

Property based testing can be used both in unit testing as well as on integration texting level. For distributed systems which are implemented as microservices architecture, each service exposes a contract for other services to consume. It is possible to define constraints on these contracts, which enables using property based testing for generating end-to-end tests for these services.

This is a major shortcoming, which is addressed by property based testing. In property based testing, the invariant properties on output are specified. The system then can generate millions of inputs, which would be impractically impossible to manually implement, and test those assertions on generated outputs.

There are a large number of open source libraries like QuickCheck, FsCheck etc. which lets you incorporate property-based testing for your projects. This talk covers both existing libraries as well as custom implementations from first principles. It should be emphasized that property based testing does not replace existing testing techniques but supplements it.

The objective of this talk is to explain why property based testing is important and enable developers to incorporate it in their projects.

Nikhil Barthwal, Facebook

Nikhil Barthwal is passionate about building distributed systems. He has several years of work experience in both big companies & smaller startups and also acts as a mentor to several startups. Outside of work, he speaks at international conferences on several topics related to Distributed systems & Programming Languages. You can know more about him via his homepage www.nikhilbarthwal.com.