1 / 18

Structural Manipulations of Software Architecture Using Tarski Relational Algebra

Structural Manipulations of Software Architecture Using Tarski Relational Algebra. Paper at WCRE '98: Working Conference on Reverse Engineering, Honolulu, Oct 1998. Ric Holt University of Waterloo, Canada holt@uwaterloo.ca. Top view of concrete software architecture of 250KLOC system.

Download Presentation

Structural Manipulations of Software Architecture Using Tarski Relational Algebra

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Structural Manipulations of Software Architecture Using Tarski Relational Algebra Paper at WCRE '98: Working Conference on Reverse Engineering, Honolulu, Oct 1998. Ric Holt University of Waterloo, Canada holt@uwaterloo.ca

  2. Top view of concrete software architecture of 250KLOC system

  3. Client-server view of one subsystem of the 250KLOC system

  4. Process of view creation Source code Clustering Parser Facts extracted from code Hierarchic decomposition Grok: Fact manipulator Architectural diagram Layouter Browser

  5. r C C r a b I a I b z C C C E C C w E U U x y v w x y z v U U Example typed graph • C = { (r,a), (r,b), (a,v), (a,w) (a,x), (b,y), (b,z) } • I = { (a,b) } • E = { (b,y) } • U = { (v,w), (x,y) }

  6. Algebraic Operators Union I + E = {(a,b), (b,y)} Intersection E ^ C = {(b,y)} Difference C - E = {(r,a), (r,b), (a,v), (a,w), (a,x), (b,z)} Inverseinv E = {(y,b)} Composition I o E = {(a,y)} Identity id = {(r,r), (a, a), (b,b), (w,w) … } Transitive Cl. C+ = {(r,a), (r, b), (r,v), (r,w), (r,x), (r,y), (r,z), (a,v), (a,w), (a,x), (b,y), (b,z)} Reflex. T.C. C* = id + C+

  7. External Representation of Graphs RSF call P Q include F G store Q X contain Main P Main contain P F call Q include store G X

  8. T a c d S e V b f g h Hide transformations Graph G d T e a V f b Graph I = hideExt(G, S) Graph H = hide(hide(G,T),V)

  9. Hide transformation The hidetransformation takes a graph G that includes a hierarchical (tree) containment relation C and another relation R and a particular node S, and eliminates all descendent nodes of S, while replacing each edge from outside S to inside S by an edge to S, and each edge from inside S to outside S by an edge from S. Similarly for hideExt.

  10. When use hide transformation? Use hide when relation R is “optimistically transitive”. T a c d S e V b f g h

  11. Edged induced by hiding T a c d S e V b f g h Edges induced by edge (f,g) = all edges that hide/hideExt may cause to be drawn = all subpaths from f to g.

  12. Family relations Given containment (child) relation C: Parent P = inv C Sibling S = P o C - id Descendent D = C+ Inclusive descendent Do = C* Ancestor A = P+ Inclusive ancestor Ao = P* Super cousin K = P* o S o C*

  13. Induced cousins Given relation U (for “use”), what “higher level” relations are induced by U? Divide U into Uk (cousin edges) Ud (descendent/export/public edges) Ua (ancestor/buy edges) Induced cousin usage: Uk’ = (Do o Uk o Ao) ^ K Uk’ Do Ao Uk

  14. Induced descendent edges (export/public edges) Ud’ = (Ao o Ud o Ao) ^ D + (K o Uk o Ao) ^ D Uk’ Ao K Ud Ao Ud’ Uk Ao Not Uk’ Ao Ud K Ao Not Ud’ Uk Ao

  15. Grok: a relational calculator Program: getdb call.rsf tcall := call+ putdb both.rsf Input from call.rsf: call P Q call Q R Output to both.rsf: call P Q call Q R tcall P Q tcall Q R tcall P R P call Q call R

  16. Inducing calls up to file level “call” is a procedure call “fcall” is a file level call File File fcall main.c start.h funcdef funcdcl main startup call Procedure body Procedure header fcall := funcdef o call o inv funcdcl

  17. R b T y a S R T c S d R x Algorithms for composition and other operators Implement T := R o S Naïve implementation, O(e**2) = O(n**4) Original a R b b S c c R x y R d x S b Result a T c c T b for i : 1 .. e if type(i) = “R” then for j : 1 .. e if type(j) = “ S” & trg(i) = src (j) then create T(src(i), trg(j)) end if end for end if end for Remove duplicates

  18. Algorithm: Isolate R edges, sort these by trg Isolate S edges, sort these by src Effectively merge these 2 lists Assuming linear sort (radix sort), time is O(e). Sorted edges a R b b S c y R d x S b c R x … ... R Result a T c c T b b T y a S R T c S d R x Algorithms for composition and other operators

More Related