LLM-based Property-based Test Generation for Guardrailing Cyber-Physical Systems

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Etemadi, Khashayar, Sirjani, Marjan, Moghadam, Mahshid Helali, Strandberg, Per, Pettersson, Paul
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912428184305664
author Etemadi, Khashayar
Sirjani, Marjan
Moghadam, Mahshid Helali
Strandberg, Per
Pettersson, Paul
author_facet Etemadi, Khashayar
Sirjani, Marjan
Moghadam, Mahshid Helali
Strandberg, Per
Pettersson, Paul
contents Cyber-physical systems (CPSs) are complex systems that integrate physical, computational, and communication subsystems. The heterogeneous nature of these systems makes their safety assurance challenging. In this paper, we propose a novel automated approach for guardrailing cyber-physical systems using property-based tests (PBTs) generated by Large Language Models (LLMs). Our approach employs an LLM to extract properties from the code and documentation of CPSs. Next, we use the LLM to generate PBTs that verify the extracted properties on the CPS. The generated PBTs have two uses. First, they are used to test the CPS before it is deployed, i.e., at design time. Secondly, these PBTs can be used after deployment, i.e., at run time, to monitor the behavior of the system and guardrail it against unsafe states. We implement our approach in ChekProp and conduct preliminary experiments to evaluate the generated PBTs in terms of their relevance (how well they match manually crafted properties), executability (how many run with minimal manual modification), and effectiveness (coverage of the input space partitions). The results of our experiments and evaluation demonstrate a promising path forward for creating guardrails for CPSs using LLM-generated property-based tests.
format Preprint
id arxiv_https___arxiv_org_abs_2505_23549
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle LLM-based Property-based Test Generation for Guardrailing Cyber-Physical Systems
Etemadi, Khashayar
Sirjani, Marjan
Moghadam, Mahshid Helali
Strandberg, Per
Pettersson, Paul
Software Engineering
Cyber-physical systems (CPSs) are complex systems that integrate physical, computational, and communication subsystems. The heterogeneous nature of these systems makes their safety assurance challenging. In this paper, we propose a novel automated approach for guardrailing cyber-physical systems using property-based tests (PBTs) generated by Large Language Models (LLMs). Our approach employs an LLM to extract properties from the code and documentation of CPSs. Next, we use the LLM to generate PBTs that verify the extracted properties on the CPS. The generated PBTs have two uses. First, they are used to test the CPS before it is deployed, i.e., at design time. Secondly, these PBTs can be used after deployment, i.e., at run time, to monitor the behavior of the system and guardrail it against unsafe states. We implement our approach in ChekProp and conduct preliminary experiments to evaluate the generated PBTs in terms of their relevance (how well they match manually crafted properties), executability (how many run with minimal manual modification), and effectiveness (coverage of the input space partitions). The results of our experiments and evaluation demonstrate a promising path forward for creating guardrails for CPSs using LLM-generated property-based tests.
title LLM-based Property-based Test Generation for Guardrailing Cyber-Physical Systems
topic Software Engineering
url https://arxiv.org/abs/2505.23549