Glossary termSoftware analysis technique

Static Analysis

Also known as: Static program analysis, Static code analysis, SAST

Examination of source code or binaries without executing them, using automated tools to find bugs, security flaws and quality issues.

Static analysis inspects a program's code, or its compiled form, to reason about what it might do without running it. Tools range from simple pattern-based linters to sophisticated analyzers that track how data flows through a whole program, model the possible values of variables or check code against a formal specification. They can find null pointer dereferences, resource leaks, unreachable code, type errors and security flaws such as unsanitized input flowing into a database query. Compilers perform a form of static analysis too, every time they check types or issue warnings.

A fundamental limit shapes the field. Rice's theorem, published by Henry Gordon Rice in 1953, shows that no algorithm can decide every nontrivial question about what arbitrary programs do. Analyzers therefore approximate: sound tools guarantee to report every instance of a bug class at the cost of false alarms, while practical bug finders accept missing some problems in exchange for fewer false positives. Techniques include data flow analysis, abstract interpretation, symbolic execution and model checking. Static analysis complements dynamic analysis, such as testing and fuzzing, which observes programs as they run.

In security, static application security testing (SAST) tools scan code for vulnerability patterns such as SQL injection and Cross-Site scripting, and they are a standard part of DevSecOps pipelines. Safety-critical industries such as aerospace and automotive use static analysis to check code against strict coding standards. The main practical challenge is trust: if a tool produces too many false positives, developers learn to ignore it, so successful deployments tune rules carefully and surface findings during code review, when they are cheapest to fix.

Key points

  • Static analysis examines code without running it to find bugs, vulnerabilities and quality problems.
  • Rice's theorem shows no analyzer can answer every nontrivial question about program behavior, so tools approximate.
  • Security-focused static analysis, known as SAST, is a standard component of secure development pipelines.
  • Too many false positives cause developers to ignore findings, so tuning and good integration are essential.

Related entries

Glossary term

Linting

Programming

Automated checking of source code for likely errors, suspicious constructs and style violations using a tool called a linter.

Glossary term

Code Review

Programming

Practice in which developers examine each other's source code changes to find defects, share knowledge and keep the codebase consistent.

Glossary term

Type System

Programming

Set of rules a programming language uses to assign types such as integer or string to values and to check that operations use them consistently.

Glossary term

DevSecOps

DevOpsCybersecurity

Extension of DevOps that integrates security practices and automated security testing throughout the software development and delivery life cycle.

Glossary term

SQL Injection

CybersecurityProgramming

Web application vulnerability in which untrusted input is interpreted as part of a database query, letting attackers read, change or delete data.

Glossary term

Cross-Site Scripting

CybersecurityProgramming

Web vulnerability that lets attackers inject malicious scripts into pages viewed by other users, which then run with the trust of the affected site.

Glossary term

Vulnerability

Cybersecurity

A weakness in software, hardware, configuration or process that an attacker could exploit to compromise confidentiality, integrity or availability.

Glossary term

Compiler

Programming

Program that translates source code written in one programming language, usually a high-level one, into another form such as machine code.

Referenced by

Other entries that discuss or point to Static Analysis.