Static analysis
Static analysis is the examination of source code or other software artifacts without executing the program to infer properties or identify potential issues.
100 Java Mistakes and How to Avoid Them
A static analysis tool is software that examines code without executing it to detect defects, policy violations, or other properties.
- How it is used
- Flags recurring suspicious Java code patterns as automated review feedback during editing, builds, and CI.
- How deep it goes
- Explains tool integration, online versus offline scope, configuration, and suppression, while cautioning that pattern checks miss defects.
- Examples
- Uses a 32-bit int shift warning, misleading shift-parenthesis quick fix, unused debug collection, and assert-side-effect detection.
- What you can do after
- Apply it via IDE plugins or build integration, then configure and narrowly suppress findings with judgment.
Read how 100 Java Mistakes and How to Avoid Them explains static analysis →
Authorization in Action
Static analysis is the examination of programs or policies without executing them to identify properties, errors, or behavioral consequences.
- How it is used
- Provides a predeployment safety net for authorization policy changes and policy-as-code workflows.
- How deep it goes
- Explains structural checks and symbolic verification, and describes pipeline integration without a step-by-step tool walkthrough.
- Examples
- Uses overlapping permit and deny rules, uncovered actions, refactoring equivalence, and a pull-request pipeline to illustrate analysis.
- What you can do after
- Apply it via Cedar Analysis to check policy sets for conflicts, redundancies, and gaps before deployment.
Effective Platform Engineering
Static analysis is the automated examination of source code or related artifacts without executing the analyzed software.
- How it is used
- Provides early quality and security feedback on infrastructure-as-code changes locally and in CI before deployment.
- How deep it goes
- Details Terraform validation, formatting, linting, and security scans, but leaves deployed-state verification to later pipeline tests.
- Examples
- Uses a Terraform VPC and ingress rule, Tflint AWS plugin configuration, and a Trivy scan.
- What you can do after
- Apply it via Terraform CLI, Tflint, and Trivy to correct validation errors, lint warnings, and security findings before deployment.
Read how Effective Platform Engineering explains static analysis →
Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform
Static analysis is the examination of source code or configuration without executing or deploying it to detect errors, inconsistencies, or violations of specified standards.
- How it is used
- Uses pre-deployment checks to validate infrastructure configuration before changes reach live resources.
- How deep it goes
- Explains parsing, isolated unit tests, dry-run handling, contracts, correction, and rollback, but defers post-deployment verification to dynamic testing.
- Examples
- Demonstrates network names, subnet ranges, Terraform plans, pytest fixtures, and module facades connecting network outputs to server inputs.
- What you can do after
- Diagnose configuration errors, enforce standards, verify module contracts, and decide whether infrastructure changes are safe to apply.
Shipping Go: Develop, deliver, discuss, design, and go again
Static code analysis is the automated examination of source code without executing it to identify defects, suspicious constructs, style violations, or security risks.
- How it is used
- Catches known bug, security, and practice-related patterns early in a code-quality pipeline so reviewers can focus on less mechanical work.
- How deep it goes
- Works through Go vet and configurable linter checks, including CI placement and local commands, without detailing the analyzers’ internals.
- Examples
- Uses a `fmt.Sprintf` argument mismatch, `go vet ./...`, and YAML configurations for `gosec` and comment-checking linters.
- What you can do after
- Operate/configure it with Go vet and golangci-lint locally and in CI to flag known issues before tests and deployment.
Read how Shipping Go: Develop, deliver, discuss, design, and go again explains static analysis →
Vibe Engineering
The automated examination of source code without executing it to identify defects, suspicious constructs, policy violations, or program properties.
- How it is used
- Provides an always-on check for suspicious code patterns and supports statically inferable refactoring.
- How deep it goes
- Explains linter warnings and false positives through a regex example, while distinguishing static checks from behavioral verification.
- Examples
- Uses a vulnerable bold-text regex and a package rename that fails to compile after an AI-assisted change.
- What you can do after
- Apply it via ESLint and eslint-plugin-security to flag potentially unsafe regular expressions, then assess the warnings.
Event Processing in Action
Static analysis is the examination of a program or expression without executing it to identify properties or errors.
- How it is used
- Validates event processing network designs and checks whether proposed changes might introduce problems.
- How deep it goes
- Explains missing-attribute and cycle checks, including infeasible cycles, while using dynamic analysis to complete validation.
- Examples
- Uses a missing mandatory output attribute and cycles between event processing agents to illustrate checks.
- What you can do after
- Evaluate potential design problems by interpreting static observations and distinguishing detected cycles from actual nontermination.
Read how Event Processing in Action explains static analysis →
Data Pipelines with Apache Airflow, Second Edition
Static code analysis is the examination of source code without executing it to detect defects, style violations, or other issues.
- How it is used
- Uses automated code checks to improve Python DAG readability, detect defects, and gate merges in CI/CD.
- How deep it goes
- Explains checker roles, commands, diagnostics, configuration, and CI integration, but stops short of checker internals.
- Examples
- Uses Flake8 commands, an unused-import diagnostic, and a GitHub Actions workflow combining checks with DAG tests.
- What you can do after
- Apply it via Flake8 or Pylint locally and automate checks with GitHub Actions before merging Python DAG changes.
Read how Data Pipelines with Apache Airflow, Second Edition explains static analysis →
Memory Safe C++
Static analysis examines software without executing it to identify properties, defects, or rule violations.
- How it is used
- Supports a systematic C++ memory-safety process by checking code before execution.
- How deep it goes
- Distinguishes deterministic rule checks from approximate value reasoning and explains how rulesets and release policies affect findings.
- Examples
- Uses an unchecked sensor-label copy into a 32-byte array to illustrate possible overflow and missing termination.
- What you can do after
- Evaluate potential analyzer findings and decide whether they should block a release under project policy.
Embedded Software with Rust
Static analysis is the examination of program properties from source or compiled artifacts without executing the program.
- How it is used
- Estimates worst-case stack usage as an initial compile-time defense against silent stack overflow in bare-metal firmware.
- How deep it goes
- Details a tool workflow and its limits, but treats estimates as lower bounds rather than guarantees.
- Examples
- Uses cargo-call-stack, release LTO, a memory.x comparison, and a Graphviz-rendered call graph.
- What you can do after
- Apply cargo-call-stack to estimate stack usage and compare its deepest path with the allocated stack region.
Read how Embedded Software with Rust explains static analysis →
100 C++ Mistakes and How to Avoid Them
A static code analyzer is a tool that examines source or compiled code without executing it to detect potential defects, vulnerabilities, violations, or suspicious patterns.
- How it is used
- Uses compiler warnings and optional static-analysis tools to uncover potential errors before they become costly defects.
- How deep it goes
- Recommends warning management and incremental cleanup but does not detail analyzer internals.
- Examples
- Shows an uninitialized pointer, compiler warnings for several code problems, and a cleaned-up C++ program.
- What you can do after
- Diagnose potential defects by enabling manageable compiler warnings, cleaning them progressively, and optionally running Cppcheck.
Read how 100 C++ Mistakes and How to Avoid Them explains static analysis →
Also covered in
- Build High Value Software SystemsIn early access (MEAP)
- Systems Programming with ZigIn early access (MEAP)
- "Looks Good to Me"
- Grokking Web Application Security
- Think Like a Software Engineering Manager
- Secure APIs
- AI GovernanceIn early access (MEAP)
- Azure Security
- Secrets of the JavaScript Ninja, Third EditionIn early access (MEAP)
- AI-Powered Developer: Build software with ChatGPT and Copilot
What to know first
- code reviewCode review is the systematic examination of source code or proposed changes to assess correctness, quality, risks, or conformance to requirements or standards.
- deployment pipelineA deployment pipeline is a repeatable sequence of stages that builds, tests or validates, packages, and delivers software changes toward release or deployment.
- software testingSoftware testing is the systematic evaluation of software under specified inputs or conditions to assess its behavior against expected results or requirements and identify defects.
- code coverageCode coverage is a measure of which portions or behaviors of a program are exercised during testing.
Related concepts
- dynamic analysiscontrasts with · Dynamic analysis is the examination of a program or system by executing it and observing its behavior during operation.
- autocompleteused by · Autocomplete is an interactive feature that suggests or completes likely continuations of partial input as a user types.
- validationpart of · Validation is the process of checking data, behavior, or results against defined criteria to determine their correctness, acceptability, or suitability for a purpose.
- code reviewcontrasts with · Code review is the systematic examination of source code or proposed changes to assess correctness, quality, risks, or conformance to requirements or standards.
- deployment pipelinepart of · A deployment pipeline is a repeatable sequence of stages that builds, tests or validates, packages, and delivers software changes toward release or deployment.
Questions about static analysis
What is static analysis?
Static analysis is the examination of source code or other software artifacts without executing the program to infer properties or identify potential issues.
Which Manning books explain static analysis?
100 Java Mistakes and How to Avoid Them, Authorization in Action, Effective Platform Engineering, Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform, Shipping Go: Develop, deliver, discuss, design, and go again, Vibe Engineering, Event Processing in Action, Data Pipelines with Apache Airflow, Second Edition and 3 more.
What should I know before learning static analysis?
Manning books that teach static analysis usually introduce code review, deployment pipeline, software testing and code coverage first.
What is the difference between static analysis and dynamic analysis?
Static analysis is the examination of source code or other software artifacts without executing the program to infer properties or identify potential issues. Dynamic analysis is the examination of a program or system by executing it and observing its behavior during operation.
What kinds of static analysis are there?
Kinds of static analysis include JSLint.
What is static analysis part of?
Static analysis is part of validation. Validation is the process of checking data, behavior, or results against defined criteria to determine their correctness, acceptability, or suitability for a purpose.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.










