Скачать презентацию Secrets from the Monster Extracting Mozilla s Software Architecture Скачать презентацию Secrets from the Monster Extracting Mozilla s Software Architecture

f80d3d83666dad8d855cb1cfaffeb3a3.ppt

  • Количество слайдов: 18

Secrets from the Monster: Extracting Mozilla’s Software Architecture Michael W. Godfrey Eric H. S. Secrets from the Monster: Extracting Mozilla’s Software Architecture Michael W. Godfrey Eric H. S. Lee Software Architecture Group Dept of Comp Sci, Univ of Waterloo

Background n Reverse engineering tools can aid in recovering from “architectural drift” n n Background n Reverse engineering tools can aid in recovering from “architectural drift” n n n RE tool: Fact extractor, manipulator, visualizer Examples: PBS, Acacia, Rigi, TKSee, SHri. MP, … Fact extractors vary in quality, detail, robustness, languages supported, … n n Extractor interoperability has proven to be a huge headache RE subtools often tightly coupled

Architectural Reconstruction System Artifacts Extractors Source Code Repository View Generation Scanning Visualization Manipulation Parsing Architectural Reconstruction System Artifacts Extractors Source Code Repository View Generation Scanning Visualization Manipulation Parsing Executing System Profiling Source Control Change Reporting Extracted Facts Architecture

Motivation 1. Want to create architecture models of C++ systems, esp. Mozilla n 2. Motivation 1. Want to create architecture models of C++ systems, esp. Mozilla n 2. Is there a “better” C extractor? n 3. How do extractors compare quali/quantitatively? Want to investigate data exchange between RE tools n 4. Options: DIY … or … Gen++, Datrix, Acacia Wo. SEF to be held tomorrow (Later) want to build BEAGLE: n a tool for exploring program evolution

Extractor interoperability n … just like western civilization n n Need to agree on Extractor interoperability n … just like western civilization n n Need to agree on n Researchers want this to work, tho Syntax (TA, XML, SQL) Semantic models (AST, CFG/DFG, Sw. Arch) Co. SET-99 paper: n n n TAXFORM suggested Exploration of problems: unique naming, entity resolution, entity location (line numbers) Preliminary case studies

Exchange Format Reqs n n n [CASCON ’ 98] Support multiple source languages Scale Exchange Format Reqs n n n [CASCON ’ 98] Support multiple source languages Scale to MLOC systems Provide mapping to source code Support static & dynamic dependencies Incremental approach Extensible, allowing new schemes to be defined as needed

TAXForm Utopia TAXForm Utopia

Transforming Between Schemas Universal High-Level Procedural Object-Oriented PL/I C Dali C PBS C C++ Transforming Between Schemas Universal High-Level Procedural Object-Oriented PL/I C Dali C PBS C C++ Rigi C Java

TAXform — High level schema TAXform — High level schema

TAXform — Procedural schema TAXform — Procedural schema

“Facts”: PBS vs. Acacia n PBS produces output in TA n tuples describe attributes “Facts”: PBS vs. Acacia n PBS produces output in TA n tuples describe attributes of program entities/relationships: funcdcl read. h file. Close funcdef read. c file. Close linkcall file. Close get. File. Size n Acacia produces two “; ” delimited plain-text DBs: entity. db and relationship. db n Use SQL-like queries to get raw text output: cdef -u func - def=dec cref -u - - m – file 2=’*. h’

Translation Nuts and Bolts n Acacia C model close to PBS’s n 1: 1 Translation Nuts and Bolts n Acacia C model close to PBS’s n 1: 1 relationship between most kinds of facts; translation via awk and ksh scripts n … but “linkcall” harder as n acacia already does resolution of “f calls g” to the function defs; cfx does resolution at a later stage no transitive closure for “includes” Solution: simple grok program n n Ccia problems: n n less robust on some C systems generates multiple UIDs sometimes

Guinea Pig #1: VIM text editor n Examined VIM version 5. 6: n n Guinea Pig #1: VIM text editor n Examined VIM version 5. 6: n n n 149 source files (. c, . h, . pro) over 160 KLOC of K&R C Extraction results: Time (min: sec) gcc compile 6: 29 — cfx extraction 4: 27 43, 000 cia extraction n # facts 1: 52 + 3: 20 51, 000 Differences due to macro expansion, lib. var. refs, and missed fcn calls

Vim’s architecture Vim’s architecture

Guinea Pig #2: Mozilla browser n n “Open source” cousin of Netscape Examined Milestone Guinea Pig #2: Mozilla browser n n “Open source” cousin of Netscape Examined Milestone 9 (M 9): n n Over 7400 files, 2 MLOC of C and C++ Extraction results: Full compile 0: 35 hrs Fact extraction (Ccia) 3: 30 hrs Fact manipulation (grok) 3: 00 hrs # of facts extracted 990, 000

Mozilla extraction details n Much extra work required: n n Reconfigured PBS to understand Mozilla extraction details n Much extra work required: n n Reconfigured PBS to understand OOPL schema Complete rewrite of translation scripts (into perl) for efficiency Some source code tweaking More complex name mangling needed

Mozilla’s architecture Mozilla’s architecture

Summary n Created automated mechanisms for using the Acacia fact extractors within the PBS Summary n Created automated mechanisms for using the Acacia fact extractors within the PBS rev. eng. system n n Tested on two large guinea pigs This work serves as an initial step towards data exchange between reverse engineering tools. n See proc. of Wo. SEF-00 for more discussion of this general topic.