SlideShare uma empresa Scribd logo
1 de 33
Applying static code analysis
for domain-specific
languages
Iván Ruiz-Rube, Tatiana Person, Juan Manuel Dodero, José Miguel
Mota, Javier Merchán Sánchez-Jara
University of Cádiz (UCA)
University of Salamanca (USAL)
IEEE / ACM 22nd International Conference on
Model Driven Engineering Languages and Systems
Ruiz-Rube, I., Person, T., Dodero, J. M., Mota, J.
M., & Sánchez-Jara, J. M. (2019). Applying static
code analysis for domain-specific languages.
Software & Systems Modeling, 1-16.
Outline
Context
Problem
Solution
Use scenarios
Conclusion
Context
Intro, related works and research question
Introduction
Static program analysis is a helpful technique to verify
software quality features.
Source code analysis tools enable to automatically discover
code smells and potential errors. So, they can be used to
estimate the Technical Debt (TD).
TD is also suitable to describe the consequences of rash
developments in several disciplines, besides software
development.
Applying static analysis to DSLs
Professionals in many different areas can develop and
describe problem solutions by means of a DSL that is
especially defined for their own field and discipline.
Ad-hoc static analysers have been developed for several
DSLs:
● IEC 61131-3, EDDL and RAPID for PLC programming1
● Puppet for Infrastructure as Code2
● BPMN and BPEL for Business Process Models3
● etc.1 Mandal et al., 2018, Prähofer et al., 2012
2 Sharma et al., 2016, Shambaugh et al., 2016
3 Saad et al., 2013, Heinze et al., 2018
Research Question
Typically, quality platforms are initially intended to check
programs written in General-Purpose Languages (GPLs),
such as Java, C++ or Python, among others...
Can source code quality analysis tools be applied to
software artefacts that are developed at the DSL code
level?
Scope & Problem
Scope
Xtext is a widespread (+5000 Xtext grammar in GitHub)
framework to create external text-based DSLs.
Xtext grammars to design
concrete syntax are defined
by using its own specific
language (≈ EBNF).
The framework uses the
ANTLR parser, which
implements an LL top-down
parse algorithm.
Scope
The SonarQube quality platform provides dashboards
including quality metrics and detailed reports of issues
(vulnerabilities, bugs and code smells).
Supports a great number of GPLs.
It is open-source.
Includes a mechanism
for parsing new languages and
integrate new rules
Parsers are implemented as Java
classes that use a specific library (API) called SSLR.
Problem
The grammar format for designing DSL editors with Xtext
diverges from the grammar format used by SonarQube.
To accomplish the recognition of our DSLs by the quality
platform is time-consuming and error-prone, especially
when it comes to maintaining the consistency of
grammars while evolving the language.
Solution
Strategy & implementation
Model-driven interoperability
Mapping between grammars elements
Implementation
Simplification: T2M (injector provided by Xtext) + M2T (Acceleo
module)
Implementation
Process wrapped as Eclipse plug-ins, which provide a new
command option in the contextual menu of .xtext files. It generates
code analysers as SonarQube plug-ins
Use scenarios (I)
Analysing computer algorithms.
The tool: Vary
A computer environment for typing and running algorithms written
with a pseudocode notation
Case study: design & data collection
Objective:
Explore how the computation of metrics for analysing the algorithms written with the
Vary tool can help teachers to automatically assess their students’ programming
assignments.
Settings:
31 students of “Introduction to Programming” in the Degree of Computer Engineering
Procedure:
1. Students had to develop with Vary an algorithm.
2. Teacher manually revised and marked the students’ assignments according to
her own correctness, validity and maintainability criteria.
3. Student marks were computed by applying some linear adjustment functions on
the metrics and quality rules provided by SonarQube.
Applying Xtext2Sonar
To analyse algorithms in pseudocode, it is necessary to create the
Java artefacts required by SonarQube.
1300 lines of Java code were automatically generated from the
Xtext grammar file of Vary containing a total of 95 rules.
Support in SonarQube (metrics & quality rules)
Case study: results
Low/medium correlation between the maintainability degree manually
estimated by the teacher and the value computed with support of the
SonarQube metrics
Insights:
● The tool could be measuring other criteria that were not actually
taken into account during the manual reviewing, or vice versa.
● Formulas for learning assessment should be continuously
improved on a regular basis
● It assures the accurate application of the same criteria for all the
students → more sustainable and fairer assessment
Use scenarios (II)
Analysing sheet music
The tool: LilyPond
Provides musicians with a DSL to type chord notes combining
melody and lyrics and then generates the graphical output
Case study: design & data collection
Objective:
Checking if automatic metrics computation for analysing the quality of Lilypond
music sheets is suitable for musicians
Settings:
20 musicians (researchers, teachers, musicologist, postgraduate students).
Procedure:
1. Fill in a pretest questionnaire
2. Analyse a given sheet music with the naked eye
3. Compare their findings with the syntactic error or bad practice warnings issued
by SonarQube.
4. Fill in a final questionnaire
Applying Xtext2Sonar
To analyse music sheet, it is necessary to create the Java artefacts
required by SonarQube.
1050 lines of Java code were automatically generated from the
Xtext grammar file of LilyPond containing a total of 82 rules.
Support in SonarQube (guideline rules)
Case study: results
Learnability: Have you been able to access to SonarQube and visualise
the errors and bad practices issued by the tool for the sheet music made
with LilyPond? (Yes/No)
→ 93,8% of the musicians with experience with composition software said
Yes
Efficiency: Do you think that the errors and warnings issued by SonarQube
correspond to the ones you found when you observed the sheet music in
PDF? (Yes/No)
→ 65% of the participants gave us a positive response
Satisfaction: Would you consider the inclusion of this type of tool to
analyse the quality of sheet music? (Yes/No)
→ 100% of the participants with experience with music software
responded affirmatively.
Utility: How useful would you consider this tool? (0-10)
Conclusion
Discussion and future works
Conclusion
Problem: DSL toolkits do not include support for advanced
analytics (reports and alerts, derived metrics, charts, historical
data and so on)
Scope: Xtext languages (ANTLR LL* grammars) and the
SonarQube platform
Solution: providing a model-driven based tool that
automatically builds language recognisers for quality platforms.
Use cases: Vary, LilyPond and others (v.g. Sculptor, TANGO
and Eclipse SmartHome)
Conclusion
Limitation: the entire process is not completely automated
● Developers must include practitioners’ specific metrics and
quality rules by programming AST visitors in Java or XPath rules
Benefits:
● DSL users will harness the features of quality platforms
● DSL developers will reduce programing efforts
Future works:
● Static analysis of visual DSLs, v.g., Blockly
● Model-driven development of augmented reality-based editors
for DSLs (on-going, under journal review)
Thanks
Project webpage:
http://tatyperson.github.io/Xtext2Sonar/
SonarQube running instance (evaluation of pseudocode project)
http://vedilsanalytics.uca.es/sonarqube/dashboard/index/1
SonarQube running instance (evaluation of sheet music project)
http://vedilsanalytics.uca.es/sonarqube/dashboard/index/35
ivan.ruiz@uca.es
Applying static code analysis for domain-specific languages

