A Multiple Phases Approach for Design Patterns Recovery Based on Structural and Method Signature Features

2018 ◽  
Vol 6 (3) ◽  
pp. 36-52
Author(s):  
Mohammed Ghazi Al-Obeidallah ◽  
Miltos Petridis ◽  
Stelios Kapetanakis

Design patterns describe both structure, behavior of classes and their relationships. They can improve software documentation, speed up the development process and enable large-scale reuse of software architectures. This article presents a multiple levels detection approach (MLDA) to recover design pattern instances from Java source code. MLDA is able to recover design pattern instances based on a generated class level representation of a subject system. Specifically, MLDA presents what is the so-called Structural Search Model (SSM) which incrementally builds the structure of each design pattern based on the generated source code model. Moreover, MLDA uses a rule-based approach to match the method signatures of the candidate design instances to that of the subject system. As the experiment results illustrate, MLDA is able to recover 23 design patterns with reasonable detection accuracy.

e-xacta ◽  
2016 ◽  
Vol 9 (1) ◽  
pp. 37
Author(s):  
Cristiano Martins Monteiro ◽  
Flavianne Braga Campos de Lima ◽  
Carlos Renato Storck

<p>A geração automática de código-fonte é uma prática adotada no desenvolvimento de softwares para agilizar, facilitar e padronizar a implementação dos projetos. Embora seja uma prática comum nas fábricas de software, não se conhece uma ferramenta que permita escolher o padrão de projeto a ser usado. O objetivo principal deste trabalho é apresentar um gerador de códigos para o desenvolvimento de sistemas Web a partir de uma modelagem entidade-relacionamento, uma linguagem de programação e um padrão de projeto determinados pelo usuário. Os objetivos específicos são propor uma arquitetura do sistema capaz de adequar e reaproveitar diferentes padrões de projeto, linguagens de programação e projetos cadastrados; permitir que o usuário cadastre, altere, exclua, importe e exporte um projeto; e gerar automaticamente o seu código-fonte e scripts de banco de dados. Este trabalho se justifica pela importância de reduzir erros de codificação; e evitar perca tempo ao realizar atividades rotineiras de implementação de padrões de projeto. Possibilitando assim, maior dedicação no planejamento das regras de negócios e redução de custos. A ferramenta proposta (GCER) foi desenvolvida em linguagem Java com o uso banco de dados Oracle 11g, e seguindo os padrões DAO e MVC. Os resultados foram avaliados através da geração e compilação de códigos de um projeto para cadastro de veículos. A geração com êxito evidencia a viabilidade da ferramenta proposta para a geração automática de códigos no processo de desenvolvimento de software.</p><p>Abstract</p><p>The automatic generation of source code is a practice adopted in the development of software to streamline, facilitate and standardize the implementation of projects. Although it be a common practice in software factories, it is not known a tool able to choose the design pattern to be used. The main objective of this paper is to present a code generator for the development of Web systems from an entity-relationship modeling, a programming language and a design pattern determined by the user. The specific objectives are to propose a system architecture able to suit and reuse different design patterns, programming languages and saved projects; allow the user to insert, update, delete, import and export a project; and automatically generate the source code and database scripts. This work is justified by the importance to reduce errors of coding; and to avoid waste of time in the development of Web systems performing routine tasks. Allowing, then, a greater dedication in the planning of business rules and the reduction of costs. The tool proposed (GCER) was developed in Java with the database using Oracle 11g, and following the DAO and MVC patterns. The results were evaluated by generating and compiling codes of a project for vehicle registration. The successful code generation demonstrate the feasibility of the proposed tool for the automatic generation of code in the software development process.</p>


Author(s):  
NADIA BOUASSIDA ◽  
HANENE BEN-ABDALLAH ◽  
IMENE ISSAOUI

