ArticleslgStudy

computer science

Infer Static Analyzer

Infer Static Analyzer is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Infer Static Analyzer rather than just read about it. In short: Infer, sometimes referred to as "Facebook Infer", is a static code analysis tool developed by an engineering team at Facebook along with open-source contributors. It provides support for Java, C, C++, and Objective-C, 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).

Key takeaways

  • Infer Static Analyzer belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Infer Static Analyzer to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Infer Static Analyzer from memory before moving on to harder problems.

Reference excerpt

Infer, sometimes referred to as "Facebook Infer", is a static code analysis tool developed by an engineering team at Facebook along with open-source contributors. It provides support for Java, C, C++, and Objective-C, 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 of software. Work on automatic program verification based on separation logic led to a succession of academic tools, including Smallfoot and SpaceInvader. 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 for computation tree logic.

Infer is mostly written in the OCaml programming language.

Awards Dino Distefano received the Royal Academy of Engineering 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 in 2016, for his work on separation logic and Infer.

References

External links Official website

Worked examples

Example 1 — a first encounter with Infer Static Analyzer

Start with the simplest possible case. Write down what Infer Static Analyzer claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Infer Static Analyzer before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Infer Static Analyzer ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Infer Static Analyzer

In research
Infer Static Analyzer appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Infer Static Analyzer in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Infer Static Analyzer is common in secondary-school and first-year university syllabi. It links to neighbouring topics Facebook software, Quality assurance, Software review, so understanding it makes those chapters shorter.
In everyday life
Look for Infer Static Analyzer outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Infer Static Analyzer” →

How to study Infer Static Analyzer in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Infer Static Analyzer means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Infer Static Analyzer out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Infer Static Analyzer in simple terms?

Infer, sometimes referred to as "Facebook Infer", is a static code analysis tool developed by an engineering team at Facebook along with open-source contributors. It provides support for Java, C, C++, and Objective-C, and is deployed at Facebook in the analysis of its Android and iOS apps (includin…

Why does Infer Static Analyzer matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Infer Static Analyzer?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Infer Static Analyzer.

Tags

  • Facebook software
  • Quality assurance
  • Software review
  • Static program analysis

Keep exploring