Analysis and application of automated unit testing for industrial control software through the TcUnit framework in Beckhoff TwinCAT 3

Mazzocchi, Niccolò (2026) Analysis and application of automated unit testing for industrial control software through the TcUnit framework in Beckhoff TwinCAT 3. [Laurea magistrale], Università di Bologna, Corso di Studio in Automation engineering / ingegneria dell’automazione [LM-DM270], Documento full-text non disponibile
Il full-text non è disponibile per scelta dell'autore. (Contatta l'autore)

Abstract

The control software of an automatic machine is never finished: each machine delivered is configured for its customer, a new unit brings code of its own, and the code in place is revised at every fault corrected, so that every change risks breaking what already works. General-purpose software meets this risk with automated unit tests, small checks written alongside the code and run again, by the developer or by a continuous integration server, to confirm that what worked still does. In industrial automation, where controllers are programmed under IEC 61131-3 and the code runs cyclically rather than from a call to a return, the practice is still young, and verification relies mostly on watching the machine or its simulation. This thesis, carried out during an internship at G.D S.p.A., asks whether that practice can be brought onto the control software of packing machines through TcUnit, the open source unit testing framework for Beckhoff TwinCAT 3. The framework was tried on three pieces of company software of growing scale: a supervisory component of a production line, tested in isolation by forty unit tests and a prototype tool that runs them unattended; an application program on a small simulated machine, tested inside its life cycle; and the full simulation of an end-of-line machine, for which a product-flow visualization was built and a suite designed to catch an intermittent synchronization fault, an axis falling off its cam profile in production, that developers used to recognize by ear. In every case the tests were made to fail on purpose, through hand-crafted mutants or injected faults, before their green report was trusted. The results, obtained in simulation, show that automated tests can be written on real machine software, from the isolated component to the machine in production, provided the framework is bent to the cyclic nature of the code. What that took, and where the tests stand today in the daily work of the developers, is what the thesis tells.

Abstract
Tipologia del documento
Tesi di laurea (Laurea magistrale)
Autore della tesi
Mazzocchi, Niccolò
Relatore della tesi
Correlatore della tesi
Scuola
Corso di studio
Indirizzo
AUTOMATION ENGINEERING
Ordinamento Cds
DM270
Parole chiave
Unit testing, Test automation, TcUnit, TwinCAT 3, IEC 61131-3, PLC programming, Automatic machines, Control software, Regression testing, Continuous integration, Test-Driven Development, Runtime observer
Data di discussione della Tesi
5 Ottobre 2026
URI

Altri metadati

Gestione del documento: Visualizza il documento

^