Mais conteúdo relacionado

Mais procurados

DAE Tools 1.8.0 - Introduction
DAE Tools 1.8.0 - IntroductionDAE Tools 1.8.0 - Introduction
DAE Tools 1.8.0 - IntroductionDragan Nikolić
 
9. Manuel Harranz (pangeanic) Hybrid Solutions for Translation
9. Manuel Harranz (pangeanic) Hybrid Solutions for Translation9. Manuel Harranz (pangeanic) Hybrid Solutions for Translation
9. Manuel Harranz (pangeanic) Hybrid Solutions for TranslationRIILP
 
p4pktgen: Automated Test Case Generation for P4 Programs
p4pktgen:  Automated Test Case  Generation for P4 Programsp4pktgen:  Automated Test Case  Generation for P4 Programs
p4pktgen: Automated Test Case Generation for P4 ProgramsAJAY KHARAT
 
Software Systems as Cities: a Controlled Experiment
Software Systems as Cities: a Controlled ExperimentSoftware Systems as Cities: a Controlled Experiment
Software Systems as Cities: a Controlled ExperimentRichard Wettel
 
Dynamic V&V in Language-Oriented Modeling
Dynamic V&V in Language-Oriented ModelingDynamic V&V in Language-Oriented Modeling
Dynamic V&V in Language-Oriented ModelingBenoit Combemale
 
