SlideShare a Scribd company logo
Christian Doppler Lab VaSiCS
LIT | Cyber-Physical Systems Lab
Johannes Kepler University Linz
Bad Smells in Industrial
Automation:
Sniffing out Feature Envy
Lisa Sonnleithner, Rick Rabiser, Alois Zoitl
Introduction and Background
© CDL VaSiCS, Lisa Sonnleithner, 2022 2
Certain suboptimal structures or
patterns in software
Bad Smells
Bad Smells lead to
Our goal
Maintenance issues, low software
quality, poor understandability, etc.
Identifying Feature Envy in
IEC 61499/Control Software
Feature Envy
3
© CDL VaSiCS, Lisa Sonnleithner, 2022
IEC 61499 – DSL for Distributed Control Systems
4
Composite Function Blocks
i := 0;
j := 0;
h := 0;
Asorted := sort(A);
Bsorted := sort(B);
REPEAT
X := Asorted[i];
Y := Bsorted[j];
IF X = Y THEN
results[h] := A;
results[h + 1] := Y;
h := h + 2;
i := i +1;
j := j+1;
ELSIF X < Y THEN
i := i + 1;
ELSE
j := j+1;
END_IF;
UNTIL i = 100 OR j = 100 END_REPEAT;
State Machine
Code
Network of Function Blocks
— Event Connections: Control Flow
— Data Connections: Information Flow
Atomic Function Blocks
© CDL VaSiCS, Lisa Sonnleithner, 2022
IEC 61499 – Example
5
© CDL VaSiCS, Lisa Sonnleithner, 2022
IEC 61499 – Example
6
SUB
PID
M RPM SP L
© CDL VaSiCS, Lisa Sonnleithner, 2022
Metric I:
Feature Envy Factor
K. Nongpong, “Feature envy factor: A metric for automatic feature envy detection,” in 2015 7th Int. Conf. on Knowledge and Smart Technology, 2015, pp. 7–12
7
𝐹𝐸𝐹 𝑜𝑏𝑗, 𝑚𝑡𝑑 =
𝑚
𝑛
𝑜𝑏𝑗 Composite FB
𝑚𝑡𝑑 FB inside a Composite FB
𝑚 nr. of connections from 𝑚𝑡𝑑 to 𝑜𝑏𝑗
𝑛 nr. of all connections of 𝑚𝑡𝑑
Can be calculated for Event and
Data Connections
© CDL VaSiCS, Lisa Sonnleithner, 2022
Metric I:
Feature Envy Factor
𝐹𝐸𝐹 𝑜𝑏𝑗, 𝑚𝑡𝑑 =
𝑚
𝑛
𝑜𝑏𝑗 Composite FB = MSpeedCtrl
𝑚𝑡𝑑 FB inside a Composite FB = PID
𝑚 nr. of connections from 𝑚𝑡𝑑 to 𝑜𝑏𝑗 = 2
𝑛 nr. of all connections of 𝑚𝑡𝑑 = 2
K. Nongpong, “Feature envy factor: A metric for automatic feature envy detection,” in 2015 7th Int. Conf. on Knowledge and Smart Technology, 2015, pp. 7–12
8
= 1
Ideal: High value for mtd to its obj
© CDL VaSiCS, Lisa Sonnleithner, 2022
Metric I:
Feature Envy Factor
𝐹𝐸𝐹 𝑜𝑏𝑗, 𝑚𝑡𝑑 =
𝑚
𝑛
𝑜𝑏𝑗 Composite FB = DataLogging
𝑚𝑡𝑑 FB inside a Composite FB = PID
𝑚 nr. of connections from 𝑚𝑡𝑑 to 𝑜𝑏𝑗 = 0
𝑛 nr. of all connections of 𝑚𝑡𝑑 = 2
K. Nongpong, “Feature envy factor: A metric for automatic feature envy detection,” in 2015 7th Int. Conf. on Knowledge and Smart Technology, 2015, pp. 7–12
9
= 0
Ideal: Low value for mtd to other obj
© CDL VaSiCS, Lisa Sonnleithner, 2022
Metric I:
Feature Envy Factor
𝐹𝐸𝐹 𝑜𝑏𝑗, 𝑚𝑡𝑑 =
𝑚
𝑛
𝑜𝑏𝑗 Composite FB
𝑚𝑡𝑑 FB inside a Composite FB
𝑚 nr. of connections from 𝑚𝑡𝑑 to 𝑜𝑏𝑗
𝑛 nr. of all connections of 𝑚𝑡𝑑
K. Nongpong, “Feature envy factor: A metric for automatic feature envy detection,” in 2015 7th Int. Conf. on Knowledge and Smart Technology, 2015, pp. 7–12
10
MSpeedCtrl DataLogging
CFlow DFlow CFlow DFlow
SUB 0.50 0.33 0.50 0.33
PID 1 1 0 0
M 0.50 1 0.50 0
RPM 0.67 0.50 0.33 0.50
SP 0 0 1 1
L 0 0 1 1
© CDL VaSiCS, Lisa Sonnleithner, 2022
Metric II:
Distance Measure
F. Simon, F. Steinbruckner, and C. Lewerentz, “Metrics based refactoring,” in Proceedings Fifth European Conf. on Software Maintenance and Reengineering, 2001, pp. 30–38
F. Simon, S. L ̈offler, and C. Lewerentz, “Distance based cohesion measuring,” 08 1999.
11
𝑑𝑖𝑠𝑡 𝐹𝐵1, 𝐹𝐵2 = 1 −
σ 𝐸𝑆
σ 𝐸𝐴
𝐹𝐵1 first FB
𝐹𝐵2 second FB
𝐸𝑆 sum of shared connections between 𝐹𝐵1 and 𝐹𝐵2
𝐸𝑆 sum of all connections of 𝐹𝐵1 and 𝐹𝐵2
Can be calculated for Event and
Data Connections
© CDL VaSiCS, Lisa Sonnleithner, 2022
Metric II:
Distance Measure
12
𝑑𝑖𝑠𝑡 𝐹𝐵1, 𝐹𝐵2 = 1 −
σ 𝐸𝑆
σ 𝐸𝐴
𝐹𝐵1 first FB
𝐹𝐵2 second FB
𝐸𝑆 sum of shared connections = 1
𝐸𝑆 sum of all connections = 3
= 0.67
F. Simon, F. Steinbruckner, and C. Lewerentz, “Metrics based refactoring,” in Proceedings Fifth European Conf. on Software Maintenance and Reengineering, 2001, pp. 30–38
F. Simon, S. L ̈offler, and C. Lewerentz, “Distance based cohesion measuring,” 08 1999.
Ideal: Low value for FBs in same CFB
© CDL VaSiCS, Lisa Sonnleithner, 2022
Metric II:
Distance Measure
13
𝑑𝑖𝑠𝑡 𝐹𝐵1, 𝐹𝐵2 = 1 −
σ 𝐸𝑆
σ 𝐸𝐴
𝐹𝐵1 first FB
𝐹𝐵2 second FB
𝐸𝑆 sum of shared connections
𝐸𝑆 sum of all connections
F. Simon, F. Steinbruckner, and C. Lewerentz, “Metrics based refactoring,” in Proceedings Fifth European Conf. on Software Maintenance and Reengineering, 2001, pp. 30–38
F. Simon, S. L ̈offler, and C. Lewerentz, “Distance based cohesion measuring,” 08 1999.
SUB PID M RPM SP L
SUB X 0.67 1 0.75 1 1
PID 0.67 X 0.67 1 1 1
M 1 0.67 X 0.75 1 1
RPM 0.75 1 0.75 X 0.75 1
SP 1 1 1 0.75 X 0.5
L 1 1 1 1 0.5 X
© CDL VaSiCS, Lisa Sonnleithner, 2022
Summary and Outlook
14
• Mapped Feature Envy Factor to IEC 61499
• Mapped Distance Measure to IEC 61499
• Performed first evaluation (example)
• Implementation
• Evaluation with real system
• Combine with automatic refactoring
Completed Next Steps
© CDL VaSiCS, Lisa Sonnleithner, 2022
Thank you!
Christian Doppler Lab VaSiCS
LIT | Cyber-Physical Systems Lab
Johannes Kepler University Linz
Univ.-Prof. Mag. Dr. Rick Rabiser | rick.rabiser@jku.at
DI Lisa Sonnleithner | lisa.sonnleithner@jku.at
Contact us!
Further Work
16
© CDL VaSiCS, Lisa Sonnleithner, 2022
Sonnleithner et al.:
Applying Visualization
Concepts to Large-Scale
Software Systems in Industrial
Automation.
VISSOFT 2022 (Oct 2/3)
Sonnleithner et al.:
Architectural Concepts for IEC
61499-based Machine Controls:
Beyond Normal Operation
Handling.
ETFA 2022 (next week)
Sonnleithner et al.:
Do you smell it too? Towards
Bad Smells in IEC 61499
Applications.
ETFA 2021
Sonnleithner et al.:
IEC 61499 Distributed Design
Patterns.
ETFA 2021