Design patterns capitalize the knowledge of expert designers and offer reuse that provides for higher design quality and overall faster development. To attain these advantages, a designer must, however, overcome the difficulties in understanding design patterns and determining those appropriate for his/her particular application. On the other hand, one way to benefit from design patterns is to assist inexperienced designers in pattern detection during the design elaboration. Such detection should tolerate variations between the design and the pattern since the exact instantiation of a pattern is infrequent in a design. However, not all variations of a pattern are tolerated. In particular, some structural variations may result in non-optimal instantiations where the requirements are respected but the structure is different; such variations are called spoiled patterns and should also be detected and transformed into acceptable pattern instantiations. This paper first presents an improvement of our design/spoiled pattern detection approach, named MAPeD (Multi-phase Approach for Pattern Discovery). The latter uses an XML information retrieval technique to identify design/spoiled pattern occurrences in a design using, first, static and semantic information and, secondly, dynamic information. This multi-phase detection approach tolerates structural differences between the examined design and the identified design pattern. Furthermore, thanks to the matching information it collects, our identification technique can offer assistance for the improvement of a design. In its second contribution, this paper evaluates MAPeD by comparing its recall and precision rates for five open source systems: JHotDraw, JUnit, JRefactory, MapperXML, QuickUML. The latter were used by other approaches in experimental evaluations. Our evaluation shows that our design pattern identification approach has an average improvement of 9.98% in terms of precision over the best known approach.


Author(s):  
Taher Ahmed Ghaleb ◽  
Khalid Aljasser ◽  
Musab A. Alturki

Design patterns are generic solutions to common programming problems. Design patterns represent a typical example of design reuse. However, implementing design patterns can lead to several problems, such as programming overhead and traceability. Existing research introduced several approaches to alleviate the implementation issues of design patterns. Nevertheless, existing approaches pose different implementation restrictions and require programmers to be aware of how design patterns should be implemented. Such approaches make the source code more prone to faults and defects. In addition, existing design pattern implementation approaches limit programmers to apply specific scenarios of design patterns (e.g. class-level), while other approaches require scattering implementation code snippets throughout the program. Such restrictions negatively impact understanding, tracing, or reusing design patterns. In this paper, we propose a novel approach to support the implementation of software design patterns as an extensible Java compiler. Our approach allows developers to use concise, easy-to-use language constructs to apply design patterns in their code. In addition, our approach allows the application of design patterns in different scenarios. We illustrate our approach using three commonly used design patterns, namely Singleton, Observer and Decorator. We show, through illustrative examples, how our design pattern constructs can significantly simplify implementing design patterns in a flexible, reusable and traceable manner. Moreover, our design pattern constructs allow class-level and instance-level implementations of design patterns.


2019 ◽  
Vol 11 (9) ◽  
pp. 1025 ◽  
Author(s):  
Weijia Li ◽  
Conghui He ◽  
Haohuan Fu ◽  
Juepeng Zheng ◽  
Runmin Dong ◽  
...  

The on-board real-time tree crown detection from high-resolution remote sensing images is beneficial for avoiding the delay between data acquisition and processing, reducing the quantity of data transmission from the satellite to the ground, monitoring the growing condition of individual trees, and discovering the damage of trees as early as possible, etc. Existing high performance platform based tree crown detection studies either focus on processing images in a small size or suffer from high power consumption or slow processing speed. In this paper, we propose the first FPGA-based real-time tree crown detection approach for large-scale satellite images. A pipelined-friendly and resource-economic tree crown detection algorithm (PF-TCD) is designed through reconstructing and modifying the workflow of the original algorithm into three computational kernels on FPGAs. Compared with the well-optimized software implementation of the original algorithm on an Intel 12-core CPU, our proposed PF-TCD obtains the speedup of 18.75 times for a satellite image with a size of 12,188 × 12,576 pixels without reducing the detection accuracy. The image processing time for the large-scale remote sensing image is only 0.33 s, which satisfies the requirements of the on-board real-time data processing on satellites.


TEM Journal ◽  
2021 ◽  
pp. 1166-1174
Author(s):  
Akshara Pande ◽  
Vivekanand Pant ◽  
Manjari Gupta ◽  
Alok Mishra

The role of design pattern mining is a very significant strategy of re-engineering as with the help of detection one could easily understand complex systems. Of course, identifying a design pattern is not always a simple task. Additionally, pattern recovering methods often encounter problems dealing with space outburst for extensive systems. This paper introduces a new way to discover a design pattern based on an Impact Analysis matrix followed by substring match. UML diagrams corresponding to codes are created using Visual Paradigm Enterprise. Impact Analysis matrices of these UML diagrams are converted to string format. Considering system code string as main string and design pattern string as a substring, the main string is further decomposed. A substring match technique is developed here to discover design patterns in the source code. Overall, this procedure has the potential to convert the representation of system design and design pattern in ingenious shapes. In addition, this method has the advantage of moderation in the size. Therefore, this approach is beneficial for Software professionals and researchers due to its simplicity.


Author(s):  
Matt Gatrell ◽  
Steve Counsell

