AI-Assisted Automotive Software Engineering: Practical Applications

    This article explores how AI-assisted development can be applied to automotive software engineering under strict industry constraints. It explains a three-layer structure of rules, skills, and roles that turns standards such as functional safety, MISRA, and ASPICE into machine-readable engineering context. Three practical workflows are covered: automated compliance checks, a closed loop from scanning to fixes, and support for architecture and interface development. The article also outlines limitations, risk controls, and recommendations for adoption.

    1. The Problem: High “Specification Density” in Automotive Software

    The biggest difference between automotive software and typical internet software is that it is an engineering deliverable produced under strict constraints. A door lock/unlock module may look simple, but behind it sit functional safety goals and ASIL decomposition, cybersecurity identity authentication and access control, diagnostic service fault read/write, and the traceability evidence chain required by ASPICE. Specifications are not an appendix; they are the design input itself.

    This leads to three frequent sources of internal friction:

    • Time spent looking up specifications: Engineers repeatedly consult documents on functional safety, MISRA coding rules, and AUTOSAR layered design, locate the relevant clauses, and then judge their applicability.
    • Cost of fixing issues after static analysis: Scanning tools can report problems, but remediation advice often stops at “rule ID plus one sentence.” Putting it into practice still requires engineers to understand each item and modify each location manually.
    • Cost of assembling evidence: Every iteration requires regenerating issue lists, fix records, and review materials, and spreadsheets become a de facto “shadow system.”

    The traditional approach is to capture experience in a manually maintained remediation guide and repeat the cycle of scan, compare, modify, and regress. The problem with this process is not a lack of rigor, but that knowledge is not structured and cannot be reused by tools.

    2. Core Idea: Turn Industry Standards into AI-Invocable “Skills”

    To make intelligent coding tools work according to automotive engineering specifications, the key is not to switch to a stronger model, but to give them a clear engineering context. This can be abstracted into three layers:

    1. Rule layer: Standard clauses are broken down into decidable check items, such as “dynamic memory allocation must not be used,” “a function must not have multiple return points,” and “pointer arithmetic must not go out of bounds.” Each item carries its scope of applicability and exception notes.
    2. Skill layer: High-frequency engineering actions are encapsulated as invocable capabilities, such as coding standard checks, interface definition generation, diagnostic service implementation, state machine modeling, and test case completion.
    3. Role layer: Review perspectives are defined by specialty. Roles such as functional safety, architecture design, cybersecurity, diagnostics, and calibration each focus on different failure modes and check priorities.

    The benefit is predictable output: the basis for a tool’s answers comes from an explicitly given rule set rather than generalized knowledge in the model’s memory, which significantly reduces the proportion of content that “looks reasonable but cannot be traced.”

    An illustrative organization of project context could be as follows:

    1. project/
    2. ├── rules/ # Check items derived from specification clauses
    3. │ ├── coding.md # Coding rules and exceptions
    4. │ └── safety.md # Safety-related design constraints
    5. ├── skills/ # Definitions of reusable engineering actions
    6. ├── roles/ # Expert perspectives and review checklists
    7. └── src/
    8. ├── door_lock.c
    9. └── door_lock.h

    3. Practice 1: Automated Compliance Checks

    The output of traditional static analysis is usually “file, line number, rule ID,” and engineers still have to translate it into modification actions themselves. With structured rules, check results can carry three elements: the semantics of the violated clause, an explanation of the risk, and an actionable direction for the fix.

    A typical output snippet (illustrative):

    1. [door_lock.c:42] Violates the "single function exit" constraint
    2. Risk: Multiple returns scatter resource release paths and increase the chance of omission
    3. Suggestion: Introduce a single exit label and centralize release
    4. [door_lock.c:67] Violates the "no implicit integer conversion" rule
    5. Risk: Width mismatch causes truncation and behavior becomes uncertain at boundaries
    6. Suggestion: Use explicit conversion and add range assertions

    It is important to emphasize that AI-generated modifications are only candidate solutions, and engineers must confirm their legality and consistency with the design intent. A reasonable collaboration model is: the tool proposes a patch, humans review the semantics, and then the code enters compilation and regression. Treat AI as a “high-speed executor,” not the “final arbiter.”

    4. Practice 2: A Closed Loop from Checking to Fixing

    Efficiency gains in the fixing stage come from closed-loop design rather than a single-point capability:

    1. Scan → Categorize → Generate patch → Human confirmation → Compile → Regress → Record and archive

    Three details determine success or failure:

    • Minimal changes: Prefer local patches and avoid having AI refactor unrelated code for “convenient optimization,” which would make review costs spiral out of control.
    • Retain evidence: Automatically record the rule ID, change location, and confirmer for each fix, directly producing the traceability material required by ASPICE.
    • Layered verification: First run a static recheck to confirm issues are cleared, then run unit tests and integration tests, and finally run safety- and diagnostics-related test cases.

    A module-by-module approach is also more reliable: handle only one software component at a time (for example, only the source and header files of the lock/unlock component), and move to the next component after verification passes, avoiding large-scale changes that make it hard to locate the cause of a regression failure.

    5. Practice 3: Support for Architecture and Interface Development

    In layered architecture development, the value of AI is more about eliminating “boilerplate work”: generating the skeleton of interface description files, aligning service interfaces with data types, checking the completeness of state machine branches, mapping diagnostic service requests and responses, and verifying the coverage of test cases against requirements.

    The effective approach is to provide structured input: requirement items, interface agreements, naming conventions, and the dependency direction between layers. The more explicit the input, the closer the generated result is to a mergeable state. Conversely, giving only a one-sentence natural language description usually means the output requires substantial rework.

    6. Boundaries and Risk Control

    The capability boundaries must be clearly recognized:

    • Hallucination risk: Nonexistent interfaces, incorrect clause numbers, and outdated version constraints may appear, so the official standard text should be the source of truth.
    • Responsibility: Conclusions related to functional safety and cybersecurity must be signed off by qualified engineers; tool output does not constitute compliance evidence in itself.
    • Data compliance: When proprietary OEM code and undisclosed requirements are involved, use enterprise-controlled deployment and permission policies; sensitive information must not enter uncontrolled external services. General cloud capabilities such as object storage, log services, and monitoring and alerting can be combined for auditing and record keeping.
    • Reproducibility: Rule sets and skill definitions should be placed under version control so that any conclusion can be traced back to the rule version in effect at the time.

    7. Adoption Recommendations

    1. Start with a high-repetition, low-risk scenario, such as coding standard checks and fixes.
    2. Organize rules and a terminology glossary before discussing automation; rule quality determines the ceiling.
    3. Establish a fixed process of “AI suggestion, human confirmation, automatic recording” to avoid process drift.
    4. Use metrics to validate benefits: issue closure time, regression failure rate, and number of review reworks.
    5. Gradually expand to architecture, diagnostics, calibration, and other scenarios, keeping a human fallback at every step.

    The significance of intelligent coding tools in automotive software engineering is not to replace engineering judgment, but to hand structured labor—looking up clauses, filling in forms, and modifying code item by item—to machines. When specifications become executable context, engineers can truly return their energy to architecture trade-offs and safety arguments.