More Related Content

Similar to Bad Smells in Industrial Automation: Sniffing out Feature Envy

Colombo+ronzoni+fontana
Colombo+ronzoni+fontanaColombo+ronzoni+fontana
Colombo+ronzoni+fontana
Ajay Ohri
 
2015 - 2016 ieee ns2 project titles
2015 - 2016 ieee ns2 project titles2015 - 2016 ieee ns2 project titles
2015 - 2016 ieee ns2 project titles
JPINFOTECH JAYAPRAKASH
 
Principles for Engineering Elastic IoT Cloud Systems
Principles for Engineering Elastic IoT Cloud SystemsPrinciples for Engineering Elastic IoT Cloud Systems
Principles for Engineering Elastic IoT Cloud Systems
Hong-Linh Truong
 
2005年EI收录浙江财经学院论文7篇
2005年EI收录浙江财经学院论文7篇2005年EI收录浙江财经学院论文7篇
2005年EI收录浙江财经学院论文7篇
butest
 

Similar to Bad Smells in Industrial Automation: Sniffing out Feature Envy (20)

ECL-Watch: A Big Data Application Performance Tuning Tool in the HPCC Systems...
ECL-Watch: A Big Data Application Performance Tuning Tool in the HPCC Systems...ECL-Watch: A Big Data Application Performance Tuning Tool in the HPCC Systems...
ECL-Watch: A Big Data Application Performance Tuning Tool in the HPCC Systems...
 