Principles of programming
Principles of programmingPrinciples of programming
Principles of programmingRob Paok
 
Imperative programming
Imperative programmingImperative programming
Imperative programmingEdward Blurock
 
Practical List COMPILER DESIGN
Practical List COMPILER DESIGNPractical List COMPILER DESIGN
Practical List COMPILER DESIGNShraddha Patel
 
Principles Of Programing Languages
Principles Of Programing LanguagesPrinciples Of Programing Languages
Principles Of Programing LanguagesMatthew McCullough
 
The VoiceMOS Challenge 2022
The VoiceMOS Challenge 2022The VoiceMOS Challenge 2022
The VoiceMOS Challenge 2022NU_I_TODALAB
 
Fdp kavita pandey_automata
Fdp kavita pandey_automataFdp kavita pandey_automata
Fdp kavita pandey_automataKpandey
 
An approach to source code plagiarism
An approach to source code plagiarismAn approach to source code plagiarism
An approach to source code plagiarismvarsha_bhat
 
Integrating natural language processing and software engineering
Integrating natural language processing and software engineeringIntegrating natural language processing and software engineering
Integrating natural language processing and software engineeringNakul Sharma
 
Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3Akshay Nagpurkar
 
An empirical evaluation of
An empirical evaluation ofAn empirical evaluation of
An empirical evaluation ofcsandit
 
Realization of natural language interfaces using
Realization of natural language interfaces usingRealization of natural language interfaces using
Realization of natural language interfaces usingunyil96
 

Mais procurados (19)

DAE Tools 1.8.0 - Introduction
DAE Tools 1.8.0 - IntroductionDAE Tools 1.8.0 - Introduction
DAE Tools 1.8.0 - Introduction
 
9. Manuel Harranz (pangeanic) Hybrid Solutions for Translation
9. Manuel Harranz (pangeanic) Hybrid Solutions for Translation9. Manuel Harranz (pangeanic) Hybrid Solutions for Translation
9. Manuel Harranz (pangeanic) Hybrid Solutions for Translation
 
p4pktgen: Automated Test Case Generation for P4 Programs
p4pktgen:  Automated Test Case  Generation for P4 Programsp4pktgen:  Automated Test Case  Generation for P4 Programs
p4pktgen: Automated Test Case Generation for P4 Programs
 
Software Systems as Cities: a Controlled Experiment
Software Systems as Cities: a Controlled ExperimentSoftware Systems as Cities: a Controlled Experiment
Software Systems as Cities: a Controlled Experiment
 
Dynamic V&V in Language-Oriented Modeling
Dynamic V&V in Language-Oriented ModelingDynamic V&V in Language-Oriented Modeling
Dynamic V&V in Language-Oriented Modeling
 
Principles of programming
Principles of programmingPrinciples of programming
Principles of programming
 
Imperative programming
Imperative programmingImperative programming
Imperative programming
 
Practical List COMPILER DESIGN
Practical List COMPILER DESIGNPractical List COMPILER DESIGN
Practical List COMPILER DESIGN
 
Principles Of Programing Languages
Principles Of Programing LanguagesPrinciples Of Programing Languages
Principles Of Programing Languages
 
Icsme16.ppt
Icsme16.pptIcsme16.ppt
Icsme16.ppt
 
The VoiceMOS Challenge 2022
The VoiceMOS Challenge 2022The VoiceMOS Challenge 2022
The VoiceMOS Challenge 2022
 
Fdp kavita pandey_automata
Fdp kavita pandey_automataFdp kavita pandey_automata
Fdp kavita pandey_automata
 
An approach to source code plagiarism
An approach to source code plagiarismAn approach to source code plagiarism
An approach to source code plagiarism
 
Integrating natural language processing and software engineering
Integrating natural language processing and software engineeringIntegrating natural language processing and software engineering
Integrating natural language processing and software engineering
 
Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3
 
An empirical evaluation of
An empirical evaluation ofAn empirical evaluation of
An empirical evaluation of
 
Msr17a.ppt
Msr17a.pptMsr17a.ppt
Msr17a.ppt
 
Oop
OopOop
Oop
 
Realization of natural language interfaces using
Realization of natural language interfaces usingRealization of natural language interfaces using
Realization of natural language interfaces using
 

