Home Learning Paths ECU Lab Assessments Interview Preparation Arena Pricing Log In Sign Up

Parasoft C/C++test Overview

FeatureDescription
Static analysisMISRA C:2012; CWE; SEI CERT; custom rules
Unit test generationAutomatic unit test stub and harness generation
Code coverageIntegrated coverage collection during unit test execution
Requirements traceLinks static findings and test results to requirements
ASPICE reportsBuilt-in ASPICE SWE.4 evidence report generator
IDE integrationEclipse + Visual Studio Code plugin for developer workflow

Parasoft C/C++test CLI

Bashparasoft_analysis.sh
#!/bin/bash
# Parasoft C/C++test static analysis via CLI
set -e

CPPT_HOME="/opt/parasoft/cpptest"
CONFIG="config/parasoft_misra_asil_b.properties"
REPORT_DIR="reports/parasoft"

mkdir -p "${REPORT_DIR}"

"${CPPT_HOME}/cpptestcli" \
    -config "${CONFIG}" \
    -compiler GCC_9_aurix \
    -include include/ -include include/autosar/ \
    -define AURIX_TC387 \
    -input src/SpeedController.c src/FaultManager.c \
    -report "${REPORT_DIR}" \
    -report.format xml,html \
    -report.rules MISRA_C_2012 \
    -staticanalysis.timeout 300

# Parse and gate
python3 check_parasoft.py "${REPORT_DIR}/static_results.xml"

CI Integration with Quality Gate

Pythoncheck_parasoft.py
"""Parse Parasoft C/C++test results; enforce quality gate."""
import sys
import xml.etree.ElementTree as ET

def check_parasoft_results(xml_file: str) -> bool:
    tree = ET.parse(xml_file)
    root = tree.getroot()

    mandatory_violations = 0
    required_violations  = 0
    advisory_violations  = 0

    for finding in root.iter("CodingViolation"):
        sev = finding.get("severity", "advisory")
        if sev == "mandatory":
            mandatory_violations += 1
            rule = finding.get("rule", "")
            file = finding.get("file", "")
            line = finding.get("line", "")
            print(f"  MANDATORY: {rule} at {file}:{line}")
        elif sev == "required":
            required_violations += 1
        else:
            advisory_violations += 1

    print(f"Mandatory: {mandatory_violations}")
    print(f"Required:  {required_violations}")
    print(f"Advisory:  {advisory_violations}")

    # Gate: zero mandatory; required violations need deviation
    return mandatory_violations == 0

result = check_parasoft_results(sys.argv[1])
sys.exit(0 if result else 1)

Summary

Parasoft C/C++test occupies a unique position among automotive static analysis tools because it integrates static analysis with unit test generation -- the two primary ASPICE SWE.4 activities. The automatic test stub generation is particularly valuable for projects adopting SiL testing: Parasoft can generate the initial test harness and stub files from the function signatures, which the engineer then extends with meaningful test cases. This reduces the "blank page" friction of starting SiL testing from scratch. The integrated coverage collection means that static analysis violations, unit test results, and code coverage are all in the same tool and evidence report, simplifying ASPICE evidence assembly.

🔬 Deep Dive — Core Concepts Expanded

This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.

Key principles to reinforce:

  • Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
  • Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
  • Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.

🏭 How This Topic Appears in Production Projects

  • Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
  • Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
  • Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.

⚠️ Common Mistakes and How to Avoid Them

  1. Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
  2. Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
  3. Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
  4. Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.

📊 Industry Note

Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.

← PreviousPerforce QA-C / Helix QACNext →Hands-On: Multi-Tool Analysis Comparison