Date post: | 29-Nov-2014 |
Category: |
Technology |
Upload: | kimmens |
View: | 612 times |
Download: | 3 times |
IntensiVEA Toolsuite For Documenting
and Checking Structural Source-Code Regularities
Kim Mens 1
Andy Kellens 2
1 Département d’Ingénierie InformatiqueUniversité catholique de Louvain, Belgium
2 Programming Technology LabVrije Universiteit Brussel, Belgium
Research Problem
• How to document structural source-code regularities?• e.g., naming and coding conventions, as well as
other structural dependencies• shared by many entities spread throughout the code
• How to verify conformance of this documentation to the source code upon evolution?• and provide fine-grained feedback to the developer
in case of problems• to fix the code or refine the documented regularities
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Solution
• Intensional Views• groups of entities spread throughout the code• that share some structural property
• Intensional Relations• binary relationships between such views
• The IntensiVE toolsuite• supports definition of intensional views and relations• enables the verification of constraints on them• provides fine-grained feedback upon problems
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
2 Case Studies
• DelfSTof• Smalltalk prototype for code mining with FCA• Documented interesting regularities before
restructuring• Reverified validity of regularities after restructuring
• SmallWiki• Smalltalk implementation of a WIKI system• Documented regularities on an initial version• Verified validity of regularities on evolved version
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Intensional Views(and Relations)
• Simplified example• Extensional vs. intensional views• Alternative intensions• Relations between views
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Simplified Example
BankAccountowneramountincrease(amount)decrease(amount)calculateInterest()saveToDisk()
SavingsAccount
calculateInterest()saveToDisk()
CheckingAccount
calculateInterest()saveToDisk()
YouthAccount
calculateInterest()expenseLimit()saveToDisk()
BankCardaccountpay(amount)checkPin()saveToDisk()
CreditCard
pay(amount)enoughCredit()saveToDisk()
Source-code View
Collection of source-
code entities
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Extensional vs. Intensional Views
Accounts
CheckingAccount
SavingsAccount
YouthAccount
Extensional
"All subclasses of
BankAccount"
if subclass(?entity,[BankAccount])
Intensional
Evaluate
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Alternative IntensionsAccounts
"All subclasses of
BankAccount"
if subclass(?entity,[BankAccount])
"All classes in
package
BankAccount"
if classInPackage(?entity,BankAccount)
Exclude: BankAccount
=
Extensional ConsistencyIntensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Intensional Relation
Intensional Relations
Accounts
Account changing
Methods
Bankcards
Persistence
Methods
Accounts
Account changing
Methods
Bankcards
Persistence
Methods
reference
implement
implement
call
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Intensional RelationsAccount changing
Methods
Persistence
Methodscall
All account changing methods must call a persistence method
Q1 x ∈ V1; Q2 y ∈ V2: x r yQ1,Q2 ∈ {∀,∃,!"#$"%%%}
V1,V2 ∈ Viewsr = predicate over source-
code entitiesIntensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
∀ x ∈ "Account changing methods"∃ y ∈ "Persistence Methods"
x calls y
The IntensionalView Environment
• Seamlessly integrated with Visualworks 7.x• IntensiVE comprises:
• IntensiVE builds upon:
Intensional View EditorView Consistency CheckerRelation EditorRelation CheckerView Displayer
StarBrowser2SOUL + NewLicor(MOOSE + CodeCrawler)
www.intensional.be
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Intensional ViewEditor
www.intensional.be
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
View ConsistencyChecker
www.intensional.be
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Relation Editorwww.intensio
nal.be
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Relation checkerwww.intensio
nal.be
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
View Displayerwww.intensio
nal.be
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
Methodological Aspects
Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure
• When using IntensiVE we advocate an incremental and iterative methodology akin to XP testing
• Document regularities by need• Documented regularities are isolated• Document and check regularities frequently• Checking regularities can be done automatically• Failed checks indicate where things need to be fixed• Improves our understanding of the code• Gives us confidence that code is structure as desired• Lightweight set of tools, seamlessly integrated with IDE
Summary
• Light-weight approach similar to XP-testing• Documentation and verification of structural
regularities/coding conventions• Fine-grained feed-back on inconsistencies between
code and documentation
Want to know more ?
• Contact :• Kim Mens ([email protected])• Andy Kellens ([email protected])
• Publications :• TOOLS1999 SEKE2002 ICSM2003 ESUG2005
ICSM2005 (2) CSMR2006 ECOOP2006• Or check our website :
• www.intensional.be