Skip to main content

LUP Student Papers

LUND UNIVERSITY LIBRARIES

Auto-testing of code

Breznica, Flamur LU (2020) In CODEN:LUTEDX/TEIE EIEM01 20192
Industrial Electrical Engineering and Automation
Abstract
The topic of this thesis is software in systems of automated machines that produce products in a company. Testing of these systems is crucial for the machines to work as intended. Usually testing is done manually, both while the system is developed and while the production is running. This is called traditional testing. Testing is done to improve the machines program code. The machine needs to do something wrong to fail the test. Certain faults lead to the change of certain parts of the code. Test-cases have to be developed to address different parts of the code. Nowadays testing is usually done completely manually. This thesis will explore the possibilities and the limitations with partly automatic testing, as well as develop a... (More)
The topic of this thesis is software in systems of automated machines that produce products in a company. Testing of these systems is crucial for the machines to work as intended. Usually testing is done manually, both while the system is developed and while the production is running. This is called traditional testing. Testing is done to improve the machines program code. The machine needs to do something wrong to fail the test. Certain faults lead to the change of certain parts of the code. Test-cases have to be developed to address different parts of the code. Nowadays testing is usually done completely manually. This thesis will explore the possibilities and the limitations with partly automatic testing, as well as develop a theoretical machine to test.

The thesis was done at a machine company in Helsingborg. The approach is to use an automatic regression testing of the code. Firstly an analysis was done which went through the existing options and refined the approach. One approach was selected and used for the thesis. The main task of the thesis is to facilitate the way of testing the machines for companies, or at least help companies to improve machines, with earlier commissioning and enable distance maintenance. The analysis went through different software aspects and old reports written about automatic testing before implementing a testing strategy to a control system. The control system needed to be developed and a theoretical machine were needed to be tested. The next part was to simulate the machine and lastly illustrate the scenario with a pictorial view.

By developing the machine code it was possible to create automatic tests on it, called unit testing. This was combined with a simulation of the machine. This was successfully shown on a human machine interface. By doing this it is possible to save time and money but it will depend on the programmer creating the tests. The simulation was done through software that coded the controller, called TIA portal. In the future a better and more suitable environment could be used for simulation purposes. Unit testing and simulation proved to work well for automatic testing. Remote maintenance and testing requires simulating the entire machine with all of its complex parts. All physical hardware can be simulated.

Simulating and testing on a machine was implemented. The combination is considered to be time and money saving and that there are options for making the tests partly automatic and machines with higher quality. (Less)
Abstract (Swedish)
I denna rapport diskuteras mjukvara som används för system bestående av automatiska maskiner som producerar produkter i ett företag. Testning är nödvändigt för att maskinerna ska fungera som planerat. Oftast görs testning manuellt, både under utveckling och medan produktionen är igång. Detta kallas för traditionell testning. Testning görs för att förbättra maskinens programkod. För att testen ska bidra med något måste maskinen misslyckas med testen. Vissa fel leder till ändringar i vissa delar av koden. Testfallen måste därför adressera olika delar av koden. Idag görs oftast testning helt manuellt. Detta examensarbete ska utforska möjligheter och begränsningar för att delvis införa automatiska tester, samt utveckla en teoretisk maskin att... (More)
I denna rapport diskuteras mjukvara som används för system bestående av automatiska maskiner som producerar produkter i ett företag. Testning är nödvändigt för att maskinerna ska fungera som planerat. Oftast görs testning manuellt, både under utveckling och medan produktionen är igång. Detta kallas för traditionell testning. Testning görs för att förbättra maskinens programkod. För att testen ska bidra med något måste maskinen misslyckas med testen. Vissa fel leder till ändringar i vissa delar av koden. Testfallen måste därför adressera olika delar av koden. Idag görs oftast testning helt manuellt. Detta examensarbete ska utforska möjligheter och begränsningar för att delvis införa automatiska tester, samt utveckla en teoretisk maskin att testa.

