IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

19
IntensiVE A Toolsuite For Documenting and Checking Structural Source-Code Regularities Kim Mens 1 Andy Kellens 2 1 Département d’Ingénierie Informatique Université catholique de Louvain, Belgium 2 Programming Technology Lab Vrije Universiteit Brussel, Belgium

description

Presentation at CSMR 2006 on "IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities"

Transcript of IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

Page 1: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 2: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 3: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 4: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 5: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 6: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 7: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 8: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 9: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 10: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 11: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 12: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

Intensional ViewEditor

www.intensional.be

Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure

Page 13: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

View ConsistencyChecker

www.intensional.be

Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure

Page 14: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

Relation Editorwww.intensio

nal.be

Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure

Page 15: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

Relation checkerwww.intensio

nal.be

Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure

Page 16: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

View Displayerwww.intensio

nal.be

Intensional Views & Relations ❄ IntensiVE ❄ Codifying Structural Regularities ❄ Co-Evolution of Code and Structure

Page 17: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 18: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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

Page 19: IntensiVE - A Toolsuite For Documenting and Checking Structural Source-Code Regularities

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