SlideShare a Scribd company logo
1 of 16
Download to read offline
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

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...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...Pradeeban Kathiravelu, Ph.D.
 
LCBM: Statistics-Based Parallel Collaborative Filtering
LCBM: Statistics-Based Parallel Collaborative FilteringLCBM: Statistics-Based Parallel Collaborative Filtering
LCBM: Statistics-Based Parallel Collaborative FilteringFabio Petroni, PhD
 
Colombo+ronzoni+fontana
Colombo+ronzoni+fontanaColombo+ronzoni+fontana
Colombo+ronzoni+fontanaAjay Ohri
 
20170410 CENTRA2 meeting - AirBox
20170410 CENTRA2 meeting - AirBox20170410 CENTRA2 meeting - AirBox
20170410 CENTRA2 meeting - AirBoxLing-Jyh Chen
 
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 CloudsHong-Linh Truong
 
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 NetworksIJCSIS Research Publications
 
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 SystemsHong-Linh Truong
 
2005年EI收录浙江财经学院论文7篇
2005年EI收录浙江财经学院论文7篇2005年EI收录浙江财经学院论文7篇
2005年EI收录浙江财经学院论文7篇butest
 
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, AustriaMartin Pinzger
 
2015/12/16 Participatory Urban Sensing
2015/12/16 Participatory Urban Sensing2015/12/16 Participatory Urban Sensing
2015/12/16 Participatory Urban SensingLing-Jyh Chen
 
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 detectionAlket Cecaj
 
IRJET- Survey on Flood Management System
IRJET- Survey on Flood Management SystemIRJET- Survey on Flood Management System
IRJET- Survey on Flood Management SystemIRJET Journal
 
Digital Twin: convergence of Multimedia Technologies
Digital Twin: convergence of Multimedia TechnologiesDigital Twin: convergence of Multimedia Technologies
Digital Twin: convergence of Multimedia TechnologiesAbdulmotaleb El Saddik
 

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
 

More from SEAA 2022

Risk and Engineering Knowledge Integration in Cyber-physical Production Syste...
Risk and Engineering Knowledge Integration in Cyber-physical Production Syste...Risk and Engineering Knowledge Integration in Cyber-physical Production Syste...
Risk and Engineering Knowledge Integration in Cyber-physical Production Syste...SEAA 2022
 
Software Architecture Challenges in Process Automation - From Code Generation...
Software Architecture Challenges in Process Automation - From Code Generation...Software Architecture Challenges in Process Automation - From Code Generation...
Software Architecture Challenges in Process Automation - From Code Generation...SEAA 2022
 
From Traditional to Digital: How software, data and AI are transforming the e...
From Traditional to Digital: How software, data and AI are transforming the e...From Traditional to Digital: How software, data and AI are transforming the e...
From Traditional to Digital: How software, data and AI are transforming the e...SEAA 2022
 
Exploiting dynamic analysis for architectural smell detection: a preliminary ...
Exploiting dynamic analysis for architectural smell detection: a preliminary ...Exploiting dynamic analysis for architectural smell detection: a preliminary ...
Exploiting dynamic analysis for architectural smell detection: a preliminary ...SEAA 2022
 
On the Role of Personality Traits in Implementation Tasks: A Preliminary Inve...
On the Role of Personality Traits in Implementation Tasks: A Preliminary Inve...On the Role of Personality Traits in Implementation Tasks: A Preliminary Inve...
On the Role of Personality Traits in Implementation Tasks: A Preliminary Inve...SEAA 2022
 
An Empirical Analysis of Microservices Systems Using Consumer-Driven Contract...
An Empirical Analysis of Microservices Systems Using Consumer-Driven Contract...An Empirical Analysis of Microservices Systems Using Consumer-Driven Contract...
An Empirical Analysis of Microservices Systems Using Consumer-Driven Contract...SEAA 2022
 
