Source code analysis, management, and visualization for PROLOG [Elektronische Ressource] / vorgelegt von Marbod Hopfner
312 pages
English

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

Source code analysis, management, and visualization for PROLOG [Elektronische Ressource] / vorgelegt von Marbod Hopfner

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
312 pages
English
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description

Source Code Analysis, Management, andVisualization for PROLOGDissertation zur Erlangung desnaturwissenschaftlichen Doktorgradesder Julius-Maximilians-Universität Würzburgvorgelegt vonMarbod Hopfneraus IphofenWürzburg, 2008Eingereicht am 27.11.2008bei der Fakultät für Mathematik und Informatik1. Gutachter: Prof. Dr. Dietmar Seipel2. Gutachter: Prof. Dr. Wolff von GudenbergTag der mündlichen Prüfung: 25.05.2009PrefaceSoftware engineering is the application of a systematic, disciplined, quantifiable approachto the development, operation, and maintenance of software. The discipline of softwareengineering encompasses knowledge, tools, and methods for defining software require-ments, and performing software design, computer programming, user interface design,software testing, and software maintenance tasks. Such software can contain millions oflines of source code, making it comparable in complexity to the most complex modernmachines. For example, a modern airliner has several millions of physical parts, while itssoftware can run to 4 million lines of code. Software engineering also draws on knowl-edge from fields such as computer engineering, computer science, management, math-ematics, project management, quality management, software ergonomics, and systemsengineering.The design, implementation and extension of computer programs is a very complexprocess. For keeping an overview of large programs it is necessary to organize and struc-ture the source code.

Sujets

Informations

Publié par
Publié le 01 janvier 2008
Nombre de lectures 19
Langue English
Poids de l'ouvrage 3 Mo

Extrait