SD-CPS: Taming the Challenges of Cyber-Physical Systems with a Software-Defin...
SD-CPS: Taming the Challenges of Cyber-Physical Systems with a Software-Defin...SD-CPS: Taming the Challenges of Cyber-Physical Systems with a Software-Defin...
SD-CPS: Taming the Challenges of Cyber-Physical Systems with a Software-Defin...
 
LCBM: Statistics-Based Parallel Collaborative Filtering
LCBM: Statistics-Based Parallel Collaborative FilteringLCBM: Statistics-Based Parallel Collaborative Filtering
LCBM: Statistics-Based Parallel Collaborative Filtering
 
Colombo+ronzoni+fontana
Colombo+ronzoni+fontanaColombo+ronzoni+fontana
Colombo+ronzoni+fontana
 
20170410 CENTRA2 meeting - AirBox
20170410 CENTRA2 meeting - AirBox20170410 CENTRA2 meeting - AirBox
20170410 CENTRA2 meeting - AirBox
 
FedBN
FedBNFedBN
FedBN
 
2015 - 2016 ieee ns2 project titles
2015 - 2016 ieee ns2 project titles2015 - 2016 ieee ns2 project titles
2015 - 2016 ieee ns2 project titles
 
Een andere kijk op Microservices
Een andere kijk op MicroservicesEen andere kijk op Microservices
Een andere kijk op Microservices
 
