Ekeko Technology Showdown at SoTeSoLa 2012Coen De Roover
This document describes Ekeko, an applicative logic meta-programming library for Clojure's core.logic that allows specifying code characteristics and querying code bases declaratively. Ekeko provides relations that can represent syntactic, structural, control flow and data flow properties of code derived from the Eclipse JDT and SOOT analyses. For example, it contains a relation to find expressions that may alias at runtime. Ekeko allows incrementally building up logic queries to identify code idioms. Queries are composed of goals that core.logic searches over to return substitutions. This provides a way to programmatically query and transform code bases using logic programming.
A Recommender System for Refining Ekeko/X TransformationCoen De Roover
This document discusses an automated recommender system for refining Ekeko/X transformations. It begins by introducing logic meta-programming and how it allows querying a "database" of program information using logic relations. Templates with meta-variables and directives are used to specify transformations, and formal operators define ways to mutate templates. A genetic search evaluates templates based on precision, recall, partial matches, and directive usage to recommend refinements for better specifying transformations.
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Coen De Roover
Presented at the 21st IEEE International Conference on Program Comprehension (ICPC 2013), San Francisco (USA). Website of the paper: http://softlang.uni-koblenz.de/explore-API-usage/
This presentation introduces some advanced concepts of generics in Java. These slides introduce the following concepts:
- Generic classes and methods
- Type variable bounds
- Type erasure process
- Generics and inheritance
- Wildcard types
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Shinpei Hayashi
This document presents an approach for generating assertion code from the Object Constraint Language (OCL) using model transformations. The approach constructs a hierarchy of programming languages based on their structural similarities. This allows rules for translating OCL to be reused across multiple implementation languages, saving approximately 50% of the effort compared to creating individual translators. An evaluation implemented the approach in Maude and demonstrated its ability to generate code for Java, Python, Haskell and O'Haskell from a single OCL specification.
Sentence-to-Code Traceability Recovery with Domain OntologiesShinpei Hayashi
The document describes a technique for recovering traceability between natural language sentences and source code using domain ontologies. An automated tool was implemented and evaluated on a case study using the JDraw software. Results showed the technique worked well, recovering traceability between 7 sentences and code with higher accuracy than without using the ontology. The ontology helped improve recall and detect traceability in cases where word similarity alone did not work well. Future work is needed to evaluate on larger cases and domains.
Ekeko Technology Showdown at SoTeSoLa 2012Coen De Roover
This document describes Ekeko, an applicative logic meta-programming library for Clojure's core.logic that allows specifying code characteristics and querying code bases declaratively. Ekeko provides relations that can represent syntactic, structural, control flow and data flow properties of code derived from the Eclipse JDT and SOOT analyses. For example, it contains a relation to find expressions that may alias at runtime. Ekeko allows incrementally building up logic queries to identify code idioms. Queries are composed of goals that core.logic searches over to return substitutions. This provides a way to programmatically query and transform code bases using logic programming.
A Recommender System for Refining Ekeko/X TransformationCoen De Roover
This document discusses an automated recommender system for refining Ekeko/X transformations. It begins by introducing logic meta-programming and how it allows querying a "database" of program information using logic relations. Templates with meta-variables and directives are used to specify transformations, and formal operators define ways to mutate templates. A genetic search evaluates templates based on precision, recall, partial matches, and directive usage to recommend refinements for better specifying transformations.
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Coen De Roover
Presented at the 21st IEEE International Conference on Program Comprehension (ICPC 2013), San Francisco (USA). Website of the paper: http://softlang.uni-koblenz.de/explore-API-usage/
This presentation introduces some advanced concepts of generics in Java. These slides introduce the following concepts:
- Generic classes and methods
- Type variable bounds
- Type erasure process
- Generics and inheritance
- Wildcard types
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Shinpei Hayashi
This document presents an approach for generating assertion code from the Object Constraint Language (OCL) using model transformations. The approach constructs a hierarchy of programming languages based on their structural similarities. This allows rules for translating OCL to be reused across multiple implementation languages, saving approximately 50% of the effort compared to creating individual translators. An evaluation implemented the approach in Maude and demonstrated its ability to generate code for Java, Python, Haskell and O'Haskell from a single OCL specification.
Sentence-to-Code Traceability Recovery with Domain OntologiesShinpei Hayashi
The document describes a technique for recovering traceability between natural language sentences and source code using domain ontologies. An automated tool was implemented and evaluated on a case study using the JDraw software. Results showed the technique worked well, recovering traceability between 7 sentences and code with higher accuracy than without using the ontology. The ontology helped improve recall and detect traceability in cases where word similarity alone did not work well. Future work is needed to evaluate on larger cases and domains.
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...Coen De Roover
Presentation at the Postdoctoral symposium of the 2011 International Conference on Software Maintenance, accompanying the paper
http://soft.vub.ac.be/Publications/2011/vub-soft-tr-11-11.pdf
Detecting Occurrences of Refactoring with Heuristic SearchShinpei Hayashi
This document describes a technique for detecting refactorings between two versions of a program using heuristic search. Refactorings are detected by generating intermediate program states through applying refactorings, and finding a path from the original to modified program that minimizes differences. Structural differences are used to identify likely refactorings. Candidate refactorings are evaluated and applied to generate new states, with the search terminating when the state matches the modified program. A supporting tool was developed and a case study found the technique could correctly detect an actual series of refactorings between program versions.
This presentation introduces the main features of Scala, an object oriented and functional programming language. The main focus of the slides is to show how the language implements natively some of the patterns and best practices that are no present in other programming languages, such as Java, C++ and so on.
In detail, the presentation spans these concepts:
- Language's main syntax
- Classes, abstract classes, objects and traits (mixin)
- The Option class
- An introduction to generics
- Implicit classes
- Functions
- Recursion (simple and tail)
- Currying
- Call by value / name
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
The document discusses extending the PHP Development Toolkit (PDT) in Eclipse. It provides examples of how to extend PDT by registering build participants and AST visitors to integrate validation rules. Quick fixes can also be added to automatically fix problems. The document recommends using Eclipse's JavaScript support to dynamically extend PDT through scripting instead of Java for PHP developers. This allows customizing PDT distributions and potentially writing PHP plugins in PHP.
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...Khushboo Jain
this presentation includes information about - subprograms,packages,use clause, aliases,resolved signals,components,configuration,generate statements,concurrent statments and use of vhdl in simulation and synthesis.
This document provides a summary of key Java concepts including keywords, packages, character escape sequences, collections, regular expressions, JAR files, and commonly used tools. It includes a table listing Java keywords with their descriptions and examples. The document is intended to give an overview of core aspects of the Java language.
This document provides a summary of key aspects of the Java programming language including:
- Java keywords and their usage
- Standard Java packages and common collections/algorithms
- Formatted output using printf
- Primitive data types in Java
The document discusses various aspects of VHDL including enumerated types, subtypes, constants, arrays, strings, and different architecture modeling styles like dataflow, behavioral, and structural. Enumerated types allow defining a set of named values for a type. Subtypes restrict a base type to a range of values. Constants contribute to readability and portability. Arrays define ordered sets of elements of the same type indexed by integers. Strings are arrays of characters. Architecture bodies specify the internal logic of an entity using components, concurrent signal assignments, sequential processes, or a combination.
Java Exception Handling, Assertions and LoggingRiccardo Cardin
This presentation introduces the java exception handling mechanisms. In detail, the main focus of the slides is to show how the language implements its exception handling polices, such as:
- Checked and uncheked exception
- Try / catch blocks
- Assertions
- Logging
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This document provides an overview of key concepts in the Java programming language, including:
- Java is an object-oriented language that is simpler than C++ and supports features like platform independence.
- The Java development environment includes tools for compiling, debugging, and running Java programs.
- Java programs work with basic data types like int and double, as well as user-defined classes, variables, and arrays.
- The document explains operators, control structures, formatting output, and the basics of classes and objects in Java.
Qcon2011 functions rockpresentation_scalaMichael Stal
Scala functions provide powerful ways to decompose problems and harness the benefits of functional programming. The presentation introduces core concepts of functional programming using Scala as an example language, highlighting how Scala combines object-oriented and functional programming. It presents benefits like immutability, higher-order functions, and improved concurrency while avoiding past performance issues through modern virtual machines and libraries.
Generics and Collections
The document discusses generics and collections in Java. It defines generics as a style of programming that allows algorithms to operate on objects of different types while providing compile-time type safety. The Java collections framework supports generics to specify the type of objects stored in a collection. Common collection classes like ArrayList, LinkedList, and HashMap are discussed along with their key characteristics.
This presentation introduces some advanced concepts of threads, as implemented in the Java platform. It is part of a series of slides dedicated to threads. This slides introduces the following concepts:
- Callable
- Futures
- Executors and executor services
- Deadlocks (brief introduction)
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
The document provides an overview of Linden Script Language (LSL) by outlining its basic concepts, data types, flow control statements, states, functions, and event handling. LSL is used to attach behaviors to objects in Second Life and has syntax similar to Java with an implicit state machine for each script. Multiple scripts can be attached to an object to create new behaviors by combining specific functions.
Unit I Advanced Java Programming Courseparveen837153
This document provides information about an Advanced Java Programming course taught by Dr. S.SHAIK PARVEEN. It includes details about the course such as prerequisites, objectives, units, and basic Java syntax concepts covered. The document outlines topics like variable declarations, operators, control flow statements, arrays, and object-oriented programming concepts in Java. It aims to teach students advanced Java programming skills like implementing object-oriented principles, working with classes, methods, and threads, as well as creating applets, GUI components, and Java beans.
Qcon2011 functions rockpresentation_f_sharpMichael Stal
This document provides an overview of functional programming concepts and introduces the F# programming language. It discusses core FP topics like immutable values, recursion, and higher-order functions. It then presents an introduction to F#, explaining that it combines object-oriented and functional programming. The document provides examples of basic F# syntax like functions, pattern matching, and the type system. It also illustrates concepts like currying, lazy evaluation, and the pipeline operator.
The document describes an algorithm for tolerating crash failures in distributed systems called the algorithm of mutual suspicion (AMS). AMS allows the backbone of a distributed application to tolerate failures of up to n-1 of its n components. Each node runs one agent of the backbone consisting of 3 tasks: D for the system database, I for monitoring "I'm alive" signals, and R for error recovery. The coordinator periodically sends "I'm alive" messages and assistants reply with acknowledgments. If a node does not receive the expected messages, it enters a suspicion period and may deduce a crashed component and initiate recovery actions.
Accord.Net: Looking for a Bug that Could Help Machines Conquer HumankindPVS-Studio
Articles discussing the results of analysis of open-source projects are a good thing as they benefit everyone: some, including project authors themselves, can find out what bugs lurk in a project; others discover for themselves the static analysis technology and start using it to improve their code's quality. For us, it is a wonderful means to promote PVS-Studio analyzer, as well as to put it through some additional testing. This time I have analyzed Accord.Net framework and found lots of interesting issues in its code.
The document discusses various behavioral diagrams in UML including use case diagrams, sequence diagrams, collaboration diagrams, state machine diagrams and activity diagrams. It provides details on how to model scenarios and interactions using these diagrams, including modeling conditional paths, asynchronous messages, procedural vs flat sequencing, and how interaction diagrams relate to use cases at different levels of abstraction.
Conflict-Free Replicated Data Types (PyCon 2022)Rebecca Bilbro
Jupyter Notebook may be one of the most controversial open source projects released in the last ten years! Love them or hate them, they’ve become a mainstay of data science and machine learning, and a significant part of the Python ecosystem. While Jupyter can simplify experimentation, rapid prototyping, documentation, and visualization, it often impedes version control, code review, and test coverage. Dev teams must accept the good with the bad… but what if they didn’t have to? In this talk we introduce conflict-free replicated data types (CRDT), a special object that supports strong consistency, and which can be used to enhance Jupyter notebooks for a truly collaborative experience.
First proposed by Shapiro et al in 2011 conflict-free replicated data types (CRDTs) evolved out of the Distributed Systems community for replication of data across a network of replicas. CRDTs are objects that come with a special guarantee — namely, that two different copies of that object can be strongly consistent, meaning they can be kept in sync. While CRDTs have enjoyed a good amount of attention from academia over the last years, primarily amongst database and cloud researchers, they have not led to many practical applications for everyday developers. However, recent work by Kleppmann et al shows CRDTs can be used for real-time rich-text collaboration — creating a “Google doc”-type experience with any document in a networked file system.
In this talk, we’ll present the basics of CRDTs and demonstrate how they work with examples written in Python. Next, we’ll explain how CRDTs can enable more collaborative Jupyter notebooks, opening up features such as synchronous insertions, diffs, and auto-merges, even with multiple simultaneous contributors!
A Logic Meta-Programming Foundation for Example-Driven Pattern Detection in O...Coen De Roover
Presentation at the Postdoctoral symposium of the 2011 International Conference on Software Maintenance, accompanying the paper
http://soft.vub.ac.be/Publications/2011/vub-soft-tr-11-11.pdf
Detecting Occurrences of Refactoring with Heuristic SearchShinpei Hayashi
This document describes a technique for detecting refactorings between two versions of a program using heuristic search. Refactorings are detected by generating intermediate program states through applying refactorings, and finding a path from the original to modified program that minimizes differences. Structural differences are used to identify likely refactorings. Candidate refactorings are evaluated and applied to generate new states, with the search terminating when the state matches the modified program. A supporting tool was developed and a case study found the technique could correctly detect an actual series of refactorings between program versions.
This presentation introduces the main features of Scala, an object oriented and functional programming language. The main focus of the slides is to show how the language implements natively some of the patterns and best practices that are no present in other programming languages, such as Java, C++ and so on.
In detail, the presentation spans these concepts:
- Language's main syntax
- Classes, abstract classes, objects and traits (mixin)
- The Option class
- An introduction to generics
- Implicit classes
- Functions
- Recursion (simple and tail)
- Currying
- Call by value / name
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
The document discusses extending the PHP Development Toolkit (PDT) in Eclipse. It provides examples of how to extend PDT by registering build participants and AST visitors to integrate validation rules. Quick fixes can also be added to automatically fix problems. The document recommends using Eclipse's JavaScript support to dynamically extend PDT through scripting instead of Java for PHP developers. This allows customizing PDT distributions and potentially writing PHP plugins in PHP.
PPT ON VHDL subprogram,package,alias,use,generate and concurrent statments an...Khushboo Jain
this presentation includes information about - subprograms,packages,use clause, aliases,resolved signals,components,configuration,generate statements,concurrent statments and use of vhdl in simulation and synthesis.
This document provides a summary of key Java concepts including keywords, packages, character escape sequences, collections, regular expressions, JAR files, and commonly used tools. It includes a table listing Java keywords with their descriptions and examples. The document is intended to give an overview of core aspects of the Java language.
This document provides a summary of key aspects of the Java programming language including:
- Java keywords and their usage
- Standard Java packages and common collections/algorithms
- Formatted output using printf
- Primitive data types in Java
The document discusses various aspects of VHDL including enumerated types, subtypes, constants, arrays, strings, and different architecture modeling styles like dataflow, behavioral, and structural. Enumerated types allow defining a set of named values for a type. Subtypes restrict a base type to a range of values. Constants contribute to readability and portability. Arrays define ordered sets of elements of the same type indexed by integers. Strings are arrays of characters. Architecture bodies specify the internal logic of an entity using components, concurrent signal assignments, sequential processes, or a combination.
Java Exception Handling, Assertions and LoggingRiccardo Cardin
This presentation introduces the java exception handling mechanisms. In detail, the main focus of the slides is to show how the language implements its exception handling polices, such as:
- Checked and uncheked exception
- Try / catch blocks
- Assertions
- Logging
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This document provides an overview of key concepts in the Java programming language, including:
- Java is an object-oriented language that is simpler than C++ and supports features like platform independence.
- The Java development environment includes tools for compiling, debugging, and running Java programs.
- Java programs work with basic data types like int and double, as well as user-defined classes, variables, and arrays.
- The document explains operators, control structures, formatting output, and the basics of classes and objects in Java.
Qcon2011 functions rockpresentation_scalaMichael Stal
Scala functions provide powerful ways to decompose problems and harness the benefits of functional programming. The presentation introduces core concepts of functional programming using Scala as an example language, highlighting how Scala combines object-oriented and functional programming. It presents benefits like immutability, higher-order functions, and improved concurrency while avoiding past performance issues through modern virtual machines and libraries.
Generics and Collections
The document discusses generics and collections in Java. It defines generics as a style of programming that allows algorithms to operate on objects of different types while providing compile-time type safety. The Java collections framework supports generics to specify the type of objects stored in a collection. Common collection classes like ArrayList, LinkedList, and HashMap are discussed along with their key characteristics.
This presentation introduces some advanced concepts of threads, as implemented in the Java platform. It is part of a series of slides dedicated to threads. This slides introduces the following concepts:
- Callable
- Futures
- Executors and executor services
- Deadlocks (brief introduction)
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
The document provides an overview of Linden Script Language (LSL) by outlining its basic concepts, data types, flow control statements, states, functions, and event handling. LSL is used to attach behaviors to objects in Second Life and has syntax similar to Java with an implicit state machine for each script. Multiple scripts can be attached to an object to create new behaviors by combining specific functions.
Unit I Advanced Java Programming Courseparveen837153
This document provides information about an Advanced Java Programming course taught by Dr. S.SHAIK PARVEEN. It includes details about the course such as prerequisites, objectives, units, and basic Java syntax concepts covered. The document outlines topics like variable declarations, operators, control flow statements, arrays, and object-oriented programming concepts in Java. It aims to teach students advanced Java programming skills like implementing object-oriented principles, working with classes, methods, and threads, as well as creating applets, GUI components, and Java beans.
Qcon2011 functions rockpresentation_f_sharpMichael Stal
This document provides an overview of functional programming concepts and introduces the F# programming language. It discusses core FP topics like immutable values, recursion, and higher-order functions. It then presents an introduction to F#, explaining that it combines object-oriented and functional programming. The document provides examples of basic F# syntax like functions, pattern matching, and the type system. It also illustrates concepts like currying, lazy evaluation, and the pipeline operator.
The document describes an algorithm for tolerating crash failures in distributed systems called the algorithm of mutual suspicion (AMS). AMS allows the backbone of a distributed application to tolerate failures of up to n-1 of its n components. Each node runs one agent of the backbone consisting of 3 tasks: D for the system database, I for monitoring "I'm alive" signals, and R for error recovery. The coordinator periodically sends "I'm alive" messages and assistants reply with acknowledgments. If a node does not receive the expected messages, it enters a suspicion period and may deduce a crashed component and initiate recovery actions.
Accord.Net: Looking for a Bug that Could Help Machines Conquer HumankindPVS-Studio
Articles discussing the results of analysis of open-source projects are a good thing as they benefit everyone: some, including project authors themselves, can find out what bugs lurk in a project; others discover for themselves the static analysis technology and start using it to improve their code's quality. For us, it is a wonderful means to promote PVS-Studio analyzer, as well as to put it through some additional testing. This time I have analyzed Accord.Net framework and found lots of interesting issues in its code.
The document discusses various behavioral diagrams in UML including use case diagrams, sequence diagrams, collaboration diagrams, state machine diagrams and activity diagrams. It provides details on how to model scenarios and interactions using these diagrams, including modeling conditional paths, asynchronous messages, procedural vs flat sequencing, and how interaction diagrams relate to use cases at different levels of abstraction.
Conflict-Free Replicated Data Types (PyCon 2022)Rebecca Bilbro
Jupyter Notebook may be one of the most controversial open source projects released in the last ten years! Love them or hate them, they’ve become a mainstay of data science and machine learning, and a significant part of the Python ecosystem. While Jupyter can simplify experimentation, rapid prototyping, documentation, and visualization, it often impedes version control, code review, and test coverage. Dev teams must accept the good with the bad… but what if they didn’t have to? In this talk we introduce conflict-free replicated data types (CRDT), a special object that supports strong consistency, and which can be used to enhance Jupyter notebooks for a truly collaborative experience.
First proposed by Shapiro et al in 2011 conflict-free replicated data types (CRDTs) evolved out of the Distributed Systems community for replication of data across a network of replicas. CRDTs are objects that come with a special guarantee — namely, that two different copies of that object can be strongly consistent, meaning they can be kept in sync. While CRDTs have enjoyed a good amount of attention from academia over the last years, primarily amongst database and cloud researchers, they have not led to many practical applications for everyday developers. However, recent work by Kleppmann et al shows CRDTs can be used for real-time rich-text collaboration — creating a “Google doc”-type experience with any document in a networked file system.
In this talk, we’ll present the basics of CRDTs and demonstrate how they work with examples written in Python. Next, we’ll explain how CRDTs can enable more collaborative Jupyter notebooks, opening up features such as synchronous insertions, diffs, and auto-merges, even with multiple simultaneous contributors!
Integrating Cloud Services in Behaviour Programming for Autonomous RobotsCorrado Santoro
This document discusses integrating cloud services into behavior programming for autonomous robots. It introduces PROFETA, a framework for programming robot behaviors using a BDI model. PROFETA allows defining behaviors with rules but synchronous execution can cause issues for slow cloud services. CLEPTA is introduced as a decoupling layer to asynchronously execute cloud service sensors and actions. It uses service invokers and proxies asynchronous sensors and actions. This allows a robot to respond to voice commands using asynchronous cloud text-to-speech and speech-to-text services.
This document summarizes a study of the socio-technical evolution of the Eclipse open source project over multiple releases. Formal concept analysis was used to cluster people and software components into concepts based on their associations through bug reports. This revealed hierarchies showing expertise levels and potential coordination issues. The approach provides a more scalable and intuitive representation of socio-technical relationships than bipartite graphs.
This document summarizes a study of the socio-technical evolution of the Eclipse open source project over multiple releases. Formal concept analysis was used to cluster people and software components into concepts based on their associations through bug reports. This revealed hierarchies showing expertise levels and potential coordination issues. The approach provides a more scalable and intuitive representation of socio-technical relationships than bipartite graphs.
The document discusses several advanced use cases for profiling applications using the XDS560 Trace tool and Advanced Event Triggering (AET) logic on Texas Instruments processors, including interrupt profiling to analyze interrupt servicing times, statistical profiling to identify functions consuming the most cycles, thread-aware profiling to generate a cycle-accurate execution graph of thread-based applications, and generating a thread-based dynamic call graph from captured trace data.
This document outlines how AP&P (Aspect-oriented Programming with Aspectual Programming Components) components can be used to model aspects. It describes the key elements of AP&P components including participants, expected operations, replacements, and new operations/fields. It provides examples of how aspects can be defined using AP&P components to instrument access operations. It also discusses how aspects can be deployed with applications using connectors, and how aspects can be composed by deploying them simultaneously with the same application.
Collaborative modeling and co simulation with destecs - a pilot studyDaniele Gianni
The document describes a pilot study conducted using the DESTECS collaborative modeling and co-simulation approach. The study involved developing models of a line-following robot using both discrete-event and continuous-time modeling formalisms. The models were integrated using the DESTECS co-simulation engine. Faults were then modeled and experiments conducted to test fault tolerance mechanisms. The results demonstrated the feasibility of the DESTECS concepts and identified areas for further work, such as model construction methods and design of experiments.
The document discusses attention mechanisms and their implementation in TensorFlow. It begins with an overview of attention mechanisms and their use in neural machine translation. It then reviews the code implementation of an attention mechanism for neural machine translation from English to French using TensorFlow. Finally, it briefly discusses pointer networks, an attention mechanism variant, and code implementation of pointer networks for solving sorting problems.
Traditional profilers provide CPU time profiling information but do not provide insight into which specific domain objects are responsible for performance issues. Domain-specific profilers address this by instrumenting the domain of interest to capture runtime information about specific domain objects and their behavior, then presenting the results in a way that relates performance to the domain. This allows pinpointing which objects are actually causing performance problems rather than just methods or code sections.
This document discusses aspect-oriented programming (AOP) and how it helps separate cross-cutting concerns from business logic. It defines key AOP concepts like advice, pointcuts, join points and aspects. It also explains how AOP frameworks like Spring and AspectJ implement AOP and how AOP addresses issues like tangling and scattering of concerns in code.
Если нашлась одна ошибка — есть и другие. Один способ выявить «наследуемые» у...Positive Hack Days
Ведущий: Асука Накадзима (Asuka Nakajima)
Практика повторного использования исходного кода позволяет сократить расходы на разработку программного обеспечения. Тем не менее, если в оригинальном исходном коде кроется уязвимость, она будет перенесена и в новое приложение. Докладчик расскажет о необычном способе обнаружения «наследуемых» уязвимостей в бинарных файлах без необходимости обращаться к исходному коду или символьным файлам.
C++ (pronounced "see plus plus") is a computer programming language based on C. It was created for writing programs for many different purposes. In the 1990s, C++ became one of the most used programming languages in the world.
The C++ programming language was developed by Bjarne Stroustrup at Bell Labs in the 1980s, and was originally named "C with classes". The language was planned as an improvement on the C programming language, adding features based on object-oriented programming. Step by step, a lot of advanced features were added to the language, like operator overloading, exception handling and templates.
C++ is an object-oriented programming language created by Bjarne Stroustrup in 1985 that maintains aspects of C while adding object-oriented features like classes. C++ can be used to create small programs or large applications across many domains. Key concepts covered include functions, classes, inheritance, polymorphism, and memory management techniques like realloc() and free().
Smart pointers help solve memory management issues like leaks by automatically freeing memory when an object goes out of scope. They support the RAII idiom where resource acquisition is tied to object lifetime. Common smart pointers include std::shared_ptr, std::unique_ptr, std::weak_ptr, which help avoid leaks from exceptions or cycles in object graphs. make_shared is preferable to separate allocation as it can allocate the object and control block together efficiently in one allocation.
This document provides an agenda for a presentation on esoteric LINQ and structural madness. The agenda includes background information on data structures like graphs, trees, and lists. It also covers design patterns like iterator, observer, visitor, and specification. The document then provides primers on LINQ and how it can be applied to functions, graphs, and specifications. The presentation aims to explore advanced and unconventional applications of LINQ through functional combinators and predicate logic.
Similar to Detecting aspect-specific code smells using Ekeko for AspectJ (20)
The Cha-Q Meta-Model: A Comprehensive, Change-Centric Software RepresentationCoen De Roover
The Cha-Q Meta-Model provides a comprehensive representation of software systems that interconnects 1) the state and evolution of system entities, 2) individual changes to entities, and 3) system snapshots under version control. It defines classes to represent concepts like entities, states, changes, and snapshots. The meta-model is object-oriented and memory efficient through identifier-based state tracking. It underlies upcoming tools for analyzing, repeating, and tracing changes to software systems.
CrimeSPOT: Language Support for Programming Interactions among Wireless Senso...Coen De Roover
CrimeSPOT is a domain-specific language for programming active wireless sensor network (WSN) applications using an event-based middleware. It aims to minimize accidental complexity so developers can focus on the essential complexity. CrimeSPOT allows specifying node interactions declaratively through rules and specifying which rules govern which nodes to enable reuse within and among WSN apps. It is tailored towards active WSN applications to handle issues like sensor readings expiration and subsumption as well as tracking reactions so they can be compensated if no longer warranted.
The STADiUM language framework for capturing domain-specific interaction patt...Coen De Roover
1. The STADiUM language framework captures domain-specific interaction patterns through CrimeSPOT, a domain-specific language for programming wireless sensor network interactions.
2. CrimeSPOT specifies interactions declaratively using distributed interaction rules to publish facts on the network and invoke application logic.
3. An example wireless sensor network application written in CrimeSPOT for monitoring tent comfort levels is implemented in 73 lines of code through the use of macros, mappings, and other CrimeSPOT features.
UbiLab@SOFT: A tale of ubiquitous bears, flyswatters and punching bags in ed...Coen De Roover
Slides of my presentation at the 2010 open day of the Software Languages Lab in which I outlined the lab's educational activities that involve ubiquitous or physical computing using microcontrollers and the Scheme programming language.
Logic-based program transformation in symbiosis with EclipseCoen De Roover
"Logic-based program transformation in symbiosis with Eclipse" as presented at the 2011 Seminar Series on Advanced Techniques & Tools for Software Evolution in Koblenz.
Logic-based program transformation in symbiosis with Eclipse
Detecting aspect-specific code smells using Ekeko for AspectJ
1. Detecting aspect-specific code smells
using Ekeko for AspectJ
Coen De Roover Johan Fabry
Software Languages Lab Pleiad Lab - DCC
Vrije Universiteit Brussel University of Chile
2. Aspect-oriented programming
... modularizes cross-cutting concerns
aspect 1 aspect 3
aspect 2
Aspect
Weaver
core application functionality
woven output code
pointcut
specifies program points at which the aspect intervenes
advice
behavior to invoke at points selected by a pointcut
3. Code smells in aspect-oriented programs
2.3 Detecting Lazy Aspects
This bad smell, initially defined in [M.P. Monteiro, 2005], occurs if an aspect has
... symptoms of suboptimal implementation
few responsibilities, and its elimination could result in benefits during mainte-
nance activities. Sometimes, this responsibility reduction is related to previous
refactoring or to unexpected changes in requirements (planned changes that did
not occur, for instance).
e.g., [Piveta07] Definition 03 Consider an aspect α. The crosscutting members of α are the
collection of all advice, pointcuts, declare constructions and inter type declara-
large aspects tions directly defined in α. Consider η as the number of crosscutting members of
α. An aspect is considered a lazy one whenever the predicate η == 0 holds. The
advices with anonymous pointcuts
function could be defined as: f (α) = η == 0
To detect lazy aspects, a similar approach to the Large Aspect bad smell is
lazy aspects taken. The LazyAspectASTVisitor creates bad smell events whenever an aspect
without crosscutting members is found (see Listing 4).
1 public c l a s s LazyAspectASTVisitor extends
BadSmellsASTVisitor {
2 public void e n d V i s i t ( T y p e D e c l a r a t i o n node ) {
3 super . e n d V i s i t ( node ) ;
4 i f ( ( ( A j T y p e D e c l a r a t i o n ) node ) . i s A s p e c t ( ) )
5 i f ( getNumberOfMembers ( ) == 0 ) {
6 BadSmellsEvent e v e n t = new BadSmellsEvent ( ) ;
7 e v e n t . setType ( ” Lazy Aspect ” ) ;
8 ...
9 }
10 }
11 } but:
Listing 4: AST visitor responsible for the detection of the Lazy Aspect bad smell
extrapolated from OO smells
rather informal specification
4. Assumption-based code smells
... aspect/aspect aspect/base assumptions
Aspect–Aspect Coordination
Inter-Aspect Inter-Advice Inter-Process
Deployment ITDs Super-Aspect Wormhole Advice Execution
Structure Sequence
Sub-Aspect
Precedence
Aspect Structure
[Zschaler11] Assumptions
Aspect–Base Coordination
Synchronisation Architecture Coding Patterns
Managed Monitor Communication Data Code Code
by Context Sharing Advised Called
Figure 1: Top-level aspect assumption categories identified
assumption: Examples. The Glassbox aspect JxtaSocketMonitor assumes
to have precedence over its super-aspect AbstractMonitor.
thread t. Conversely, let ef (a, t) indicate that ad
executing in thread t.3 Then, we might formal
This is the default semantics of AspectJ. However, an assumption that advice a1 ∈ A assumes previous executio
remains that this is not changed by any declare precedence
behaviour A1 introduces or to introduce base behaviour that A1 ψ aspect 1 .G¬es (a1 , t )U∃t2 .ef (a2 , t2 ).4
among other things, this A ⇒ ∀tassumes that 1the Observer-Pattern
can then modify. If A1 requires Aanywhere in the code.
clauses 2 to be deployed because it uses aspect is only woven into the system for data updates (and not, for as
Examples. For example, MobileMedia has an
inter-type definitions (ITDs) defined in A2 , this may be influenced by declare prece- creation).
Discussion. Precedence is classified with example, for data MusicAndVideo, which is deployed when a
the other ITD assumptionsdence clauses directly referencing a set of aspects, but also quite
below. Beyond the general case, we have identified a specifictwo pieces o
tures are selected. This provides variation,
tool support: warn when advice precedence DAG is not completely connected
indirectly. For example, AbstractMonitor defines an interface defines a marker interface that isother reacting to
A special case is when an aspect A1 has been introduced to re-
between two other aspects aspect A3
where one aspect forming some setup code, the then used by
solve a feature interactionLowerPrecedence. AnyA2 and implementing this aspect in a declare parents clause. In thisClearly, ther
another interface items installed by the first advice. case, the
(or more). In this case, will automatically receive lower precedence thansecond aspect assumes deployment of the first, so that the semantics
there will be an inclusion assumption AbstractMo- here that the first advice has run before the seco
warn about aspects that override implicit precedence
ψA1 ⇒ d(A2 ) ∧ d(A3 ).
nitor. Discussion. If broken, this type of assumptio
of the marker interface are operationalised.
However, AspectJ’s declare precedence clause can also pected behaviour or errors at runtime. For ex
Examples. MobileMedia uses aspects to configure different prod- For example, Glassbox defines interface MonitoredType.
be used to make precedence assumptions explicit. Then, if they are bileMedia case, if the setup code were not to be
ucts of a product line. For example, deploying PhotoAndMu- has been done for the a top-level interface, but is documented touser, bec
continuously check assumptions made explicit in code
violated, ajc will produce an error. This
sicAspect implies features for both photo and music manage-
This is defined as feature would not be accessible to the “start
[the] agent when loading any such type. Should be added to any
5. Eclipse plugin
causally connected
Ekeko
applications
program querying
program transformation
corpus mining
meta-programming library
for Clojure’s core.logic
logic meta-programming
specify code characteristics declaratively, leave search to logic engine
applicative meta-programming
script queries over workspace
manipulate workspace
7. Applicative logic meta-programming
... core.logic in a nutshell
embedding of logic programming
port of Kanren [Friedman, Kiselyov, Bird] to Clojure by David Nolen
no operational impurities (e.g., cut), yet high performance
features tabling, extensible constraints, extensible unification protocols
core.logic
logic goals
functions that take a substitution
either return a possibly infinite stream of substitutions (success) or nil (failure)
constructors:
always success: s#, always failure: f#, success if arguments unify: ==
composing goals
introduces lexically scoped variables
chains goals together abstraction
(fresh
[?x
?y] (defn
g
[?y]
(fresh
[?x
?y]
(conde
(fresh
[]
(==
?x
?y)
[(==
?x
1)
..]
(==
?y
5)))
(==
?x
5)))
[(==
?x
5)
..]))
(fresh
[?x]
interleaves substitutions from goals
(g
?x))
8. Applicative logic meta-programming
... using relations provided by the Ekeko library
syntactic
concern
characteristics { structural
control flow
data flow
JDT DOM
derived
from
{ JDT Model
control flow graph
SOOT data flow analyses
AspectJ weaver
(defn
aspect-declaredsuper+
"Relation between an aspect and one of its declared ancestors.”
[?aspect ?ancestor]
(conde
[(aspect-declaredsuper ?aspect ?ancestor) ]
[(fresh [?super]
(aspect-declaredsuper ?aspect ?super)
(aspect-declaredsuper+ ?super ?ancestor))]))
9. Example queries
... using Ekeko for AspectJ
(ekeko* [?advice1 ?advice2 ?shadow] two advices operating on the
(advice-shadow ?advice1 ?shadow) same join point shadow
(advice-shadow ?advice2 ?shadow)
(!= ?advice1 ?advice2))
(ekeko* [?declaringaspect ?intertype ?member ?targettype]
(aspect-intertype ?declaringaspect ?intertype)
(intertype-member-type ?intertype ?member ?targettype)
(aspect ?targettype))
aspect adding a member to another
aspect through an intertype declaration
advice operating on a join point shadow
stemming from an intertype declaration
(ekeko* [?advice ?shadow ?intertype]
(intertype-element ?intertype ?shadow)
(advice-shadow ?advice ?shadow))
10. Code smells
... related to precedence graph
(defn
incomplete-precedence precedence DAG is
not fully connected
[?first ?second]
(all
(aspect ?first) an aspect may assume default
(aspect ?second) precedence is never changed
(!= ?first ?second)
(fails (aspect-dominates-aspect ?first ?second))
(fails (aspect-dominates-aspect ?second ?first))))
(defn
overriden-implicit-precedence aspect overrides implicit
precedence
[?first ?second]
(all
(aspect-dominates-aspect ?second ?first)
(aspect-dominates-aspect-implicitly+ ?first ?second)))
inverse assumption made explicit
11. Code smells
... related to aspect hierarchy
(defn
pointcut concretizing
pointcut-concretizedby abstract pointcut from
[?abstractpc ?concretepc] super aspect
(fresh [?abaspect ?concaspect ?name]
(aspect-super+ ?concaspect ?abaspect)
(aspect-pointcutdefinition ?abaspect ?abstractpc)
(aspect-pointcutdefinition ?concaspect ?concretepc)
(pointcut-name ?abstractpc ?name)
(pointcut-name ?concretepc ?name)))
aspect introducing pointcut assumes it
is not already defined unless behavior of
super does not need to be maintained
(defn
abstractpointcut-concretized-reconcretized pointcut
[?abpointcut ?concpointcut1 ?concpointcut2] concretized
twice
(all
(pointcut-concretizedby ?abpointcut ?concpointcut1)
(pointcut-concretizedby ?concpointcut1 ?concpointcut2)))
12. Code smells
... related to intertype declarations
(defn
modifies-aspect
[?modifier ?modified]
(fresh [?advice ?shadow]
(aspect-advice ?modifier ?advice)
aspect modifies (advice-shadow ?advice ?shadow)
another aspect (shadow-enclosingtypedeclaration ?shadow ?modified)
(aspect ?modified)))
(defn an intertype declaration introduces
a method that is never called
intertypemethod-unused
[?itmethod]
(fresh [?caller]
(intertypemethod ?itmethod)
(fails
(soot-method-called-by-method ?itmethod ?caller)))))
13. Code smells
... related to behavioral patterns
public aspect WormholeAspect {
pointcut entry(int save):
execution(* BaseClass.method1(int)) && args(save);
pointcut exit() :
execution(* BaseClass.method2());
int store;
before(int savedarg) : entry (savedarg) {
this.store = savedarg;
}
before() : exit() {
System.out.println("Wormholed value is: "+ store);
}
} assumes it is the
wormholed value
15. Conclusions
logic-based specifications
Ekeko provides actual tool support
of smells related to implicit aspect assumptions
moving from structurally to behaviorally characterized
Ongoing work
designing annotation library for making assumptions explicit
continuously cross-check explicit and derived assumptions
empirical study
script Ekeko against AspectJ corpus
https://github.com/cderoove/damp.ekeko [.aspectj]