CAPLint: A Static Analysis Tool for CAPL in Automotive Software Development - Automated Code Quality Enforcement for HIL Test Scripts

Loading...
Thumbnail Image

Date

Type

Examensarbete pÄ kandidatnivÄ
Bachelor Thesis

Programme

Model builders

Journal Title

Journal ISSN

Volume Title

Publisher

Abstract

CAPL (Communication Access Programming Language) is a domain-specific language widely used in the automotive industry for Hardware-in-the-Loop (HIL) testing of electronic control units. Despite its critical role in vehicle software validation, CAPL has limited or no widely adopted static analysis tooling to enforce coding standards or detect common programming mistakes. This gap forces development teams to rely on manual code review, a process that could be time-consuming, error-prone, and difficult to scale. This thesis presents CAPLint, a static analysis tool designed specifically for CAPL. The tool was developed in collaboration with the HIL development team at Volvo Cars in Gothenburg, Sweden, and informed by a formative survey of engineers on their CAPL debugging practices. CAPLint addresses this problem through a two tier analysis architecture: a fast text-based tier that operates on raw source lines using pattern matching, and a structured tier that performs analysis on an abstract syntax tree generated by a custom-built LALR parser. The parser was developed from scratch due to the absence of a publicly available CAPL grammar specification, and achieves a 100% parse success rate on a large production corpus of CAPL files. CAPLint implements 39 lint rules across fifteen categories, including naming conventions, formatting, documentation, semantic checks for unused and undeclared variables, and cross-file include analysis. The tool supports hierarchical configuration, inline suppression comments, and integrates into existing command-line workflows and CI/CD pipelines. The system was developed using an Agile methodology over a 17-week period and evaluated through corpus validation and developer feedback. The results show that automated static analysis can be applied to a domain-specific language with limited public documentation, and that CAPLint can reduce the amount of repetitive checking engineers do during code review.

Description

Keywords

static analysis, linting, CAPL, domain-specific language, automotive, HIL testing, parser, code quality

Citation

Architect

Location

Type of building

Build Year

Model type

Scale

Material / technology

Index

Collections

Endorsement

Review

Supplemented By

Referenced By