Have Java Production Methods Co-Evolved With Test Methods Properly?: A Fine-G...
Have Java Production Methods Co-Evolved With Test Methods Properly?: A Fine-G...Have Java Production Methods Co-Evolved With Test Methods Properly?: A Fine-G...
Have Java Production Methods Co-Evolved With Test Methods Properly?: A Fine-G...SEAA 2022
 
A Preliminary Conceptualization and Analysis on Automated Static Analysis Too...
A Preliminary Conceptualization and Analysis on Automated Static Analysis Too...A Preliminary Conceptualization and Analysis on Automated Static Analysis Too...
A Preliminary Conceptualization and Analysis on Automated Static Analysis Too...SEAA 2022
 
An Evaluation of Effort-Aware Fine-Grained Just-in-Time Defect Prediction Met...
An Evaluation of Effort-Aware Fine-Grained Just-in-Time Defect Prediction Met...An Evaluation of Effort-Aware Fine-Grained Just-in-Time Defect Prediction Met...
An Evaluation of Effort-Aware Fine-Grained Just-in-Time Defect Prediction Met...SEAA 2022
 
The Impact of Forced Working-From-Home on Code Technical Debt: An Industrial ...
The Impact of Forced Working-From-Home on Code Technical Debt: An Industrial ...The Impact of Forced Working-From-Home on Code Technical Debt: An Industrial ...
The Impact of Forced Working-From-Home on Code Technical Debt: An Industrial ...SEAA 2022
 
Service Classification through Machine Learning: Aiding in the Efficient Ide...
 Service Classification through Machine Learning: Aiding in the Efficient Ide... Service Classification through Machine Learning: Aiding in the Efficient Ide...
Service Classification through Machine Learning: Aiding in the Efficient Ide...SEAA 2022
 
Maintainability Challenges inML:ASLR
Maintainability Challenges inML:ASLRMaintainability Challenges inML:ASLR
Maintainability Challenges inML:ASLRSEAA 2022
 
Model-Driven Optimization: Generating Smart Mutation Operators for Multi-Obj...
 Model-Driven Optimization: Generating Smart Mutation Operators for Multi-Obj... Model-Driven Optimization: Generating Smart Mutation Operators for Multi-Obj...
Model-Driven Optimization: Generating Smart Mutation Operators for Multi-Obj...SEAA 2022
 
An Industrial Experience Report about Challenges from Continuous Monitoring, ...
An Industrial Experience Report about Challenges from Continuous Monitoring, ...An Industrial Experience Report about Challenges from Continuous Monitoring, ...
An Industrial Experience Report about Challenges from Continuous Monitoring, ...SEAA 2022
 
API Deprecation: A Systematic Mapping Study
API Deprecation: A Systematic Mapping StudyAPI Deprecation: A Systematic Mapping Study
API Deprecation: A Systematic Mapping StudySEAA 2022
 
MDEML_UMLsec4Edge Extending UMLsec to model data-protection-compliant edge co...
MDEML_UMLsec4Edge Extending UMLsec to model data-protection-compliant edge co...MDEML_UMLsec4Edge Extending UMLsec to model data-protection-compliant edge co...
MDEML_UMLsec4Edge Extending UMLsec to model data-protection-compliant edge co...SEAA 2022
 
EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments
 EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments
EMMM: A Unified Meta-Model for Tracking Machine Learning ExperimentsSEAA 2022
 
Easing the Reuse of ML Solutions by Interactive Clustering-based Autotuning i...
Easing the Reuse of ML Solutions by Interactive Clustering-based Autotuning i...Easing the Reuse of ML Solutions by Interactive Clustering-based Autotuning i...
Easing the Reuse of ML Solutions by Interactive Clustering-based Autotuning i...SEAA 2022
 

More from SEAA 2022 (18)

Risk and Engineering Knowledge Integration in Cyber-physical Production Syste...
Risk and Engineering Knowledge Integration in Cyber-physical Production Syste...Risk and Engineering Knowledge Integration in Cyber-physical Production Syste...
Risk and Engineering Knowledge Integration in Cyber-physical Production Syste...
 