Source Code Analysis, Management, and
Visualization for PROLOG
Dissertation zur Erlangung des
naturwissenschaftlichen Doktorgrades
der Julius-Maximilians-Universität Würzburg
vorgelegt von
Marbod Hopfner
aus Iphofen
Würzburg, 2008Eingereicht am 27.11.2008
bei der Fakultät für Mathematik und Informatik
1. Gutachter: Prof. Dr. Dietmar Seipel
2. Gutachter: Prof. Dr. Wolff von Gudenberg
Tag der mündlichen Prüfung: 25.05.2009Preface
Software engineering is the application of a systematic, disciplined, quantifiable approach
to the development, operation, and maintenance of software. The discipline of software
engineering encompasses knowledge, tools, and methods for defining software require-
ments, and performing software design, computer programming, user interface design,
software testing, and software maintenance tasks. Such software can contain millions of
lines of source code, making it comparable in complexity to the most complex modern
machines. For example, a modern airliner has several millions of physical parts, while its
software can run to 4 million lines of code. Software engineering also draws on knowl-
edge from fields such as computer engineering, computer science, management, math-
ematics, project management, quality management, software ergonomics, and systems
engineering.
The design, implementation and extension of computer programs is a very complex
process. For keeping an overview of large programs it is necessary to organize and struc-
ture the source code. For small programs, having about hundred lines of source code, it
is often sufficient to use a simple editor. But if a program grows, Integrated Development
Environments (IDEs) are needed for supporting programmers. IDEs help both newcom-
ers and expert programmers in implementing, organizing, structuring and extending their
programs. Using an IDE for analyzing source code, calculating metrics, refactoring or
visualizing methods is useful. Call graphs can be used for human understanding of pro-
grams, or as a basis for further analyses, such as tracking the flow of values between
procedures [69].
The declarative language PROLOG is very appropriate for analyzing and refactoring
source code. Using its symbolic computation and meta-programming techniques, we can
nicely analyze source code in a structural representation such as XML. We have designed
the tool SCAV (Source Code Analysis and Visualization) consisting of the libraries RAR
(Reasoning about Rules), VISUR (Visualization of Rules), and the software repository
PROSORE. These libraries support
• software metrics and source code statistics,
• program slicing and refactoring, and
• visualization of code structures.
iiiThis dissertation is organized in five parts: Part I, the Background, introduces source
code analysis and visualization. Chapter 1 explains some well known software develop-
ment processes. We sketch basic software engineering methods, and we explain software
metrics, design patterns, and software repositories. In Chapter 2, we introduce the declar-
ative programming language PROLOG, we list some existing Integrated Development En-
vironments (IDE) for PROLOG, and we present some typical PROLOG refactorings.
Part II deals with the management and analysis of source code. Chapter 3 explains
the structure of the used software repository PROSORE in detail. We use XML as the
basic data structure for complex data, such as programs or graphs. Chapter 4 introduces
the basic RAR methods and contains some examples of source code analysis in PRO-
LOG, such as source code statistics, and predicate spectra. We give some examples how
to change the basic predicates, in order to visualize and analyze languages other than
PROLOG, and we present case studies for PHP, and JAVA. Chapter 5 describes slicing of
PROLOG source code.
Part III deals with the visualization of source code. We have implemented a graph li-
brary based on the Graph eXchange Language GXL. Our graph library, which we explain
in Chapter 6, contains methods to validate and to transform GXL graphs, to layout graphs,
and to classify nodes and edges. Chapter 7 describes the GUI of SCAV. The case studies
in Chapter 7 give some examples of visualizations.
Part IV, the Conclusion, summarizes the essential parts of this work and gives an
outlook on possible extensions by further methods for source code analysis, visualization
and refactoring.
In Part V, the Appendix, we describe some configurations, XPCE programming tech-
niques and useful tools, which we have implemented.
ivAcknowledgment
During my doctorate many people crossed my path. I am grateful to all these people who
helped me in writing this thesis. First of all, I thank a lot my doctor father Prof. Dr. Di-
etmar Seipel from the University of Würzburg. Our regular meetings for developing new
ideas gave me interesting insights, and his guidance improved my work a lot. I also thank
Prof. Dr. Wolff von Gudenberg, who agreed to be my second reviewer. His suggestions
and reviewing of the thesis helped me, too.
I would also like to thank Prof. Dr. Ulrich Güntzer from the University of Tübingen for
the years in his research group and my colleagues at the University of Tübingen, Andreas
Ludwig and Bernd Heumesser, with whom I had a great working atmosphere.
I thank all proofreaders, especially my cousin, Prof. Dr. Reinhold Behringer, and
Dr. Jürgen Engbring. Both gave me critical and useful feedback. Furthermore, I thank
Andreas Klein and Andreas Vetter for their friendly help with software and operating
system problems.
Finally, I thank my parents, Elena and Wielant, and the very special Susanne for their
support and understanding – especially in the last months during the completion of this
thesis. Without them, this work would not have been possible.
vTo Susi and my parentsContents
Preface iii
I Background 1
1 Software Engineering, Development and Programming Tools 5
1.1 Software Development . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Software Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.3 Design Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.4 Call Dependencies and Program Slicing . . . . . . . . . . . . . . . . . . 16
1.5 Software Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2 Software Engineering and PROLOG 19
2.1 Integrated Development Environments for PROLOG . . . . . . . . . . . . 20
2.2 PROLOG Refactorings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
II Management and Analysis of Source Code 29
3 The Software Repository PROSORE 35
3.1 Representation of Source Code in PROLOGML . . . . . . . . . . . . . . 37
3.1.1 Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.1.2 Hierarchy Tree and Exported Predicates . . . . . . . . . . . . . . 44
3.1.3 Management of PROLOGML using PL4XML . . . . . . . . . . . 51
3.2 The PROSORE Database . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.2.1 The Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.2.2 Basic Access Methods . . . . . . . . . . . . . . . . . . . . . . . 62
3.2.3 Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3.2.4 Call Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.2.5 The Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.2.6 Predicate Groups and Meta-Call Predicates . . . . . . . . . . . . 77
ixCONTENTS
4 Source Code Analysis 83
4.1 Call Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.1.1 Calls between Predicates, Files and Packages . . . . . . . . . . . 85
4.1.2 Strongly Connected Components . . . . . . . . . . . . . . . . . 92
4.1.3 Dependencies in PROLOG, JAVA or PHP . . . . . . . . . . . . . . 93
4.2 Anomalies, Software Metrics, and Design Patterns . . . . . . . . . . . . 97
4.2.1 Undefined Predicates and Dead Code . . . . . . . . . . . . . . . 99
4.2.2 Predicate Properties . . . . . . . . . . . . . . . . . . . . . . . . 109
4.2.3 File Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
4.2.4 PROLOG Design Patterns . . . . . . . . . . . . . . . . . . . . . . 114
4.3 Spectra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.3.1 Predicate Spectra . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.3.2 Package Spectra . . . . . . . . . . . . . . . . . . . . . . . . . . 126
5 Slicing 129
5.1 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5.2 Special PROLOG Constructs . . . . . . . . . . . . . . . . . . . . . . . . 136
5.2.1 Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
5.2.2 Consults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5.2.3 Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5.2.4 Test Predicates . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
III Visualization of Source Code 141
6 A Graph Library Based on GXL 145
6.1 Layout of Extended GXL Documents . . . . . . . . . . . . . . . . . . . . 145
6.1.1 The GXL Document Extensions for Layout . . . . . . . . . . . . 146
6.1.2 Layout Methods . . . . . . . . . . . . . . . . . . . . . . . . . . 156
6.2 Basic Methods for GXL Documents . . . .

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents