Infer,
sometimes referred to as "Facebook Infer", is a
static code analysis
In computer science, static program analysis (or static analysis) is the analysis of computer programs performed without executing them, in contrast with dynamic program analysis, which is performed on programs during their execution.
The term ...
tool developed by an engineering team at Facebook along with open-source contributors. It provides support for
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
,
C,
C++, and
Objective-C
Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its N ...
, and
is deployed at Facebook in the analysis of its Android and iOS apps (including those for WhatsApp, Instagram, Messenger and the main Facebook app).
History
Infer has its roots in academic research on
Separation Logic, a theory for the
formal verification
In the context of hardware and software systems, formal verification is the act of proving or disproving the correctness of intended algorithms underlying a system with respect to a certain formal specification or property, using formal met ...
of software. Work on automatic program verification based on Separation Logic led to a succession of academic tools, includin
Smallfootan
Building on the academic work, Cristiano Calcagno, Dino Distefano and Peter O'Hearn, three researchers at University College London and Queen Mary University of London, co-founded the verification startup Monoidics in 2009, and Monoidics developed the first version of Infer.
Monoidics was acquired by Facebook in 2013,
and in 2015 the code of Infer was open-sourced.
As of 2013 when Infer was open-sourced it was claimed that hundreds of bugs per month identified by Infer were fixed by Facebook's developers before reaching production.
By 2015 this had increased to over 1000 bugs per month.
Spotify, Uber, Mozilla, Sky, and Marks and Spencer are among the reported users of Infer.
Technology
Infer performs checks for null pointer exceptions, resource leaks, annotation reachability, missing lock guards, and concurrency race conditions in Android and Java code. It checks for null pointer problems, memory leaks, coding conventions and unavailable API's in C, C++ and Objective C.
Infer uses a technique called bi-abduction to perform a ''
compositional program analysis'' that interprets program procedures independently of their callers. It is claimed that this enables Infer to scale to large codebases and to run quickly on code-changes in an incremental fashion, while still performing an inter-procedural analysis that reasons across procedure boundaries.
Infer is wired up to the code review system at Facebook. Its deployment model is to comment automatically on code modifications as they are submitted for review, where it reports potential regressions. It does this by incrementally analyzing code changes via a job on Facebook's
continuous integration system which runs in its data centers.
Infer also has a domain specific language for abstract syntax tree linting, based on ideas from
Model Checking
In computer science, model checking or property checking is a method for checking whether a finite-state model of a system meets a given specification (also known as correctness). This is typically associated with hardware or software system ...
for
Computation Tree Logic.
Infer is mostly written in the
OCaml
OCaml ( , formerly Objective Caml) is a general-purpose, multi-paradigm programming language which extends the Caml dialect of ML with object-oriented features. OCaml was created in 1996 by Xavier Leroy, Jérôme Vouillon, Damien Doligez, D ...
programming language.
Awards
received the
Royal Academy of Engineering
The Royal Academy of Engineering (RAEng) is the United Kingdom's national academy of engineering.
The Academy was founded in June 1976 as the Fellowship of Engineering with support from Prince Philip, Duke of Edinburgh, who became the first senior ...
silver medal in 2014 in recognition of the acquisition of Monoidics.
Four Infer team members, Josh Berdine, Cristiano Calcagno, Dino Distafano and Peter O'Hearn, received the 2016 Computer Aided Verification Award, an award they shared with
John C. Reynolds, Samin Ishtiaq and Hongseok Yang.
Peter O'Hearn was elected
Fellow of the Royal Academy of Engineering
Fellowship of the Royal Academy of Engineering (FREng) is an award and fellowship for engineers who are recognised by the Royal Academy of Engineering as being the best and brightest engineers, inventors and technologists in the UK and from aro ...
in 2016, for his work on Separation Logic and Infer.
References
External links
*
{{Facebook navbox
Facebook software
Static program analysis
Software review
Quality assurance