Software Architecture Challenges in Process Automation - From Code Generation...
Software Architecture Challenges in Process Automation - From Code Generation...Software Architecture Challenges in Process Automation - From Code Generation...
Software Architecture Challenges in Process Automation - From Code Generation...
 
From Traditional to Digital: How software, data and AI are transforming the e...
From Traditional to Digital: How software, data and AI are transforming the e...From Traditional to Digital: How software, data and AI are transforming the e...
From Traditional to Digital: How software, data and AI are transforming the e...
 
Exploiting dynamic analysis for architectural smell detection: a preliminary ...
Exploiting dynamic analysis for architectural smell detection: a preliminary ...Exploiting dynamic analysis for architectural smell detection: a preliminary ...
Exploiting dynamic analysis for architectural smell detection: a preliminary ...
 
On the Role of Personality Traits in Implementation Tasks: A Preliminary Inve...
On the Role of Personality Traits in Implementation Tasks: A Preliminary Inve...On the Role of Personality Traits in Implementation Tasks: A Preliminary Inve...
On the Role of Personality Traits in Implementation Tasks: A Preliminary Inve...
 
An Empirical Analysis of Microservices Systems Using Consumer-Driven Contract...
An Empirical Analysis of Microservices Systems Using Consumer-Driven Contract...An Empirical Analysis of Microservices Systems Using Consumer-Driven Contract...
An Empirical Analysis of Microservices Systems Using Consumer-Driven Contract...
 
Have Java Production Methods Co-Evolved With Test Methods Properly?: A Fine-G...
Have Java Production Methods Co-Evolved With Test Methods Properly?: A Fine-G...Have Java Production Methods Co-Evolved With Test Methods Properly?: A Fine-G...
Have Java Production Methods Co-Evolved With Test Methods Properly?: A Fine-G...
 
A Preliminary Conceptualization and Analysis on Automated Static Analysis Too...
A Preliminary Conceptualization and Analysis on Automated Static Analysis Too...A Preliminary Conceptualization and Analysis on Automated Static Analysis Too...
A Preliminary Conceptualization and Analysis on Automated Static Analysis Too...
 
An Evaluation of Effort-Aware Fine-Grained Just-in-Time Defect Prediction Met...
An Evaluation of Effort-Aware Fine-Grained Just-in-Time Defect Prediction Met...An Evaluation of Effort-Aware Fine-Grained Just-in-Time Defect Prediction Met...
An Evaluation of Effort-Aware Fine-Grained Just-in-Time Defect Prediction Met...
 
The Impact of Forced Working-From-Home on Code Technical Debt: An Industrial ...
The Impact of Forced Working-From-Home on Code Technical Debt: An Industrial ...The Impact of Forced Working-From-Home on Code Technical Debt: An Industrial ...
The Impact of Forced Working-From-Home on Code Technical Debt: An Industrial ...
 
Service Classification through Machine Learning: Aiding in the Efficient Ide...
 Service Classification through Machine Learning: Aiding in the Efficient Ide... Service Classification through Machine Learning: Aiding in the Efficient Ide...
Service Classification through Machine Learning: Aiding in the Efficient Ide...
 
Maintainability Challenges inML:ASLR
Maintainability Challenges inML:ASLRMaintainability Challenges inML:ASLR
Maintainability Challenges inML:ASLR
 
Model-Driven Optimization: Generating Smart Mutation Operators for Multi-Obj...
 Model-Driven Optimization: Generating Smart Mutation Operators for Multi-Obj... Model-Driven Optimization: Generating Smart Mutation Operators for Multi-Obj...
Model-Driven Optimization: Generating Smart Mutation Operators for Multi-Obj...
 
