on the criteria to be used in decomposing systems into modules (artículo original)

Upload: isotropy

Post on 09-Apr-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 On the criteria to be used in decomposing systems into modules (artculo original)

    1/6

    P r o g r a m m i n g R . M o r r i sTe c h n i q u e s E d i t o r

    O n the C riteria T o Be

    U s e d in D e c o m p o s in gSys tem s in to M odulesD.L. ParnasCarnegie-Mellon University

    This paper d i scusses modula r i za t ion as a mechan i smfor improv ing the f l ex ib i l i ty and comprehens ib i l i ty o f asys tem whi le a l lowing the shor ten ing o f i t s deve lopmentt ime . The effec t iveness o f a "m odula r i za t ion " i sdependen t upon the c r i te r i a used in d iv id ing the sy s temin to modules . A sys tem des ign p rob lem i s p resen ted andbo th a conven t iona l and unconven t iona l decompos i t ionare desc r ibed . I t i s shown tha t the unconven t iona ldecompos i t ions have d i s t inc t advan tages fo r the goa l sou t l ined . The c r i t e r i a used in a r r iv ing a t the decom-pos i t ions a re d iscussed . The u nconven t iona l decompos i -t ion , i f implemented wi th the conven t iona l a s sumpt iontha t a module cons i s t s o f one o r more subrou t ines , wi l lbe l e s s e ff i c i en t in mos t cases . An a l t e rna t ive approach

    to implementa t ion which does no t have th i s e ffec t i sske tched .K e y W o r d s a n d P h r a s e s : s o f t w a r e , m o d u l e s,

    m o d u l a r i t y, s o f t w a r e e n g in e e r i n g , K W I C i n d e x ,so f tware des ign

    C R C a t e g o r i e s : 4 . 0

    In t roduc t ion

    A l u c id s t a t e m e n t o f t h e p h i l o s o p h y o f m o d u l a rp r o g r a m m i n g c a n b e f o u n d i n a 1 9 70 te x t b o o k o n t h ed e s ig n o f s y s t e m p r o g r a m s b y G o u t h i e r a n d P o n t [1 , I 0 . 2 3 ] , w h i c h w e q u o t e b e l o w : 1

    A w ell-defined segmen tation of the project effort ensuressystem m odularity. Each task forms a separate, d istinct pro grammodule. At implementation time each module and its inputs andoutputs are well-defined, there is no confusion in the intendedinterface with other system modules. At checkout time the in-tegrity of the m od ule is tested independently; there are few sche-duling problems in synchronizing the com pletion o f several tasksbefore checkout can begin. Finally, the system is maintained inmo dular fashion; system errors and deficiencies can be traced tospecific system mo dules, thu s limiting the scope of detailed erro rsearching.

    U s u a l l y n o t h i n g i s s a i d a b o u t t h e c r i t e ri a t o b e u s e di n d i v i d i n g t h e s y s t e m i n t o m o d u l e s . T h i s p a p e r w i lld i s c u s s t h a t i ss u e a n d , b y m e a n s o f e x a m p l e s , s u g g e s ts o m e c r it e ri a w h i c h c a n b e u s e d in d e c o m p o s i n g as y s t e m i n t o m o d u l e s .

    Cop yright @ 1972, Association for Com puting M achinery, Inc.General permission to republish, bu t no t for profit, all or p art

    of this material is granted, provided that reference is ma de to thispublication, to its date o f issue, and to the fact that reprintingprivileges were granted by permission of the Association for Co m-puting Machinery.

    Au thor's address: D epartme nt o f Co mp uter Science, Carnegie-Mellon University, Pittsburgh, PA 15213.

    1 0 5 3

    A B r i e f S t a t u s R e p o r t

    T h e m a j o r a d v a n c e m e n t i n th e a re a o f m o d u l a rp r o g r a m m i n g h a s b e en t h e d e v e l o p m e n t o f c o d i n gt e c h n i q u e s a n d a s s e m b l e r s w h i c h ( l ) a l l o w o n e m o d u l et o b e w r i t t e n w i t h l it tl e k n o w l e d g e o f t h e c o d e i na n o t h e r m o d u l e , a n d ( 2) a ll o w m o d u l e s t o b e re a s-s e m b l e d a n d r e p l a c e d w i t h o u t r e a s s e m b l y o f t h e w h o l es y s t e m . T h i s f a c il i ty i s e x t r e m e l y v a l u a b l e f o r t h ep r o d u c t i o n o f la r g e p i ec e s o f c o d e , b u t t h e s y s te m s m o s to f t e n u s e d a s e x a m p l e s o f p r o b l e m s y s t e m s a re h i g h l y -m o d u l a r i ze d p r o g r a m s a n d m a k e u se o f t h e te c h n iq u e sm e n t i o n e d a b o v e .

    1 Rep rinted by permission of Prentice-Hall, EnglewoodCliffs, N.J.

    Comm unications December 1972of Volume 15

    t h e A C M N u m b e r 1 2

  • 8/8/2019 On the criteria to be used in decomposing systems into modules (artculo original)

    2/6

    E x p e c t e d B e n e f it s o f M o d u l a r P r o g r a m m i n g

    T h e b e n e f it s e x p ec t e d o f m o d u l a r p r o g r a m m i n g a r e:( 1) m a n a g e r i a l - - d e v e l o p m e n t t i m e s h o u l d b e s h o r t e n e db e c a u s e s e p a r a t e g r o u p s w o u l d w o r k o n e a c h m o d u l ew i t h li tt le n e e d f o r c o m m u n i c a t i o n : ( 2) p r o d u c t f le x i-b i l i t y - i t s h o u l d b e p o s s ib l e t o m a k e d r a s t i c c h a n g e s t oo n e m o d u l e w i t h o u t a n e e d to c h a n g e o t h e r s ; ( 3) c o m -p r e h e n s i b i l i t y - i t s h o u l d b e p o s s ib l e t o s t u d y t h es y s t e m o n e m o d u l e a t a t i m e . T h e w h o l e s y s t e m c a nt h e r e f o r e b e b e t t e r d e s i g n e d b e c a u s e i t is b e t t e r u n d e r -s t o o d .

    W h a t I s M o d u l a r i z a ti o n ?

    B e l o w a r e s e v e r a l p a r t i a l s y s t e m d e s c r i p t i o n s c a l l e dmodularizations.I n t h i s c o n t e x t " m o d u l e " i s c o n s i d e r e dt o b e a r e s p o n s i b i l i t y a s s i g n m e n t r a t h e r t h a n a s u b -p r o g r a m . T h emodularizations i n c l u d e t h e d e s i g n d e c i -s i o n s w h i c h m u s t b e m a d ebefore t h e w o r k o n i n d e -p e n d e n t m o d u l e s c a n b e g i n. Q u i t e d i f f er e n t d e c i si o n sa r e i n c l u d e d f o r e a c h a l t e r n a t i v e , b u t i n a l l c a s e s t h ei n t e n t i o n i s to d e s c r i b e a l l " s y s t e m l e v e l " d e c i s i o n s ( i . e.d e c i si o n s w h i c h a f fe c t m o r e t h a n o n e m o d u l e ) .

    E x a m p l e S y s t e m 1 : A K W I C I n d e x P r o d u c t io n S y s t e m

    T h e f o l l o w i n g d e s c r i p t i o n o f a K W I C i n d e x w i lls u f fi c e f o r t h i s p a p e r. T h e K W I C i n d e x s y s t e m a c c e p t s a no r d e r e d s e t o f l i n es , e a c h l i n e is a n o r d e r e d s e t o f w o r d s ,a n d e a c h w o r d i s a n o r d e r e d s e t o f c h a ra c t e r s . A n y l in em a y b e " c i r c u l a r l y s h i f t e d " b y r e p e a t e d l y r e m o v i n g t h efirst w o r d a n d a p p e n d i n g i t a t t h e e n d o f th e l in e . T h eKWXC ind ex sy s tem ou tpu ts a l i s t ing o f a ll c i rcu la r sh i f t so f a l l l i n e s i n a l p h a b e t i c a l o r d e r.

    T h i s i s a s m a l l s y s t e m . E x c e p t u n d e r e x t r e m e c i r -c u m s t a n c e s ( h u g e d a t a b as e , n o s u p p o r t i n g s o f t w a r e ) ,s u c h a sy s te m c o u l d b e p r o d u c e d b y a g o o d p r o g r a m m e rw i t h in a w e e k o r t w o . C o n s e q u e n t l y, n o n e o f th ed i ff ic u lt ie s m o t i v a t i n g m o d u l a r p r o g r a m m i n g a r e i m -p o r t a n t f o r t h i s s y s t e m . B e c a u s e i t i s i m p r a c t i c a l t ot r e a t a l a rg e s y s t e m t h o r o u g h l y, w e m u s t g o t h r o u g ht h e e x e r c i s e o f t r e a t i n g t h i s p r o b l e m a s i f i t w e r e a l a rg ep r o j e c t . We g i v e o n e m o d u l a r i z a t i o n w h i c h t y p i f i e sc u r r e n t a p p r o a c h e s , a n d a n o t h e r w h i c h h a s b e e n u s e ds u c c e s s f u l l y i n u n d e rg r a d u a t e c l a s s p r o j e c t s .

    Modular lza t ion 1We s e e t h e f o l l o w i n g m o d u l e s :M o d u l e 1 : I n p u t . T h i s m o d u l e r e a d s t h e d a t a l i n e s

    f r o m t h e i n p u t m e d i u m a n d s t o r e s t h e m i n c o r e f o rp r o c e s s i n g b y t h e r e m a i n i n g m o d u l e s . T h e c h a r a c t e r sa r e p a c k e d f o u r t o a w o r d , a n d a n o t h e r w i s e u n u s e dc h a r a c t e r i s u s e d to i n d i c a t e t h e e n d o f a w o r d . A n i n d e xi s k e p t t o s h o w t h e s t a r t i n g a d d r e s s o f e a c h l in e .

    M odule 2 : C i rcu la r Sh i f t .T h i s m o d u l e i s c a l le d a f t e rt h e i n p u t m o d u l e h a s c o m p l e t e d i ts w o r k . I t p r e p a r e s a ni n d e x w h i c h g i v e s t h e a d d r e s s o f t h e fi r s t c h a r a c t e r oe a c h c i r c u l a r s h if t , a n d t h e o r i g i n a l i n d e x o f t h e l i n e int h e a r r a y m a d e u p b y m o d u l e 1 . I t l e a v es it s o u t p u t i nc o r e w i t h w o r d s i n p a i r s ( o r i g i n a l l i n e n u m b e r, s t a r t i n ga d d r e s s ) .

    M o d u l e 3 : A l p h a b e t i z i n g . T h i s m o d u l e t a k e s a si n p u t t h e a r r a y s p r o d u c e d b y m o d u l e s 1 a n d 2 . Ip r o d u c e s a n a r r a y i n t h e s a m e f o r m a t a s t h a t p r o d u c e db y m o d u l e 2 . I n t h i s c a s e , h o w e v e r, t h e c i r c u l a r s h i f t sa r e l i s t e d i n a n o t h e r o r d e r ( a l p h a b e t i c a l l y ) .

    M o d u l e 4 : O u t p u t . U s i n g t h e a r r a y s p r o d u c e d b ym o d u l e 3 a n d m o d u l e 1 , t h is m o d u l e p r o d u c e s a n i c e lf o r m a t t e d o u t p u t l is t in g a l l o f th e c i r c u l a r s h i f ts . I n as o p h i s t i c a t e d s y s t e m t h e a c t u a l s t a r t o f e a c h l i n e w i lb e m a r k e d , p o i n t e r s t o f u r t h e r i n f o r m a t i o n m a y b ei n s e r te d , a n d t h e s t a r t o f th e c i r c u l a r s h i ft m a y a c t u a l l yn o t b e t h e f i r s t w o r d i n t h e l i n e , e t c .

    M o d u l e 5 : M a s t e r C o n t r o l. T h i s m o d u l e d o e s l i t t l em o r e t h a n c o n t r o l th e s e q u e n c in g a m o n g t h e o t h e r f o um o d u l e s . I t m a y a l s o h a n d l e e r r o r m e s s a g e s , s p a c ea l l o c a t i o n , e t c .

    I t s h o u l d b e c l e a r t h a t t h e a b o v e d o e s n o t c o n s t i t u t ea d e fi n it iv e d o c u m e n t . M u c h m o r e i n f o r m a t i o n w o u l dh a v e t o b e s u p p l i e d b e f o r e w o r k c o u l d s t a r t . T h e d e f i ni n g d o c u m e n t s w o u l d i n c l u d e a n u m b e r o f p i c t u r es h o w i n g c o r e f o r m a t s , p o i n t e r c o n v e n t i o n s , c a l l i n gc o n v e n t i o n s , e t c. A l l o f t h e i n t e rf a c e s b e t w e e n t h e f o um o d u l e s m u s t b e s p e c if i ed b e f o r e w o r k c o u l d b e g i n .

    T h i s i s a m o d u l a r i z a t i o n i n t h e s e n s e m e a n t b y a lp r o p o n e n t s o f m o d u l a r p r o g r a m m i n g . T h e s y s t e m id i v i d e d i n to a n u m b e r o f m o d u l e s w i t h w e l l -d e f i n ei n t e r fa c e s ; e a c h o n e i s s m a ll e n o u g h a n d s i m p l e e n o u gt o b e t h o r o u g h l y u n d e r s t o o d a n d w e l l p r o g r a m m e dE x p e r i m e n t s o n a s m a l l s c a le i n d i c a t e t h a t t h i s ia p p r o x i m a t e l y t h e d e c o m p o s i t i o n w h i c h w o u l d bp r o p o s e d b y m o s t p r o g r a m m e r s f o r th e t a s k sp e c if ie d

    M o d u l a r i z a ti o n 2

    We s e e t h e f o l l o w i n g m o d u l e s :M o d u l e 1 : L i n e S t o r a g e . T h i s m o d u l e c o n s i s t s o f a

    n u m b e r o f fu n c t i o n s o r s u b r o u t in e s w h i c h p r o v i d e t hm e a n s b y w h i c h t h e u s e r o f t h e m o d u l e m a y c a l l o n iT h e f u n c t i o n c a l lCHAR(r,w,c ) w i l l h a v e a s v a l u e a ni n t e g e r r e p r e s e n t i n g t h e c t h c h a r a c t e r i n t h e r t h l i n ew t h w o r d . A c a l l s u c h a sSETCHAR(r,w,c ,d )wil l causet h e c t h c h a r a c t e r i n t h e w t h w o r d o f t h e r t h li n e t o bt h e c h a r a c t e r r e p r e s e n t e d b y d ( i .e .CHAR(r,w,c) = d) .W O R D S ( r ) r e t u r n s a s v a lu e t h e n u m b e r o f w o r d s i n

    1054 Comm unications December 1972of Volume 15th e ACM Number 12

  • 8/8/2019 On the criteria to be used in decomposing systems into modules (artculo original)

    3/6

    l i n e r. T h e r e a r e c e r t a i n r e s t r i c t i o n s i n th e w a y t h a t t h e s er o u t i n e s m a y b e c a l l e d ; i f t h e s e r e s t r i c t i o n s a r e v i o l a t e dt h e r o u t i n e s " t r a p " t o a n e r r o r - h a n d l i n g s u b r o u t i n ew h i c h i s t o b e p r o v i d e d b y t h e u s e r s o f th e r o u t i n e .A d d i t i o n a l r o u t i n e s a r e a v a i l a b l e w h i c h r e v e a l to t h ec a l le r th e n u m b e r o f w o r d s i n a n y l i ne , th e n u m b e r o fl in e s c u r r e n t l y s to r e d , a n d t h e n u m b e r o f c h a r a c t e r s ina n y w o r d . F u n c t i o n s D E L I N E a n d D E LW R D a r ep r o v i d e d t o d e l e t e p o r t i o n s o f li n e s w h i ch h a v e a l r e a d yb e e n s t o r e d . A p r e c i s e s p e c i f ic a t i o n o f a s i m i l a r m o d u l e

    h a s b e e n g i v e n i n [ 3] a n d [8 ] a n d w e w i ll n o t r e p e a t i th e r e .

    Modu le 2 : I N P U T. T h i s m o d u l e r e a d s t h e o r i g i n a ll i n e s f r o m t h e i n p u t m e d i a a n d c a l l s t h e l i n e s t o r a g em o d u l e t o h a v e t h e m s t o r e d i n t e r n a l l y.

    Module 3: Circular Shifter. T h e p r i n c i p a l f u n c t i o n sp r o v i d e d b y t h i s m o d u l e a r e a n a l o g s o f f u n c t io n s p r o -v i d e d i n m o d u l e I . T h e m o d u l e c r e a t e s t h e i m p r e s -s i o n t h a t w e h a v e c r e a t e d a l i n e h o l d e r c o n t a i n i n gn o t a l l o f t h e l in e s b u t a l l o f t h e c i r c u l a r s h i f t s o f t h el i n e s . T h u s t h e f u n c t i o n c a l lCSCHAR(I ,w,c )p r o v i d e st h e v a l u e r e p r e s e n t i n g t h e c t h c h a r a c t e r i n t h e w t hw o r d o f t h e l t h c i r c u l a r s h i ft . I t i s sp e c i f ie d t h a t ( 1 )

    i f i < j t h e n t h e s h i f t s o f li n e i p r e c e d e t h e s h i f t s o f li n ej , a n d ( 2 ) f o r e a c h l i n e t h e f i r st s h i ft is t h e o r i g i n a ll in e , th e s e c o n d s h i f t i s o b t a i n e d b y m a k i n g a o n e - w o r dr o t a t i o n t o t h e f i r s t s h i f t , e t c . A f u n c t i o nC S S E T U P isp r o v i d e d w h i c h m u s t b e c a l le d b e f o r e t h e o t h e r f u n c t i o n sh a v e t h e i r s p e c i f ie d v a l u e s. F o r a m o r e p r e c i s e s p e c i f ic a -t i o n o f s u c h a m o d u l e s e e [ 8] .

    Module 4: Alphabetizer. T h i s m o d u l e c o n s i s t sp r i n c i p a ll y o f t w o f u n c t i o n s . O n e ,A L P H , m u s t b ec a l l e d b e f o r e t h e o t h e r w i l l h a v e a d e f i n e d v a l u e . T h es e c o n d , I T H , wil l se rve as an index .ITH( i ) wil l g ive thei n d e x o f th e c i r c u l a r s h i f t w h i c h c o m e s i t h i n t h ea l p h a b e t i c a l o r d e r i n g . F o r m a l d e f i n it i o n s o f th e s e

    f u n c t i o n s a r e g i v e n [ 8 ] .Module 5 : O u t p u t . T h i s m o d u l e w i ll g i v e t h e d e s i r e d

    p r i n t i n g o f s e t o f li n e s o r c i r c u l a r s h i f ts .Module 6 : M a s t e r C o n t r o l . S i m i l a r i n f u n c t i o n t o t h e

    m o d u l a r i z a t i o n a b o v e .

    Comparison of the T wo Modularizat ionsGeneral. B o t h s c h e m e s w i l l w o r k . T h e f i r s t i s q u i t e

    c o n v e n t i o n a l ; t h e s e c o n d h a s b e e n u s e d s u c c e s s fu l ly ina c l a s s p r o j e c t [ 7 ] . B o t h w i l l r e d u c e t h e p r o g r a m m i n g t ot h e r e la t iv e ly in d e p e n d e n t p r o g r a m m i n g o f a n u m b e r o fs m a l l , m a n a g e a b l e , p r o g r a m s .

    N o t e f ir st t h a t t h e t w o d e c o m p o s i t i o n s m a y s h a r ea ll d a t a r e p r e s e n t a t i o n s a n d a c c e s s m e t h o d s . O u rd i s c u s s i o n i s a b o u t t w o d i f f e r e n t w a y s o f c u t t i n g u pw h a t m ay b e t h e s a m e o b j e c t . A s y s t e m b u i l t a c c o r d i n gt o d e c o m p o s i t i o n 1 c o u l d c o n c e i v a b l y b e id e n t i ca lafter assembly t o o n e b u i l t a c c o r d i n g t o d e c o m p o s i t i o n2 . T h e d i f f e r e n c e s b e t w e e n t h e t w o a l t e r n a t i v e s a r e i nt h e w a y t h a t t h e y a r e d i v i d e d i n to t h e w o r k a s s i g n m e n t s ,a n d t h e i n t e r f a c e s b e t w e e n m o d u l e s . T h e a l g o r i t h m su s e d i n b o t h c a s e smight b e i d e n t i c a l . T h e s y s t e m s a r e

    s u b s t a n t i a l l y d i f f e r e n t e v e n i f i d e n t i c a l i n t h e r u n n a b l er e p r e s e n t a t i o n . T h i s i s p o s s i b l e b e c a u s e t h e r u n n a b l er e p r e s e n t a t i o n n e e d o n l y b e u s e d f o r r u n n i n g ; o t h e rr e p r e s e n t a t i o n s a r e u s e d fo r c h a n g i n g , d o c u m e n t i n g ,u n d e r s t a n d i n g , e t c . T h e t w o s y s t e m s w i ll n o t b e i d e n t i c a li n t h o s e o t h e r r e p r e s e n t a t i o n s .

    C h a n g e a b i l i ty. T h e r e a r e a n u m b e r o f d e s ig n d e -c i s io n s w h i c h a r e q u e s t i o n a b l e a n d l i k el y to c h a n g eu n d e r m a n y c i r c u m s t a n c e s . T h i s is a p a r t i a l l is t .

    1 . I n p u t f o r m a t .2 . T h e d e c i s i o n t o h a v e a ll l i n e s s t o r e d i n c o r e . F o rl a rg e j o b s i t m a y p r o v e i n c o n v e n i e n t o r i m p r a c t i c a l t ok e e p a ll o f th e l i n e s i n c o r e a t a n y o n e t i m e .3 . T h e d e c i s i o n to p a c k t h e c h a r a c t e r s f o u r to a w o r d .I n c a s e s w h e r e w e a r e w o r k i n g w i t h s m a l l a m o u n t s o fd a t a i t m a y p r o v e u n d e s i r a b l e t o p a c k t h e c h a r a c t e r s ;t i m e w i l l b e s a v e d b y a c h a r a c t e r p e r w o r d l a y o u t . I no t h e r c a s e s w e m a y p a c k , b u t i n d i f fe r e n t f o r m a t s .4 . T h e d e c i s i o n t o m a k e a n i n d e x f o r t h e c i r c u l a r 's h i f t s r a t h e r t h a t a c t u a l l y s t o r e t h e m a s s u c h . A g a i n , f o ra s m a l l i n d e x o r a l a rg e c o r e , w r i t i n g t h e m o u t m a y b et h e p r e f e r a b le a p p r o a c h . A l t e r n a ti v e l y, w e m a y c h o o s et o p r e p a r e n o t h i n g d u r i n gC S S E T U P. A l l c o m p u t a t i o nc o u l d b e d o n e d u r i n g t h e c a l l s o n t h e o t h e r f u n c t i o n ss u c h a s C S C H A R .5 . T h e d e c i s i o n t o a l p h a b e t i z e t h e l i s t o n c e , r a t h e rt h a n e i t h e r ( a ) s e a r c h f o r e a c h i t e m w h e n n e e d e d , o r( b ) p a r t i a l l y a l p h a b e t i z e a s i s d o n e i n H o a r e ' s r I N D[2 ]. I n a n u m b e r o f c ir c u m s t a n c e s i t w o u l d b e a d v a n -t a g e o u s t o d i s t r ib u t e t h e c o m p u t a t i o n i n v o l v e d ina l p h a b e t i z a t i o n o v e r th e t i m e re q u i r e d t o p r o d u c e t h ei n d e x .

    B y l o o k i n g a t t h e s e c h a n g e s w e c a n s e e t h e d i f f e r e n c e sb e t w e e n t h e t w o m o d u l a r i z a t i o n s . T h e f i rs t c h a n g e i sc o n f i n ed t o o n e m o d u l e i n b o t h d e c o m p o s i t i o n s . F o r t h e

    f i r s t d e c o m p o s i t i o n t h e s e c o n d c h a n g e w o u l d r e s u l t i nc h a n g e s i n e v e r y m o d u l e ! T h e s a m e i s t ru e o f th e t h i r dc h a n g e . I n t h e f i rs t d e c o m p o s i t i o n t h e f o r m a t o f t h el in e s t o r a g e i n c o r e m u s t b e u s e d b y a l l o f t h e p r o g r a m s .I n t h e s e c o n d d e c o m p o s i t i o n t h e s t o r y i s e n t i r e l yd i f fe r e n t. K n o w l e d g e o f t h e e x a c t w a y t h a t t h e l i n e s a r es t o r e d is e n t i r e ly h i d d e n f r o m a ll b u t m o d u l e 1 . A n yc h a n g e i n t h e m a n n e r o f s t o r a g e c a n b e c o n f i n e d t o t h a tm o d u l e !

    I n s o m e v e r s i o n s o f t h is s y s t e m t h e r e w a s a n a d d i -t i o n a l m o d u l e i n t h e d e c o m p o s i t i o n . A s y m b o l t a b l em o d u l e ( a s s p e c if i e d i n [ 3] ) w a s u s e d w i t h i n t h e l i n es t o r a g e m o d u l e . T h i s f a c t w a s c o m p l e t e l y in v i s ib l e t ot h e r e s t o f t h e s y s t e m .

    T h e f o u r t h c h a n g e i s c o n f in e d t o t h e c i r c u l a r s h i f tm o d u l e i n t h e s e c o n d d e c o m p o s i t i o n , b u t i n t h e f i r s td e c o m p o s i t i o n th e a l p h a b e t i z e r a n d t h e o u t p u t r o u t i n e sw i ll a ls o k n o w o f t h e c h a n g e .

    T h e f i f th c h a n g e w i ll a l s o p r o v e d i f f ic u l t i n t h e f i r std e c o m p o s i t i o n . T h e o u t p u t m o d u l e w i ll e x p e c t th e i n d e xt o h a v e b e e n c o m p l e t e d b e f o r e it b e g a n . T h e a l p h a -b e t i z e r m o d u l e i n t h e s e c o n d d e c o m p o s i t i o n w a s

    1055 Comm unications December 1972of Volume 15the ACM Number 12

  • 8/8/2019 On the criteria to be used in decomposing systems into modules (artculo original)

    4/6

    d e s i g n e d s o t h a t a u s e r c o u l d n o t d e t e c t w h e n t h ea l p h a b e t i z a t i o n w a s a c t u a l l y d o n e . N o o t h e r m o d u l en e e d b e c h a n g e d .

    Independent Development.I n t h e f i r st m o d u l a r i z a t i o nt h e i n t e r f a c e s b e tw e e n t h e m o d u l e s a r e t h e f a i r ly c o m -p l e x f o r m a t s a n d t a b l e o rg a n i z a t i o n s d e s c r i b e d a b o v e .T h e s e r e p r e s e n t d e s i g n d e c i si o n s w h i ch c a n n o t b e t a k e nl i g h t l y. T h e t a b l e s t r u c t u r e a n d o rg a n i z a t i o n a r e e s -s e n ti a l t o t h e e f f ic i en c y o f t h e v a r i o u s m o d u l e s a n d m u s tb e d e s i g n e d c a re f u l ly. T h e d e v e l o p m e n t o f th o s e f o r m a t s

    w i ll b e a m a j o r p a r t o f t h e m o d u l e d e v e l o p m e n t a n dt h a t p a r t m u s t b e a j o i n t e f f o r t a m o n g t h e s e v e r a ld e v e l o p m e n t g r o u p s . I n t h e s e c o n d m o d u l a r i z a t i o n t h ei n t e r f a c e s a r e m o r e a b s t r a c t ; t h e y c o n s i s t p r i m a r i l y i nt h e f u n c t i o n n a m e s a n d t h e n u m b e r s a n d t y p e s o f t h ep a r a m e t e r s . T h e s e a r e r e l a ti v e l y s i m p l e d e c i s io n s a n dt h e i n d e p e n d e n t d e v e l o p m e n t o f m o d u l e s s h o u l db e g i n m u c h e a r l i e r.

    Comprehensibil i ty. To u n d e r s t a n d t h e o u t p u t m o d u l ei n t h e f i r s t m o d u l a r i z a t i o n , i t w i l l b e n e c e s s a r y t ou n d e r s t a n d s o m e t h i n g o f t h e a l p h a b e t i z e r , t h e c i r c u l a rs h i f t e r , a n d t h e i n p u t m o d u l e . T h e r e w i l l b e a s p e c t s o ft h e t a b l e s u s e d b y o u t p u t w h i c h w i l l o n l y m a k e s e n s eb e c a u s e o f t h e w a y t h a t t h e o t h e r m o d u l e s w o r k . T h e r ew i ll b e c o n s t r a i n t s o n t h e s t r u c t u r e o f t h e t a b l e s d u e t ot h e a l g o r i t h m s u s e d i n t h e o t h e r m o d u l e s . T h e s y s t e mw i l l o n l y b e c o m p r e h e n s i b l e a s a w h o l e . I t i s m y s u b -j e c t i v e j u d g m e n t t h a t t h i s is n o t t r u e i n t h e s e c o n dm o d u l a r i z a t i o n .

    The CriteriaM a n y r e a d e r s w i l l n o w s e e w h a t c r i t e r i a w e r e u s e d

    i n e a c h d e c o m p o s i t i o n . I n t h e f i r s t d e c o m p o s i t i o n t h ec r i t e r io n u s e d w a s t o m a k e e a c h m a j o r s t e p i n th ep r o c e s s i n g a m o d u l e . O n e m i g h t s a y t h a t t o g e t th e f i rs td e c o m p o s i t i o n o n e m a k e s a f l o w c h a r t . T h i s i s t h e m o s tc o m m o n a p p r o a c h t o d e c o m p o s i t i o n o r m o d u l a r i z a -t i o n . I t i s a n o u t g r o w t h o f a ll p r o g r a m m e r t r a i n i n gw h i c h t e a c h e s u s t h a t w e s h o u l d b e g i n w i t h a r o u g hf l o w c h a r t a n d m o v e f r o m t h e r e t o a d e t a i l e d i m p l e -m e n t a t i o n . T h e f l o w c h a r t w a s a u s ef u l a b s t ra c t i o n f o rs y s t e m s w i t h o n t h e o r d e r o f 5 , 0 0 0 - 1 0 , 0 0 0 i n s t r u c t i o n s ,b u t a s w e m o v e b e y o n d t h a t i t d o e s n o t a p p e a r t o b es u ff i c ie n t ; s o m e t h i n g a d d i t i o n a l i s n e e d e d .

    T h e s e c o n d d e c o m p o s i t i o n w a s m a d e u s i n g ' f i n -f o r m a t i o n h i d i n g " [ 4 ] a s a c r i t e r i o n . T h e m o d u l e s n ol o n g e r c o r r e s p o n d t o s t e p s i n t h e p r o c e s s i n g . T h e l i n es t o r a g e m o d u l e , f o r e x a m p l e , i s u s e d i n a l m o s t e v e r ya c t i o n b y t h e s y s t e m . A l p h a b e t i z a t i o n m a y o r m a y n o tc o r r e s p o n d t o a p h a s e i n t h e p r o c e s s i n g a c c o r d i n g t ot h e m e t h o d u s e d . S i m i l a r l y, c i r c u l a r s h i f t m i g h t , i n s o m ec i r c u m s t a n c e s , n o t m a k e a n y t a b l e a t a l l b u t c a l c u l a t ee a c h c h a r a c t e r a s d e m a n d e d . E v e r y m o d u l e i n t h es e c o n d d e c o m p o s i t i o n i s c h a r a c t e r i z e d b y i t s k n o w l e d g eo f a d e s i g n d e c i s i o n w h i c h i t h i d e s f r o m a l l o t h e r s . I t si n t e r f a c e o r d e f i n i t i o n w a s c h o s e n t o r e v e a l a s l i t t l e a sp o s s ib l e a b o u t i ts i n n e r w o r k i n g s .

    1056

    Improvement in Circular Shift ModuleTo i l l u s t r a t e t h e i m p a c t o f su c h a c r i t e r i o n l e t u s

    t a k e a c l o s e r l o o k a t t h e d e s i g n o f th e c i r c u l a r s h i f tm o d u l e f r o m t h e s e c o n d d e c o m p o s i t i o n . H i n d s i g h t n o ws u g g e s t s t h a t t h i s d e f i n i t i o n r e v e a l s m o r e i n f o r m a t i o nt h a n n e c e s s a ry. W h i l e w e c a r e f u ll y h i d t h e m e t h o do f s t o r i n g o r c a l c u l a t i n g t h e l is t o f c i r c u l a r s h i f ts , w es p e c i f i e d a n o r d e r t o t h a t l i s t . P r o g r a m s c o u l d b e e f f e c -t i v e l y w r i t t e n i f w e s p e c i f i e d o n l y ( I ) t h a t t h e l i n e si n d i c a t e d i n c i r c u l a r s h i f t ' s c u r r e n t d e f i n i t i o n w i l l a l l

    e x i s t i n th e t a b l e , ( 2 ) t h a t n o o n e o f t h e m w o u l d b ei n c l u d e d t w i c e , a n d ( 3 ) t h a t a n a d d i t i o n a l f u n c t i o ne x i s t e d w h i c h w o u l d a l l o w u s t o i d e n t i fy t h e o r i g i n a ll i n e g i v e n t h e s h i f t . B y p r e s c r i b i n g t h e o r d e r f o r t h es h i f t s w e h a v e g i v e n m o r e i n f o r m a t i o n t h a n n e c e s s a r ya n d s o u n n e c e s s a r i l y r e s t ri c t e d t h e c l a ss o f s y s te m s t h a tw e c a n b u i l d w i t h o u t c h a n g i n g t h e d e f i n i t i o n s . F o re x a m p l e , w e h a v e n o t a l l o w e d f o r a s y s t e m in w h i c h t h ec i r c u l a r s h i f t s w e r e p r o d u c e d i n a l p h a b e t i c a l o r d e r ,ALPH i s e m p t y, a n d ITH s i m p l y r e t u r n s i t s a rg u m e n ta s a v a l u e . O u r f a i l u r e t o d o t h i s i n c o n s t r u c t i n g t h es y s t em s w i t h th e s e c o n d d e c o m p o s i t i o n m u s t c l e a r l y b ec lass i f ied as a des ign e r ror.

    I n a d d i t i o n t o t h e g e n e r a l c r i t e r i a t h a t e a c h m o d u l eh i d e s s o m e d e s i g n d e c i s io n f r o m t h e r e s t o f th e s y s t e m ,w e c a n m e n t i o n s o m e s p e c i fi c e x a m p l e s o f d e c o m -p o s i t i o n s w h i c h s e e m a d v i s a b l e .

    1. A data structure, i t s in te rna l l ink ings , accessingprocedures and modifying procedures a r e p a r t o f as in g le m o d u l e . T h e y a r e n o t s h a r e d b y m a n y m o d u l e s a si s c o n v e n t i o n a l l y d o n e . T h i s n o t i o n i s p e r h a p s j u s t a ne l a b o r a t i o n o f t h e a s s u m p t i o n s b e h i n d t h e p a p e r s o fB a l z e r [ 9 ] a n d M e a l y [ 1 0 ] . D e s i g n w i t h t h i s i n m i n d i sc l e a r l y b e h i n d t h e d e s i g n o f B L I S S [ 11 ].2. The sequence o f instructions necessary to call a given

    routine and the routine itse lf are part of the same module.T h i s r u l e w a s n o t r e l e v a n t i n t h e F o r t r a n s y s t e m s u s e df o r e x p e r i m e n t a t i o n b u t i t b e c o m e s e s s e n ti a l f o r s y s te m sc o n s t r u c t e d i n a n a s s e m b l y l a n g u a g e . T h e r e a r e n op e r f e c t g e n e ra l c a l li n g s e q u e n c e s f o r r e a l m a c h i n e s a n dc o n s e q u e n t l y t h e y t e n d t o v a r y a s w e c o n t i n u e o u rs e a r c h f o r t h e i d e a l s e q u e n c e . B y a s s i g n i n g r e s p o n s i b i l i t yf o r g e n e r a t i n g t h e c a l l t o t h e p e r s o n r e s p o n s i b l e f o r t h er o u t i n e w e m a k e s u c h i m p r o v e m e n t s e a s i e r a n d a l s om a k e i t m o r e f e a s i b le t o h a v e s e v e r al d i s t in c t s e q u e n c e si n t h e s a m e s o f t w a r e s t r u c t u r e .3 . T h e formats of control blocks u s e d i n q u e u e s i no p e r a t i n g s y s t e m s a n d s i m i l a r p r o g r a m smust be hiddenw i t h i n a " c o n t r o l b l o c k m o d u l e . " I t is c o n v e n t i o n a l t om a k e s u c h f o r m a t s t h e i n t e r f a c e s b e t w e e n v a r i o u sm o d u l e s . B e c a u s e d e s ig n e v o l u t i o n f o r c e s f r e q u e n tc h a n g e s o n c o n t r o l b l o c k f o r m a t s s u c h a d e c i s i o n o f t e np r o v e s e x t r e m e l y c o s t l y.4. Character codes, alphabetic orderings, and similardata should be hidden i n a m o d u l e f o r g r e a t e s t f l e x i b i li t y.5 . T h e s e q u e n c e in w h i c h c e r t a i n i te m s w i ll b e p r o c -e s s e d s h o u l d ( a s f a r a s p r a c t i c a l ) b e h i d d e n w i t h i n as i n g l e m o d u l e . Va r i o u s c h a n g e s r a n g i n g f r o m e q u i p -

    Comm unications December 1972of Volume 15the ACM Number 12

  • 8/8/2019 On the criteria to be used in decomposing systems into modules (artculo original)

    5/6

    m e n t a d d i t i o n s t o u n a v a i l a b i li t y o f c e r ta i n r e s o u r c e s i na n o p e r a t i n g s y s t e m m a k e s e q u e n c i n g e x t r e m e l y v a ri -a b l e .

    Eff ic iency and Implementa t ionI f w e a r e n o t c a r e f u l t h e s e c o n d d e c o m p o s i t i o n w i ll

    p r o v e t o b e m u c h l e ss e f fi c i en t t h a n t h e f ir s t. I f e a c h o ft h e f u n c t i o n s i s a c t u a l l y i m p l e m e n t e d a s a p r o c e d u r ew i t h a n e l a b o r a t e c a l l i n g s e q u e n c e t h e r e w i l l b e a g r e a td e a l o f s u c h c a l l in g d u e t o t h e r e p e a t e d s w i t c h in gb e t w e e n m o d u l e s . T h e f i r s t d e c o m p o s i t i o n w i l l n o t

    s u f f e r f r o m t h i s p r o b l e m b e c a u s e t h e r e i s r e l a t i v e l y i n -f r e q u e n t t r a n s f e r o f c o n t r o l b e t w e e n m o d u l e s .

    To s a v e t h e p r o c e d u r e c a l l o v e r h e a d , y e t g a i n t h ea d v a n t a g e s t h a t w e h a v e s e e n a b o v e , w e m u s t i m p l e m e n tt h e s e m o d u l e s i n a n u n u s u a l w a y. I n m a n y c a s e s t h er o u t i n e s w i l l b e b e s t i n s e r t e d i n t o t h e c o d e b y a na s s e m b l e r ; i n o t h e r c a s e s , h i g h l y s p e c i a l i z e d a n d e f f i ci e n tt r a n s f e r s w o u l d b e i n s e r t e d . To s u c c e ss f u ll y a n de f fi c ie n t ly m a k e u s e o f t h e s e c o n d t y p e o f d e c o m p o s i t i o nw i ll r e q u i r e a t o o l b y m e a n s o f w h ic h p r o g r a m s m a y b ew r i t te n a s i f t h e f u n c t i o n s w e r e s u b r o u t i n e s , b u t a s -s e m b l e d b y w h a t e v e r i m p l e m e n t a t i o n i s a p p r o p r i a t e . I fs u c h a t e c h n i q u e i s u s e d , t h e s e p a r a t i o n b e t w e e nm o d u l e s m a y n o t b e c l e a r i n t h e f i n a l c o d e . F o r t h a tr e a s o n a d d i t i o n a l p r o g r a m m o d i f i c a t i o n f e a t u r e s w o u l da l s o b e u s e f u l . I n o t h e r w o r d s , t h e s e v e r a l r e p r e s e n t a -t i o n s o f th e p r o g r a m ( w h i c h w e re m e n t i o n e d e a r li e r )m u s t b e m a i n t a i n e d i n t h e m a c h i n e t o g e t h e r w i t h ap r o g r a m p e r f o r m i n g m a p p i n g b e t w e e n th e m .

    A D ecom pos i t ion Comm on to a Com pi le r and In te rpretorf o r t h e S a m e L a n g u a g e

    I n a n e a r l i e r a t t e m p t t o a p p l y t h e s e d e c o m p o s i t i o nr u l e s to a d e s i g n p r o j e c t w e c o n s t r u c t e d a t r a n s l a t o r f o ra M a r k o v a l g o r i t h m e x p r e s s e d i n t h e n o t a t i o n d e s c r i b e di n [ 6 ] . A l t h o u g h i t w a s n o t o u r i n t e n t i o n t o i n v e s t i g a t et h e r e l a t i o n b e t w e e n c o m p i l i n g a n d i n t e r p r e t i v e t r a n s -l a t o r s o f a l an g u g a g e , w e d i s c o v e r e d t h a t o u r d e c o m -p o s i t i o n w a s v a l i d f o r a p u r e c o m p i l e r a n d s e v e r a lv a r ie t ie s o f i n t e r p r e t o r s f o r th e l a n g u a g e . A l t h o u g h t h e r ew o u l d b e d e e p a n d s u b s t a n t ia l d i f fe r e n c e s i n t h e f in a lr u n n i n g r e p r e s e n t a t i o n s o f e a c h t y p e o f c o m p i l e r , w ef o u n d t h a t t h e d e c i s i o n s i m p l i c i t i n t h e e a r l y d e c o m -p o s i t i o n h e l d f o r a l l .

    T h i s w o u l d n o t h a v e b e e n t r u e i f w e h a d d i v i d e dr e s p o n s i b i l i t i e s a l o n g t h e c l a s s i c a l l i n e s f o r e i t h e r ac o m p i l e r o r i n t e r p r e t o r ( e . g . s y n t a x r e c o g n i z e r , c o d eg e n e r a t o r , r u n t i m e r o u t i n e s f o r a c o m p i l e r ) . I n s t e a d

    t h e d e c o m p o s i t i o n w a s b a s e d u p o n t h e h i d in g o f v a r io u sd e c i s i o n s a s i n t h e e x a m p l e a b o v e . T h u s r e g i s t e r r e p r e -s e n t a t i o n , s e a r c h a l g o r i t h m , r u l e i n t e r p r e t a t i o n e t c . w e r em o d u l e s a n d t h e s e p r o b l e m s e x i s t e d i n b o t h c o m p i l i n ga n d i n t e r p r e ti v e t ra n s l a t o r s . N o t o n l y w a s t h e d e c o m -p o s i t i o n v a l i d in a l l c a s e s , b u t m a n y o f th e r o u t i n e sc o u l d b e u s e d w i t h o n l y s l i g h t c h a n g e s i n a n y s o r t o ft r a n s l a t o r.

    T h i s e x a m p l e p r o v i d e s a d d i t i o n a l s u p p o r t f o r t h e

    s t a t e m e n t t h a t t h e o r d e r i n t i m e i n w h i c h p r o c e s s i n g i se x p e c t e d t o t a k e p l a c e s h o u l d n o t b e u s e d i n m a k i n gt h e d e c o m p o s i t i o n i n t o m o d u l e s . I t f u r t h e r p r o v i d e se v i d e n c e t h a t a c a r e fu l j o b o f d e c o m p o s i t i o n c a n r e s u l ti n c o n s id e r a b le c a r r y o v e r o f w o r k f r o m o n e p r o j e c t t oa n o t h e r .

    A m o r e d e t a i l e d d i s cu s s i o n o f th i s e x a m p l e w a sc o n t a i n e d i n [ 8 ] .

    Hierarch ica l S t ruc ture

    We c a n f i n d a p r o g r a m h i e r a r c h y i n t h e s e n s e i l l u s -t r a t e d b y D i j k s t r a [5 ] i n t h e s y s t e m d e f i n e d a c c o r d i n g t od e c o m p o s i t i o n 2 . I f a s y m b o l t a b l e e x is ts , i t f u n c t i o n sw i t h o u t a n y o f t h e o t h e r m o d u l e s , h e n c e i t i s o n l e v e l 1 .L i n e s t o r a g e i s o n l e v e l 1 i f n o s y m b o l t a b l e i s u s e d o r i ti s o n l e v e l 2 o t h e r w i s e . I n p u t a n d C i r c u l a r S h i f t e r r e -q u i r e l i n e s t o r a g e f o r t h e i r f u n c t i o n i n g . O u t p u t a n dA l p h a b e t i z e r w i l l r e q u i r e C i r c u l a r S h i f t e r, b u t s i n c eC i r c u l a r S h i f t e r a n d l i n e h o l d e r a r e i n s o m e s e n s ec o m p a t i b l e , it w o u l d b e e a s y t o b u i l d a p a r a m e t e r i z e dv e r s i o n o f t h o s e r o u t i n e s w h i c h c o u l d b e u s e d t oa l p h a b e t i z e o r p r i n t o u t e i t h e r t h e o r i g i n a l l i n e s o r t h ec i r c u l a r s h i f t s . I n t h e f i r s t u s a g e t h e y w o u l d n o t r e q u i r eC i r c u l a r S h i f t e r ; i n t h e s e c o n d t h e y w o u l d . I n o t h e rw o r d s , o u r d e s i g n h a s a l l o w e d u s t o h a v e a s i n g l er e p r e s e n t a t i o n f o r p r o g r a m s w h i c h m a y r u n a t e i t h e ro f t w o l e v e l s i n t h e h i e r a r c h y.

    I n d i s c u s s i o n s o f s y s t e m s t r u c t u r e i t is e a s y t o c o n f u s et h e b e n e f it s o f a g o o d d e c o m p o s i t i o n w i t h t h o s e o f ah i e r a r c h i c a l s tr u c t u r e . W e h a v e a h i e r a r c h i c a l s t r u c t u r ei f a c e r t a in r e l a t i o n m a y b e d e f i n e d b e t w e e n t h e m o d u l e so r p r o g r a m s a n d t h a t r e l a t i o n i s a p a r t i a l o r d e r i n g . T h er e l a t i o n w e a r e c o n c e r n e d w i t h i s " u s e s " o r " d e p e n d su p o n . " I t i s b e t t e r t o u s e a r e l a t i o n b e t w e e n p r o g r a m ss i n c e i n m a n y c a s e s o n e m o d u l e d e p e n d s u p o n o n l yp a r t o f a n o t h e r m o d u l e ( e .g . C i rc u l a r S h i f t e r d e p e n d so n l y o n t h e o u t p u t p a r t s o f th e l in e h o l d e r a n d n o t o nt h e c o r r e c t w o r k i n g o fSETWORD).I t i s c o n c e i v a b l et h a t w e c o u l d o b t a i n t h e b e n e f i t s t h a t w e h a v e b e e nd i s c u s s i n g w i t h o u t s u c h a p a r t i a l o r d e r i n g , e . g . i f a l lt h e m o d u l e s w e r e o n t h e s a m e l ev e l . T h e p a r t i a l o r d e r i n gg i v e s u s t w o a d d i t i o n a l b e n e f i t s . F i r s t , p a r t s o f t h es y s t e m a r e b e n e f i t e d ( s i m p l i f i e d ) b e c a u s e t h e y u s e t h es e r v i c e s o f l o w e r 2 l e v e ls . S e c o n d , w e a r e a b l e t o c u t o f ft h e u p p e r l e v e l s a n d s t i l l h a v e a u s a b l e a n d u s e f u lp r o d u c t . F o r e x a m p l e , t h e s y m b o l t a b l e c a n b e u s e d i no t h e r a p p l i c a t i o n s ; t h e li n e h o l d e r c o u l d b e th e b a s is o f

    a q u e s t i o n a n s w e r i n g s y s t e m . T h e e x i s t e n c e o f t h eh i e r a r c h i c a l s t r u c t u r e a s su r e s u s th a t w e c a n " p r u n e "o f f t h e u p p e r l e v e ls o f t h e t r e e a n d s t a r t a n e w t r e e o nt h e o l d t r u n k . I f w e h a d d e s i g n e d a s y s t e m in w h i c h t h e" l o w l e v e l " m o d u l e s m a d e s o m e u s e o f th e " h i g h l e v e l"m o d u l e s , w e w o u l d n o t h a v e th e h i e r a r c h y, w e w o u l d f i n di t m u c h h a r d e r t o r e m o v e p o r t i o n s o f t h e s y st e m , a n d" l e v e l " w o u l d n o t h a v e m u c h m e a n i n g i n th e s y s te m .

    Here "low er" means "lower numbered."

    1057 Comm unications December 1972of Volume 15th e ACM Number 12

  • 8/8/2019 On the criteria to be used in decomposing systems into modules (artculo original)

    6/6

    S i n c e it is c o n c e i v a b l e t h a t w e c o u l d h a v e a s y s t e mw i t h th e ty p e o f d e c o m p o s i t i o n s h o w n i n v er s i o n 1( i m p o r t a n t d e s i g n d e c i s i o n s i n t h e in t e r f a c e s) b u tr e t a i n i n g a h i e r a r c h i c a l s t r u c t u r e , w e m u s t c o n c l u d et h a t h ie r a rc h i c a l s t ru c t u r e a n d " c l e a n " d e c o m p o s i t i o na r e t w o d e s i r a b l e b u t independent p r o p e r t i e s o f as y s t e m s t r u c t u r e .

    C o n c l u s i o n

    We h a v e t r i ed t o d e m o n s t r a t e b y th e s e e x a m p l e s t h a ti t i s a l m o s t a l w a y s i n c o r r e c t t o b e g i n t h e d e c o m p o s i t i o no f a s y s te m i n t o m o d u l e s o n t h e b a s is o f a f l o w c h a r t .We p r o p o s e i n s t e a d t h a t o n e b e g i n s w i t h a li st o fd i f f i c u l t d e s i g n d e c i s i o n s o r d e s i g n d e c i s i o n s w h i c h a r el ik e l y t o c h a n g e . E a c h m o d u l e i s t h e n d e s i g n e d t o h i d es u c h a d e c i s i o n f r o m t h e o t h e r s . S i n c e , i n m o s t c a s es ,d e s i g n d e c is i o n s t r a n s c e n d t i m e o f e x ec u t i o n , m o d u l e sw i ll n o t c o r r e s p o n d t o s te p s i n t h e p r o c e s s i n g . Toa c h i e v e a n ef fi ci en t i m p l e m e n t a t i o n w e m u s t a b a n d o nt h e a s s u m p t i o n t h a t a m o d u l e i s o n e o r m o r e s u b -

    r o u t i n e s , a n d in s t e a d a ll o w s u b r o u t i n e s a n d p r o g r a m st o b e a s s e m b l e d c o l l e c ti o n s o f c o d e f r o m v a r i o u sm o d u l e s .

    Received August 1971; revised November 1971

    References

    1. Gau thier, Richard, and Pon t, Stephen.Designing SystemsPrograms, (C), Prentice-Hall, Englewood Cliffs, N.J., 1970.2 . Hoare , C . A . R . P roof o f a p rogram, F IN D.Comm. AC M 14,1 (Jan. 1971), 39-45.3. Parnas, D . L. A technique for software m odule specificationwith examples.Comm. ACM 15, 5 (May, 1972), 330-336.

    4. Parnas, D. L. Info rma tion distribution aspects of designmeth odo logy. Tech. Rept., Dep art. Com puter Science, Carnegie-Mellon U ., Pittsburgh, Pa., 1971. Also presented at the IF IPCong ress 1971, Ljubljana, Y ugoslavia.5 . Di jkstra , E. W. The st ructure of "THE "-mult iprogramm ingsystem. Comm. AC M 11, 5 (M ay 1968), 341-346.6. Galler, B., and Perlis,A. J. A View of Programming Languages,Addison-Wesley, Reading, Mass., 1970.7. Parnas, D. L. A course on software engineering. Proc. SIGC SETechnical S ympo sium, Mar. 1972.8. Parnas, D . L. On the criteria to be used in decomposingsystems into modules. Tech. Rept., Depart. Computer Science,Carnegie-Mellon U ., Pittsburgh, P a., 1971.9. Balzer, R. M. Dataless programming. Proc . AF IPS 1967FJC C, Vol. 31, AF IPS Press, Montvale, N.J., pp. 535-544.10. M ealy, G. H. A nother look at data . Proc. AF IPS 1967 FJCC ,Vol. 31, AF IPS Press, Montvale, N .J., pp. 525-534.

    11. W ulf, W. A., Russell, D. B., and H aberm ann , A. N. BLISS,A language fo r systems programming.Comm. ACM 14, 12 (Dec.1971), 780-790.

    1058 Communica t ionso fthe ACM

    December 1972Volume 15Number 12