Managing and Testing Ensembles of IoT, Network functions, and Clouds
Managing and Testing Ensembles of IoT, Network functions, and CloudsManaging and Testing Ensembles of IoT, Network functions, and Clouds
Managing and Testing Ensembles of IoT, Network functions, and Clouds
 
LCF: A Temporal Approach to Link Prediction in Dynamic Social Networks
 LCF: A Temporal Approach to Link Prediction in Dynamic Social Networks LCF: A Temporal Approach to Link Prediction in Dynamic Social Networks
LCF: A Temporal Approach to Link Prediction in Dynamic Social Networks
 
Principles for Engineering Elastic IoT Cloud Systems
Principles for Engineering Elastic IoT Cloud SystemsPrinciples for Engineering Elastic IoT Cloud Systems
Principles for Engineering Elastic IoT Cloud Systems
 
Is Your Software Development Process Green?
Is Your Software Development Process Green?Is Your Software Development Process Green?
Is Your Software Development Process Green?
 
2005年EI收录浙江财经学院论文7篇
2005年EI收录浙江财经学院论文7篇2005年EI收录浙江财经学院论文7篇
2005年EI收录浙江财经学院论文7篇
 
Inauguration lecture Martin Pinzger, University of Klagenfurt, Austria
Inauguration lecture Martin Pinzger, University of Klagenfurt, AustriaInauguration lecture Martin Pinzger, University of Klagenfurt, Austria
Inauguration lecture Martin Pinzger, University of Klagenfurt, Austria
 
Linkset quality (LWDM 2013)
Linkset quality (LWDM 2013)Linkset quality (LWDM 2013)
Linkset quality (LWDM 2013)
 
2015/12/16 Participatory Urban Sensing
2015/12/16 Participatory Urban Sensing2015/12/16 Participatory Urban Sensing
2015/12/16 Participatory Urban Sensing
 
Data fusion for city live event detection
Data fusion for city live event detectionData fusion for city live event detection
Data fusion for city live event detection
 
IRJET- Survey on Flood Management System
IRJET- Survey on Flood Management SystemIRJET- Survey on Flood Management System
IRJET- Survey on Flood Management System
 
Digital Twin: convergence of Multimedia Technologies
Digital Twin: convergence of Multimedia TechnologiesDigital Twin: convergence of Multimedia Technologies
Digital Twin: convergence of Multimedia Technologies
 
IDRC-Davos-250814-R.Filippini-final
IDRC-Davos-250814-R.Filippini-finalIDRC-Davos-250814-R.Filippini-final
IDRC-Davos-250814-R.Filippini-final
 

Recently uploaded

Pests of sugarcane_Binomics_IPM_Dr.UPR.pdf
Pests of sugarcane_Binomics_IPM_Dr.UPR.pdfPests of sugarcane_Binomics_IPM_Dr.UPR.pdf
Pests of sugarcane_Binomics_IPM_Dr.UPR.pdf
PirithiRaju
 
Isolation of AMF by wet sieving and decantation method pptx
Isolation of AMF by wet sieving and decantation method pptxIsolation of AMF by wet sieving and decantation method pptx
Isolation of AMF by wet sieving and decantation method pptx
GOWTHAMIM22
 
Exomoons & Exorings with the Habitable Worlds Observatory I: On the Detection...
Exomoons & Exorings with the Habitable Worlds Observatory I: On the Detection...Exomoons & Exorings with the Habitable Worlds Observatory I: On the Detection...
Exomoons & Exorings with the Habitable Worlds Observatory I: On the Detection...
Sérgio Sacani
 
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Sérgio Sacani
 
Pests of Green Manures_Bionomics_IPM_Dr.UPR.pdf
Pests of Green Manures_Bionomics_IPM_Dr.UPR.pdfPests of Green Manures_Bionomics_IPM_Dr.UPR.pdf
Pests of Green Manures_Bionomics_IPM_Dr.UPR.pdf
PirithiRaju
 