Semelhante a Applying static code analysis for domain-specific languages

Usability evaluation of Domain-Specific Languages
Usability evaluation of Domain-Specific LanguagesUsability evaluation of Domain-Specific Languages
Usability evaluation of Domain-Specific LanguagesAnkica Barisic
 
Language and Offensive Word Detection
Language and Offensive Word DetectionLanguage and Offensive Word Detection
Language and Offensive Word DetectionIRJET Journal
 
Acceptance Testing Of A Spoken Language Translation System
Acceptance Testing Of A Spoken Language Translation SystemAcceptance Testing Of A Spoken Language Translation System
Acceptance Testing Of A Spoken Language Translation SystemMichele Thomas
 
On the Globalization of Modeling Languages (June 8th, 2015)
On the Globalization of Modeling Languages (June 8th, 2015)On the Globalization of Modeling Languages (June 8th, 2015)
On the Globalization of Modeling Languages (June 8th, 2015)Benoit Combemale
 
Software development slides
Software development slidesSoftware development slides
Software development slidesiarthur
 
2014 01-ticosa
2014 01-ticosa2014 01-ticosa
2014 01-ticosaPharo
 
IRJET- Voice to Code Editor using Speech Recognition
IRJET- Voice to Code Editor using Speech RecognitionIRJET- Voice to Code Editor using Speech Recognition
IRJET- Voice to Code Editor using Speech RecognitionIRJET Journal
 
Static analysis of textual models
Static analysis of textual modelsStatic analysis of textual models
Static analysis of textual modelsIván Ruiz-Rube
 
Iterative usability evaluation of DSLs
Iterative usability evaluation of DSLsIterative usability evaluation of DSLs
Iterative usability evaluation of DSLsAnkica Barisic
 
Software developer occupational brief
Software developer occupational briefSoftware developer occupational brief
Software developer occupational briefEnda Crossan
 
Script identification using dct coefficients 2
Script identification using dct coefficients 2Script identification using dct coefficients 2
Script identification using dct coefficients 2IAEME Publication
 
Class Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP TechniquesClass Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP Techniquesiosrjce
 
130817 latifa guerrouj - context-aware source code vocabulary normalization...
130817   latifa guerrouj - context-aware source code vocabulary normalization...130817   latifa guerrouj - context-aware source code vocabulary normalization...
130817 latifa guerrouj - context-aware source code vocabulary normalization...Ptidej Team
 
IRJET- Speech Based Answer Sheet Evaluation System
IRJET- Speech Based Answer Sheet Evaluation SystemIRJET- Speech Based Answer Sheet Evaluation System
IRJET- Speech Based Answer Sheet Evaluation SystemIRJET Journal
 

Semelhante a Applying static code analysis for domain-specific languages (20)

Usability evaluation of Domain-Specific Languages
Usability evaluation of Domain-Specific LanguagesUsability evaluation of Domain-Specific Languages
Usability evaluation of Domain-Specific Languages
 
Language and Offensive Word Detection
Language and Offensive Word DetectionLanguage and Offensive Word Detection
Language and Offensive Word Detection
 
GPSS interactive learning environment
GPSS interactive learning environmentGPSS interactive learning environment
GPSS interactive learning environment
 
Acceptance Testing Of A Spoken Language Translation System
Acceptance Testing Of A Spoken Language Translation SystemAcceptance Testing Of A Spoken Language Translation System
Acceptance Testing Of A Spoken Language Translation System
 
On the Globalization of Modeling Languages (June 8th, 2015)
On the Globalization of Modeling Languages (June 8th, 2015)On the Globalization of Modeling Languages (June 8th, 2015)
On the Globalization of Modeling Languages (June 8th, 2015)
 
Software development slides
Software development slidesSoftware development slides
Software development slides
 
UdayakumarArunachalam
UdayakumarArunachalamUdayakumarArunachalam
UdayakumarArunachalam
 
ESSENSE
ESSENSEESSENSE
ESSENSE
 
2014 01-ticosa
2014 01-ticosa2014 01-ticosa
2014 01-ticosa
 
IRJET- Voice to Code Editor using Speech Recognition
IRJET- Voice to Code Editor using Speech RecognitionIRJET- Voice to Code Editor using Speech Recognition
IRJET- Voice to Code Editor using Speech Recognition
 