An Industrial Experience Report about Challenges from Continuous Monitoring, ...
An Industrial Experience Report about Challenges from Continuous Monitoring, ...An Industrial Experience Report about Challenges from Continuous Monitoring, ...
An Industrial Experience Report about Challenges from Continuous Monitoring, ...
 
API Deprecation: A Systematic Mapping Study
API Deprecation: A Systematic Mapping StudyAPI Deprecation: A Systematic Mapping Study
API Deprecation: A Systematic Mapping Study
 
MDEML_UMLsec4Edge Extending UMLsec to model data-protection-compliant edge co...
MDEML_UMLsec4Edge Extending UMLsec to model data-protection-compliant edge co...MDEML_UMLsec4Edge Extending UMLsec to model data-protection-compliant edge co...
MDEML_UMLsec4Edge Extending UMLsec to model data-protection-compliant edge co...
 
EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments
 EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments
EMMM: A Unified Meta-Model for Tracking Machine Learning Experiments
 
Easing the Reuse of ML Solutions by Interactive Clustering-based Autotuning i...
Easing the Reuse of ML Solutions by Interactive Clustering-based Autotuning i...Easing the Reuse of ML Solutions by Interactive Clustering-based Autotuning i...
Easing the Reuse of ML Solutions by Interactive Clustering-based Autotuning i...
 

Recently uploaded

Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsSérgio Sacani
 
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxSOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxkessiyaTpeter
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PPRINCE C P
 
Boyles law module in the grade 10 science
Boyles law module in the grade 10 scienceBoyles law module in the grade 10 science
Boyles law module in the grade 10 sciencefloriejanemacaya1
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxyaramohamed343013
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfSELF-EXPLANATORY
 
Work, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE PhysicsWork, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE Physicsvishikhakeshava1
 
Module 4: Mendelian Genetics and Punnett Square
Module 4:  Mendelian Genetics and Punnett SquareModule 4:  Mendelian Genetics and Punnett Square
Module 4: Mendelian Genetics and Punnett SquareIsiahStephanRadaza
 
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaDashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaPraksha3
 
Recombinant DNA technology( Transgenic plant and animal)
Recombinant DNA technology( Transgenic plant and animal)Recombinant DNA technology( Transgenic plant and animal)
Recombinant DNA technology( Transgenic plant and animal)DHURKADEVIBASKAR
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoSérgio Sacani
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTSérgio Sacani
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trssuser06f238
 
The Black hole shadow in Modified Gravity
The Black hole shadow in Modified GravityThe Black hole shadow in Modified Gravity
The Black hole shadow in Modified GravitySubhadipsau21168
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...anilsa9823
 
A relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfA relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfnehabiju2046
 
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptxanandsmhk
 
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...jana861314
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Sérgio Sacani
 

Recently uploaded (20)

Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
 
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxSOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C P
 
Boyles law module in the grade 10 science
Boyles law module in the grade 10 scienceBoyles law module in the grade 10 science
Boyles law module in the grade 10 science
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docx
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
 
Work, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE PhysicsWork, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE Physics
 
Module 4: Mendelian Genetics and Punnett Square
Module 4:  Mendelian Genetics and Punnett SquareModule 4:  Mendelian Genetics and Punnett Square
Module 4: Mendelian Genetics and Punnett Square
 
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaDashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
 
Recombinant DNA technology( Transgenic plant and animal)
Recombinant DNA technology( Transgenic plant and animal)Recombinant DNA technology( Transgenic plant and animal)
Recombinant DNA technology( Transgenic plant and animal)
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on Io
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOST
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 tr
 
The Black hole shadow in Modified Gravity
The Black hole shadow in Modified GravityThe Black hole shadow in Modified Gravity
The Black hole shadow in Modified Gravity
 
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
Lucknow 💋 Russian Call Girls Lucknow Finest Escorts Service 8923113531 Availa...
 
A relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfA relative description on Sonoporation.pdf
A relative description on Sonoporation.pdf
 
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
 
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
 

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