Mitosis...............................pptx
Mitosis...............................pptxMitosis...............................pptx
Mitosis...............................pptx
Cherry
 

Recently uploaded (20)

Pests of sugarcane_Binomics_IPM_Dr.UPR.pdf
Pests of sugarcane_Binomics_IPM_Dr.UPR.pdfPests of sugarcane_Binomics_IPM_Dr.UPR.pdf
Pests of sugarcane_Binomics_IPM_Dr.UPR.pdf
 
Unveiling The Crucial Role Of Cobalt In Plant
Unveiling The Crucial Role Of Cobalt In PlantUnveiling The Crucial Role Of Cobalt In Plant
Unveiling The Crucial Role Of Cobalt In Plant
 
Cell Immobilization Methods and Applications.pptx
Cell Immobilization Methods and Applications.pptxCell Immobilization Methods and Applications.pptx
Cell Immobilization Methods and Applications.pptx
 
electrochemical gas sensors and their uses.pptx
electrochemical gas sensors and their uses.pptxelectrochemical gas sensors and their uses.pptx
electrochemical gas sensors and their uses.pptx
 
Isolation of AMF by wet sieving and decantation method pptx
Isolation of AMF by wet sieving and decantation method pptxIsolation of AMF by wet sieving and decantation method pptx
Isolation of AMF by wet sieving and decantation method pptx
 
Plasma proteins_ Dr.Muralinath_Dr.c. kalyan
Plasma proteins_ Dr.Muralinath_Dr.c. kalyanPlasma proteins_ Dr.Muralinath_Dr.c. kalyan
Plasma proteins_ Dr.Muralinath_Dr.c. kalyan
 
Exomoons & Exorings with the Habitable Worlds Observatory I: On the Detection...
Exomoons & Exorings with the Habitable Worlds Observatory I: On the Detection...Exomoons & Exorings with the Habitable Worlds Observatory I: On the Detection...
Exomoons & Exorings with the Habitable Worlds Observatory I: On the Detection...
 
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
 
National Biodiversity protection initiatives and Convention on Biological Di...
National Biodiversity protection initiatives and  Convention on Biological Di...National Biodiversity protection initiatives and  Convention on Biological Di...
National Biodiversity protection initiatives and Convention on Biological Di...
 
A Giant Impact Origin for the First Subduction on Earth
A Giant Impact Origin for the First Subduction on EarthA Giant Impact Origin for the First Subduction on Earth
A Giant Impact Origin for the First Subduction on Earth
 
Triploidy ...............................pptx
Triploidy ...............................pptxTriploidy ...............................pptx
Triploidy ...............................pptx
 
Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243
Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243
Constraints on Neutrino Natal Kicks from Black-Hole Binary VFTS 243
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 
In vitro androgenesis ...............pptx
In vitro androgenesis ...............pptxIn vitro androgenesis ...............pptx
In vitro androgenesis ...............pptx
 
Tissue engineering......................pptx
Tissue engineering......................pptxTissue engineering......................pptx
Tissue engineering......................pptx
 
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...
 
Pests of Green Manures_Bionomics_IPM_Dr.UPR.pdf
Pests of Green Manures_Bionomics_IPM_Dr.UPR.pdfPests of Green Manures_Bionomics_IPM_Dr.UPR.pdf
Pests of Green Manures_Bionomics_IPM_Dr.UPR.pdf
 
Mitosis...............................pptx
Mitosis...............................pptxMitosis...............................pptx
Mitosis...............................pptx
 
Structural annotation................pptx
Structural annotation................pptxStructural annotation................pptx
Structural annotation................pptx
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
 

