Simülasyon yazılımlarında kod klonları
Code clones in simulation software systems
- Tez No: 323784
- Danışmanlar: PROF. DR. MUHİTTİN GÖKMEN
- Tez Türü: Yüksek Lisans
- Konular: Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve Kontrol, Computer Engineering and Computer Science and Control
- Anahtar Kelimeler: Belirtilmemiş.
- Yıl: 2012
- Dil: Türkçe
- Üniversite: İstanbul Teknik Üniversitesi
- Enstitü: Fen Bilimleri Enstitüsü
- Ana Bilim Dalı: Bilgisayar Mühendisliği Ana Bilim Dalı
- Bilim Dalı: Belirtilmemiş.
- Sayfa Sayısı: 66
Özet
Son yıllarda, yazılım dünyasındaki hızlı gelişim geniş ölçekli yazılım projelerini beraberinde getirmiştir. Boyutları hızla artan yazılım sistemlerinde, model ve kod kalitesini sağlayabilmek güçleşmiştir. Büyük yazılım sistemlerinde sıkça karşılaşılan, model ve kod kalitesini önemli ölçüde etkileyen bir parametre, bilinçli ya da bilinç dışı kullanım sonucu oluşan kod tekrarlarıdır. Bazı benzerlik tanımlarına ya da fonksiyonlarına göre benzer olan kod parçaları olarak tanımlanan kod klonları, açık kaynaklı veya endüstriyel yazılım sistemlerinde sıklıkla gözlenmektedir. Geliştiriciler tarafından benimsenen geliştirme tekniği olarak kod parçalarının küçük değişiklikler ile ya da aynen tekrar kullanımı, kod klonlarına sebep olmaktadır. Kod klonlarının yazılım sistemlerine zararları ve bazı açılardan yararları olduğu gerekçeleriyle, sistem için avantajlı ya da dezavantajlı oldukları kararı netleştirilememiş, açık bir argümandır. Sistem bakımı, yeniden düzenlemesi, hata yayılımı, tasarım kalitesi, yeniden kullanılabilirlik, performans gereksinimleri, kod anlaşılırlığı ve karmaşıklığı yönleriyle, yazılım sistemlerine zararlı oldukları düşüncesi hakimdir. Sistem üzerindeki olumsuz etkileri nedeniyle varlığı istenmeyen kod klonlarının, günümüz geniş ölçekli yazılım sistemlerinde manuel olarak tutarlı bir şekilde kaldırılması mümkün olmamaktadır. Otomatize bir yöntem ile tespit edilmesi zorunlu hale gelen bu kavramın saptanması için, literatürde birçok teknik ve araç önerilmektedir. Günümüze dek, otomatik kod klon tespiti için birçok teknik ve araç önerilmiş ve değerlendirilmiştir. Bu teknikler genel olarak, metin-tabanlı, simge-tabanlı, soyut sözdizim ağacı-tabanlı, program bağımlılık grafı-tabanlı teknikler ile tüm bu teknikler birleştirici nitelikteki melez yaklaşımlar sınıflandırılırlar. Klon tespit teknikleri ve araçları üzerine aktif birçok çalışma olsa da, çeşitli sistemlerdeki klonlama davranışını kapsamlı olarak ele alan çalışmalara sıklıkla rastlamak mümkün değildir. Klonlama üzerine gerçekleştirilen deneysel çalışmaların odağı genellikle teknikleri karşılaştırmak, geçerlemek iken, bu çalışmalar genellikle, özel sistemler üzerine klonlama karakteristiklerini çalışma amacı olarak ele almamaktadırlar. Otomatik klon tespiti için önerilen teknikler, web uygulamaları ve cihaz sürücüleri başta olmak üzere birçok farklı alanda açık kaynaklı sistemler üzerinde uygulanmıştır. Klon tespit teknikleri, ayrıca uygulama alanına dair kavramların tanımlanmasında ve yazılım üretim bandının iyileştirilmesinde de kullanılmaktadır. Bu yaklaşım, endüstriyel durum çalışmalarında şimdiye kadar denenmemiştir. xviBu çalışma, klon tespit yönteminin etkinliğini alan analizi yönüyle incelemektedir. Çalışmada, klon tespit aracı olarak CCFinder kullanılmıştır. CCFinder klon tespit aracı, simge-tabanlı algoritması ve kullandığı birçok optimizasyon tekniği ile geniş ölçekli yazılım sistemleri için verimli ve ölçeklenebilir bir çözüm niteliği taşımaktadır. Çalışmada, simge-tabanlı klon tespit yönteminden yararlanıldı. Simge-tabanlı teknik, sözdizimsel eş kopyalar olan Tip 2 klonlarının tespiti için yüksek başarıma sahiptir. Bu yaklaşımda, tüm kaynak sistem bütünüyle simge sekansına dönüştürülür. Klonlar, bu sekansın tekrar eden alt simge sekanslarını bulmak üzere taranması ile tespit edilirler. Çalışmada, dört farklı endüstriyel simülasyon yazılım sistemi incelenmiş ve değerlendirilmiştir. Simülasyon sistemlerinden kimileri aynı mimariyi kullanmakta ya da benzer takımlar tarafından geliştirilir iken, kimileri bağımsız olarak geliştirilmiştir. Birbirinden farklı büyüklüklerdeki bu sistemler, analiz için uygun çeşitliliği sağlamaktadırlar. Klon tespit yönteminin simülasyon sistemleri alan analizi için uygulanabilirliğini araştıran bir çalışma gerçekleştirilmiştir. Bu alanda dört farklı simülasyon projesi incelenmiş, uygulama alanı kavramlarının bir kümesi ile tekrar kullanılabilir bileşenler tanımlanmıştır. Bu doğrultuda, yüksek düzeyli mimariyi temel alan bir referans mimari tanımlanmıştır. Yaklaşımın verimliliğini nicel olarak ölçebilmek için tanımlanmış ve kesinleştirilmiş klon kümesi ya da tekrar kullanılabilir bileşenlerin tam ve kesin bir listesi gibi herhangi bir dayanak bulunmamaktadır. Analiz ile elde edilen sonuçların doğruluğu ve yararlılığı, uygulama alanı uzmanları ve yazılım mimarları tarafından onaylanmıştır. Klon tespit yönteminin, alan analizi ve referans mimari tanımlama/detaylandırma için uygulanabilir olduğu görülmüştür. Ayrıca, tanımlanan tekrar kullanılabilir bileşenler ile, simülasyon projelerinin tamamı için yararlı olabilecek ?Yazılım Ürün Hattı? aday bileşenleri belirlendi. Çalışma, klon büyüklüğünü, dağılımını ve yoğunluğunu sistemlerin kendi içlerinde ve birbirleri ile aralarında incelemektedir. Çalışma sürecinde gözlenen diğer sonuçlar olarak, projedeki kod satır sayısının/dosya sayısının fazla olmasının, aynı mimari altyapıya sahip olmanın, benzer geliştirme ekipleri tarafından geliştirilmenin ve benzer alan hizmeti sunmanın klon sayısını artıran etkenler olduğu görülmüştür. Projelerin kendi içlerinde gerçekleştirilen analizler ile, yazılım kalitesini artıran bakım işlemi kapsamında yeniden düzenleme çalışmalarının yoğunlaşacağı ve yüksek hata olasılığına sahip alanlara referans oluşturuldu. Ayrıca, projelerin kendi içlerindeki klonların iyi kullanılamamış ya da kullanılması gerektiği halde kullanılmamış kalıtım yapıları nedeniyle de oluştuğu görülmüştür. Bu durum, sınıf yapıları kararlarının verildiği tasarım aşamasına bağlanarak, yazılım kalitesi özelliği olarak değerlendirilen iyi kullanılmış kalıtım özelliğinin kaliteli bir tasarımdan üretilebileceğini destekler niteliktedir.
Özet (Çeviri)
In recent years, rapid development of software?s world has brought with large scale software projects. Increasing size of growing software systems made difficult to provide and ensure model and code quality. Reusing code as a result of concious or unconcious use is a parameter which is frequently encountered in large scale software systems and significantly affects quality of model and code.Code clones are defined as the segments of code which are similar according to some definition of similarity. They typically result from reusing code fragments with or without minor modifications. They can be often observed in both open source and industrial software systems.This is an open argument and indeterminate issue that code cloning is a detriment to software systems. Pros and cons of the effects of cloning on systems should be weighed by examination with respect to diverse perspectives including system maintenance, refactoring, bug propagation, design/reusability, performance requirements, code understandability. According to these views, cloning is mainly considered as harmful for software systems.Detection and removal of code clones is desired because of effects on software systems considered as detrimental. Increasing complexity and number of projects makes it costly to manually analyze commonality/variability among different systems. Therefore, an automated way for this operation is essential and detection of code clones has been an active research area over the last decades.Automated clone detection is an active field of research, and up to date, many techniques and tools have been proposed and evaluated for detection of different types of clones. While, Type 1 is an exact copy without modifications (except for whitespace and comments), Type 2 is a syntactically identical copy; changes only on variable, type, or function identifiers. Type 3 is a copy with modified/removed/added statements. Type 4 indicates functional similarity, and includes two or more code fragments that perform the same computation with different syntactic variants.The techniques behind clone detection tools are distinguished according to the type of information their analysis based on and the used algorithms. The techniques based on text, token, metric, abstract syntax trees (AST), program dependency graph (PDG) comparison, and the other hybrid techniques that combine specialized comparison.Textual Comparison is based on textual comparison of whole lines or efficient string matching based on fingerprints. Token Comparison requires the entire source code to be transformed into a sequence of tokens. Duplicated subsequences of tokens are detected thereafter. Metric Comparison relies on a set of metrics defined to compare different code fragments with each other. Abstract Syntax Tree Comparison works on parse trees or abstract syntax trees (ASTs) to find similar sub-trees as clones. Program Dependency Graph Comparison is based on using a program dependency graph. The nodes of this graph represent expressions and statements. The edges symbolize control and data dependencies. Other Hybrid Techniques combine different approaches to achieve better accuracy.Many clone detection techniques and tools have been proposed using various techniques and algorithms. These techniques have been mostly applied on open source software to analyze cloning in different domains and systems such as web applications and device drivers. Clone detection techniques have also been proposed for identifying domain concepts and enhancing software product line development. However, the effectiveness of this approach has not been evaluated yet in the context of industrial case studies.This study investigates the effectiveness of clone detection in supporting domain analysis. For the analysis, the CCFinder clone detection tool is used and evaluated on four industrial simulation software systems.In this study, a token-based code clone detection tool has been used, CCFinder. The reason for choosing this tool is that it has a precision comparable to the other techniques and yet, it has the highest recall. The tool is also pretty suitable, efficient, scalable for large scale software systems with developed optimization techniques in tool.The token-based clone detection is utitlized in this study. The technique is highly succesful for Type 2 clones which are syntactically identical copies. The token-based clone detection process in CCFinder consists of four basic steps: Lexical Analysis, Transformation, Match Detection, and Formatting. In Lexical Analysis step, each line of source code is divided into a set of tokens. In Transformation step, a set of transformation rules are applied for regularizing identifiers, and identifying structures. As such, clone detection becomes agnostic to variable names. Mapping information between the transformed and the original token sequences is stored. In Match Detection step, equivalent pairs (i.e., clones) for all the sub-strings in the token sequence are detected. In Formatting step, mapping information is used for locating the detected clones in the source code files.CCFinder uses several parameters including minimum clone length (MCL) and minimum TKS shaper level. The parameter settings (MCL=100, min. TKS=10) that are suggested for the analysis of large software systems are used in the study.CCFinder presents a metric set which points to interesting clones. Some of these metrics are used in the analysis for identifying systems? cloning behavior. CLN which represents accumulation of clones per each source code file, NIF which measures the amount of scattering of each code clone among the source code files and RAD which defines the range of source code fragments regarding a code clone in a directory hierarchy are selected for the analysis.Four different simulation systems have been studied in this study. Simulation software is widely used in many application domains to investigate real-world conditions that are difficult or costly to experiment with. TUBITAK has years of experience in developing simulation software for different type of systems (e.g., trains, submarines). The size and complexity of simulation software increases because of the complexity of the simulated systems. Systematic software reuse at the architectural level becomes essential to increase software quality and decrease the development time and costs. However, increasing complexity and number of projects makes it costly to manually analyze commonality/variability among different systems. In this study, the effectiveness of a clone detection tool has been investigated in supporting such a domain analysis. Due to confidentiality, detailed information can not be presented regarding the corresponding projects. In the rest of the paper, these projects will be referred as Project X, Project Y, Project Z, and Project T. Some of these systems share a common architectural style or they have been developed by a common team, whereas some of them have been developed independently. These projects which are at quitely different sizes are appropriate for analysis with their variety.Project Z and Project T adopt the same architectural style based on High Level Architecture (HLA). Also, the de-velopment team of Project T is a subgroup of the development team of Project Z. Project X has a separate development team, which does not follow HLA rules but adopts some of the features of HLA. Project Y has also a separate, independent development team. This project uses a simulation engine infrastructure designed for a particular application domain and it does not employ HLA. These projects have been analyzed with CCFinder to identify commonalities.A case study on utilizing clone detection for domain analysis of simulation systems have been conducted. Four industrial software systems in this domain have been analyzed. The clone size, distribution and density both within each system and across the four systems have been examined. A set of domain concepts and reusable components have been identified. Accordingly, a reference architecture based on HLA have been defined. The metrics for the (quantitative) measure of effectiveness of the approach do not exist. However, the validity and usefulness of the results were confirmed by the domain experts and software architects. As such, utilization of clone detection can be a viable approach for supporting domain analysis and definition/refinement of a reference architecture. Besides, software product line candidate components which are useful for the simulation software systems are identified with defined reusable components in this study.The clone size, distribution and density both within each system and across the four systems are examined in the study. As a result of the analysis, increased line of code or number of files of the projects, having similar architectural infrastructure, being developed by similar development team and presenting similar domian service increases cloning ratio in systems.The results of study are reference for selection of points which are focus for maintenance and refactoring processes, and also highly bugy regions, by means of the analysis within each system. Moreover, it has been experienced that one other reason of cloning is code clones within projects, which have no or bad inheritance structure or abstraction. Quality of inheritance structure is highly dependent on the quality of design phase. In this way, it is concluded that design is a quite important factor on cloning ratio of software systems.
Benzer Tezler
- Inverse dynamics control of a humanoid robot arm
İnsansı bir robot kolunun ters dinamik kontrolü
OĞUZHAN CEBE
Yüksek Lisans
İngilizce
2017
Mekatronik Mühendisliğiİstanbul Teknik ÜniversitesiMekatronik Mühendisliği Ana Bilim Dalı
PROF. DR. ŞENİZ ERTUĞRUL
- Implementation of reliability based design optimization techniques for aerospace structures
Güvenilirlik tabanlı tasarım optimizasyonu tekniklerinin hava-uzay yapıları için uygulanması
ÇAĞRI ULUCENK
Yüksek Lisans
İngilizce
2009
Matematikİstanbul Teknik ÜniversitesiEnformatik Ana Bilim Dalı
YRD. DOÇ. DR. MELİKE NİKBAY
- Developing simulation-optimization code library
Benzetim-eniyileme kod kütüphanesi geliştirilmesi
SERDAR BOZOĞLAN
Yüksek Lisans
İngilizce
2010
Endüstri ve Endüstri MühendisliğiDeniz Harp Okulu KomutanlığıYöneylem Araştırması Ana Bilim Dalı
YRD. DOÇ. DR. M. MURAT GÜNAL
- Monte carlo yöntemi ile lineer hızlandırıcı modellemesi ve dozimetrik kalite kontrolü
Monte carlo simulation of linear accelerator and dosimetric quality assurance
ÇAĞRI YAZĞAN
Yüksek Lisans
Türkçe
2016
Fizik ve Fizik MühendisliğiAkdeniz ÜniversitesiRadyasyon Onkolojisi Ana Bilim Dalı
YRD. DOÇ. DR. YİĞİT ÇEÇEN
- Simulation of orthogonal metal cutting by finite element analysis
Dik kesme işlemlerinin sonlu eleman analizi ile simulasyonu
HALİL BİL
Yüksek Lisans
İngilizce
2003
Makine MühendisliğiOrta Doğu Teknik ÜniversitesiMakine Mühendisliği Ana Bilim Dalı
PROF.DR. EMAN TEKKAYA
PROF.DR. ENGİN KILIÇ