LinkedIn, the social networking platform for professionals, has now open sourced Flashback, a proxy server application that helps in recording, storing and replaying internet transactions for developer testing.
Flashback tool is used for mocking internet traffic for developer testing, when web applications are being developed which needed interaction with third-party websites.
The application has been open sourced under the BSD two-clause license, a family of permissive free software licenses.
LinkedIn stated that Flashback tool was developed by Shangshang Feng, Yabin Kang, and Dan Vinegrad to test reliability, scalability and speed on new code before wide application. It is based on Betamax, a tool developed to mock actions (record and replay) of web services and REST APIs used by developers.
According to LinkedIn, it develops web applications which need to interact with third party websites, hence it uses automatic testing that ensures quality of testing.
Sometimes it can be hard to test third party websites, as they could change without notice, suffer from downtime and become temporarily unavailable or sometimes the failure could be due to an internal change at LinkedIn, an external change made at the website or an issue with network infrastructure.
In order to deal with such issues, the company initially relied on Betamax. It works by intercepting HTTP connections initiated by a web application and are replayed later on. It can be used to replace any interaction over HTTP with previously recorded responses which can be served reliably.
But, Betamax has its own limitations. Firstly, LinkedIn’s test environment did not have internet access and Betamax relies on internet connectivity to function properly.
Secondly, the company also uses several use cases which require authentication protocols such as OAuth and OpenId and complex interactions over HTTP.
To overcome these issues, LinkedIn developed Flashback to mock HTTP and HTTPS resources. It records these HTTP/HTTPS requests and will playback previously recorded HTTP transaction. LinkedIn calls this a ‘scene’, where no internet connection is needed to complete the testing.
The tool can also replay scenes based on partial matching of requests, which is done using ‘match rules’. A match rule relates an incoming request with a previously recorded request and uses to generate a response.
LinkedIn previously open sourced FeatureFu, a toolkit for building machine learning models in 2015. One of the main reasons cited by the company was that FeatureFu could no longer be treated as a ‘business differentiator’ by the company.