https://www.mdu.se/

mdu.sePublications
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
PyLC+: A Scalable Python Framework for Automated Translation and Testing of Industrial PLC Programs
Mälardalen University, School of Innovation, Design and Engineering, Embedded Systems.ORCID iD: 0000-0002-6992-9200
Mälardalen University, School of Innovation, Design and Engineering, Embedded Systems.ORCID iD: 0000-0003-2416-4205
Mälardalen University, School of Innovation, Design and Engineering, Embedded Systems.ORCID iD: 0000-0002-8027-0611
Mälardalen University, School of Innovation, Design and Engineering, Embedded Systems.ORCID iD: 0000-0003-0611-2655
Show others and affiliations
2025 (English)In: Proceedings - 2025 IEEE 49th Annual Computers, Software, and Applications Conference, COMPSAC 2025, Institute of Electrical and Electronics Engineers (IEEE) , 2025, p. 628-639Conference paper, Published paper (Refereed)
Abstract [en]

As industrial PLC programs become more complex, automated testing and verification methods are needed to ensure their reliability and correctness. This paper presents PyLC+, a modular framework that translates PLC programs into Python, allowing for automated AI-driven test generation. PyLC+ builds upon our previous work, addressing limitations by adopting a class-based modular architecture that improves the tool's scalability, maintainability, and extensibility. This structural refinement eliminates reliance on nested functions, facilitating the translation of large-scale, real-world PLC programs while maintaining precise use of cyclic execution. Furthermore, PyLC+ introduces automated handling of stateful FBs, ensuring compliance with IEC 61131-3 execution semantics.Additionally, the tool proposes integrating LLM-driven test generation with search-based test generation to improve the efficiency and effectiveness of testing PLC software. We tested PyLC+ in a large-scale company developing train control systems, demonstrating its efficiency and effectiveness in handling complex industrial PLC programs.

Place, publisher, year, edition, pages
Institute of Electrical and Electronics Engineers (IEEE) , 2025. p. 628-639
Series
IEEE Annual Computer Software and Applications Conference Workshops, ISSN 2836-3795
Keywords [en]
Ai, Fbd, Llm, Plc, Pylc+, Python, Search-based Testing, Test Automation Framework, Automatic Test Pattern Generation, Automation, Efficiency, Integration Testing, Program Translators, Automated Testing, Large-scales, Plc Programs, Test Automation Frameworks, Test Generations, Programmable Logic Controllers
National Category
Computer Sciences
Identifiers
URN: urn:nbn:se:mdh:diva-73407DOI: 10.1109/COMPSAC65507.2025.00085ISI: 001575960000079Scopus ID: 2-s2.0-105016253942ISBN: 9798331574345 (print)OAI: oai:DiVA.org:mdh-73407DiVA, id: diva2:2000874
Conference
49th IEEE Annual Computers, Software, and Applications Conference, COMPSAC 2025, Toronto, Canada, 8-11 July, 2025
Available from: 2025-09-25 Created: 2025-09-25 Last updated: 2026-02-17Bibliographically approved
In thesis
1. Test Automation for Industrial Programmable Logic Controller Software: From Requirements to Executable Tests
Open this publication in new window or tab >>Test Automation for Industrial Programmable Logic Controller Software: From Requirements to Executable Tests
2026 (English)Doctoral thesis, comprehensive summary (Other academic)
Abstract [en]

Programmable Logic Controllers (PLCs), which are specialized computers used to control machines and processes in industrial settings, play a vital role in the automation industry. Testing these systems to identify faults during the development phase, especially for safety-critical applications such as crane control in ports or train control systems, is crucial to ensuring the system's safety in operation. Current PLC testing practices are mostly manual, and it has been a challenge for both practitioners and researchers to develop robust, applicable test automation techniques and tools that are relevant in practice. This thesis proposes test automation solutions for PLC programs, which can improve current testing practices by augmenting manual testing. We first propose a method for selecting an appropriate test automation framework for PLCs, derived from a grey literature review and a set of empirically validated evaluation criteria. To achieve practical integration of test automation solutions, we design a method and tool, PyLC+, for automated program-to-program translation from PLC to Python. Our tool automatically translates a PLC program into executable Python code, and then verifies the latter against given assertions, using an automated Python program verifier called Nagini. PyLC+ then uses metaheuristic algorithms for automated test generation. In addition, we introduce a domain-specific LLM, PyLC-M1, which serves as an interactive test-automation assistant within PyLC+. It assists the generation of verification harnesses for formal PLC analysis while operating entirely in secure, offline environments. Investigating the applicability of a well-known syntax notation pattern for semi-formal requirements specification, called Easy Approach to Requirements Syntax, for specification-based testing through a controlled experiment is another contribution of this thesis. The applicability and efficiency of the proposed testing and verification solutions in this thesis have been evaluated on real-world industrial use cases.