Bad Smells in Industrial Automation: Sniffing out Feature Envy

  • 1. Christian Doppler Lab VaSiCS LIT | Cyber-Physical Systems Lab Johannes Kepler University Linz Bad Smells in Industrial Automation: Sniffing out Feature Envy Lisa Sonnleithner, Rick Rabiser, Alois Zoitl
  • 2. Introduction and Background © CDL VaSiCS, Lisa Sonnleithner, 2022 2 Certain suboptimal structures or patterns in software Bad Smells Bad Smells lead to Our goal Maintenance issues, low software quality, poor understandability, etc. Identifying Feature Envy in IEC 61499/Control Software
  • 3. Feature Envy 3 © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 4. IEC 61499 – DSL for Distributed Control Systems 4 Composite Function Blocks i := 0; j := 0; h := 0; Asorted := sort(A); Bsorted := sort(B); REPEAT X := Asorted[i]; Y := Bsorted[j]; IF X = Y THEN results[h] := A; results[h + 1] := Y; h := h + 2; i := i +1; j := j+1; ELSIF X < Y THEN i := i + 1; ELSE j := j+1; END_IF; UNTIL i = 100 OR j = 100 END_REPEAT; State Machine Code Network of Function Blocks — Event Connections: Control Flow — Data Connections: Information Flow Atomic Function Blocks © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 5. IEC 61499 – Example 5 © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 6. IEC 61499 – Example 6 SUB PID M RPM SP L © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 7. Metric I: Feature Envy Factor K. Nongpong, “Feature envy factor: A metric for automatic feature envy detection,” in 2015 7th Int. Conf. on Knowledge and Smart Technology, 2015, pp. 7–12 7 𝐹𝐸𝐹 𝑜𝑏𝑗, 𝑚𝑡𝑑 = 𝑚 𝑛 𝑜𝑏𝑗 Composite FB 𝑚𝑡𝑑 FB inside a Composite FB 𝑚 nr. of connections from 𝑚𝑡𝑑 to 𝑜𝑏𝑗 𝑛 nr. of all connections of 𝑚𝑡𝑑 Can be calculated for Event and Data Connections © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 8. Metric I: Feature Envy Factor 𝐹𝐸𝐹 𝑜𝑏𝑗, 𝑚𝑡𝑑 = 𝑚 𝑛 𝑜𝑏𝑗 Composite FB = MSpeedCtrl 𝑚𝑡𝑑 FB inside a Composite FB = PID 𝑚 nr. of connections from 𝑚𝑡𝑑 to 𝑜𝑏𝑗 = 2 𝑛 nr. of all connections of 𝑚𝑡𝑑 = 2 K. Nongpong, “Feature envy factor: A metric for automatic feature envy detection,” in 2015 7th Int. Conf. on Knowledge and Smart Technology, 2015, pp. 7–12 8 = 1 Ideal: High value for mtd to its obj © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 9. Metric I: Feature Envy Factor 𝐹𝐸𝐹 𝑜𝑏𝑗, 𝑚𝑡𝑑 = 𝑚 𝑛 𝑜𝑏𝑗 Composite FB = DataLogging 𝑚𝑡𝑑 FB inside a Composite FB = PID 𝑚 nr. of connections from 𝑚𝑡𝑑 to 𝑜𝑏𝑗 = 0 𝑛 nr. of all connections of 𝑚𝑡𝑑 = 2 K. Nongpong, “Feature envy factor: A metric for automatic feature envy detection,” in 2015 7th Int. Conf. on Knowledge and Smart Technology, 2015, pp. 7–12 9 = 0 Ideal: Low value for mtd to other obj © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 10. Metric I: Feature Envy Factor 𝐹𝐸𝐹 𝑜𝑏𝑗, 𝑚𝑡𝑑 = 𝑚 𝑛 𝑜𝑏𝑗 Composite FB 𝑚𝑡𝑑 FB inside a Composite FB 𝑚 nr. of connections from 𝑚𝑡𝑑 to 𝑜𝑏𝑗 𝑛 nr. of all connections of 𝑚𝑡𝑑 K. Nongpong, “Feature envy factor: A metric for automatic feature envy detection,” in 2015 7th Int. Conf. on Knowledge and Smart Technology, 2015, pp. 7–12 10 MSpeedCtrl DataLogging CFlow DFlow CFlow DFlow SUB 0.50 0.33 0.50 0.33 PID 1 1 0 0 M 0.50 1 0.50 0 RPM 0.67 0.50 0.33 0.50 SP 0 0 1 1 L 0 0 1 1 © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 11. Metric II: Distance Measure F. Simon, F. Steinbruckner, and C. Lewerentz, “Metrics based refactoring,” in Proceedings Fifth European Conf. on Software Maintenance and Reengineering, 2001, pp. 30–38 F. Simon, S. L ̈offler, and C. Lewerentz, “Distance based cohesion measuring,” 08 1999. 11 𝑑𝑖𝑠𝑡 𝐹𝐵1, 𝐹𝐵2 = 1 − σ 𝐸𝑆 σ 𝐸𝐴 𝐹𝐵1 first FB 𝐹𝐵2 second FB 𝐸𝑆 sum of shared connections between 𝐹𝐵1 and 𝐹𝐵2 𝐸𝑆 sum of all connections of 𝐹𝐵1 and 𝐹𝐵2 Can be calculated for Event and Data Connections © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 12. Metric II: Distance Measure 12 𝑑𝑖𝑠𝑡 𝐹𝐵1, 𝐹𝐵2 = 1 − σ 𝐸𝑆 σ 𝐸𝐴 𝐹𝐵1 first FB 𝐹𝐵2 second FB 𝐸𝑆 sum of shared connections = 1 𝐸𝑆 sum of all connections = 3 = 0.67 F. Simon, F. Steinbruckner, and C. Lewerentz, “Metrics based refactoring,” in Proceedings Fifth European Conf. on Software Maintenance and Reengineering, 2001, pp. 30–38 F. Simon, S. L ̈offler, and C. Lewerentz, “Distance based cohesion measuring,” 08 1999. Ideal: Low value for FBs in same CFB © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 13. Metric II: Distance Measure 13 𝑑𝑖𝑠𝑡 𝐹𝐵1, 𝐹𝐵2 = 1 − σ 𝐸𝑆 σ 𝐸𝐴 𝐹𝐵1 first FB 𝐹𝐵2 second FB 𝐸𝑆 sum of shared connections 𝐸𝑆 sum of all connections F. Simon, F. Steinbruckner, and C. Lewerentz, “Metrics based refactoring,” in Proceedings Fifth European Conf. on Software Maintenance and Reengineering, 2001, pp. 30–38 F. Simon, S. L ̈offler, and C. Lewerentz, “Distance based cohesion measuring,” 08 1999. SUB PID M RPM SP L SUB X 0.67 1 0.75 1 1 PID 0.67 X 0.67 1 1 1 M 1 0.67 X 0.75 1 1 RPM 0.75 1 0.75 X 0.75 1 SP 1 1 1 0.75 X 0.5 L 1 1 1 1 0.5 X © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 14. Summary and Outlook 14 • Mapped Feature Envy Factor to IEC 61499 • Mapped Distance Measure to IEC 61499 • Performed first evaluation (example) • Implementation • Evaluation with real system • Combine with automatic refactoring Completed Next Steps © CDL VaSiCS, Lisa Sonnleithner, 2022
  • 15. Thank you! Christian Doppler Lab VaSiCS LIT | Cyber-Physical Systems Lab Johannes Kepler University Linz Univ.-Prof. Mag. Dr. Rick Rabiser | rick.rabiser@jku.at DI Lisa Sonnleithner | lisa.sonnleithner@jku.at Contact us!
  • 16. Further Work 16 © CDL VaSiCS, Lisa Sonnleithner, 2022 Sonnleithner et al.: Applying Visualization Concepts to Large-Scale Software Systems in Industrial Automation. VISSOFT 2022 (Oct 2/3) Sonnleithner et al.: Architectural Concepts for IEC 61499-based Machine Controls: Beyond Normal Operation Handling. ETFA 2022 (next week) Sonnleithner et al.: Do you smell it too? Towards Bad Smells in IEC 61499 Applications. ETFA 2021 Sonnleithner et al.: IEC 61499 Distributed Design Patterns. ETFA 2021