Static analysis
What is Infer? An introduction to Meta's static analysis tool
Infer is a static analysis tool that takes Java or C/C++/Objective-C code and produces a list of potential bugs. It is a static program analyzer written in OCaml, and it supports Java, C, C++, Objective-C and Erlang. Its purpose is to catch critical bugs before they reach users.
- Tool
- Infer
- Made by
- Meta
- Official site
- fbinfer.com
- Category
- Static analysis
Who makes Infer
Infer is made by Meta. The official website, fbinfer.com, is linked below this article and is the place to find the project's own documentation and community resources.
Official website: fbinfer.com
What Infer is for
Infer is meant to catch critical bugs before they reach users. The problems it targets are the kind that lead to crashes or poor performance once software has shipped.
It works by analyzing source code rather than running the program. You give it Java or C/C++/Objective-C code, and it produces a list of potential bugs for you to review.
Who Infer is for
The vendor describes the audience as anyone who wants to find bugs in Java, C, C++ or Objective-C code before release. That covers teams building Android apps in Java, as well as teams working in C, C++ or iOS/Objective-C.
Because Infer runs in Meta's Continuous Integration pipeline, it is also relevant to teams that want to check each code change automatically instead of reviewing code only at release time.
Notable capabilities
Infer applies different checks depending on the language and platform of the code it analyzes. It can also reason beyond a single function, which lets it surface problems that are hard to spot by reading one piece of code in isolation.
- Android and Java checks: finds null pointer exceptions, resource leaks, annotation reachability problems, missing lock guards and concurrency race conditions.
- C, C++ and iOS/Objective-C checks: finds null pointer dereferences, memory leaks, coding convention issues and uses of unavailable APIs.
- Deep issue detection: finds issues such as null pointer dereferences and data races, including ones that require reasoning across multiple functions or files.
- Continuous Integration use: runs in Meta's Continuous Integration pipeline to verify select properties of every code modification.
- Multi-language support: works as a static program analyzer for Java, C, C++, Objective-C and Erlang.
- Pre-release bug finding: produces a list of potential bugs so they can be addressed before users encounter crashes or poor performance.
How Infer fits static analysis
Within static analysis, Infer is a bug-finding analyzer. Its checks center on defects such as null dereferences, leaks and concurrency problems, rather than on formatting or style alone. The C, C++ and Objective-C checks do include coding conventions, so it overlaps with linting in places.
For readers of Linthelm, who follow linters, static analysis and code quality tools, Infer is an example of the deeper end of that range. Its ability to reason across functions and files means it can report issues that a check confined to a single file would not see.
Infer is still evolving and is developed in the open. Users are invited to contribute, join the community and give feedback, so the project's direction is shaped partly by the people who use it.
Frequently asked questions
What is Infer used for?
Infer is used to find potential bugs in Java, C, C++ and Objective-C code before release. It aims to catch critical bugs before they reach users, helping prevent crashes or poor performance.
Who develops Infer?
Infer is made by Meta. It is developed in the open, and users are invited to contribute, join the community and give feedback.
What languages does Infer support?
Infer is a static program analyzer for Java, C, C++, Objective-C and Erlang. It is written in OCaml.
What kinds of bugs does Infer find in Java code?
For Android and Java code, Infer checks for null pointer exceptions, resource leaks, annotation reachability, missing lock guards and concurrency race conditions.
Can Infer find issues that span multiple files?
Yes. Infer can find deep issues such as null pointer dereferences and data races, including ones that require reasoning across multiple functions or files.
Linthelm is independent and is not affiliated with Meta. Product names belong to their owners. Features change; confirm details on the official website.