Abstract [sv]

Programmerbara logikstyrenheter (PLC), som är specialiserade datorer som används för att styra maskiner och processer i industriella miljöer, spelar en viktig roll inom automationsindustrin. Att testa dessa system för att identifiera fel under utvecklingsfasen, särskilt för säkerhetskritiska applikationer som kranstyrning i hamnar eller tågstyrningssystem, är avgörande för att säkerställa systemets säkerhet i drift. Nuvarande PLC-testmetoder är mestadels manuella, och det har varit en utmaning för både praktiker och forskare att utveckla robusta, tillämpliga testautomationstekniker och verktyg som är relevanta i praktiken. Denna avhandling föreslår testautomationslösningar för PLC-program, vilka kan förbättra nuvarande testmetoder genom att utöka manuell testning. Vi föreslår först en metod för att välja ett lämpligt testautomationsramverk för PLC, härlett från en grå litteraturgenomgång och en uppsättning empiriskt validerade utvärderingskriterier. För att uppnå praktisk integration av testautomationslösningar designar vi en metod och ett verktyg, PyLC+, för automatiserad program-till-program-översättning från PLC till Python. Vårt verktyg översätter automatiskt ett PLC-program till körbar Python-kod och verifierar sedan det senare mot givna påståenden med hjälp av en automatiserad Python-programverifierare som heter Nagini. PyLC+ använder sedan metaheuristiska algoritmer för automatiserad testgenerering. Dessutom introducerar vi en domänspecifik LLM, PyLC-M1, som fungerar som en interaktiv testautomationsassistent inom PyLC+. Den hjälper till att generera verifieringsverktyg för formell PLC-analys samtidigt som den arbetar helt i säkra offline-miljöer. Att undersöka tillämpligheten av ett välkänt syntaxnotationsmönster för semiformell kravspecifikation, kallat Easy Approach to Requirements Syntax, för specifikationsbaserad testning genom ett kontrollerat experiment är ytterligare ett bidrag från denna avhandling. Tillämpligheten och effektiviteten hos de föreslagna test- och verifieringslösningarna i denna avhandling har utvärderats på verkliga industriella användningsfall.

Place, publisher, year, edition, pages
Västerås: Mälardalen University, 2026
Series
Mälardalen University Press Dissertations, ISSN 1651-4238 ; 456
Keywords
Test Automation, PLC, Python, PyLC+, Embedded Systems
National Category
Computer Sciences
Research subject
Computer Science
Identifiers
urn:nbn:se:mdh:diva-74961 (URN)978-91-7485-744-3 (ISBN)
Public defence
2026-01-22, Case, Mälardalens universitet, Västerås, 13:15 (English)
Opponent
Supervisors
Available from: 2025-12-09 Created: 2025-12-09 Last updated: 2026-01-02Bibliographically approved

Open Access in DiVA

No full text in DiVA

Other links

Publisher's full textScopus

Authority records

Salari, Mikael EbrahimiEnoiu, Eduard PaulBucaioni, AlessioAfzal, WasifSeceleanu, Cristina

Search in DiVA

By author/editor
Salari, Mikael EbrahimiEnoiu, Eduard PaulBucaioni, AlessioAfzal, WasifSeceleanu, Cristina
By organisation
Embedded Systems
Computer Sciences

Search outside of DiVA

GoogleGoogle Scholar

doi
isbn
urn-nbn

Altmetric score

doi
isbn
urn-nbn
Total: 131 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf