Polyspace R2021a [work] -

Polyspace R2021a: Advancing Static Code Analysis for Safety-Critical Systems

Polyspace R2021a, developed by MathWorks, introduces significant enhancements to its static analysis suite to improve the safety, security, and reliability of embedded software. This release focuses on faster analysis times, expanded coding standard support, and better integration for complex C++ and AUTOSAR projects. Key Feature Enhancements in R2021a 1. New Guidelines Checkers for Code Complexity

R2021a introduces a new category of Guidelines checkers specifically designed to manage and reduce software complexity.

Quantifiable Metrics: These checkers monitor metrics such as cyclomatic complexity and the number of execution paths.

Early Detection: By identifying complex modules early, developers can refactor code before it becomes a maintenance or safety liability.

Standard Compliance: The suite supports HIS (Hersteller Initiative Software) recommended thresholds for these complexity checkers. 2. Improved AUTOSAR Support

For automotive developers, this release significantly optimizes workflows involving the AUTOSAR standard.

Faster RTE Analysis: Polyspace Code Prover now runs faster and provides more precise results for C/C++ code utilizing the AUTOSAR RTE API. polyspace r2021a

Smart Stubs: The analysis uses "smart stubs" for AUTOSAR library functions, reducing the need for manual setup while maintaining high precision. 3. Mixed C and C++ Analysis

Polyspace Code Prover now natively supports projects containing a mix of C and C++ source files.

Seamless Compilation: The tool automatically compiles C files as C and C++ files as C++, then verifies the entire project as a unified C++ entity.

Reduced Overhead: Developers no longer need to separate these files to achieve successful compilation and verification. Product Suite Comparison What's New in Polyspace R2021a? - MATLAB & Simulink

Polyspace R2021a represents a significant milestone in the evolution of static code analysis, specifically within the MathWorks ecosystem. As a tool designed for the formal verification of C, C++, and Ada source code, R2021a introduced critical enhancements that bridged the gap between rigorous mathematical proof and the practical needs of modern DevOps workflows. The Core Value Proposition

At its heart, Polyspace R2021a utilizes "abstract interpretation," a formal method that allows the tool to prove the absence of specific run-time errors (like overflow, divide-by-zero, or out-of-bounds access) without actually executing the code. Unlike traditional "bug hunters" that rely on heuristics to find likely errors, Polyspace provides a level of certainty—categorizing code into green (safe), red (error), gray (unreachable), and orange (unproven) zones. This exhaustive analysis is vital for safety-critical industries such as automotive (ISO 26262), aerospace (DO-178C), and medical devices. Key Innovations in R2021a

The R2021a release focused heavily on accessibility and integration. Key features included: Upload results to Polyspace Access server

Polyspace Access: This release strengthened the web-based interface, allowing developers and project managers to review results without needing a local installation. This shifted the tool from a specialist’s workstation to a collaborative team environment.

Jira Integration: R2021a streamlined the remediation process by allowing users to export identified defects directly into Jira. This integrated security and quality checks into the standard project management lifecycle.

Expanded Coding Standards: The update provided enhanced support for MISRA C:2012 and AUTOSAR C++14, ensuring that code not only ran without errors but also adhered to industry-standard stylistic and safety guidelines.

Performance Improvements: This version introduced faster analysis engines and better support for incremental analysis, addressing the common criticism that formal verification is too slow for rapid development cycles. Impact on the Development Lifecycle

Polyspace R2021a moved formal verification "to the left" of the development cycle. By integrating with build systems and providing clear dashboards, it allowed teams to identify "unprovable" code segments long before they reached the integration or testing phases. This reduces the cost of fixing bugs, which increases exponentially as code moves toward production. Conclusion

Polyspace R2021a is more than just a bug finder; it is a quality assurance powerhouse. By combining the "exhaustiveness" of formal methods with the "connectedness" of modern software tools, it provides a comprehensive solution for developers who cannot afford to be wrong. It remains a definitive example of how complex mathematical analysis can be packaged into a usable, collaborative, and essential part of the software engineering toolkit.


3. Recommended Workflow for Safety-Critical Projects

Phase 3: Dashboard & Review (Polyspace Access)


Step 4: Review and Justify in Polyspace Access

The verification manager uses Polyspace Access to: Bug Finder improved its interprocedural analysis

Integration Examples


Polyspace Bug Finder (Static Analysis)

Bug Finder is a fast, scalable static analysis engine designed for developers during the coding phase. It identifies:

In R2021a, Bug Finder improved its interprocedural analysis, enabling detection of defects across function boundaries without incurring the performance penalty of full formal verification.

Real-World Case Study: Aerospace Flight Controller

A Tier-1 aerospace supplier (anonymous due to ITAR) migrated from LDRA to Polyspace R2021a for a fly-by-wire controller.

Codebase: 1.2M LOC of C99, targeting DO-178C Level A.

Challenge: Previous static analysis produced 4,000+ warnings, requiring 6 person-months of manual triage per release.

Polyspace R2021a Results:

Outcome: First-pass certification success. The verification team shrank from 12 to 7 engineers.


Integration with Simulink and Embedded Coder

Polyspace is not just for hand-written C/C++. In R2021a, the integration with Simulink and Embedded Coder matured significantly.