home *** CD-ROM | disk | FTP | other *** search
/ ftp.umcs.maine.edu / 2015-02-07.ftp.umcs.maine.edu.tar / ftp.umcs.maine.edu / pub / WISR / wisr4 / proceedings / detex / luqi.detex < prev    next >
Text File  |  1992-04-05  |  19KB  |  426 lines

  1.   [12pt]  article 
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                  Software Reuse in Specification-Based Prototyping 
  11.  
  12.   Luqi 
  13.         J. McDowell 
  14.      
  15.         Computer Science Department 
  16.         Naval Postgraduate School 
  17.         Monterey, CA 93943 
  18.          
  19.     luqi@cs.nps.navy.mil 
  20.  
  21.    
  22.  
  23.  
  24.   
  25.             This  paper  explains  the  mechanisms  for  retrieving
  26.             reusable  software components used by CAPS, a computer-aided 
  27.         prototyping system  for  embedded  and  real-time
  28.             software  systems.   The  software retrieval system has
  29.             been designed to  provide  retrievals  with  both  high
  30.             precision   and   high   recall   by   exploiting   the
  31.             specifications associated with these prototypes.   This
  32.             speeds  up  software  reuse  by  enabling the system to
  33.             reduce the amount of information that a  designer  must
  34.             examine to find an appropriate reusable component.
  35.  
  36.          0.3in 
  37.         
  38.               Keywords : prototyping, component specification, software
  39.            retrieval, normalization, syntactic   semantic matching
  40.  
  41.  
  42.   Introduction 
  43.  
  44.                This paper addresses the design and implementation  of
  45.           the  automated  reusable  software  retrieval system in the
  46.           Computer Aided Prototyping System (CAPS)  .  The  purpose
  47.           of  CAPS  is to speed up prototyping for large Ada programs
  48.           that can have hard real-time constraints.   CAPS  addresses
  49.           these  goals  via  software reuse, partial code generation,
  50.           automatic  construction   of   real-time   schedules,   and
  51.           computer-aided   design  tools.   CAPS  supports  automated
  52.           retrieval of software components  based  on  specifications
  53.           expressed  in  the  prototyping  language  PSDL  .  
  54.       These
  55.           specifications  serve  a  dual  purpose:  to  document  the
  56.           requirements  and  design  of  a  prototype, and to support
  57.           accurate  retrieval  of   appropriate   reusable   software
  58.           components.
  59.  
  60.   Relation to Previous Work 
  61.  
  62.                Almost all of the tools developed to assist in reusing
  63.           software  components use one or more of the following three
  64.           approaches:  interactive  browsers,  automated   retrievals
  65.           based  on informal specifications, and automated retrievals
  66.           based on  formal  specifications.   Browsers  are  easy  to
  67.           implement  and  they are provided as backup methods by many
  68.           systems, including  CAPS,  but  they  rely  on  the  user's
  69.           knowledge  of  the structure of the library and can require
  70.           examination of  the  entire  library  in  the  worst  case.
  71.           Automated    retrieval   facilities   based   on   informal
  72.           specifications are also provided by many systems.  The most
  73.           popular  variants are keyword searches (CAPS, the Operation
  74.           Support  System  OSS),  multi-attribute  queries  based  on
  75.           faceted   classification  (CAPS,  DRACO,  RAPID,  OSS,  the
  76.           Reusable Software Library, the Common Ada Missile  Packages
  77.           project  CAMP),  and  natural  language  searches (Reusable
  78.           Software Library).  CAPS also supports retrievals based  on
  79.           formal  specifications.   Formal specifications can support
  80.           more  accurate  retrievals  than  informal  specifications,
  81.           although retrievals can be potentially time consuming.  The
  82.           CAPS system alleviates this problem via a  layered  set  of
  83.           increasingly   refined  filters,  so  that  the  more  time
  84.           consuming methods are applied only to relatively small sets
  85.           of components.
  86.  
  87.   Software Base Functions 
  88.  
  89.                The CAPS software base management system must  perform
  90.           three   main   tasks:  query  by  specification,  component
  91.           browsing, and component  transformation.   The  ability  to
  92.           query   the  software  base  to  find  software  components
  93.           satisfying a given PSDL specification is an essential  part
  94.           of   the   rapid  prototyping  method  supported  by  CAPS.
  95.           Component browsing gives the designer the ability to locate
  96.           and  view  components in a manner other than by PSDL query,
  97.           and provides  interim  bottom-up  guidance  for  developing
  98.           decompositions until automated assistance for this function
  99.           can be developed.   Component  transformation  is  required
  100.           once  a  reusable  component  is located to materialize any
  101.           needed generic instantiations in a form consistent with the
  102.           coding conventions of the CAPS execution support system.
  103.  
  104.   Query by Specification 
  105.  
  106.                The  CAPS  software  base  stores  components  in   an
  107.           object-oriented  database  and  uses PSDL specifications as
  108.           the basis for high recall queries.  Each  stored  component
  109.           consists of a PSDL specification, a PSDL description of the
  110.           implementation, the implementation code, and  a  normalized
  111.           version of the PSDL specification. The syntax and semantics
  112.           of the PSDL specification are used to direct the search for
  113.           a component.
  114.  
  115.                Figures 1 and 2 summarize the steps necessary to store
  116.           components  in the software base and to retrieve them using
  117.           a given query specification. Components to be  stored  must
  118.           first  pass  through  syntactic  and semantic normalization
  119.           (see Figure 1).  The normalization processes transform  the
  120.           component's PSDL specification to facilitate later matching. 
  121.           Syntactic normalization  involves primarily format  changes 
  122.           and  statistical calculations  while semantic normalization   
  123.           involves specification expansion and transformations.
  124.  
  125.                Figure 2  shows  the  general  process  for  component
  126.           retrieval.  A  query  for  a library component is formed by
  127.           constructing  the  PSDL  specification  for   the   desired
  128.           component.  The  query  specification  is syntactically and
  129.           semantically normalized and then matched against the stored
  130.           specifications.
  131.  
  132.                The  retrieval   process   starts   with   a   faceted
  133.           classification  step  in  which attributes that are derived
  134.           from the PSDL specification are used as  a  multi-attribute
  135.           index  to  select  a subset of the database to serve as the
  136.           starting point for  the  rest  of  the  process.   A  major
  137.           difference between the CAPS approach and other systems that
  138.           use multi-attribute searches is that the  attribute  values
  139.           are  derived  from the formal specification by a repeatable
  140.           and  completely  automatic  process.   This  ensures   that
  141.           components  are  eliminated from consideration only if they
  142.           could not possibly satisfy the query.
  143.  
  144.                After selection of a database partition based  on  the
  145.           multi-attribute   index,   the  partition  is  exhaustively
  146.           scanned and passed through the syntactic  matching  filter.
  147.  
  148.   
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.    
  166.    
  167.  
  168.   
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.    
  178.    
  179.  
  180.  
  181.  
  182.           The components that remain are then passed through  several
  183.           semantic matching filters.  Syntactic matching of the query
  184.           component takes  place  before  semantic  matching  because
  185.           syntactic  matching is faster than semantic matching and is
  186.           used to partition the software base  quickly  in  order  to
  187.           narrow  the  list  of possible candidates that the semantic
  188.           matching algorithm must consider. Semantic matching is time
  189.           consuming  and must be applied to as small a candidate list
  190.           as possible.
  191.  
  192.                The  main  benefit  of  syntactic  matching  is  speed
  193.           whereas  the  advantage  of  semantic matching is accuracy.
  194.           Accuracy is required in  order  to  reduce  the  number  of
  195.           reusable  components  that a designer will have to evaluate
  196.           before making a selection. Many  functions  or  types  with
  197.           different   behaviors   can  have  syntactically  identical
  198.           interfaces.  Clearly we cannot  rely  on  syntax  alone  to
  199.           provide us a sufficiently fine grained search.
  200.  
  201.                A semantic process alone would be unacceptable because
  202.           semantic  matching  would  have  to  be  applied  to  every
  203.           software base component causing the search  process  to  be
  204.           impractically   time   consuming.   For   a  more  detailed
  205.           discussion of the semantic matching mechanisms used by  the
  206.           software base see  .
  207.  
  208.   Syntactic Matching 
  209.  
  210.                The  purpose  of  syntactic  matching  is  to  rapidly
  211.           eliminate  from consideration those modules in the software
  212.           base that cannot match the query specification's interface.
  213.           This  matching  process   
  214.       uses  the type information in
  215.           query module's PSDL interface specification to formulate  a
  216.           query.
  217.  
  218.                The  attributes  of  a  PSDL  specification  p  for  a
  219.           software  component  c  that are important to the syntactic
  220.           matching process are the following:
  221.  
  222.           S(p)= ( In(t, n) : there are n 0 occurrences of type  t  as
  223.           input parameters to c  ,
  224.  
  225.                   Out(t, m) : there are m 0 occurrences of type t  as
  226.           output parameters from c  ,
  227.  
  228.                   E : E is an exception defined in c ,
  229.  
  230.                   St : St is a state variable in c  )
  231.  
  232.           S(p) is the interface subset of the PSDL specification  for
  233.           module  c  and  is  the only part of the specification that
  234.           pertains to the syntactic matching process.
  235.  
  236.                Given a software base module c, and a query module  q,
  237.           along  with  their respective PSDL interface specifications
  238.           S[c] and S[q] c is a syntactic match for q if and  only  if
  239.           all of the following constraints are met:
  240.  
  241.  
  242.   
  243. xxxxx   x    
  244.           (1) Exists f[i] : S[q] --  S[c] such that 
  245.                  [f[i](In[q](t, n)) = In[c](t', m) 
  246.                     and m = n 
  247.                     and (t = t' or t' is a generic match of t) 
  248.                     and f[i] is bijective] 
  249.  
  250.           (2) Exists f[o] : S[q] --  S[c] such that 
  251.                  [f[o](Out[q](t, n)) = Out[c](t', m) 
  252.                     and m = n 
  253.                     and (t = t' or t' is a generic match of t) 
  254.                     and f[o] is injective] 
  255.  
  256.           (3) if   ST[q]     0 then   ST[m]     0 else (  ST[q]   = 0 
  257.            =   ST[m]  ) 
  258.  
  259.  
  260.                To improve efficiency, we use the  matching  rules  to
  261.           derive  a  set  of  module  attributes  that can be used to
  262.           rapidly  identify  and  reject  modules   with   unsuitable
  263.           interfaces.  Some  examples  of  these  derived  attributes
  264.           include:
  265.  
  266.                If the number of input parameters in S[q] is not equal
  267.           to  the  number input parameters in S[c], then there can be
  268.           no function f[i] to satisfy rule 1. Therefore S[c]  can  be
  269.           eliminated from the search.
  270.  
  271.                If the number of output parameters in S[q] is  greater
  272.           than  the  number  of output parameters in S[c], then there
  273.           can be no function f[o] to satisfy rule 2.  Therefore  S[c]
  274.           can be eliminated from the search.
  275.  
  276.                If S[q] has state variables defined (i.e. q defines  a
  277.           state  machine)  but S[c] has no state variables, then S[c]
  278.           can be eliminated from the search.
  279.  
  280.                The rules for the syntactic matching of  type  modules
  281.           are similar to those for operator modules with the addition
  282.           of a mapping function to map the operators of S[q]  to  the
  283.           operators  of  S[c]  and  an additional check to ensure the
  284.           generic  parameter  substitutions  used  for  this  mapping
  285.           function are consistent for all operators in S[c].
  286.  
  287.   Semantic Matching 
  288.  
  289.                Semantic matching is based on test cases and  symbolic
  290.           inference.   The  set of components that pass the syntactic
  291.           matching all have interfaces that are type-consistent  with
  292.           the  query.   These  components are passed through a set of
  293.           filters  defined  by  test  cases  derived  from  the  PSDL
  294.           specification.  Additional test cases and additional filter
  295.           passes are generated until either the set of candidates  is
  296.           small  enough  or  the last new test case did not eliminate
  297.           any components.  At this point the remaining candidates are
  298.           likely  candidates  for  satisfying  the  query.  The final
  299.           phase consists  of  a  set  of  automated  theorem  proving
  300.           techniques  that  attempt  to conclusively show that one of
  301.           the   retrieved   components   does   satisfy   the   query
  302.           specification.     These    are    based    on    algebraic
  303.           specifications,  term  rewrite  systems,  and  a  fast  but
  304.           limited inference method.
  305.  
  306.   Component Browsing 
  307.  
  308.                Although  browsing  by  component  name  and   keyword
  309.           browsing are not the preferred methods for finding reusable
  310.           components in a large software base,  they  are  needed  to
  311.           allow  users  to familiarize themselves with the components
  312.           in the  software  base  and  to  allow  the  software  base
  313.           administrators  to  maintain  them.   The software base was
  314.           designed and implemented to support  both  keyword  queries
  315.           and named look up.  The result of a keyword query is a list
  316.           of those components that possess one or more of  the  query
  317.           keywords.   The  list is ordered with those components that
  318.           satisfy the most query keywords coming first.
  319.  
  320.   Component transformation 
  321.  
  322.                The goal of the software base is to provide to CAPS  a
  323.           component implementation that is an exact match for a query
  324.           specification and meets the needs  of  the  CAPS  execution
  325.           support  system.   To  accomplish  this,  once  a  reusable
  326.           software component has been located it must be  transformed
  327.           into  a  form that matches all of these requirements.  This
  328.           transformation  involves  changing  parameter,  type,   and
  329.           operator  names  of the library component to match those of
  330.           the  query  specification  as  well  as  instantiating  any
  331.           generics.
  332.  
  333.                The  CAPS  software  base  cannot  directly   generate
  334.           implementation  code  because  it is not language specific.
  335.           It can generate  an  abstract  representation  of  how  the
  336.           library  component  satisfies the syntax and semantics of a
  337.           query component.  This representation can then be used by a
  338.           translation  tool  specific  to a particular implementation
  339.           language to generate the implementation code.  This  method
  340.           of  component  integration  is  preferable since components
  341.           coded in additional implementation languages can  be  added
  342.           to  the  software  base  as  long  as a translation tool to
  343.           generate the final implementation for  each  implementation
  344.           language is provided.
  345.  
  346.  
  347.  
  348.   Position 
  349.  
  350.                We believe that specification-based software retrieval
  351.           is  feasible  and  necessary  for  effective reuse in large
  352.           libraries, to prevent the designer from  being  swamped  by
  353.           mountains of irrelevant components.
  354.  
  355.  
  356.  
  357.     Luqi 88b 
  358.  
  359.  
  360. Luqi and M. Ketabchi, "A  Computer  Aided  Prototyping
  361.                System", IEEE Software 5, 2 (March 1988), 66-72.
  362.  
  363. Luqi, V. Berzins and R. Yeh, "A  Prototyping  Language
  364.                for  Real-Time Software", IEEE Trans. on Software Eng.
  365.                14, 10 (October, 1988), 1409-1423.
  366.  
  367. J. McDowell, "A Reusable  Component  Retrieval  System
  368.                for  Prototyping",  M.  S.  Thesis,  Computer Science,
  369.                Naval Postgraduate School, Monterey, CA, Sep. 1991.
  370.  
  371. R. Steigerwald, Luqi and J. McDowell, "A CASE Tool for
  372.                Reusable  Software  Component Storage and Retrieval in
  373.                Rapid   Prototyping",   Information    and    Software
  374.                Technology 38, 11 (Nov. 1991).
  375.  
  376. Luqi,  "Normalized  Specifications   for   Identifying
  377.                Reusable  Software",  Proc.  ACM-IEEE Computer Society
  378.                1987 Fall Joint Computer Conference, p. 46-49, Dallas,
  379.                TX, October, 1987.
  380.  
  381. M.   Griss,   "Software   Reuse  at  Hewlett-Packard",
  382.                Position paper for Workshop on Reuse, OOPSLA'91,  Oct.
  383.                6, 1991.
  384.  
  385. T. Biggerstaff and A. Perlis,  "Software Reusability",
  386.                Addison-Wesley, 1989.
  387.  
  388. V.  Berzins  and  Luqi,  "Software  Engineering   with
  389.                Abstractions", Addison-Wesley, 1991.
  390.  
  391. P.  Freeman,  "Tutorial:  Software  Reusability", IEEE
  392.                Computer Society, 1986.
  393.  
  394. Proceedings,  Workshop  on Reusability in Programming,
  395.                ITT Programming, Stratford, Connecticut, Sep. 1983.
  396.  
  397.  
  398.  
  399.   Biography 
  400.  
  401.           Dr. Luqi received the B.S.  degree  from  Jilin  University,
  402.           China,  received the M.S. and Ph.D. degrees in Computer Sci-
  403.           ence from University of Minnesota, and is currently an asso-
  404.           ciate  professor  at  the  Naval  Postgraduate  School.  She
  405.           worked on software research   development  for  the  Science
  406.           Academy  of  China,  University  of Minnesota, University of
  407.           Maryland, International Software Systems Inc., and etc.  She
  408.           is  a  technical  consultant for the computer industry.  Her
  409.           research interests include rapid prototyping, real-time sys-
  410.           tems, design of computer languages, software reuse, specifi-
  411.           cations,   software   configuration   management,   software
  412.           development  tools,  and scientific computing.  Her research
  413.           is supported by the National Science Foundation, the  Office
  414.           of  Naval Research and many other agencies.  She received an
  415.           Engineering Initiation Award and a Presidential Young Inves-
  416.           tigator  Award  from NSF.  She has published more than fifty
  417.           technical papers in professional journals and conferences as
  418.           well  as co-authored several books. She is an associate edi-
  419.           tor for IEEE Expert and the Journal of Systems  Integration.
  420.           She  has  supervised more than twenty-eight M. S. and Ph. D.
  421.           theses in software engineering.
  422.  
  423.           Her current address is NPS CS/Lq, Monterey, CA 93943.
  424.  
  425.  
  426.