Gail C. Murphy
Reflexion
Models: Models*
Sullivan
Dept.
Engineering
Dept.
of Computer
Science
98195-2350
Virginia.
{gmurphy,
notkin}(lcs.Washington.edu
Abstract
Software stance, municate problem most source helps ture which engineers box and about with always code. often arrow an use high-level sketches) software is that an model respect models system. they approach of the are to the (for inOne althat strucIn and
Introduction
engineers system found these about in often terms think about an existing models. Alreafor instance, used,
Software software are often though soning always source. Current high-level derived their very
to reason
and
com-
of high-level whiteboards.
existing with
models developed
sketches models
systems
on engineers
an engineer of an existing
in terms
as a lens source
through code.
systems
particular, specifies then where where The flexion proach, proach The
a high-level to the
model
model
source. that
model source.
the engineers
agrees
with
characterization aspects of applying of different in the paper to NetBSD, of 250,000 him of the approach and Excel with computed
discusses
practical
the models
an exam-
illustrative
by Wong
the application plementation code. eral global tual applied tal product. In only reflexion overview memory to aid
models
developed enables
an approach, an engineer
models
in
an engineer
1, that
a useful, vir-
NetBSD
from
reengineering
of the
source between
code, the
a declarative
mapping
*This scholarship.
research and
in part
by the NSF
grant
computed source
CCR-8858804
NSERC
post-graduate
engineers
engineer
Permission to make digitallhard copies of all or part of this material without fee is granted provided that the copies are not made or distributed for profit or commercial advantage, the ACM copyrightkerver notme, the title of the publication and its date appear, and notice is given that copyright is by permission of the Association for Computing Machinery, Inc. (ACM). To copy otherwise? to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. SIGSOFT 95 Washington, D.C., USA 01995 ACM 0-89791 -716-2/95/0010...$3.50
as necessary, compute
to iteratively
spelling
differentiates
the field
of reflective
computing
approach
key aspects
In
Section that
of the with
/ \
Detines
engineers
the
flexibility
y. Section
7 considers
related
work.
An
Example
our with
systems himself
To convey
basic
approach,
we describe virtual
models implement
Y3=-q
Input Source Code O* Extraction Tool Produces Source Model
a developer ory
Input
expertise
used
in Unix
reflexion
(VM)
specified
he
be-
Figure
1: The
Reflexion
Model
Approach
lieved, tic
on his virtual
experience, memory
of Unix of
consists
a virtual between
essence, model
model system
a form
ory
calls
of a particular a variety
case, an
high-level
model.
of summarization
to engineers engineering
Microsoft
performIn
functions
was
cross-reference [Rei95],
database
and to transformat. of
awk the
[AKW79] calls
over developer
script relation
output
of Field
of
spreadsheet a several
extracted
tuples the
over
computing
3,000
source
highlighted modules
defined
map-
violated that an
the engineer
software to
ping:
architecture exist. We plifying models tools tems tion that in have the and
perceived
[ file=. developed engineers mappings. several task We techniques of defining have models As and in of also for for sim-
*pager. * ault\. fs
mapTo=Pager mapTo=VirtAddres c
] sMaint 1 1 1 1 1 1
mapTo=KernelFaultHdler mapTo=FileSystem
compute a minute
reflexion or two.
mapTo=Memory \. c mapTo=VMPolicy
mapTo=HardwareTrans
2, these for
possible ter
a few several
Each tities
line
in this
map (on
enentiThe given
understand
hundreds
of lines the
ties in the
and computation a formal system is in of re-
seeming the
a mapping NetBSD
models, of
characteriSection 3.
thousands
of entities
in the
source
function,
a reflexion of 4 through
flexibility Section
approach descriptions
of the
19
Memory
u
.:
Memory
;0:0
.
,=
HardwareTrans
v
4
I
/
I I I I
{b
,tl
I KemelFaultHdler
, ,
&)
FileSystem
Pager
I I I I I I . \ \
16
I I I
\
I I I I
d+
User
I I
VirtAddressMaint
II
I I I I I 3 ;6 I I I I I / , /
..
., ...
I I 16 1 I
(0 ;0
. User I
l-l
-
n
0
>
---> calls . . . . . . . . . .> .
Module
n
*
(a) High-level Model
(b) Reflexion
Model
Figure
2: High-level
and
Reflexion
Models
Virtual
Memory
Subsystem
20
ways.
ducing tuples.
displays The
of the
associated
source
model
snapshot
consider
Values
show their
the calldirectory
functions
structure source
functions,
including
source
are used to name line physical logical are used structure structure. to obviate
and file information. In a one hour able to iteratively several extracted during found overview plement this the reflexion session, specify, models. the VM developer was
entities
in a single
of the
mapping.
compute (The
source was
beforehand, session.) representation model of ation. the For ation that rely module.
and
it
not the
source
includes
a reflexion
providing from
with
NetBSD studying
model
was
cific
divergences,
developer on information
of FileSyst
is useful
for planning
modifica-
there functions
in modules
Formal
precise
Characterization
the meaning we present model [Spi92]. and system computation specithe Z using
VMPolicy
and
To make fication
divergences, arcs not in$tance, Pager mapped within lines model. tween mapped with model the
source from
includes
of a reflexion specification
model, language
a formal
predicted
of a reflexion
to Pager.
Reflexion
schema in
Model
Z describes state a state the that Any sysmust sys-
does not
arcs predicted
be maintained
to FileSystem.
number
state
components
each arc in the figure relation zero. and in Figure with C++ values absence
in the ReflezionModel
schema
mapped
ReflexioniWodel
uses
two
basic
HLMENTITY, model type and high-level define represents Four over entities which
of
the twenty
SMENTITY,
3000/300 small
tools,
sist of several
programs
HLMRelation
HLMTuple of tuples
graphviz to select
the types
arcs in a reflexion
model,
21
file
function
dir
file
function
Figure
3: The
Reflexion
Model
Tool
User
Interface
[HLMENTITY,
SMENTITYj
the
divergences
source
HLMReiation SMRelation HLMTuple SMTupie == == == == HLMENTITY SMENTITY HLMENTITY SMENTITY +-+ HLMENTITY ++ SMENTITY x HLMENTITY x SMENTITY
model defines a
differs where
absences model
fourth a relation
deto
r
dom The schema maintained relation defines a given
divergent operations
convergence divergences
mappedSourceA40del
an engiFor exis
absences
in interpreting
a reflexion a query
in mappedSourcehlodel
n divergences n absences = 0
necessary in Figure
shown
divergences
n absences
to declaring model, of must The of the relations that values the constraints
the static
state (below by
mappedSourceModel convergence
schema
U divergences
(above the
the
dividing
constraints The
information model
must
divergences
a reflexion by the
system.
states is only
high-level model;
to a reflexion values
described
meaningful
22
convergence have
and
divergences source
relations; model
absences
model matches
also map,
no contributing
values.
(mapl+mc)
entities entities.
to the specified
3.2 The
Computing dynamic model a source to the model (Mm?) model The type model schema, from
a Reflexion
Model
model
of mappedSourceModel the elements the map, entities. and of each resulting The each (through source
ComputeReflexionModel, the computation of a three inputs: and model. and the a high-level from highover model model ordered or more these The source is an
by
pushing
below,
describes
high-level
model
model, high-level
a mapping as a relation
element
set is associated
is described entities,
original
is described entries.
mapping
(map?)
through
set intersection
set difference
operations.
MapEntrynames entities
source entities,
one or more
high-level represents
Family
of Reflexion
defines Different depending the source function
Models
of reflexof reflexion choices deOur model inforsupproand for entity
type
source
in our
on the
defining reflexion
system
describes
MapEntry
== X (P HLMENTITY)
of structural Our tools used source function entities found reflexion mapping function model of a given
SMENTITYDESC
expressions.
entities
ated with
in the map.
Alternatively,
mapFunc
: [seq MapEntry
(P HLMENTITY)
to provide
: SMTuple
implement systems.
t ) ] x
t ) x
second
him? n (dom
divergences (dom absences =
mappedSourceModel)
4
him? l)
Experience
reflexion engineering systems language. model approach has been a variety applied of soft-
mappedSourceMode
3An additional invariant which constrains a map entry to name only high-level model entities specified in hkn?
has
on a number
of different
been elided
for presentation
purposes.
23
at models
Mito
applied
reflexion
models in
prior product
Ada
consists The
code, several
basis
times model A
a day over
minor additional
restructuring warnings
compiler students.
or at
a posited the
detailed
Performance
iteratively reflexion specify, The upon compute, rate the and inan of
of almost used
was produced
extraction engineer
from
the
The
models. in part,
valuable and
understanding
can interpret
and iterate
reflexion
mod-
t ure of Excel
planning
the reengineering
Design reflexion tectural ing tool of calls modules layering approach found An
of
provides
archi-
theoretical model,
a source
reflexion
highlighted,
to the
highre-
violations
An upper by:
bound,
on the com-
so directly. industrial partner line matched applied C++ design object reflexion mod-
of computing
the mappedSourceModel
if a 6,000 of a Booth
implementation documentation diagram This [Bo091]) case was conwhere relation, model #sm is the cardinality is number the to entry, in the cost a source and model constant, of of the source of entries comparing model #him relation. high-level the yielding: entity is the Since model in the model map, #may entity in a map high-level and of entities small
O(#sm x
#map
tcomp.rt$on) ~((#~~~)2) x
was fully
tcompa,i.on is
tion ber to comally
System models in
of the
0((#Mm)2)
computed
a reflexion
practice,
be ignored,
extracted model
imports meaningful
relation [PW92]. diverenin Our puting tation ward initial reflexion of manner implementation models described model in of tools performed the by the the for comO(#sm x #map
a conventional
of a compiler
tcompartson)
gences
of high-level explains,
of coupling difficulty
compuschema
changing
a reflexion
straightfor-
dynamic
24
in
Section fast
3.2. for
This
was systems
suffi(with of was or of to
different ware
kinds
interactions dependence,
moderately consisting
system
of thousands but
also means,
small
maps models
of lines), larger
engineers
responsibility source
to support
the iterative
compusystems version
a selected
high-level
specified
calls same
diagram
required a reflexion
on a Pentium
2a with but
an extracted the
comparing model
with
a source
representing
we have of 1).
structure
of NetBSD
would
probably
be mean-
ingless. In practice, ibility els over veloper a calls source tion their by time. and source models the with both engineers the For have exploited both engineer later data. dependence By adding implicitly a calls need diagram In both additional the this VM first flexmoddeused the static shifted to a cases, the aspects
software
and large
in a minute
changing
meaning
of their
the mat ch of high-level source entity depend model in the the entity The
for a given
example,
a source
additional
space requirements used for source entities and are in to there 2 Mb of unique tools,
model
augmented
scheme the
of func-
case of Excel
dependence,
by our
model
entities
communicates-with changes for the task of the system To models aid the
(less than
to understand,
a variety
the appropriate
space
computed relations
cent aining
ent kinds
of information,
Discussion
models permit aspects an engineer of a large to easily software exsysengi-
and high-level
structural
Maps
The
maps in may
used the
in
is to provide
enable
at low-cost, enough porting, models, and for t ask etc.). to meetthe support
engineering
to the task
at hand.
Second, to the
aspects goal
critical maps,
Generally, puted with in the formal are computed semantics A benefit of of an engimany based terest system when structure
and the
partial in the
map. areas
an engineer
about
is obtained. we applied
Sometimes,
as was the
to use reflexion
to investigate
of the compiler
25
System
Language
Mapping (Lines)
33
SPARC
20/50
(min:sec)
:00.5
c++
Ada
3,700
4,200
72
:00.2
:01
CLOS
47,000
5,855
215
:04.3
:06
250,000
15,657
:04.0
:19
(VM) Excel
1,200,000
119,637
971
15
2:13.0
4:05
Table
1: Performance
of Reflexion
Model
Tools
rough
map
was
sufficient. map
In
contrast,
in to
absences result
in the computed
model
are the
was desired
map. interpretation, an
Based enables an enthe map engineer model, tion all task. terpretation techniques gation of refining
The gineer
either
to refine that
of the inputs,
computing
wit h the level a particular to track degree changes gineer ating the evolution made
the use of some declarative of sensitivity in judging the of our mapping This
maps
an engineer querying
in the source.
of a series
of computed
amortization
detailed
maps
for large
systems,
7
Querying els bridge Ievel rize the tions arcs. engineer terpret In the gates the engineering first model selected between Based convergence, Reflexion the gap and Models between a model of in the the and Reflexion an engineers source. source, t he source and absences captures modhighThe while connecmodel the to insumma-
Related
Work
The to ours and reverse culled engineerincomfor include a com-
approaches
mappedSourceModel
representations
Examples and
of this
information, of queries a specific an engineer contributing second determine that This were query the map to In the
statistically-based [Sch91]. of ways. the archithem. and highin uses the infer high-level
architectural Reflexion First, in our high-level tectural Second, source level tive,
model
engineer
specifies
of query, model
source
comparing mappings
rather source
on discovering
values
models. associating
in the
an engineer complete
contrast operational
to approaches mappings.
whether
26
differs
from
our explicit
approach
by enabling models
an of
of abstraction mapping.
through
an explicit
and
to build
software the
structure investigation by
support models
of substructure of abstraction.
a subsystem)
computing levels
8
A
Summary
reflexion from model source summarizes code into accurate a software three The a high-level refiexion in the by until the information a high-level to support engineering model, model context engineer. computes The have exmodel an engitask. a source presents of the The sucfeabeen from
at various
Comparison
for [0ss84]. a fixed type
Ossher
has
comparison
of relational
defines
inputs
to a reflexion
The intent is to
the
of a system
and tems permits tion tate viates intended of the of the enforce [0ss87, an
specify,
structure
summary
pg.
219]. to
The choose
mechanism descripto system annodeis not structure two mapping models be-
engineer software
and iteratively
structure structure
satisfied.
the
actual the
approach
in a numranging
specify but
lines of code.
t ween
provided system
the
engineer.
Acknowledgments
Jacksons partial els) source cannot Aspect a model that to program data to be uses of flow Aspect [Jac93] (high-level extracted the static between of a source type data system focusing the posited from code compares modthe that specifications models bugs in
Allen,
Chow, Jackson,
detect detected
Michael on
VanHilst with
using
helped ion VM
is correct, from
source In
to Excel.
McNamee
interested from
of a design editing
conformance We
differs the
model from
of AT&T
the graphviz
also
disthe
also source.
how
high-level
anonymous
has also for developed comparing behavior [J L94]. model consisting the of of a semantic the between This the differences two versions derives effect of that exdifferin
referees
their
constructive
com-
ments.
a procedure approximate
approach semantic
References
[AKW79] A.V. Aho, B.W. Kernighan, and P.J.
a binary
relation after
dependence upon
Awk A Pattern ScanWeinberger. ning and Processing Language. Software Practice and Experience, 9(4):267-280,
1979. G. with Booth. Applications. Object-oriented Design
a procedure. at differ-
Benjamin-Cummings,
on the
of relations
1991.
27
[GN95]
Griswold Tradeoffs
and for on
ArchitecIEEE [Spi92]
ACM guages
of
LanACM,
Transactions 21(4):275-287, [Jac93] D. Jackson. pect. national and [JL94] D. Diff fects In
Z Notation. edition,
with 1993
AsInter-
[Str86]
B. Stroustrup. guage.
C++
Summarizing Conference
12(1):46-54,
January
of Modifications.
Proceedings on Software
the International Maintenance, [KR78] B. Kernighan gramming [MK89] H.A. tem Muller for
September
Programming-in-the-large. of on 1989. A New Based Stanford Program on Structuring the 10th International Engineering,
Software
8086.
April
IEEE
Computer
Society
[0ss84]
H .L. Ossher, Mechanism PhD ber thesis, 1984. Ossher. the Wegner, MIT
Layered
Graphs. Decem-
University,
[0ss87]
H, fying ter in
A Structure In
for
SpeciLayered
Systems.
Bruce
and
Pepages
Directions
Object-Oriented
Ousterhout.
@ the TX
Toollcat.
Addison-Wesley, [PW92] D.E. tions ture. Perry for the ACM and Study
1994. A. Wolf. Engineering 1992. Programming Integrated and 1995. Tool for ReConpages EnEnviFoundaArchitecNotes,
of Software
Learning
Development.
Academic An
In Pro-
[Smi84]
B.C. in
Reflection Proceedings
and of
28