Static analysis of textual models
Static analysis of textual modelsStatic analysis of textual models
Static analysis of textual models
 
Iterative usability evaluation of DSLs
Iterative usability evaluation of DSLsIterative usability evaluation of DSLs
Iterative usability evaluation of DSLs
 
GPSS interactive learning environment
GPSS interactive learning environmentGPSS interactive learning environment
GPSS interactive learning environment
 
Software developer occupational brief
Software developer occupational briefSoftware developer occupational brief
Software developer occupational brief
 
Script identification using dct coefficients 2
Script identification using dct coefficients 2Script identification using dct coefficients 2
Script identification using dct coefficients 2
 
Class Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP TechniquesClass Diagram Extraction from Textual Requirements Using NLP Techniques
Class Diagram Extraction from Textual Requirements Using NLP Techniques
 
D017232729
D017232729D017232729
D017232729
 
130817 latifa guerrouj - context-aware source code vocabulary normalization...
130817   latifa guerrouj - context-aware source code vocabulary normalization...130817   latifa guerrouj - context-aware source code vocabulary normalization...
130817 latifa guerrouj - context-aware source code vocabulary normalization...
 
IRJET- Speech Based Answer Sheet Evaluation System
IRJET- Speech Based Answer Sheet Evaluation SystemIRJET- Speech Based Answer Sheet Evaluation System
IRJET- Speech Based Answer Sheet Evaluation System
 
Source Code Summarization
Source Code SummarizationSource Code Summarization
Source Code Summarization
 

Mais de Iván Ruiz-Rube

Static code analysis to measure the quality of musical scores
Static code analysis to measure the quality of musical scoresStatic code analysis to measure the quality of musical scores
Static code analysis to measure the quality of musical scoresIván Ruiz-Rube
 
Cómo desarrollar fácilmente una app para Android
Cómo desarrollar fácilmente una app para AndroidCómo desarrollar fácilmente una app para Android
Cómo desarrollar fácilmente una app para AndroidIván Ruiz-Rube
 
Un framework para el despliegue y evaluación de procesos software
Un framework para el despliegue y evaluación de procesos softwareUn framework para el despliegue y evaluación de procesos software
Un framework para el despliegue y evaluación de procesos softwareIván Ruiz-Rube
 
Introducción al BI con pentaho
Introducción al BI con pentahoIntroducción al BI con pentaho
Introducción al BI con pentahoIván Ruiz-Rube
 
PseudoDSL. Un lenguaje generativo para el aprendizaje de pseudocódigo
PseudoDSL. Un lenguaje generativo para el aprendizaje de pseudocódigoPseudoDSL. Un lenguaje generativo para el aprendizaje de pseudocódigo
PseudoDSL. Un lenguaje generativo para el aprendizaje de pseudocódigoIván Ruiz-Rube
 
Herramientas para linked data
Herramientas para linked dataHerramientas para linked data
Herramientas para linked dataIván Ruiz-Rube
 
Revisiones de la literatura en Ingeniería del Software
Revisiones de la literatura en Ingeniería del SoftwareRevisiones de la literatura en Ingeniería del Software
Revisiones de la literatura en Ingeniería del SoftwareIván Ruiz-Rube
 
Desarrollo y monitorización de TFGs basados en un modelo de procesos y un eco...
Desarrollo y monitorización de TFGs basados en un modelo de procesos y un eco...Desarrollo y monitorización de TFGs basados en un modelo de procesos y un eco...
Desarrollo y monitorización de TFGs basados en un modelo de procesos y un eco...Iván Ruiz-Rube
 
Development issues on linked data weblog enrichment
Development issues on linked data weblog enrichmentDevelopment issues on linked data weblog enrichment
Development issues on linked data weblog enrichmentIván Ruiz-Rube
 
Evaluación de un ecosistema software en organizaciones de desarrollo web bajo...
Evaluación de un ecosistema software en organizaciones de desarrollo web bajo...Evaluación de un ecosistema software en organizaciones de desarrollo web bajo...
Evaluación de un ecosistema software en organizaciones de desarrollo web bajo...Iván Ruiz-Rube
 
Supporting the software process management with model driven engineering
Supporting the software process management with model driven engineeringSupporting the software process management with model driven engineering
Supporting the software process management with model driven engineeringIván Ruiz-Rube
 