Examensarbetet gjordes på ett maskinföretag i Helsingborg. Metoden var att använda en regressions-testning av koden. Först gjordes en analys som gick igenom nuvarande möjligheter och förfina tillvägagångssättet. En metod valdes och användes för examensarbetet. Huvudsyftet med examensarbetet är att underlätta test av maskinerna för företag, eller åtminstone hjälpa företag att förbättra maskiner, vilket medger tidigare driftsättning och möjlighet till distansunderhåll. Analysen gick igenom olika mjukvaruaspekter och tidigare rapporten skrivna om automatisk testning. Sedan valdes en strategi som skulle implementeras på ett kontrollsystem. Kontrollsystemet behövde utvecklas och en teoretisk maskin behövdes för testning. Nästa steg var att simulera maskinen och illustrera scenariot med en grafisk operatörsbild.

Genom att utveckla maskinkoden var det möjligt att skapa automatiska tester på den, så kallade enhetstest. Detta kombinerades med en simulering av maskinen. Detta visade sig framgångsrikt på ett människa-maskin-gränssnitt. Genom att göra detta är det möjligt att spara tid och pengar men det kommer vara beroende på programmeraren som skapar testerna. Simuleringen gjordes genom mjukvaran som kodar kontrollenheten. Mjukvaran heter TIA portal. I framtiden kan en bättre och mer lämplig miljö användas för simuleringsändamålet. Enhetstestning och simulering visade sig fungera bra för automatisk testning. Fjärrunderhåll och fjärrtestning kräver simulering av hela maskinen med alla dess komplexa delar. All fysisk hårdvara kan simuleras.

Simulering och testningen av maskinen implementerades. Kombinationen anses vara tid- och kostnadsbesparande och det finns möjligheter för att delvis göra tester automatiska och även att få maskiner med högre kvalité. (Less)
Popular Abstract
Testing in the automation production system is usually done manually and physically, what if it was possible to do the test automatically with the help of a computer instead. Are there enough tools to do this and can the process be more time-saving? This report will aim to answer those questions.
Please use this url to cite or link to this publication:
author
Breznica, Flamur LU
supervisor
organization
course
EIEM01 20192
year
type
H3 - Professional qualifications (4 Years - )
subject
keywords
IEC-61131-3, regression testing, automation, automatic, machines, S7 Unit test, unit testing, NUnit, Siemens, TIA Portal, Simulation, SIMIT, automation production systems, digital twin
publication/series
CODEN:LUTEDX/TEIE
report number
5433
language
English
id
9006413
date added to LUP
2021-04-27 14:36:59
date last changed
2021-04-27 14:36:59
@misc{9006413,
  abstract     = {{The topic of this thesis is software in systems of automated machines that produce products in a company. Testing of these systems is crucial for the machines to work as intended. Usually testing is done manually, both while the system is developed and while the production is running. This is called traditional testing. Testing is done to improve the machines program code. The machine needs to do something wrong to fail the test. Certain faults lead to the change of certain parts of the code. Test-cases have to be developed to address different parts of the code. Nowadays testing is usually done completely manually. This thesis will explore the possibilities and the limitations with partly automatic testing, as well as develop a theoretical machine to test. 

The thesis was done at a machine company in Helsingborg. The approach is to use an automatic regression testing of the code. Firstly an analysis was done which went through the existing options and refined the approach. One approach was selected and used for the thesis. The main task of the thesis is to facilitate the way of testing the machines for companies, or at least help companies to improve machines, with earlier commissioning and enable distance maintenance. The analysis went through different software aspects and old reports written about automatic testing before implementing a testing strategy to a control system. The control system needed to be developed and a theoretical machine were needed to be tested. The next part was to simulate the machine and lastly illustrate the scenario with a pictorial view.

By developing the machine code it was possible to create automatic tests on it, called unit testing. This was combined with a simulation of the machine. This was successfully shown on a human machine interface. By doing this it is possible to save time and money but it will depend on the programmer creating the tests. The simulation was done through software that coded the controller, called TIA portal. In the future a better and more suitable environment could be used for simulation purposes. Unit testing and simulation proved to work well for automatic testing. Remote maintenance and testing requires simulating the entire machine with all of its complex parts. All physical hardware can be simulated.

Simulating and testing on a machine was implemented. The combination is considered to be time and money saving and that there are options for making the tests partly automatic and machines with higher quality.}},
  author       = {{Breznica, Flamur}},
  language     = {{eng}},
  note         = {{Student Paper}},
  series       = {{CODEN:LUTEDX/TEIE}},
  title        = {{Auto-testing of code}},
  year         = {{2020}},
}