This paper documents a study of fault proneness in commercial, proprietary software and attempts to determine whether a relationship exists between class faults and the design context of a class, namely the coupling and cohesion of a class, and whether the class is a participant of common design patterns. The authors studied a commercial software system for a 24 month period and identified design pattern participants by inspecting the design documentation and source code; coupling and cohesion metrics were measured by inspecting the source code with a tool; we also extracted fault data for the same period to determine whether a relationship existed between the design context and the fault propensity of a class. Results showed that design pattern participant classes were marginally more fault-prone than non-participant classes, The Adaptor, Method and Singleton patterns were found to be the most fault-prone of thirteen patterns explored. Coupling was found to have a significant relationship with the fault proneness of classes in the system; efferent coupling was a stronger indicator of fault propensity than afferent coupling. Cohesion, when measured using the LCOM(HS) metric, was not found to have a strong relationship with fault proneness.


Author(s):  
Jason Smith ◽  
David Stotts

This chapter introduces the system for pattern query and recognition, a collection of formalisms, definitions, and concepts that provides a means for formally describing Design patterns from the viewpoint of design intent. These descriptions enable efficient and effective searching for instances of Design patterns in source code, for purposes of discovery, documentation, validation, or refactoring. SPQR is composed of ?-calculus, a formal denotation semantics for defining relationships between programmatic entities, elemental Design patterns, a collection of binary relationships that define the basis for software design principles, and isotopes, a flexible approach to combining formal design definitions so that they retain their conceptual integrity. It is our intent that the reader be better equipped to contemplate the hierarchical nature of the concepts of programming, and to come away from this discussion with a clearer view of how software is designed, from the small to the large.


2014 ◽  
Author(s):  
Guinther de B. Pauli ◽  
Eduardo K. Piveta

It is difficult to maintain and to adapt poorly written code presenting shortcomings in its structure. Refactoring techniques are used to improve thecode and the structure of applications, making them better and easier to modify. Design patterns are reusable solutions used in similar problems in object-oriented systems, so there is no need to recreate the solutions. Applying design patterns in the context of refactoring in a corrective way becomes a desired activity in the life cycle of a specific software system. However, in large-scale projects, the manual examination of artefacts to find problems and opportunities to apply a design pattern is a hard task. In this context, wepresent a metric-based heuristic function to detect where the Strategy designpattern can be applied in a given project. To evaluate the heuristic functionand its results we have also built a tool to show the results. This tool canexamine source code using ASTs (Abstract Syntax Trees), searching for opportunities to apply the Strategy pattern, indicating the exact location in the source code where the pattern is suggested, also showing some evidences usedin the detection.


2012 ◽  
Vol 2 (2) ◽  
pp. 112-116
Author(s):  
Shikha Bhatia ◽  
Mr. Harshpreet Singh

With the mounting demand of web applications, a number of issues allied to its quality have came in existence. In the meadow of web applications, it is very thorny to develop high quality web applications. A design pattern is a general repeatable solution to a generally stirring problem in software design. It should be noted that design pattern is not a finished product that can be directly transformed into source code. Rather design pattern is a depiction or template that describes how to find solution of a problem that can be used in many different situations. Past research has shown that design patterns greatly improved the execution speed of a software application. Design pattern are classified as creational design patterns, structural design pattern, behavioral design pattern, etc. MVC design pattern is very productive for architecting interactive software systems and web applications. This design pattern is partition-independent, because it is expressed in terms of an interactive application running in a single address space. We will design and analyze an algorithm by using MVC approach to improve the performance of web based application. The objective of our study will be to reduce one of the major object oriented features i.e. coupling between model and view segments of web based application. The implementation for the same will be done in by using .NET framework.


Author(s):  
Tran Thanh Luong ◽  
Le My Canh

JavaScript has become more and more popular in recent years because its wealthy features as being dynamic, interpreted and object-oriented with first-class functions. Furthermore, JavaScript is designed with event-driven and I/O non-blocking model that boosts the performance of overall application especially in the case of Node.js. To take advantage of these characteristics, many design patterns that implement asynchronous programming for JavaScript were proposed. However, choosing a right pattern and implementing a good asynchronous source code is a challenge and thus easily lead into less robust application and low quality source code. Extended from our previous works on exception handling code smells in JavaScript and exception handling code smells in JavaScript asynchronous programming with promise, this research aims at studying the impact of three JavaScript asynchronous programming patterns on quality of source code and application.


Sign in / Sign up

Export Citation Format

Share Document