Gestión de la calidad usando ingeniería dirigida por modelos
Gestión de la calidad usando ingeniería dirigida por modelosGestión de la calidad usando ingeniería dirigida por modelos
Gestión de la calidad usando ingeniería dirigida por modelosIván Ruiz-Rube
 
Quality management using mde - an overview
Quality management using mde - an overviewQuality management using mde - an overview
Quality management using mde - an overviewIván Ruiz-Rube
 
Linked Open Data: an overview
Linked Open Data: an overviewLinked Open Data: an overview
Linked Open Data: an overviewIván Ruiz-Rube
 
Publishing linked data from relational databases
Publishing linked data from relational databasesPublishing linked data from relational databases
Publishing linked data from relational databasesIván Ruiz-Rube
 
Herramientas para la mejora del proceso de desarrollo de aplicaciones J2EE
Herramientas para la mejora del proceso de desarrollo de aplicaciones J2EEHerramientas para la mejora del proceso de desarrollo de aplicaciones J2EE
Herramientas para la mejora del proceso de desarrollo de aplicaciones J2EEIván Ruiz-Rube
 

Mais de Iván Ruiz-Rube (17)

Static code analysis to measure the quality of musical scores
Static code analysis to measure the quality of musical scoresStatic code analysis to measure the quality of musical scores
Static code analysis to measure the quality of musical scores
 
Cómo desarrollar fácilmente una app para Android
Cómo desarrollar fácilmente una app para AndroidCómo desarrollar fácilmente una app para Android
Cómo desarrollar fácilmente una app para Android
 
Un framework para el despliegue y evaluación de procesos software
Un framework para el despliegue y evaluación de procesos softwareUn framework para el despliegue y evaluación de procesos software
Un framework para el despliegue y evaluación de procesos software
 
Introducción al BI con pentaho
Introducción al BI con pentahoIntroducción al BI con pentaho
Introducción al BI con pentaho
 
PseudoDSL. Un lenguaje generativo para el aprendizaje de pseudocódigo
PseudoDSL. Un lenguaje generativo para el aprendizaje de pseudocódigoPseudoDSL. Un lenguaje generativo para el aprendizaje de pseudocódigo
PseudoDSL. Un lenguaje generativo para el aprendizaje de pseudocódigo
 
Herramientas para linked data
Herramientas para linked dataHerramientas para linked data
Herramientas para linked data
 
Revisiones de la literatura en Ingeniería del Software
Revisiones de la literatura en Ingeniería del SoftwareRevisiones de la literatura en Ingeniería del Software
Revisiones de la literatura en Ingeniería del Software
 
Desarrollo y monitorización de TFGs basados en un modelo de procesos y un eco...
Desarrollo y monitorización de TFGs basados en un modelo de procesos y un eco...Desarrollo y monitorización de TFGs basados en un modelo de procesos y un eco...
Desarrollo y monitorización de TFGs basados en un modelo de procesos y un eco...
 
MDE & DSLs
MDE & DSLsMDE & DSLs
MDE & DSLs
 
Development issues on linked data weblog enrichment
Development issues on linked data weblog enrichmentDevelopment issues on linked data weblog enrichment
Development issues on linked data weblog enrichment
 
Evaluación de un ecosistema software en organizaciones de desarrollo web bajo...
Evaluación de un ecosistema software en organizaciones de desarrollo web bajo...Evaluación de un ecosistema software en organizaciones de desarrollo web bajo...
Evaluación de un ecosistema software en organizaciones de desarrollo web bajo...
 
Supporting the software process management with model driven engineering
Supporting the software process management with model driven engineeringSupporting the software process management with model driven engineering
Supporting the software process management with model driven engineering
 
Gestión de la calidad usando ingeniería dirigida por modelos
Gestión de la calidad usando ingeniería dirigida por modelosGestión de la calidad usando ingeniería dirigida por modelos
Gestión de la calidad usando ingeniería dirigida por modelos
 
Quality management using mde - an overview
Quality management using mde - an overviewQuality management using mde - an overview
Quality management using mde - an overview
 
Linked Open Data: an overview
Linked Open Data: an overviewLinked Open Data: an overview
Linked Open Data: an overview
 
Publishing linked data from relational databases
Publishing linked data from relational databasesPublishing linked data from relational databases
Publishing linked data from relational databases
 
Herramientas para la mejora del proceso de desarrollo de aplicaciones J2EE
Herramientas para la mejora del proceso de desarrollo de aplicaciones J2EEHerramientas para la mejora del proceso de desarrollo de aplicaciones J2EE
Herramientas para la mejora del proceso de desarrollo de aplicaciones J2EE
 

Último

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 

Último (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Applying static code analysis for domain-specific languages

  • 1. Applying static code analysis for domain-specific languages Iván Ruiz-Rube, Tatiana Person, Juan Manuel Dodero, José Miguel Mota, Javier Merchán Sánchez-Jara University of Cádiz (UCA) University of Salamanca (USAL) IEEE / ACM 22nd International Conference on Model Driven Engineering Languages and Systems
  • 2. Ruiz-Rube, I., Person, T., Dodero, J. M., Mota, J. M., & Sánchez-Jara, J. M. (2019). Applying static code analysis for domain-specific languages. Software & Systems Modeling, 1-16.
  • 4. Context Intro, related works and research question
  • 5. Introduction Static program analysis is a helpful technique to verify software quality features. Source code analysis tools enable to automatically discover code smells and potential errors. So, they can be used to estimate the Technical Debt (TD). TD is also suitable to describe the consequences of rash developments in several disciplines, besides software development.
  • 6. Applying static analysis to DSLs Professionals in many different areas can develop and describe problem solutions by means of a DSL that is especially defined for their own field and discipline. Ad-hoc static analysers have been developed for several DSLs: ● IEC 61131-3, EDDL and RAPID for PLC programming1 ● Puppet for Infrastructure as Code2 ● BPMN and BPEL for Business Process Models3 ● etc.1 Mandal et al., 2018, Prähofer et al., 2012 2 Sharma et al., 2016, Shambaugh et al., 2016 3 Saad et al., 2013, Heinze et al., 2018
  • 7. Research Question Typically, quality platforms are initially intended to check programs written in General-Purpose Languages (GPLs), such as Java, C++ or Python, among others... Can source code quality analysis tools be applied to software artefacts that are developed at the DSL code level?
  • 9. Scope Xtext is a widespread (+5000 Xtext grammar in GitHub) framework to create external text-based DSLs. Xtext grammars to design concrete syntax are defined by using its own specific language (≈ EBNF). The framework uses the ANTLR parser, which implements an LL top-down parse algorithm.
  • 10. Scope The SonarQube quality platform provides dashboards including quality metrics and detailed reports of issues (vulnerabilities, bugs and code smells). Supports a great number of GPLs. It is open-source. Includes a mechanism for parsing new languages and integrate new rules Parsers are implemented as Java classes that use a specific library (API) called SSLR.
  • 11. Problem The grammar format for designing DSL editors with Xtext diverges from the grammar format used by SonarQube. To accomplish the recognition of our DSLs by the quality platform is time-consuming and error-prone, especially when it comes to maintaining the consistency of grammars while evolving the language.
  • 15. Implementation Simplification: T2M (injector provided by Xtext) + M2T (Acceleo module)
  • 16. Implementation Process wrapped as Eclipse plug-ins, which provide a new command option in the contextual menu of .xtext files. It generates code analysers as SonarQube plug-ins
  • 17. Use scenarios (I) Analysing computer algorithms.
  • 18. The tool: Vary A computer environment for typing and running algorithms written with a pseudocode notation
  • 19. Case study: design & data collection Objective: Explore how the computation of metrics for analysing the algorithms written with the Vary tool can help teachers to automatically assess their students’ programming assignments. Settings: 31 students of “Introduction to Programming” in the Degree of Computer Engineering Procedure: 1. Students had to develop with Vary an algorithm. 2. Teacher manually revised and marked the students’ assignments according to her own correctness, validity and maintainability criteria. 3. Student marks were computed by applying some linear adjustment functions on the metrics and quality rules provided by SonarQube.
  • 20. Applying Xtext2Sonar To analyse algorithms in pseudocode, it is necessary to create the Java artefacts required by SonarQube. 1300 lines of Java code were automatically generated from the Xtext grammar file of Vary containing a total of 95 rules.
  • 21. Support in SonarQube (metrics & quality rules)
  • 22. Case study: results Low/medium correlation between the maintainability degree manually estimated by the teacher and the value computed with support of the SonarQube metrics Insights: ● The tool could be measuring other criteria that were not actually taken into account during the manual reviewing, or vice versa. ● Formulas for learning assessment should be continuously improved on a regular basis ● It assures the accurate application of the same criteria for all the students → more sustainable and fairer assessment
  • 24. The tool: LilyPond Provides musicians with a DSL to type chord notes combining melody and lyrics and then generates the graphical output
  • 25. Case study: design & data collection Objective: Checking if automatic metrics computation for analysing the quality of Lilypond music sheets is suitable for musicians Settings: 20 musicians (researchers, teachers, musicologist, postgraduate students). Procedure: 1. Fill in a pretest questionnaire 2. Analyse a given sheet music with the naked eye 3. Compare their findings with the syntactic error or bad practice warnings issued by SonarQube. 4. Fill in a final questionnaire
  • 26. Applying Xtext2Sonar To analyse music sheet, it is necessary to create the Java artefacts required by SonarQube. 1050 lines of Java code were automatically generated from the Xtext grammar file of LilyPond containing a total of 82 rules.
  • 27. Support in SonarQube (guideline rules)
  • 28. Case study: results Learnability: Have you been able to access to SonarQube and visualise the errors and bad practices issued by the tool for the sheet music made with LilyPond? (Yes/No) → 93,8% of the musicians with experience with composition software said Yes Efficiency: Do you think that the errors and warnings issued by SonarQube correspond to the ones you found when you observed the sheet music in PDF? (Yes/No) → 65% of the participants gave us a positive response Satisfaction: Would you consider the inclusion of this type of tool to analyse the quality of sheet music? (Yes/No) → 100% of the participants with experience with music software responded affirmatively. Utility: How useful would you consider this tool? (0-10)
  • 30. Conclusion Problem: DSL toolkits do not include support for advanced analytics (reports and alerts, derived metrics, charts, historical data and so on) Scope: Xtext languages (ANTLR LL* grammars) and the SonarQube platform Solution: providing a model-driven based tool that automatically builds language recognisers for quality platforms. Use cases: Vary, LilyPond and others (v.g. Sculptor, TANGO and Eclipse SmartHome)
  • 31. Conclusion Limitation: the entire process is not completely automated ● Developers must include practitioners’ specific metrics and quality rules by programming AST visitors in Java or XPath rules Benefits: ● DSL users will harness the features of quality platforms ● DSL developers will reduce programing efforts Future works: ● Static analysis of visual DSLs, v.g., Blockly ● Model-driven development of augmented reality-based editors for DSLs (on-going, under journal review)
  • 32. Thanks Project webpage: http://tatyperson.github.io/Xtext2Sonar/ SonarQube running instance (evaluation of pseudocode project) http://vedilsanalytics.uca.es/sonarqube/dashboard/index/1 SonarQube running instance (evaluation of sheet music project) http://vedilsanalytics.uca.es/sonarqube/dashboard/index/35 ivan.ruiz@uca.es

Notas do Editor

  1. Quality management: plan, control, assure and improve the quality of the organisations, products or services. TD claims that doing things quickly and carelessly may cause future costs and effort to fix a software project.
  2. to check programs either written with the built-in languages or with new ones. is particularly prevalent nowadays, due to its flexibility to parse a great number of GPLs and its open-source nature.
  3. M1: Cyclomatic Complexity (CC) M2: Source Lines of Code (SLOC) M3: Percentage of duplicated code (DC) QR1: Algorithm with no documentation. QR2: Variable name too long. QR3: Variable name is too short and maybe is meaningless. QR4: Use of a input sentence (read) without using an output sentence (write). QR5: Too many global variables. QR6: Code lines that are too long. QR7: Procedure or function with no documentation. QR8: Lines with bad indentation.
  4. more sustainable and fairer
  5. There are no consecutive silent beats. When a note is held in the previous beat, a precautionary alteration must be included. Check that the tempo has been defined at the beginning. Check that the time change has been made correctly. The music sheet title must be defined. The music sheet composer must be defined. A page step cannot exist in a repeat volta instruction. Lines of code should not be too long.