I n te r n ati o n al   Jo u r n al   o El e c tr i c a l   an d   C o m p u te r   En gi n e e r i n g   (I JEC E )   V o l .   10 ,   N o .   3 J u n e   20 20,   pp .   2719 ~ 2733   IS S N :   2088 - 8708 D O I :   10. 1 1591 / i j e c e . v 10 i 3 . pp2719 - 2733             2719       Jou r n al   h o m e pa ge ht t p: / / i j e c e . i ae s c or e . c om / i nd e x . php / IJ E CE   A   st u d y   o f   c o d e   c h a n g e   p a t t e r n f o r     a d a p t i v e   m a i n t e n a n c e   w i t h   A S T   a n a l y si s       O m ar   M e q d ad i ,   S h ad i   A l jaw a r n e h   D e pa rt m e n t   o f   S of t w a r e   E n gi n e e r i n g ,   J o r da U ni v e r s i t y   of   S c i e n c e   a n d   T e c hn o l o gy ,   J o r da n       A r ti c l e   I n fo     A B S TR A C T   Ar t i c l e   h i s t or y :   R e c e i v e d   J ul   3 ,   201 9   R e v i s e N o v   2 5 ,   20 19   A c c e pt e D e c   6 ,   20 19       E xa m pl e - ba s e d   t r a ns f o r m a t i o na l   a pp r o a c he s   t o   a u t o m a t e   a da p t i v e   m a i n t e n a nc e   c ha ng e s   p l a y s   a i m po r t a nt   r o l e   i s o f t w a r e   r e s e a r c h.   O ne   p r i m a r y   c o nc e r o f   t ho s e   a pp r o a c he s   i s   t h a t   a   s e t   o f   g oo qua l i f i e r e a l   e xa m p l e s   o f   a da pt i v e   c ha ng e s   p r e v i o us l y   m a de   i t he   hi s t o r y   m us t   be   i de n t i f i e d ,   o r   o t he r w i s e   t he   a do pt i o o f   s uc a pp r o a c he s   w i l l   be   pu t   i que s t i o n .   U nf o r t u na t e l y ,   t he r e   i s   r a r e l y   e no ug de t a i l   t o   c l e a r l y   di r e c t   t r a ns f o r m a t i o r ul e   de v e l o pe r s   t o   o v e r c o m e   t he   b a r r i e r   o f   f i ndi ng   qu a l i f i e d   e xa m p l e s   f o r   a da p t i v e   c ha ng e s .   T h i s   w o r k   e xp l o r e s   t he   h i s t o r i e s   o f   s e v e r a l   o pe s o ur c e   s y s t e m s   t o   s t u dy   t he   r e pe t i t i v e ne s s   o f   a da pt i v e   c ha ng e s   i n   s o f t w a r e   e v o l ut i o n,   a nd   he nc e   r e c og ni z i ng   t h e   s o ur c e   c o de   c ha ng e   pa t t e r n s   t h a t   a r e   s t r o ng l y   r e l a t e w i t t he   a d a pt i v e   m a i n t e n a nc e .   W e   c o l l e c t e d   t h e   a d a p t i v e   c om m i t s   f r o m   t he   hi s t o r y   o f   num e r o us   o pe n   s o ur c e   s y s t e m s ,   t h e n   w e   o b t a i ne d   t he   r e p e t i t i v e ne s s   f r e qu e nc i e s   o f   s o ur c e   c o de   c ha ng e s   ba s e d   o t he   a na l y s i s   o f   A bs t r a c t   S y nt a T r e e   ( A S T )   e di t   a c t i o ns   w i t hi a a da p t i v e   c o m m i t .   U s i ng     t he   pr e v a l e nc e   o f   t he   m o s t   c o m m o a da pt i v e   c ha ng e s ,   w e   s ug g e s t e a   s e t   o f   c ha ng e   pa t t e r ns   t ha t   s e e m   c o r r e l a t e d   w i t h   a da p t i v e   m a i n t e n a nc e .   I t   i s   o bs e r v e t ha t   76 . 93 %   o f   t he   un de r t a ke n   a da p t i v e   c ha ng e s   w e r e   r e p r e s e n t e d   b y   12  A S T   c o de   di f f e r e nc e s .   M o r e o v e r ,   o nl y   c ha ng e   p a t t e r ns   c o v e r e 6 4. 69 %   t o   76 . 58 %   o f   t he   t o t a l   a da pt i v e   c ha ng e   hunk s   i n   t he   e xa m i ne d   p r o j e c t s .   T he   m o s t   c o m m o n   i nd i v i dua l   pa t t e r n s   a r e   r e l a t e d   t o   i n i t i a l i z i ng   o bj e c t s   a nd  m e t ho d   c a l l s   c ha ng e s .   A   c o r r e l a t i o a n a l y s i s   o e x a m i n e p r o j e c t s   s ho w s   t ha t   t he y   ha v e   v e r y   s i m i l a r   f r e que nc i e s   o f   t he   p a t t e r ns   c o r r e l a t e w i t a da pt i v e   c ha ng e s .   T he   o bs e r v e d   r e pe a t e d   a d a p t i v e   c ha ng e s   c o ul d   be   u s e f u l   e xa m p l e s   f o r   t h e   c o ns t r uc t i o n   o f   t r a ns f o r m a t i o a ppr o a c he s .   Ke y w or d s :   A b s t r a c t   s y n t a t r e e   A da pt i v e   m a i nt e n a n c e   API - m i g ra t i o n   Cha n ge   r e pe r t i t i v e n e s s   S o ur c e   c o d e   c h a n ge   pa t t e rn s   T r a n s f o r m a t i o n a l   a pp r o a c h e s     C opy r i gh t   ©   2020   I n s t i t ut e   o f   A dv anc e E ng i ne e r i ng   and   S c i e nc e   A l l   r i gh t s   r e s e r v e d .   Cor r e s pon di n g   Au t h or :   S ha di   A l j a w a rn e h,   D e pa rt m e n t   o f   S of t w a r e   E n gi n e e r i n g ,   J o r da U n i v e r s i t y   o f   S c i e n c e   a n d   T e c hn o l o gy ,     Ir b i d ,   J o r d a n .   E m a i l :   s a a l j a w a rn e h@ j us t . e du . j o       1.   I N TR O D U C TI O N   In  s o f t w a r e   e vo l ut i o n,   i t   i s   e s s e n t i a l   t o   w o r o n   s e c t i o n s   o f   a   s o ur c e   c o de   t o   i m pl e m e n t   a   pa rt i c ul a r   c h a nge   r e que s t   [1] ,   m a na gi ng   c o de   c l o n e s   [2] ,   po s s i b l y   r e f a c t o r i ng   c o de   t o   e nha n c e   f u n c t i o na l i t y   [3],   f i x     a i m pl e m e n t a t i o b ug  [ 4],   f i xi ng   c o de   s m e l l s   [ 5],   o a d a pt i n g   t h e   s y s t e m   t o   c ha n ge s   i t h e   f r a m e w o r k,   p h y s i c a l   m a c h i n e   [6 ,   7] ,   o r   A P Is   [8,   9] .   S i n c e   e vo l ut i o n   i s   a n   o f t e n   p r o c e s s ,   de ve l o p e r s   n e e f r e que n t l y   t o   m i gra t e   t o   n e w   r e l e a s e s   o f   t h e i r   e m pl oy e A P fo r   i m p r o v e s e r v i c e s   [10,   1 1].   E v o l ut i o t o   a d d r e s s   c h a nge s   t o   de pe n de n t   pl a t f o r m s ,   A P Is ,   a n d   c o m pi l e r s   a r e   ge n e ra l l y   n a m e a d a pt i v e   m a i nt e na n c e   t a s ks   [12 ,   13].   T h e   e xa m pl e - b a s e d   c o n s t r uc t i o o f   t r a n s f o r m a t i o r ul e s   t o   a ut o m a t e   a da pt i v e   m a i nt e n a n c e   t a s ks   h a v e   b e e n   de m o n s t ra t e d   t o   ra di c a l l y   r e duc e   c o s t s   a n d   i m p r o v e   qua l i t y   of   A P I - m i g ra t i o pr o c e s s e s   [14,   15] .   T h o ug h,   t h e   p r i n c i pa l   p r o b l e m   of   t h e   e xa m p l e - b a s e c o n s t r uc t i o n   o f   t r a n s f o r m a t i o n   rul e s   i s   t h e   n e e f o r   e n o ug b e f o r e   a n d   a f t e r   r e a l   e xa m pl e s   of   a da pt i v e   c o de   c ha n ge s   t ha t   h a d   b e e m a de   i t h e   h i s t o r y   of   t h e   s y s t e m   o r   o t h e s y s t e m s   [14].   F u r t h e rm o r e ,   Evaluation Warning : The document was created with Spire.PDF for Python.
                                IS S N :   2088 - 8708   Int   J   E l e c   &   Co m E n g ,   V o l .   10 ,   N o .   3 J u n e   2 020   :     27 19   -   2 73 3   2720   a n o t h e r   m a i c ha l l e n ge   i s   t ha t   t h e   e x a m p l e s   o f   A P I - m i gra t i o n s   p r e v i o us l y   m a de   i n   t h e   h i s t o r y   m us t   a l s o   be   c a t e go r i z e d   a n d   t h e b e   ge n e r a l i z e d   [15 - 1 7]  f o r   b e t t e s y s t e m   e v o l ut i o n .   T hus ,   e v i de n c e s   s h o w   t ha t   e xa m pl e - b a s e t ra n s f o r m a t i o n   l i e s   i n   c a t e go r i z i ng  r e pe t i t i v e   A P c ha nge   e di t s   i n t o   a b s t ra c t i ng  c h a nge   p a t t e rn s   t o   c r e a t e   r u l e s   t h a t   r e a ppl y   t h e s e   r e pe t i t i v e   c ha n ge s   i nt o   o t h e l o c a t i o n s   i n   a   s y s t e m   [15].   Co n s e que nt l y ,   m i ni n a n d   ob s e r v i n t h e   m o s t   r e pe t i t i v e   c o d e   e di t s   t h a t   a r e   r e l e v a nt   t o   t h e   A P I - m i g ra t i o n   c h a n ge s   i s   a n   e s s e n t i a l   s t e t o   c o l l e c t   s uff i c i e n t   e xa m pl e s   f o r   t h e   c o n s t r uc t i o n   o f   e xa m p l e - ba s e t ra n s f o r m a t i o na l   a p p r o a c h e s .   T h e r e   i s   n o   do ub t   t ha t   t h e   s t a t e - of - t h e - a rt   s t udi e s   e nri c h e t h e   s o f t w a r e   e n g i n e e ri n g   r e s e a r c w i t   t h e   e xa m i n a t i o n   o f   t h e   c o de   c h a nge   r e pe t i t i v e n e s s   a n t h e   r e c o gn i z i n g   o f   c h a n ge   p a t t e rn s   r e l e v a n t   t o   t h e   v a r i e t y   of   s of t w a r e   e v o l ut i o n   t a s ks .   N guy e n   e t . a l   [18]   i nt r o duc e a   g ra p h - ba s e m i ni n g   a pp r o a c h,   CP A T M IN E R ,   t o   m i n e   a   s e t   o f   f i n e - gra i n e c h a nge   pa t t e rn s   f r o m   hi s t o r y   r e po s i t o r i e s .   A m o n t h e   m i n e c ha n ge   p a t t e rn s ,   t h e i r   t o o l   c l a s s i f i e o n l y   9%  a s   pa t t e rn s   r e l e v a n t   t o   a da p t i v e   m a i nt e na n c e .   H ow e ve r ,   t h e   p r o po s e a ppr o a c h   fo c us e o i n v e s t i ga t i v e   t h e   c ha n ge   pa t t e rn s   a t   t h e   s e m a n t i c   l e v e l   a n d   t hus   na rr o w s   t h e   po t e n t i a l   c o m p r e h e n s i o n   of   r e c u rr e nt   c o de   c h a n ge s   o f   a da pt i v e   m a i n t e na n c e .   A l s o ,   t h e   m i n e d   c ha n ge   pa t t e rn s   a r e   o n l y   fo r   J a v a   p r o j e c t s   a n d   s o   c a nn o t   b e   ge n e r a l i z e f o r   o t h e d i v e r s e   o pe n - s o ur c e   s y s t e m s .   N i u   e t . a l   [19]   p r o po s e d   a a pp r o a c t ha t   i de nt i f i e s   A P us a ge   p a t t e rn s   b a s e o n   t h e   c o - e xi s t e n c e   r e l a t i o n s   b e t w e e n   o bj e c t   us a ge s .   A dd i t i o n a l l y ,     t h e   a pp r o a c h   h e l ps   r e c o m m e n d i n c h a nge s   t hr o ug h   r e t r i e v i n g   a   g r o up  o f   A P us a ge   pa t t e rn s   r e l e v a nt   t o   a   g i v e n   A P m e t h o d   a s   a   que r y .   A l t h o ugh  t h o s e   s t udi e s   f o c us e o n   a da pt i v e   m a i n t e na n c e ,   t h e i o b t a i n e r e s ul t s   do   n o t   ha v e   ge n e r a l   a n a l y s i s   o n   w h i c ki nds   o f   a da p t i v e   c ha n ge s   a r e   m o s t   c o m m o n   a n d   w h a t   t a xo n o m i e s   o f   a da pt i v e   c h a nge   pa t t e rn s   a r e   o v e r   t h e   hi s t o r y .     O t h e e a rl i e s t ud i e s ,   o t h e   o t h e h a nd,   ha v e   e xa m i n e c o d e   c h a nge   p a t t e rn s   f o r   n o n - a da p t i v e   s of t w a r e   e v o l ut i o n   a t   a   hi g h   l e v e l   of   de t a i l s .   C a m po s   e t   a l   [20]  pe r f o r m e a   l a r ge - s c a l e   s t u dy   t o   e xpl o r e     t h e   r e pe t i t i v e n e s s   of   s e v e r a l   b ug - f i p a t t e rn s   i h i s t o r y   r e po s i t o r i e s   o f   f i ve   J a v a   p r o j e c t s .   T h e   s t u dy   f o un   t h e   p r e v a l e n c e   of   f i v e   b ug - f i pa t t e rn s   s uc a s   a ddi t i o o f   i f   p r e c o n di t i o n   c h e c a n m e t h o c a l l   w i t h   di f f e r e n t   n u m b e o f   pa ra m e t e r s .   A c t u a l l y ,   t h e   s t udy   t ha t   w a s   u n de r t a k e n   i [20]   f o c us e o n   a   s e t   o f   pa t t e rn s   t h a t   w e r e   o r i gi n a l l y   r e c o gn i z e by   P a n   e t   a l .   [ 21].   P a n   a n d   o t h e r   a ut h o rs   m a nua l l y   c l a s s i f i e f i xi n c h a nge s   i n t o   s e v e r a l   pa t t e rn s   b a s e o n   t h e   s y n t a o f   t h e   c ha n ge .   T s a nt a l i s   e t . a l   [ 2 2]  p r e s e n t e d   a   n e w   t e c hni que   f o r   de t e c t i n g   t h e   s e t   of   c o m m o n l y   r e f a c t o r i n c h a nge   pa t t e r n s   t hr o ug t h e   c o m pa ri s o n   o f   s o ur c e   c o de   b e t w e e n   t w o   s y s t e m   v e r s i o n s .   K i m   e t   a l .   [2 3]   o ff e r e a   t a xo n o m y   of   s i g n a t u r e   c ha n ge   pa t t e rn s   o v e r   r e v i s i o n s   t o   c a t e go ri z e   o b s e r v e c h a nge s   t hr o ugh  t h e   a n a l y s i s   of   e i gh t   o pe n   s o u r c e   pr o j e c t s .   N guy e n   e t   a l .   [24]  p r e s e n t e a n   e xa m i na t i o s t udy   fo r     t h e   c o de   c h a n ge   r e pe t i t i v e n e s s   i t h e   hi s t o ri e s   o f   s of t w a r e   s y s t e m s   t hr o ug t h e   m o de l i n g   o f   c o de   c h a n ge s   a s   pa i r s   o f   o l a n n e w   A S T   s ub - t r e e s   a t   t h e   g r a nul a r i t y   of   m e t h o ds .   T h e y   a r e   i nt e r e s t e i n   e xa m i ni n g   r e pe t i t i v e n e s s   o f   b ug  f i xi n g   c h a n ge s   a nd  r e f a c t o r i ng   c ha nge s ,   h o w e ve r ,   w i t h o ut   f oc us i n g   o t h e   c ha n ge   r e pe t i t i v e n e s s   of   o t h e r   m a i n t e n a n c e   t y pe s   s u c h   a s   t h e   a da pt i v e   o n e .   T ha t   i s ,   p r i o s t ud i e s   ha v e   n o   s uff i c i e n t   da t a   t o   dra w   c o n c l us i o n s   r e ga rdi n g   t h e   m o s t   r e pe t i t i v e   A P I - mig ra t i o n   c o de   e di t s   a n t h e i r e l e v a n t   c ha n ge   pa t t e rn s ,   t h o ugh  s uc c o n c l us i o n s   a r e   t h e   i n t e nt   t ha t   i s   r e qu i r e t o   c o n s t r uc t   qu a l i f i e t ra n s f o r m a t i o r ul e s   f o r     a da p t i v e   m a i nt e na n c e .   T h e   w o r o ffe r e h e r e   a i m s   t o   a dd r e s s   t h e   p r o b l e m   of   c o l l e c t i n g   e n o ug e xa m pl e s   f o r   t h e   c o n s t ruc t i o of   c o de   t ra n s f o r m a t i o rul e s   f o A P I - m i g ra t i o t a s ks .   O u s t u d y   i s   w i t t w o   c o n t ri b ut i o n s .   T h e   f i r s t   c o nt r i b ut i o n   i s   t h e   e xpl o ra t i o o f   t h e   h i g h l y   r e pe t i t i v e   a d a pt i v e   c o de   c h a n ge s   a c r o s s   t h e   h i s t o r i e s   o f   o pe n   s o u r c e   s y s t e m s .   O ur  s e c o n d   c o n t r i b ut i o i s   t h e   r e o r ga ni z a t i o o f   t h e   p r e v a l e nt   a d a pt i v e   c ha n ge   pa t t e rn s   a nd   t h e i f r e que n c i e s   a c r o s s   p r o j e c t s .   T h e   m o t i v a t i o o f   o ur   w o r i s   t h e   m a ki n g   o f   ob s e r v a t i o n s   t ha t   d i r e c t l y   gui de   t h e   f ut u r e   r e s e a r c h   i a u t o m a t i c   a d a pt i v e   m a i nt e na n c e   t hr o ug t h e   i de n t i f i c a t i o o f   qua l i f i e r e a l   c o de   e xa m p l e s   o f   c ha n ge s   t ha t   c o ul b e   us e l a t e r   f o r   t r a n s f o r m a t i o n   t o o l   c o n s t ruc t i o n s   a n d   r e g r e s s i o n   t e s t i n g .   In  t hi s   w o r k,   w e   c o n duc t e a   l a rge   c a s e   s t u dy   of   s i C+ +   a nd  J a v a   o pe n - s o ur c e   s y s t e m s   t h a t   p r e v i o us l y   unde r w e n t   m a j o r   a da pt i v e   m a i nt e n a n c e   t a s ks .   W e   c o l l e c t e a   da t a s e t   c o n s i s t i ng  o f   501  a d a pt i v e   c o m m i t s   w i t 6380   c ha n ge   h u n ks   (e . g . ,   a   c o n t i n uo us   s e t   o f   s o ur c e   c o d e   l i n e s   t ha t   a r e   c ha n ge a l o n g   w i t c o n t e xt u a l   un c ha n ge l i n e s ).   T h e n ,   w e   e xa m i n e d   t h e   a da p t i v e   c ha n ge s   a t   t hr e e   l e v e l   o f   gr a nul a r i t y ,   na m e l y   c o m m i t ,   s o u r c e   f i l e ,   a n hu n ks .   O u e xa m i na t i o n   ha s   b e e n   a c c o m pl i s h e t hr o ug h   s o phi s t i c a t e c o m pa r i s o n   a l go r i t h m s   t h a t   i n v o l ve   h e uri s t i c   s e a r c h   o t h e   A S T .   T h e   m a i a dv a nt a ge   o f   w o r ki ng  a t   t h e   A S T   l e v e l   i s   t h e   s uf f i c i e n c y   i ge n e ra t i n g   f i n e - gra i n e d   s y n t a c t i c   c o de   di f f e r e n c e s   b e t w e e n   t w o   A S T s   b e f o r e   a nd  a f t e u n de r t a ki ng   a   m a i n t e n a n c e   c h a nge ,   a n d   h e n c e   de t e c t i ng  c o de   c h a nge   pa t t e rn s   [24] .   W e   us e d   t h e   s t a t e - of - t h e - a rt   A S T   di f fe r e n c i n g   t o o l   G U M T R E E   [2 5]  t o o l   t o   a ut o m a t e   t h e   c om put a t i o o f   t h e   A S T   d i f fe r e n c e s   b e t w e e n   e v e r y   c h a nge   pa i r s   (e . g . ,   f i l e   v e r s i o n s   b e fo r e   a nd  a f t e r   e a c h   u n de rt a ke n   a da p t i v e   c o m m i t o f   a l l   a d a p t i v e   c o m m i t s   unde c o n s i de r a t i o n.   O u r e s ul t s   i n d i c a t e   t ha t   76 . 93%   o f   t h e   e xa m i n e d   a d a p t i v e   c ha n ge s   c o ul b e   r e pr e s e nt e o n l y   by   12  A S T   c o de   di f fe r e n c e s .   F i na l l y ,   w e   e v a l ua t e t h e   pr e v a l e n c e   o f   c h a nge   pa t t e rn s   a n d   s t a t i s t i c a l l y   c o m pa r e t h e i r   r e pe t i t i v e n e s s   f r e que n c i e s   a c r o s s   t h e   e xa m i n e p r o j e c t s .   W e   fo un t ha t   t h e s e   p a t t e rn s   c o v e r e d   64. 69 t o   76. 58 %   o f   a l l   a d a p t i v e   c ha n ge   h u nks .   T h e   r e s t   of   t h i s   pa pe i s   o r g a n i z e a s   f o l l ow s .   S e c t i o n   pr e s e nt s   o u r e s e a r c m e t h o do l o g y .   S e c t i o n   s h o w s   t h e   o b t a i n e r e s ul t s   a n d   o u di s c us s i o n.   W e   p r e s e nt     t h e   r e l a t e w o r i s e c t i o 4,   f o l l ow e by   t h e   c o n c l us i o n s   a nd  o ur  pl a n s   f o r   f ut u r e   r e s e a r c h   i s e c t i o n   5.   Evaluation Warning : The document was created with Spire.PDF for Python.
Int   J   E l e c   &   Co m E n g     IS S N :   2088 - 8708       A   s t udy   of   c ode   c hang e   p at t e r ns   f or   a dapt i v e   m a i nt e nan c e   w i t A ST   a nal y s i s   ( O m ar   M e qdad i l )   2721   2.   R ES EA R C H   M ET H O D     In  t hi s   s e c t i o n,   w e   de s c r i b e   o ur   m e t h o do l o g y   t o   c o l l e c t   a da p t i v e   c h a nge s   f r o m   t h e   v e r s i o n   hi s t o r y   t b ui l o u c h a n ge   d a t a b a s e   a n d   c o m pu t e   t h e i r e pe t i t i v e n e s s   a c r o s s   a da p t i v e   c o m m i t s .   O u m e t h o do l o g y   i s   s h o w n   i n   F i g u r e   1 B e l ow ,   w e   w i l l   e xp l a i n   i n   de t a i l s   t h e   a f o r e m e n t i o n e s t e ps   o f   o ur   r e s e a r c h   m e t h o do l o g y .           F i gu r e   1 .   B l o c di a g r a m   o f   t h e   r e s e a r c m e t h o do l o g y       2. 1 .   D ata  c o l l e c ti o n     T o   i n v e s t i ga t e   A S T   c ha n ge s   i n   a d a pt i v e   c o m m i t s ,   t hr e e   o pe s o ur c e   s y s t e m s   w e r e   s e l e c t e fo r   s t udy .   T h e   s ub j e c t   s y s t e m s   a r e   na m e l y :   t h e   K D E   p a c ka ge   K e xi   (v i s ua l   d a t a b a s e   a pp l i c a t i o n s   c r e a t o r),   t h e   3D   g ra p hi c s   t o o l ki t   O pe n S c e n e G ra p h   (O S G ),   a n d   t h e   J a v a   r e po rt i n g   l i b ra r y   J a s pe r R e p o r t s .   T h e s e   s y s t e m s   w e r e   c h o s e n   us i n g   t h e   f o l l o w i n c r i t e ri a :   1)   h a v e   a c t i v e   hi s t o r y   r e po s i t o r i e s   f r o m   G i t H ub   w i t a   m i ni m um   o f   500  c o m m i t s ,   2)  w e l l   do c um e n t e d,   3)   ha v e   a   l o n g   e v o l ut i o n a r y   hi s t o r y   t h a t   c o n s i s t s   o f   s uc c e s s f ul   A P m i g ra t i o n s   a n d   a da p t a t i o t a s ks ,   a nd  4)   r e p r e s e n t a t i v e   s a m pl e   o f   do m a i n s   a n u n de r l y i n A P Is .   M o r e o v e r ,   t h e   h i s t o r y   o   t h e   A P m i g ra t i o n   t a s ks   f o r   t h e s e   s e l e c t e s y s t e m s   h a b e e n   i n v e s t i ga t e i n   s e v e r a l   p r e v i o us   s t udi e s   [ 26 27 ] .   F o r   i n s t a n c e ,   t h e   A P I - m i g ra t i o n s   o f   K D E   p r o j e c t   a n d   O S G   s y s t e m   h a d   b e e n   i n v e s t i ga t e i n   [ 26 ] ,   w hi l e     t h e   m i g ra t i o n   o f   J a s pe r R e po r t s   t o   us e   J F r e e Cha r t   A P I   v e r s i o 1 . 0. 1 ha d   b e e n   s t ud i e by   N gu y e n   e t   a l .   [ 27 ].   T h e   a c t ua l   a da pt i v e   c o m m i t s   o f   o ur   s ub j e c t   s y s t e m s   ha d   b e e n   m a n u a l l y   r e c o gn i z e d   by   fo l l ow i n   t h e   a pp r o a c h   pe r f o r m e by   M e qda di .   e t . a l   [ 26 ] ,   i n   w hi c i f   t h e   l o m e s s a ge   o f   a   c o m m i t   h a s   t h e   ke y   t e r m s   i n di c a t i n g   A P I - m i g r a t i o n   a c t i v i t i e s   (i . e . ,   i n v o l v i n k n o w n   A P I’s   o r   l a ngua ge   f e a t u r e s   t h a t   w e r e   c h a nge t o   c o m pl y   w i t h   f e a t u r e s / i nt e r f a c e s   fo un i t h e   n e w   A P I),   t h e   c om m i t   i s   c o n s i de r e a s   a d a pt i v e ,   a n t h e t h e   c o de   c h a nge s   i n   t ha t   c o m m i t   a r e   c o n s i de r e a s   a d a p t i v e   c h a n ge s .   T a b l e   1   s h o w s   t h e   s ub j e c t   s y s t e m s   a l o n g   w i t h     t h e   u n de rt a ke a d a p t i v e   m a i nt e na n c e   t a s k,   e xa m i na t i o t i m e   pe r i o d,   a nd   t h e   n um b e o f   m a nua l l y   r e c o gn i z e a da p t i v e   c o m m i t s   o f   e a c h   s y s t e m .   W e   p r o c e s s e a l l   t h e   m a n u a l l y   i de n t i f i e 346   a d a p t i v e   c o m m i t s   o f   t h e   t hr e e   e xa m i n e d   s y s t e m s   a n d   p a r s e i t o t a l   153 s o u r c e   f i l e s   t ha t   b e i n g   a dde d,   m o di f i e d,   a nd  de l e t e d   by     t h e   c o n s i de r e d   a d a pt i v e   c o m m i t s .   R e c a l l   t ha t   a   s o ur c e   f i l e   c o u l b e   c h a nge by   m a n y   c o m m i t s .   If   a   f i l e   c h a nge by   N   a da p t i v e   c o m m i t s ,   w e   c o un t   t hi s   f i l e   N   t i m e s   i o ur  c ha n ge   d a t a s e t ,   s i n c e   w e   fo c us   o n   t h e   c o de   c h a n ge s   o c c urr e i e a c c o m m i t   i nde pe n de n t l y .   P a n   e t   a l .   [ 21 de m o n s t r a t e t ha t   a i n s t a n c e   o f   a   c h a n ge   pa t t e rn  l i e s   i n   t h e   s a m e   s o ur c e   f i l e   a n d   e v e n   w i t hi a   s i ngl e   c ha n ge   hu n k .   T h e r e f o r e ,   w e   p r o c e s s e a l l   346   a d a p t i v e   c o m m i t s   a n w e   us e t h e   G N U   U n i d i f f   ut i l i t y   t o   i de n t i fy   c h a n ge   hunks   (e . g. ,   m o di f i e d,   a dde d ,   a n d   de l e t e d)  h a v i n g   o c c urr e i e a c a d a pt i v e   c o m m i t .   F r o m   t hi s ,   w e   c o l l e c t e a   d a t a   s e t   c o n s i s t i n o f   4737  a da p t i v e   c h a nge   h u n ks .   T a b l e   1   s um m a ri e s   o ur  da t a s e t   o f   a da pt i v e   c h a n ge s .       T a b l e   1 .   S e l e c t e o pe n - s o ur c e   s y s t e m s   us e i o ur  s t udy   w i t t h e i r e l e v a nt   a d a pt i v e   c h a n ge   h u n ks     K e x i   O S G   J a s p e r Re p o rt s   L a n g u a g e   C+ +   C+ +   J a v a   A d a p t i v e   M a i n t e n a n c e   T a s k   M i g ra t i n g   t o   Q t 5 . x   M i g ra t i n g   t o   O p e n G L   4 . x   M i g ra t i o n   t o   J F r e e C h a rt   A P v e r s i o n   1 . 5 . x   T i m e   P e ri o d   7 / 7 / 2 0 1 4   1 / 1 / 2 0 1 8   1 / 1 / 2 0 1 4   -   1 / 1 / 2 0 1 7   1 1 / 1 1 / 2 0 1 7   1 / 1 / 2 0 1 9   #   Co m m i t s   i n   t h e   L o g   F i l e   3283   1984   910   #   A d a p t i v e   Co m m i t s   161  (4 . 9 0 % )   1 2 6   (6 . 3 5 % )   5 9   (6 . 4 8 % )   #   A d a p t i v e   Ch a n g e   F i l e s   682   491   357   #   A d a p t i v e   Ch a n g e   H u n k s   2104   1521   1112     Evaluation Warning : The document was created with Spire.PDF for Python.
                                IS S N :   2088 - 8708   Int   J   E l e c   &   Co m E n g ,   V o l .   10 ,   N o .   3 J u n e   2 020   :     27 19   -   2 73 3   2722   2. 2 .   A S an al ys i s   o s o u r c e   c o d e   c h an ge s   O ur  m e t h o do l o g y   i s   c e n t e r e o n   t h e   a na l y s i s   of   s o ur c e   c o d e   di f fe r e n c e s   b e t w e e n   a   pa i r   o f   s uc c e s s i ve   v e r s i o n s   o f   a   s o ur c e   f i l e   t h a t   w a s   m o di f i e by   a n   a da pt i v e   c o m m i t .   T h e r e   a r e   s e v e r a l   a pp r o a c h e s   f o r   s o ur c e - c o d e   v e r s i o n i n g   a nd  di f f e r e n c i n i t h e   l i t e ra t u r e   [28] .   T h e   m o s t   po p ul a di f f e r e n c i n g   a l go ri t hm s   i s   t h e   e xt ra c t i o n   o f   t e xt u a l   di f f e r e n c e s   (e . g. ,   c ha ra c t e r - ba s e v i e w us i n g   d i f f   ut i l i t y   t ha t   i de nt i f i e s   c h a n ge d   l i n e s   (e . g. ,   m o di f i e d,   a dde d ,   a n de l e t e d)  r e c o r de by   t h e i r   l i n e   n um b e r s .   T h e   d ra w b a c of   t h i s   a pp r o a c h   i s   t ha t   i t   ov e r l o o ks   t h e   u n de r l y i n g   s y n t a x - s t r uc t u r e   o f   t h e   s o u r c e   c o de   c ha n ge s   [ 28],   s i n c e   t h e   d i f fe r e n c i n g   i s     c h a ra c t e r - b a s e d.   A n o t h e a p p r o a c i s   l o o ki n g   f o di f f e r e n c e s   a t   t h e   s y n t a c t i c a l   l e v e l   by   a   c o m pa ri s o o   t h e   t w o   A S T ’s   b e fo r e   a nd  a f t e r   t h e   c h a nge .   T h e   r e s ul t s   o f   t hi s   a pp r o a c h   a r e   b a s e o t h e   t r e e   o pe r a t i o n s   o c c ur   o n   t h e   i n d i v i dua l   n o de s   o f   a A S T   [29] .   S y n t a c t i c a l   d i f fe r e n c i n g   ha s   b e e n   w i de l y   a n d   s uc c e s s f ul l y   us e i   t h e   l i t e r a t u r e   [24 ,   28 - 30] .     T h us ,   i t h i s   r e s e a r c h,   w e   ha v e   us e t h e   a ut o m a t e d   c o m put a t i o o f   s o ur c e - c o de   ve r s i o n i ng   a n d   di f fe r e n c i n g   b e t w e e n   t h e   A S T s   t ha t   a r e   e xt ra c t e f r o m   t h e   s uc c e s s i ve   v e r s i o n s   o f   c h a n ge s o ur c e   f i l e s .   S i n c e   t h e   s ub j e c t   s y s t e m s   i o ur  s t udy   a r e   C+ +   a n J a v a   o pe n - s o ur c e   s y s t e m s ,   w e   h a v e   c h o o s e   t h e   o pe n - s o u r c e   G U M T R E E   t o o l   [25],   w hi c h a s   t h e   a b i l i t y   t o   c o m put e   t h e   s o ur c e   c o d e   ve r s i o ni n f o r   b o t h   C+ +   a n J a v a   s y s t e m s   a t   t h e   A S T   l e v e l ,   t hr o ug t h e   us a ge   o f   s r c M L   [28]   f o r m a t   a s   a   b a c ke n d   f o r   t h e   r e p r e s e nt a t i o o f   C+ +   c o d e .   T h e   G U M T R E E   i s   a   c o m pl e t e   f r a m e w o r t h a t   c o n v e r t s   a   s o ur c e   f i l e / h u n k   i n t o   a A S T   f o r m a t   a n d   a l s c o m put e s   t h e   d i f f e r e n c e s   b e t w e e n   t w o   g i v e n   A S T s .   M o r e o ve r,   t h e   e v a l ua t i o r e s ul t s   o f   G U M T R E E   s h o w   t ha t   i t   o ut pe r f o r m s   t h e   d i f f   ut i l i t y   a n o t h e r   t r e e - b a s e di f f e r e n c i ng  t o o l s   s uc h   a s   C h a nge D i s t i l l e r   [29] .   G U M T R E E   pr o duc e s   di f f e r e n c i n g   r e s ul t s   by   c o m put i ng  a   s e que n c e   o f   e di t   a c t i o n s   t ha t   t ra n s f o r m   o n e   A S T   i n t o   a n o t h e r .   T h e   po s s i b l e   e di t   a c t i o n s   a r e   a s   f o l l ow s :     In s e r t   (N ,   P N ,   I ,   L ,   V ):   a i n s e rt i n g   o f   a   n e w   n o de   N   a s   t h e   I th   c h i l o f   t h e   n o de   P N .   T h e   l a b e l   o f   n o de   N   i s   L ,   a nd  i t s   v a l ue   i s   V .   H e r e ,   V   i s   o pt i o n a l .     D e l e t e   (N ):   de l e t i n a e xi s t i ng  n o de   N   f r o m   t h e   A S T .     U pda t e   (N ,   V ):   upd a t i ng  t h e   v a l ue   o f   a e xi s t i ng  n o de   N   w i t a   v a l ue   v .     M ov e   (N ,   P N ,   I):   m o v i n g   a   s ub   t r e e   r o o t e a t   t h e   n o de   N   t o   b e   t h e   I th   c hi l d   o f   t h e   n o de   P N .   T h e   e di t   a c t i o n s   t o   t r a n s f o r m   t h e   A S T   v e r s i o b e fo r e   t h e   u n de rt a ke c o d e   c h a n ge s   t o   t h e   A S T   v e r s i o n   a f t e r   c h a nge s   a r e   r e c o r de i a E di t   S c r i p t .   T h e   de t a i l e de s c r i pt i o o f   t h e   e di t   s c ri pt s   a nd  t h e i r   c o n t e n t s   a r e   a v a i l a b l e   i [25 ,   29] .   T o   b e t t e u nde r s t a n d   t h e   d i f fe r e n c i n g   r e s ul t s   b e t w e e n   t w o   A S T s   b e fo r e   a nd  a f t e c o de   c h a ng e s ,   l e t   us   c o n s i de t h e   c h a nge   e xa m pl e   t ha t   i s   s h o w i n   F i gu r e   2 .   T h e   f i gu r e   s h o w s   t h e   i ni t i a l   a n d     t h e   m o di f i e v e r s i o n s   o f   a   C+ +   c o de ,   a n a l s o   s h o w s   t h e   c o r r e s po n di n A S T s   b e f o r e   a n a f t e r   t h e   c o de   c h a n ge s .   G i v e n   t w o   A S T s   b e fo r e   a n d   a f t e c o de   c ha n ge s ,   t h e   G U M T R E E   ge n e ra t e s   t h e   c o rr e s po n di n g   e d i t   s c ri pt   c o n t a i ni n g   8   e di t   a c t i o n s ,   a s   t h e   o n e   s h o w n   i n   F i gu r e   2 .   F o i n s t a n c e ,   o n e   o f   t h e   e di t   a c t i o n s   i n   t h e   s c ri pt   i s   (In s e r t   ( n29 ,   n 10 ,   0 ,   If S t a t e m e n t ) ),   w hi c r e p r e s e nt s   a i n s e rt i o o f   a   n e w   n o de   n 29   c o n t a i n s   a If   s t a t e m e nt   t o   b e   t h e   0t c h i l o f   t h e   n o de   n 10.   S i m i l a rl y ,   t h e   e di t   a c t i o n   (U pda t e   ( n18 ,   pa t h ) r e p r e s e n t s   upd a t i n g   t h e   v a l ue   of   n o de   n 18   w i t h   a   s t ri n g   l i t e r a l   o f   t h e   v a l ue   pa t h” .           F i gu r e   2 .   A   c ha n ge   e xa m p l e   o f   a   C+ +   c o de   f r a gm e n t   a nd  t h e   r e s ul t i n g   G U M T R E E ’s   e di t   s c ri p t       H ow e ve r ,   t h e   e di t   s c ri pt s   t h a t   a r e   ge n e ra t e b y   t h e   G U M T RE E   t o o l   a r e   a t   t o o   l o w   gr a n u l a ri t y ,   w h e r e   t h e   e di t   a c t i o n s   c o m put e by   t hi s   t o o l   a r e   a t   t h e   l e v e l   of   n o de s   (e . g. ,   t o o   f i n e - g r a i n e c o de   di f fe r e n c e s i n s t e a of   e xpr e s s i o n s   [ 31 ].   B ut ,   t h e   r e pr e s e nt a t i o n   o f   c o de   c h a n ge s   us i n t h e   e di t   a c t i o n s   a t   t h e   l e v e l   of   n o de s   m a ke s   Evaluation Warning : The document was created with Spire.PDF for Python.
Int   J   E l e c   &   Co m E n g     IS S N :   2088 - 8708       A   s t udy   of   c ode   c hang e   p at t e r ns   f or   a dapt i v e   m a i nt e nan c e   w i t A ST   a nal y s i s   ( O m ar   M e qdad i l )   2723   t h e   f o l l ow - up  a na l y s i s   a nd  t h e   u n de r s t a ndi n g   o f   m a i nt e na n c e   t a s ks   di f f i c ul t .   F o r   i n s t a n c e ,   de v e l o pe r s   w i l l   f o c u s   o n   t h e   i n s e r t i o o f   a   v a ri a b l e   de c l a ra t i o n   s t a t e m e n t   r a t h e t ha c o n s i de r i ng  t h e   t o o   f i n e - gra i n e d   t r e e   o pe ra t i o n s   a s s o c i a t e w i t h   t h a t   i n s e r t i o n .   T h e r e fo r e ,   i t   i s   n e c e s s a r y   t o   c o n s i de s uc r e l a t e d   t o o   f i n e - g r a i n e t r e e   o pe r a t i o n s   a s   a   w h o l e   i n   t h e   f o l l ow - up  a n a l y s i s   t a s ks .   M o r e o v e r ,   t h e   s e t   o f   r e l a t e f i n e - g ra i n e d   e di t   a c t i o n s ,   w h i c h   de s c r i b e   o n e   h i g h - l e v e l   c ha n ge   (e . g. ,   m e t h o de c l a ra t i o s t a t e m e n t ) ,   us ua l l y   w o ul b e   s c a t t e r e t hr o ugh  t h e   e di t   s c r i p t   c o m put e by   t h e   G U M T R E E   t o o l   [ 32 ].   T h e r e f o r e ,   a   s e t   o f   pr e p r o c e s s i n s t e ps   a r e   n e e de t o   ge n e r a t e   m o r e   unde r s t a n d a b l e   c o de   di f fe r e n c e s   f r o m   e a c h   e d i t   s c ri pt   ge n e ra t e d   by   t h e   G U M T R E E   t o o l .   H e r e ,   t h e   p r i m a r y   i de a   i s   t o   g r o up  t o ge t h e a l l   o f   t h e   f i n e - g ra i n e d   c o de   di f f e r e n c e s   t ha t   a r e   r e l a t e t o   a   hi g h - l e v e l   A S T   e l e m e n t   o r   b e l o n t o   t h e   s a m e   c o nn e c t e c o m po n e n t   i nt o   o n e   c l us t e r,   w h e r e   t h o s e   r e l a t e di f f e r e n c e s   m i g ht   b e   s c a t t e r e a c r o s s   t h e   s c ri pt .   A c c o r di n g l y ,   w e   h a v e   de v e l o p e o ur   o w n   t oo l   t h a t   t r a v e r s e   t h e   t r e e   a c t i o n s   o f   a n   e di t   s c r i p t   by   pe r fo r m i ng  t w o   ph a s e s   a s   f o l l ow s :   a .   P h a s e   1 :   S u m m a ri z i ng  Co de   D i f fe r e n c e s .     P a rt i c ul a r l y ,   t h i s   p ha s e   i s   s pe c i f i c   f o r   t h e   i n s e r t i o a n d   de l e t i o n   a c t i o n s   w i t hi a e di t   s c ri pt .   M o s t l y ,   a i n s e r t   o a   de l e t e   a c t i o o a   de c l a ra t i o o a   s t a t e m e n t   A S T   n o de   i s   s uppl e m e nt e b y   s e v e r a l   i n s e r t i o o de l e t i o a c t i o n s   o n   c o m po s i ng  e l e m e nt s   o f   t h a t   A S T   n o de .   T h e r e f o r e ,   a s   i [ 32 ],   w e   di f f e r e n t i a t e   b e t w e e n   t w t y p e s   of   i n s e r t i o n / de l e t i o a c t i o n s ,   a s   f o l l ow s :   In s e r t i n g/ de l e t i n g   o f   a   b as e   n o de :   A   b a s e   n o de   i s   r e c o gn i z e a s   a   n o de   i n v o l ve s   a   hi g h - l e v e l   A S T   e l e m e n t   (de c l a ra t i o o s t a t e m e n t ) .   F o i n s t a n c e ,   w e   c o n s i de n o de s   t ha t   c o nt a i e i t h e i f   s t a t e m e nt ,   f o r   s t a t e m e n t ,   r e t u rn  s t a t e m e n t ,   m e t h o de c l a ra t i o n,   v a r i a b l e   de c l a r a t i o n,   o r   a t t r i b u t e   de c l a ra t i o n   a s   b a s e   n o de s .     F o r   e xa m pl e ,   i n   F i g u r e   2     ,   n o de s   n 29 ,   n33,   n 34 ,   n 36 ,   a n d   n 38   a r e   c o n s i de r e d   a s   b a s e   no de s .     In s e r t i n g/ de l e t i n g   o f   a   c om pos i te   n o de :   A   c o m po s i t e   n o de   i s   a   n o de   t ha t   i s   i n s e r t e d/ de l e t e d   a s   a   c o n s e que n c e   of   a n   i n s e rt i n g / de l e t i ng  o f   a   b a s e   n o de .   T ha t   i s ,   a   c o m po s i t e   no de   doe s   n o t   h o l d   s t a t e m e n t s   o r   de c l a r a t i o n s .   F o r   e xa m pl e ,   i n   F i gu r e   2 ,   t h e   n o de   n 30  i s   c o n s i de r e a s   a   c o m po s i t e   n o de   s i n c e   i t   c o n t a i n s   a i n f i e xpr e s s i o n .   A l s o ,   a   c o m po s i t e   n o de   c o ul b e   a   c hi l d   o a   b a s e   n o de   o a n o t h e r   c o m po s i t e   n o de .     In,   t h e   c o m po s i t e   n o de   n 30   i s   a   c hi l d   o f   t h e   b a s e   n o de   n 29 ,   w h i l e   t h e   c o m po s i t e   n o de   n 3 1   i s   a   c h i l d   of    t h e   c o m po s i t e   n o de   n 30 .   In   t hi s   p ha s e ,   s i n c e   w e   a r e   o nl y   i n t e r e s t e o n   i n s e rt i o n   a n de l e t i o n   a c t i o n s ,   w e   ha v e   i m pl e m e n t e d   a   pa rt i a l   o f   t h e   G e n e ra t i n Co n c i s e   Co de   D i ffe r e n c e s   s t e of   t h e   CL D IF F   t o o l   t h a t   i s   p r o po s e i n   [ 32].   T ha t   i s ,   i n s t e a d   o f   c a rr y i n o ut   t h e   w h o l e   c o n c i s e   s t e o f   t h e   CL D IF F   t o o l ,   w e   h a v e   o n l y   pe r f o r m e d   t h e   pa rt i a l   t ha t   fo c us e s   o n   g r o upi n a n   i n s e rt / de l e t e   a c t i o n   o f   a   b a s e   n o de   w i t h   t h e   i n s e r t i o n / de l e t i o n   a c t i o n s   o f   t h e   c o m po s i n g   n o de s   o f   t ha t   b a s e   n o de .   H e n c e ,   w e   pa r s e   a l l   t h e   i n s e rt i o a nd  de l e t i o a c t i o n s   i a e di t   s c ri pt .   F i r s t l y ,   f o r   a i n s e r t i o a c t i o n   o f   t h e   b a s e   n o de   A   (e . g. ,   I n s e rt   (A ,   P N ,   I ,   L ,   V )),   w e   t ra v e r s e   A ’s   c hi l d   n o de s   i n   a   de pt h - f i r s t   w a y   w h i l e   d i s t i ngui s hi n g   b e t w e e n   t h e   b a s e   a nd   c o m po s i n g   c h i l d   n o de s   o f   A .   F o e a c t ra v e r s e c h i l d   c o m po s i t e   no de   C,   i f   C   i s   a   n e w l y - a dde by   t h e   i n s e rt i o n   a c t i o o A ,   w e   gr o up  A   t o   C   a nd  c o n t i n ue   t h e   t ra v e r s a l   o C’s   c h i l d   n o de s .   O t h e   o t h e ha n d ,   f o r   e a c t ra v e r s e c h i l d   b a s e   n o de   B ,   w e   s t o t ra v e r s a l   o B ’s   c h i l d   n o de s ,   b ut   c o n t i n ue   t h e   t r a v e r s a l   o t h e   o t h e c h i l n o de s   o f   A .   A t   t h e   e n d,   w e   r e pl a c e   t h e   i n s e r t i o o f   A   a nd  a l l     t h e   i n s e rt i o n   a c t i o n s   o f   t h o s e   c o m po s i t e   n o de s   t ha t   w e r e   gr o u pe w i t h   A   by   t h e   c o n c i s e   c o de   di ffe r e n c e   I n s e rt   (A ,   P N ,   I,   L ,   V )) .   T h e n ,   w e   pe r fo r m   t h e   s a m e   c o n c i s e   s t e m e n t i o n e a b o ve   fo r   e a c de l e t i o a c t i o n   o f   a   b a s e   n o de .   F o e xa m pl e ,   w h e t ra v e r s i n g   t h e   e di t   s c r i p t   s h o w n   i n   F i gu r e   2 ,   w e   c o n s i de (I n s e r t ( n 2 9,   n 10 ,   0 ,   If S t a t e m e nt ))  a s   a n   i n s e rt i o n   o f   a   n e w l y - a dde b a s e   n o de   ,   a n d   w e   gr o up  i t   w i t h   i t s   de s c e n de n t   i n s e rt i o n s   o n e w l y - a dde c o m po s i t e   n o de s :   (I n s e rt ( n 30 ,   n29,   0 ,   I n f i x E xp r e s s i o n,   = = ) ,   I n s e r t ( n31 ,   n 3 0,   0,   S i m pl e N a m e ,   j ) ,   a n I n s e r t ( n32,   n 30 ,   1 ,   N um b e r L i t e ra l ,   5)) .   F i gu r e   s h o w s   t h e   o ut put   o f   t h i s   p h a s e   w h e n   a p pl y i n i t   o   t h e   e di t   s c ri pt   gi v e i n   F i g u r e   2 .   b .   P ha s e   2:   T e x t ua l   R e pr e s e nt i n g   o f   Co n c i s e   Co de   D i f fe r e n c e s .   H e r e ,   w e   a i m   a t   r e p r e s e n t i ng   t h e   c o n c i s e   c o de   di f f e r e n c e s   i a   m a nn e h e l ps   e xt r a c t i n g   t h e   e s s e n c e   o t h e   c ha n ge s   f r o m   t h o s e   i n s e rt e d,   m o v e d,   upda t e d,   a n d   de l e t e n o de s ,   a nd  c o n s e que nt l y   unde r s t a n d   t h e   s y n t a c t i c   ty p e s   of   t h e   u nde rt a ke c ha n ge s .   T h e r e f o r e ,   w e   h a v e   t e xt u a l l y   r e pr e s e n t e d   e a c h   c o n c i s e   e di t   a c t i o i a   m a nn e r   s i m i l a t o   t h e   t e xt u a l   r e p r e s e n t a t i o o f   e di t   a c t i o n s   pe r f o r m e i [30 ].   T h e   t e xt u a l   r e p r e s e n t a t i o n   o f   a A S T   c o n c i s e   e di t   a c t i o n   i s   a   3 - v a l ue   t u pl e :   ( T ,   E ,   P E ),   w h e r e   T   i s   t h e   c h a nge   t y pe ,   E   i s   t h e   c o de   e n t i t y   c o rr e l a t e t o   t h e   c h a nge ,   a nd  P E   i s   t h e   p a r e nt   c o de   e n t i t y   w h e r e   t h e   c ha n g e   oc c ur s .   I n   o ur  w o r k,   t h e   c h a n ge   t y p e   (T i s   o n e   of   t h o s e   c ha n ge   t y pe s   t ha t   a r e   de f i n e i [33 ],   w hi c a r e   s pe c i f i c   t o   c ha n ge s   o f   o b j e c t - o r i e n t e d   c o de ,   s uc a s   F i na l   M o di f i e r   I n s e r t ,   S t a t e m e n t   I n s e rt ,   Cl a s s   R e n a m i ng,   M e t h o R e n a m i n g ,   P a r e n t   Cl a s s   U pda t e ,   P a r a m e t e r   T y p e   Cha n ge ,   a nd  R e t u rn  T y pe   U pda t e .   M o r e o ve r ,   s i n c e   a d a pt i v e   m a i nt e n a n c e   i s   i r e s po n s e   t o   c h a nge s   i   t h e   API - m e t h o i n v o c a t i o n s ,   w e   m a ke   us e   of   a ddi t i o n a l   c ha n ge   t y pe s ,   n a m e l y   A r gum e nt   I n s e r t ,   A r gu m e nt   D e l e t e ,   a n d   A r gu m e n t   U pda t e .   T h o s e   a ddi t i o n a l   c h a nge   t y p e s   a r e   a l s o   us e by   t h e   G U M T R E E   t o o l .   F o r   i n s t a n c e ,   t h e   3 - v a l ue   t upl e   o f   t h e   c o n c i s e   e di t   a c t i o (I n s e r t   ( n 33 ,   n 2 9,   1,   R e t urn S t a t e m e nt )) ,   s h o w n   i   F i gu r e   3 ,   w o ul b e :   (S t a t e m e nt   I n s e rt ,   R e t urn,   If ).   Evaluation Warning : The document was created with Spire.PDF for Python.
                                IS S N :   2088 - 8708   Int   J   E l e c   &   Co m E n g ,   V o l .   10 ,   N o .   3 J u n e   2 020   :     27 19   -   2 73 3   2724   In  t h e   c a s e   o f   a   b l o c s t a t e m e nt   a s   a   p a r e nt   e nt i t y   (P E )   i t he   3 - v a l ue   t upl e   o f   a   c o n c i s e   e di t   a c t i o n,   w e   r e pl a c e   i t   by   i t s   n o n - b l o c k’  i m m e di a t e   p a r e n t .   F o e xa m pl e ,   i n   F i g u r e   3 ,   t h e   3 - v a l ue   t up l e   o f   t h e   c o n c i s e   e di t   a c t i o I n s e rt   ( n 29 ,   n 10 ,   0 ,   If S t a t e m e n t )   w o ul b e   (S t a t e m e n t   I n s e r t ,   If ,   b l o c k).   H e n c e ,   w e   r e pl a c e   t h e   n o de   n 1 (e . g . ,   b l o c k)  by   i t s   i m m e di a t e   p a r e nt   n 6 ,   s e e   F i gu r e   2 ,   a n d   a s   a   r e s ul t   t h e   t e xt u a l   r e p r e s e nt a t i o w o ul be   (S t a t e m e nt   I n s e r t ,   If ,   F o r ) .   A t   t h e   e n d   o f   t h e   a f o r e m e n t i o n e d   p ha s e s ,   o u t o o l   p r o duc e s   a   n e w   e di t   s c r i p t   f r o m   t h e   o n e   t h a t   ha s   b e e n   ge n e ra t e d   by   t h e   G U M T R E E   t o o l .   I t h e   r e s t   o f   t h e   p a p e r ,   w e   c a l l   t h i s   n e w   s c r i pt   a s   Co n c i s e   E d i t   S c ri pt .   F i gu r e   4   s h o w s   t h e   c o n c i s e   s c r i pt   a s s o c i a t e w i t t h e   A S T   e di t   a c t i o n s   g i v e n   i n   F i gu r e   3 .   I t hi s   s t u dy ,   t o   pe r f o r m   o u r   e xa m i na t i o n   o f   t h e   f r e que n t   c o de   c h a n ge s   r e l e v a n t   t o   t h e   a d a pt i v e   m a i nt e na n c e ,   w e   fo r m ul a t e   a   c o de   c ha n ge   b y   a   c o m m i t   R   a s   i t h e   b e l ow   de f i n i t i o a nd   t h us   e a c h   c o n c i s e   e d i t   a c t i o i F i gu r e   4   r e p r e s e nt s   a   s i ngl e   c o de   c h a nge .       D e f i n i t i o n   1 :   A   c o de   c h a n ge   b y   t h e   c o m m i t   R   i s   r e p r e s e nt e a s   a   c o n c i s e   A S T   c o de   di ff e r e n c e   i n   t h e   c o n c i s e   e di t   s c r i p t   o f   R .     2. 3 .   C om p u ti n r e p e ti t i v e n e s s   o AST   c o d e   c h an g e s   W e   w a n t   t o   e xa m i n e   t h e   r e pe t i t i v e n e s s   o f   a d a pt i v e   c o d e   c ha n ge s   a c r o s s   t h e   hi s t o ri e s   o f   di f fe r e nt     o pe n - s o ur c e   s y s t e m s ,   w h e r e   w e   c o n s i de t h e   D e f i na t i o n 1   t o   m o de l   t h e   c o de   c h a n ge s   pe r f o r m e d   by   e a c h   c o m m i t   unde r   t h e   c o n s i de r a t i o n.   T h e   r e pe t i t i v e n e s s   o f   a   c o de   c h a n ge   i s   c o m put e a s   t h e   ra t i o   b e t w e e n   t h e   n u m b e r   o o c c urr e n c e s   o f   t h a t   c ha n ge   o v e r   t h e   t o t a l   n u m b e r   o f   s t udi e c ha n ge s .   T h e   go a l   o f   s uc h   e xa m i n a t i o n   i s   t o   l e a rn   w h a t   t y pe s   of   A S T   c o de   di ffe r e n c e s   t h a t   a r e   f r e que n t l y   o c c u rri n i n   a d a pt i v e   c o m m i t s .   T o   a c hi e v e   o ur   go a l ,   w e   n e e s t udy i n t h e   r e pe t i t i v e n e s s   o f   a   c o de   c h a nge   i n   t w o   s c e n a ri o s   na m e l y   w i t hi n - s y s t e m   a n d     a c r o s s - s y s t e m s .   I w i t h i n - s y s t e m   s e t t i n g ,   w e   a i m   a t   m i ni n g   t h e   r e pe t i t i v e n e s s   o f   a   c o de   c ha n ge   w i t hi n   t h e   hi s t o r y   of   a   s pe c i f i c   s y s t e m ,   w h i l e   i t h e   o t h e s e t t i ng  w e   c h e c t h e   r e pe t i t i v e n e s s   t hr o ug t h e   h i s t o r i e s   o di f fe r e nt   s y s t e m s T h us ,   a s   i [ 24 ] ,   w e   de f i n e   a   r e pe a t e d   a d a p t i v e   c h a nge   w i t hi t h e   hi s t o r y   o f   a   s pe c i f i c   s y s t e m   a s   f o l l ow s :     D e f i n i t i o 2:   A   c o de   c h a nge   by   t h e   a da p t i v e   c o m m i t   R   o f   t he   o pe n - s o ur c e   s y s t e m   S   i s   a   r e pe a t e d   c ha n ge   i f   i t   m a t c h e s   a n o t h e r   a d a pt i v e   c o de   c h a n ge   o c c urr i ng  i a e a rl i e r   a da pt i v e   c o m m i t   o f   S .           F i gu r e   3 .   T h e   e di t   s c r i p t   a s s o c i a t e w i t c o de   c h a n ge s   of  F i g ur e   a t   t h e   e n d   o f   pha s e 1           F i gu r e   4 .   T h e   c o n c i s e   e di t   s c ri pt   a s s o c i a t e w i t c o de   c h a n ge s   of  F i gur e   2       O n   t h e   o t h e r   ha n d ,   w e   c o m put e   t h e   r e pe t i t i v e n e s s   o f   a   c o de   c h a nge   a c r o s s   t h e   h i s t o r i e s   o f   di ffe r e nt   s y s t e m s   us i n g   t h e   f o l l ow i n de f i n i t i o n:     D e f i n i t i o 3:   A   c o de   c h a n ge   by   t h e   a da p t i v e   c o m m i t   R   o f   t h e   o pe n - s o ur c e   s y s t e m   S   i s   a   r e pe a t e d   c h a n ge   i f   i t   m a t c h e s   a n o t h e a da pt i v e   c o de   c h a nge   o c c urr i ng   i a e a r l i e a d a pt i v e   c o m m i t   o f   S   o o t h e o pe n - s o ur c e   s y s t e m s .   If   a da p t i v e   c ha n ge s   r e pe a t   c o m m o nl y   i t h e   w i t h i n - s y s t e m   s e t t i ng,   t h e n   t h e   r e pe a t e d   c ha n ge s   o f   a   s y s t e m   w o ul b e   goo e xa m p l e s   f o r   t h e   e xa m p l e - b a s e c on s t ruc t i o o f   t h e   s pe c i f i c   t ra n s f o r m a t i o rul e s   f o r   t h a t   s y s t e m .   If   c ha n ge s   a r e   f r e que n t   i n   t h e   a c r o s s - s y s t e m s   s e t t i n g,   t h e n   t h o s e   r e pe a t e c ha n ge s   w o ul b e   us e f ul   e xa m pl e s   f o r   t h e   ge n e ri c   t r a n s f o r m a t i o n   r u l e s   t o   b e   us e for   d i f f e r e n t   s y s t e m s .   T o   c h e c c o de   c h a n ge s   fo r   r e pe t i t i v e n e s s ,   w e   ha v e   b ui l t   a   C ha n ge   D i c t i o n a r y   (CD )   f r o m   t h e   h i s t o r i e s   o f   di f f e r e n t   o pe n - s o ur c e   s y s t e m s .   T h e   di c t i o na r y   i s   a   s e t   o f   pa i r s   o f   t h e   f o r m   ( C,   R e p (C))  w h e r e   i s   a   c o de   c h a n ge   a n R e p (C)  i s   t h e   r e pe t i t i v e n e s s   of   C   a c r o s s   t h e   e xa m i n e d   s y s t e m s .   E a c c o de   c ha n ge   C   i s   s t o r e d   i t h e   di c t i o n a r y   a s   a   s t ruc t u r e   w i t h   t h e   3 - v a l ue   t up l e :   ( T ,   E ,   P E ) ,   a s   w e   di s c us s e pr e v i o us l y .   F i gu r e   5   s h o w s   t h e   a l go ri t hm   t h a t   c o n s t r uc t s   t h e   c ha n ge   d i c t i o na r y .   T h e   a l go r i t h m   i s   s i m p l e   a n d   w o r ks   m uc h   l i ke   h o w   de v e l o pe r s   w o ul c o m put e   Evaluation Warning : The document was created with Spire.PDF for Python.
Int   J   E l e c   &   Co m E n g     IS S N :   2088 - 8708       A   s t udy   of   c ode   c hang e   p at t e r ns   f or   a dapt i v e   m a i nt e nan c e   w i t A ST   a nal y s i s   ( O m ar   M e qdad i l )   2725   c h a nge   r e pe t i t i v e n e s s   i n   t h e i r   h e a d .   T h e   a l go r i t h m   t ra c e s   a l l   t h e   c o m m i t s   u n de r   t h e   e xa m i n a t i o n   (l i n e   2).   T h e n,   f o r   e a c c o m m i t ,   t h e   a l go ri t hm   t ra c e s   a l l   t h e   s o ur c e   f i l e s   t o uc h e by   t h e   c o m m i t ,   a n d   ge n e ra t e s   t h e   c o n c i s e   e di t   s c r i p t   a s s o c i a t e w i t h   t h e   c ha n ge s   pe r f o r m e o v e r   e a c t o uc h e s o ur c e   f i l e   ( l i n e s   3 - 5 ).   N e xt ,   f o e a c c o n c i s e   c o de   c h a nge   b e l o n gs   t o   t h e   ge n e ra t e c o n c i s e   s c ri pt ,   t h e   t o t a l   num b e o f   c h a nge s   i i n c r e m e n t e d   ( l i n e   7)   a n d   t h e i f   t h e   c ha n ge   i s   e n c o un t e r e f o r   t h e   f i r s t   t i m e ,   t h e   a l go r i t h m   i n s e rt s   t h e   c h a n ge   w i t a   c o un t e v a l ue   o f   i n t o   t h e   O c c urr e n c e   D i c t i o n a r y   O C   ( l i n e   9 ).   O t h e r w i s e ,   t h e   c o unt   v a l ue   f o r   t h e   c h a nge   i s   i n c r e m e nt e (l i n e   1 1 ).   F i n a l l y ,   t h e   r e pe t i t i v e n e s s   o f   a   c o de   c h a nge   i s   c o m put e a s   w e   di s c us s e e a r l y   (l i n e s   16 - 19)   a nd  v a l ue s   a r e   s t o r e i t h e   C h a nge   D i c t i o na r y T he   s a m e   a l go r i t h m   i s   us e w i t t h e   t w o   s e t t i n gs .   In  w i t hi n - s y s t e m   s e t t i n g ,   w e   f o l l ow   D e f i n i t i o 2   a n d   h e n c e   t h e   S o ur c e L i s t   i n c l ude s   o n l y   o n e   o pe n - s o u r c e   s y s t e m   a n d   t h e   Com m i L i s t   i s   a   l i s t   o f   a l l   c o l l e c t e a da p t i v e   c o m m i t s   o f   t ha t   s y s t e m .   W i t h   t h e   o t h e r   s e t t i n g ,   t h e   Sour c e L i s t   c o nt a i n s   a l l   t h e   e xa m i n e o pe n - s o ur c e   s y s t e m s   a n s o   Com m i L i s t   i s   a   l i s t   o f   a l l   c o l l e c t e d   ad a p t i v e   c o m m i t s   a c r o s s   t h e   s t ud i e s y s t e m s .       3.   R ES U LTS   A N D   A N A L Y S I S     W e   h a v e   a pp l i e d   o ur   e x a m i n a t i o n   m e t h o do l o g y   o n   t h e   a l l   a d a pt i v e   c o m m i t s   t ha t   w e r e   c o l l e c t e f r o m   t h e   hi s t o r y   r e po s i t o r i e s   o f   t h e   e xa m i n e d   s y s t e m s .   H e r e ,   w e   a s s um e   t h a t   e a c a da pt i v e   c o m m i t   o n l y   c o n t a i n s   a da p t i v e   c h a nge s   (e . g. ,   n o   c h a nge s   r e l e v a n t   t o   o t h e r   t y pe s   of   m a i n t e n a n c e   a c t i o n s ) .   T h i s   a s s um p t i o r e p r e s e n t s   o n e   o f   t h e   t hr e a t s   t o   v a l i d i t y   of   o ur   s t udy ,   a s   w e   w i l l   di s c us s   l a t e r .   A f t e r w a r d ,   w e   h a v e   e xt r a c t e d   t h e   c o n c i s e   e di t   s c ri pt   a s s o c i a t e w i t e a c c o n s i de r e c o m m i t .   W e   o b s e r v e i t o t a l   11 281  c o n c i s e   e di t   a c t i o n s .   T h i s   d a t a s e t   o f   c o d e   c h a n ge   w a s   us e t o   a n s w e r   o ur   r e s e a r c h   q ue s t i o n s   a t   d i f fe r e nt   l e v e l s   of   gr a n u l a ri t y   s uc h   a s   c o m m i t   a n d   c h a n ge   h u nk .   T a b l e   2   r e po r t s   o ur  c h a nge   d a t a s e t   t h a t   i s   us e d   i t h i s   s t udy .   B e l ow ,   w e   p r e s e n t   t h e   de t a i l s   b e h i n d   o ur  o b t a i n e r e s ul t s   a nd  a n s w e r i n g   t h e   r e s e a r c h   que s t i o n s   po s e b e fo r e .             F i gu r e   5 .   A l go r i t hm   t o   c o m put e   r e pe t i t i v e n e s s   f o r   e a c h   c h a n ge   a c r o s s   e xa m i n e s y s t e m s       T a b l e   2 .   Co l l e c t e c o n c i s e   c o de   c h a n ge s   f r o m   e xa m i n e s y s t e m s   S y s t e m   T o t a l   N u m b e o f   Co n c i s e   C o d e   C h a n g e s   K e x i   4991   O S G   3569   J a s p e r Re p o rt s   2721   T o t a l   1 1 2 8 1       3. 1 .   R Q 1:   Wh at   ar e   th e   m o s c o mmo n   typ e s   o A S c o d e   d i f fe r e n c e s   th a a r e   t i gh tl y   c o r r e l at e d   w i th   ad ap ti v e   m ai n te n an c e   tas k s ?   T o   a n s w e t hi s   r e s e a r c que s t i o n,   w e   a pp l i e d   t h e   r e pe t i t i v e n e s s   c o m put a t i o a l go ri t hm ,   s h o w i n   F i gu r e   5 ,   w i t h   t h e   a c r o s s - s y s t e m s   s e t t i n (e . g. ,   D e f i ni t i o n   3)   a n d   a t   t h e   g r a nul a r i t y   of   s o ur c e   f i l e s ,   w h e r e   w e   ge n e ra t e d   a   s e pa r a t e   c o n c i s e   e di t   s c ri pt   f o r   e a c h   t o uc h e f i l e .   T h e n,   w e   r a nke t h e   c a pt u r e d   c o n c i s e   A S T   c o de   c h a nge s   i n   t h e   c o n s t r uc t e c ha n ge   d i c t i o na r y   us i n g   t h e i r e pe t i t i v e n e s s .   T h e   r e pe t i t i v e n e s s   of   a   c o n c i s e   A S T   Evaluation Warning : The document was created with Spire.PDF for Python.
                                IS S N :   2088 - 8708   Int   J   E l e c   &   Co m E n g ,   V o l .   10 ,   N o .   3 J u n e   2 020   :     27 19   -   2 73 3   2726   c h a nge   i s   c o m put e a s   t h e   ra t i o   o f   oc c ur r e n c e   c o un t   o f   t ha t   c ha n ge   a c r o s s   a l l   s y s t e m s   ov e r   t h e   t o t a l   n u m b e of  c o n c i s e   A S T   c h a nge s   of   a l l   t y pe s   i n   a l l   s y s t e m s   (w e   di n o t   c o m put e   i n di v i du a l l y   fo r   e a c h   s y s t e m ) .   T a b l e   pr e s e nt s   t h e   t o p   c o n c i s e   A S T   c o de   c ha n ge s   w i t t h e i re pe t i t i v e n e s s   a c r o s s   t h e   t hr e e   s t ud i e d   s y s t e m s .   In   T a b l e   3 ,   w e   o n l y   r e po r t e t h e   c o n c i s e   c ha n ge s   t ha t   ha v e   a   r e pe t i t i v e n e s s   g r e a t e r   t ha n   1 . 00 %.   F r o m   T a b l e   3 o ur  f i r s t   f i n d i n g   i s   t ha t   t h e r e   a r e   a   f e w   num b e r s   o f   c o n c i s e   A S T   c o de   c ha n ge s   t ha t   r e p r e s e nt   t h e   m a j o r i t y   of    t h e   u n de r t a ke a d a pt i v e   c h a n ge s .   F o r   i n s t a n c e ,   76. 93%  o f   t h e   e xa m i n e a d a p t i v e   c h a nge s   f i t   i n t o   o nl y   12   c o n c i s e   A S T   c ha n ge s .   T h e   m a i e xpl a n a t i o o f   t h i s   f i n d i n g   i s   t ha t   t h e   a da pt i v e   m a i nt e n a n c e   i s   i r e s po n s e   t o   c h a nge s   i n   t h e   f e a t u r e / i nt e r f a c e   o f   un de r l y i n A P I .   F o i n s t a n c e ,   t h e   c l a s s   Q M L   i n   Q t i s   n o w   a v a i l a b l e   u nde t h e   n a m e   Q t Q ui c i n   Q t 5,   a nd  h e n c e   s pe c i f i c   s t a t e m e n t s   t ha t   i n c l ude   a   us a ge   o f   t h e   c l a s s   Q M L   m us t   b e   i de nt i f i e a n d   c ha n ge d,   w h i c h   us u a l l y   a r e   i n   t h e   f o r m   o f   i n c l ude ,   i n s t a n c e   de c e l e r a t i o n s ,   a n m e t h o   i n v oc a t i o s t a t e m e n t s .   O ur  s e c o n f i n d i n g   i s   t ha t   t h e   upda t i ng  of   a   s t a t e m e n t   t h a t   c o nt a i n s   c r e a t i o o f   a   c l a s s   i n s t a n c e     (e . g. ,   n e w   o p e r a t o r i s   t h e   m o s t   po pul a A S T   c h a nge   w i t a   ra t i o   of   16. 51%  a m o n t h e   u nde rt a ke n   a d a pt i v e   c h a nge s   (t h e   e xpl a n a t i o n   o f   t hi s   w a s   po s t e a b ov e ).   A ddi t i o na l l y ,   t h e   u pda t i n g   o f   s y s t e m   m e t h o i nt e r f a c e s   by   us i n g   d i f fe r e nt   pa ra m e t e t y p e s   r e pe a t s   m uc l e s s   f r e qu e n t l y   (e . g. ,   1 . 08 %)   w h e c o m pa r e t o   o t h e t o c o n c i s e   A S T   c o d e   c h a n ge s .   P r e v i o us   w o r i [24 i l l us t ra t e t ha t   c h a n ge s   t o   c o n s t r uc t o r   c a l l s   ( i n s t a n c e   c r e a t i o n ha v e   l e s s   r e pe t i t i v e n e s s   w h e c o m pa r e w i t h   o t h e n o n - f i xi ng  c h a nge s .   H ow e ve r ,   w i t t h e   f u r t h e r   fo c us i n o n   a da pt i v e   m a i nt e n a n c e ,   o ur  r e s ul t s   s h o w   t ha t   c o n s t r uc t o r   c a l l s   h a v e   t h e   m o s t   c h a nge s .   T h us ,   w e   c o n c l ude   t ha t   t h e   r e pe t i t i v e n e s s   o f   c h a nge s   v a r i e s   a c c o r di n g   t o   m a i nt e na n c e   t y pe s ,   a n d   h e n c e   m e a n i n g   t h a t   o ur   i n v e s t i ga t i o i s   n e e de t o   d r a w   c o n c l us i o n s   r e ga rdi ng  t he   qua l i f i e c o de   e xa m p l e s   f o r   t h e   c o n s t ruc t i o o t r a n s f o r m a t i o n a l   rul e s .       T a b l e   3 .   T o c o n c i s e   A S T   c o de   c h a nge s   r e l e v a n t   t o   a da p t i v e   c h a nge s   a c r o s s   ke xi ,   O S G ,     a n j a s pe r   r e po r t s   s y s t e m s       By   f ur t h e r   a n a l y z i n g   t h e   t o c o n c i s e   A S T   c ha n ge s ,   w e   fo un a o v e r l a pp i n g   b e t w e e n   s o m e   c h a nge s   w i t h   r e s pe c t   t o   t h e   s t a t e m e n t   ki nds .   F o i n s t a n c e ,   m e t h o i n v o c a t i o n   s t a t e m e n t s   a ppe a i s e v e r a l   t o A S T   c h a nge s ,   a s   s h o w n   i n   T a b l e   3 .   T h us ,   w e   ha v e   de e pe n e our  a na l y s i s   o f   t h e   t o A S T   c h a nge s   i o r de r   t o   c a t e go r i z e   t h e m   b a s e o w h i c h   s t a t e m e nt   ki n ds   t h e y   oc c u r,   a n d   s o   di s c o ve r   w h i c s t a t e m e n t   ki nds   b e i n g   t o uc h e by   a da pt i v e   c o m m i t s   m o r e   f r e que nt l y   t ha o t h e r s .   T a b l e   s h o w s   t h e   r e s ul t s   w e   o b t a i n e d,   w h e r e     t h e   r e pe t i t i v e n e s s   f r e que n c y   o f   a   s t a t e m e nt   ki n d   i s   e qui v a l e n t   t o   t h e   r a t i o   o f   r e pe t i t i v e n e s s   c o un t   o f   t h e   t o A S T   c h a nge s   r e l e v a nt   t o   t ha t   k i n d   o v e r   t h e   t o t a l   c o unt   o f   t h e   t o c o n c i s e   A S T   c o de   c h a n ge s   i a l l   s y s t e m s     A S T   Co d e   C h a n g e   Ch a n g e   D e s c ri p t i o n   Re p e t i t i v e n e s s   (S t a t e m e n t   U p d a t e ,   S i m p l e   T y p e ,   Cl a s s   I n s t a n c e   Cre a t i o n )   U p d a t i n g   o f   a   s t a t e m e n t   t h a t   c o n t a i n s   c r e a t i o n   o f   a   c l a s s   i n s t a n c e   (e . g . ,   n e w   o p e ra t o r)   b y   c a l l i n g   d i ffe r e n t   c o n s t ru c t o o c h a n g e   t h e   t y p e   o t h e   i n s t a n c e .   1 8 6 2   (1 6 . 5 1 % )   (S t a t e m e n t   U p d a t e ,   S i m p l e   N a m e ,   In c l u d e o r   (S t a t e m e n t   U p d a t e ,   S i m p l e   N a m e ,   I m p o rt )   Ch a n g i n g   o f   a n   i n c l u d e / i m p o rt   s t a t e m e n t   s i n c e   t h e   i n c l u d e d   l i b ra r y / m o d u l e   h a s   b e e n   re n a m e d ,   r e p l a c e d ,   o r   m o v e d   t o   a n o t h e r   p a c k a g e .   N o t e   t h a t   i m p o r t   i s   s p e c i f i c   t o   J a v a   f i l e s   a n d   i n c l u d e   i s   r e l a t e d   t o   C+ +   fi l e s .   1 5 2 5   (1 3 . 5 2 % )   (A r g u m e n t   T y p e   Ch a n g e ,   A r g u m e n t   L i s t ,   M e t h o d   In v o c a t i o n )   A   c h a n g e   o f   a   m e t h o d   i n v o c a t i o n   s t a t e m e n t   b y   u s i n g   d i ffe r e n t   a r g u m e n t   t y p e s ,   s i n c e   o f   a n   u p d a t i n g   o f   m e t h o d   i n t e r f a c e   o c a l l i n g   a n   o v e r l o a d e d   m e t h o d .   1 1 1 4   (9 . 8 8 % )   (M e t h o d   R e n a m i n g ,   M e t h o d   I n v o c a t i o n ,   F o r)   A   c h a n g e   o f   a   m e t h o d   i n v o c a t i o n   s t a t e m e n t   b y   c a l l i n g   a n o t h e m e m b e r   m e t h o d   o f   a   c l a s s   i n s t a n c e   w i t h i n   a   F o b l o c k ,   s i n c e   o a   m e t h o d   b e i n g   re n a m e d   o r   re p l a c e d .   1 0 5 9   (9 . 3 9 % )   (S t a t e m e n t   In s e r t ,   I f,   F o r )   A n   i n s e rt   o a   n e w   I f   s t a t e m e n t   w i t h i n   a   f o b l o c k .   9 9 7   (8 . 8 4 % )   (A r g u m e n t   In s e rt ,   A r g u m e n t   L i s t ,   M e t h o d   In v o c a t i o n )     A   c h a n g e   o f   a   m e t h o d   i n v o c a t i o n   s t a t e m e n t   b y   u s i n g   a   d i ffe r e n t   n u m b e o f   a r g u m e n t ,   s i n c e   o a n   u p d a t i n g   o m e t h o d   i n t e r f a c e   o c a l l i n g   a n   o v e r l o a d e d   m e t h o d .   6 2 2   (5 . 5 2 % )   (S t a t e m e n t   In s e r t ,   M e t h o d   I n v o c a t i o n ,   I f )   A n   i n s e rt   o a   m e t h o d   i n v o c a t i o n     s t a t e m e n t   w i t h i n   a n   I b l o c k .   4 9 0   (4 . 3 5 % )   (S t a t e m e n t   U p d a t e ,   S u p e r   C o n s t ru c t o In v o c a t i o n ,   M e t h o d )   A   c h a n g e   o f   a   s u p e c o n s t ru c t o i n v o c a t i o n   s t a t e m e n t   2 7 7   (2 . 4 6 % )   (S t a t e m e n t   In s e r t ,   R e t u rn ,   I f )   A n   i n s e rt   o a   r e t u rn   s t a t e m e n t   w i t h i n   a n   I f   b l o c k .   2 5 4   (2 . 2 5 % )   (Re t u r n   T y p e   C h a n g e ,   S i m p l e   T y p e ,   M e t h o d   D e c e l e ra t i o n )   A   c h a n g e   o f   a   m e t h o d   i n t e r f a c e   (d e c l a ra t i o n   s t a t e m e n t b y   u s i n g   a   d i ffe r e n t   r e t u rn   t y p e .   1 9 6   (1 . 7 4 % )   (Co n d i t i o n   E x p re s s i o n   C h a n g e ,   I f ,   F o r)     A   c h a n g e   o f   t h e   c o n d i t i o n   e x p re s s i o n   o f   a n   I s t a t e m e n t   w i t h i n   a   F o b l o c k .   1 6 1   (1 . 4 3 % )   (P a ra m e t e r   T y p e   Ch a n g e ,   P a ra m e t e L i s t ,   M e t h o d   D e c e l e ra t i o n )     A   c h a n g e   o f   a   m e t h o d   i n t e r f a c e   (d e c l a ra t i o n   s t a t e m e n t b y   u s i n g   d i ffe r e n t   p a ra m e t e r   t y p e s .   1 2 2   (1 . 0 8 % )   T o t a l   8 6 7 9   (7 6 . 9 3 % )   Evaluation Warning : The document was created with Spire.PDF for Python.
Int   J   E l e c   &   Co m E n g     IS S N :   2088 - 8708       A   s t udy   of   c ode   c hang e   p at t e r ns   f or   a dapt i v e   m a i nt e nan c e   w i t A ST   a nal y s i s   ( O m ar   M e qdad i l )   2727   (e . g. ,   t h e   t o t a l   c o un t   i s   86 79  a s   s h o w n   i n   T a b l e   3 ) .   F o r   i n s t a nc e ,   a m o ng  t h e   t o A S T   c h a nge s ,   t h e   o n l y   c h a n ge   r e l e v a nt   t o   t h e   r e t u rn  s t a t e m e n t   i s   (S t a t e m e nt   I n s e rt ,   R e t u rn,   If ),   a nd   t h us   t h e   c o unt   o f   t hi s   s t a t e m e nt   ki nd   i s   254  w i t h   a   f r e que n c y   of   2. 93%  (25 /   8679) .   I o ur  a na l y s i s ,   w e   c o n s i de r   t h e   s t a t e m e nt   o f   c a l l i n g   a   s u pe c o n s t r uc t o a s   a   m e t h o i n v o c a t i o s t a t e m e n t ,   w h i l e   t h e   c a l l i n g   o f   a   c o n s t r uc t o us i n g   a   n e w   o pe r a t o w a s   c o n s i de r e a s   a   m o di f i c a t i o t o   a n   i n s t a n c e   c r e a t i o s t a t e m e nt .   H e n c e ,   o ur   r e s ul t s   p r o v i de   ge n e r a l   f e a t u r e s   o f   a da pt i v e   c ha n ge s   a n d   t h us   c a b e   l e ve r a ge by   a ut o m a t i c   t r a n s f o r m a t i o n   r ul e   ge n e ra t i o n   a l go r i t h m s   t o   p ri o ri t i z e   s o m e   ki n ds   o f   s t a t e m e n t s   (e . g . ,   i n c l u de   a nd  m e t h o i n v o c a t i o n a n d   A S T   c h a nge s .   T o   b e   pr e c i s e ,   o ur   r e s ul t s   r e c o m m e n t ha t   i n   o r de r   t o   pus h   t h e   de gr e e   of   c o r r e c t n e s s   o f   t r a n s f o r m a t i o n s ,   de v e l o pe r s   n e e t o   f o c us   o n   t he   t o A S T   c o de   c ha n ge s ,   s h o w n   in   T a b l e   3 ,   t o   c o l l e c t   r e a l   qu a l i f i e e xa m p l e s   t h a t   w i l l   b e   us e i n   c o n j u n c t i o n   w i t a   s y n t a c t i c   di f f e r e n c i n g   t o o l   t o   ge n e ra t e   t r a n s f o r m a t i o n s   t ha t   c a b e   a ppl i e t o   o t h e r   s y s t e m   t ha t   y e t   n e e t o   u n de rgo   t h e   s a m e   a d a pt i v e   c h a n ge .   A t   t h i s   po i nt   f urt h e i n v e s t i ga t i o i s   n e c e s s a r y   t o   c a t e go r i z e   t h e   c o l l e c t e e xa m p l e s   t h a t   a dd r e s s   t h e   s a m e   pr o b l e m   a nd   s o   ge n e r a t e   t h e   t ra n s f o r m a t i o n   n e c e s s a r y   t o   s o l v e   a   s pe c i f i c   a da p t i v e   m a i nt e na n c e   t a s k.   W e   p l a t o   a dd r e s s   t hi s   i n v e s t i ga t i o i f u t u r e .   A s   s h o w n   i n   T a b l e   4 ,   t h e r e   i s   a   p r e v a l e n c e   o f   i n c l ude / i m po r t ,   m e t h o i n v o c a t i o n ,   m e t h o de c e l e r a t i o n,   i n s t a n c e   de c e l e r a t i o (e . g . ,   n e w   o pe r a t o r ) ,   If ,   a nd  r e t u rn  s t a t e m e n t s   w h e c o m pa r e t o   t h e   o t h e r s .   M o r e o ve r ,   o ur   o b s e r v a t i o i s   t h a t   41 . 04%   o f   t h e   t o A S T   c h a nge s   a r e   r e l e v a n t   t o   m e t h o i n v o c a t i o n   s t a t e m e n t s ,   a n d   h e n c e   t h i s   ki nd   o f   s t a t e m e n t s   r e p r e s e n t s   t h e   m o s t   f r e que n t l y   m o di f i e s t a t e m e n t   b y   a da pt i v e   c ha n ge s ,   a s   e xpe c t e d.   T h a t   i s ,   c h a n ge s   r e l a t e t o   m e t h o i n v o c a t i o n   s t a t e m e nt s   a r e   t h e   m o s t   po pul a r   a n f r e que n t l y   r e pe a t e s t a t e m e n t s   t h a t   t o uc h e d   by   a da p t i v e   c h a nge s   a c r o s s   C+ +   a n d   J a v a   o pe n - s o u r c e   s y s t e m s .   T h us ,   t hi s   f i n d i n g   i n di c a t e s   t h e r e   i s   n o   do ub t   t ha t   e xi s t i n t o o l s   of   A P us a ge   pa t t e rn  r e c o m m e nda t i o n s   (e . g. ,   a l t e r i n g   a   s e que n c e   of   m e t h o c a l l s   r e qu i r e t o   i m pl e m e n t   a   f u n c t i o na l i t y l i ke   t h e   t o o l s   pr o po s e i n   [ 19,   27 w o ul b e   us e f ul   i n   e xt ra c t i n g   t h e   c o de   e xa m pl e s   f o r   t h e   c o n s t ruc t i o o f   t r a n s f o r m a t i o n a l   r u l e s .   N e v e r t h e l e s s ,   b e c a us e   m e t h o i n v oc a t i o s t a t e m e n t s   r e p r e s e n t   o nl y   41. 04%   o f   t o s t a t e m e nt s   t o uc h e b y   A P I - m i g r a t i o n s ,   w e   s t i l l   l a c a pp r o a c h e s   f o a u t o m a t i n g   t h e   e xt ra c t i o o f   c o de   e xa m pl e s   re l a t e t o   o t h e s t a t e m e n t s   (e . g . ,   i n s t a n c e   c r e a t i o a n d   IF   s t a t e m e n t s ) .   A l s o ,   w e   w o ul o b s e r v e   t ha t   m o s t   o f   a d a pt i v e   c ha n ge s   w e r e   pe r f o r m e w i t hi e i t h e f o r   o r   i f   b l oc ks .   A   r e c e n t   s t udy   by   Ca m po s   e t   a l   [20]   i l l us t ra t e t ha t   t h e r e   i s   a   p r e v a l e n c e   o f   IF   a n r e t u rn  s t a t e m e nt s   w h e n   c o m pa r e t o   t h e   o t h e r   b ug  f i xi n s t a t e m e nt s .   T hi s   r e s ul t   i s   c o n s i s t e n t   w i t o ur   f i n d i n g .   O t h e   o t h e h a nd,   c h a nge s   t o   s o m e   s t a t e m e n t   k i n ds   s uc h   a s   c a t c h,   t r y ,   a n d   s w i t c h   s t a t e m e n t s   a r e   ra r e l y   fo un i n   t h e   a da p t i v e   c o m m i t s ,   de s pi t e   t h a t   t h e   r e pe t i t i v e n e s s   o f   t h e s e   s t a t e m e n t s   w e r e   f o un de d   r e l a t i v e l y   h i g (e . g. ,   c a t c s t a t e m e nt   ha a   r e pe t i t i v e n e s s   of   37%)  i n   f i x i n g   c ha n ge s   a s   i l l us t ra t e by   t h e   r e s ul t s   o f   [24].       T a b l e   4 .   T o s t a t e m e nt   ki n ds   t ha t   t o uc h e d   by   t h e   t o A S T   c ha n ge s   o f   t h e   a da pt i v e   c o m m i t s   S t a t e m e n t   K i n d   Re l e v a n t   A S T   c h a n g e s   Re p e t i t i v e n e s s     In c l u d e / i m p o rt   (S t a t e m e n t   u p d a t e ,   S i m p l e   N a m e ,   i n c l u d e )   o r   (S t a t e m e n t   u p d a t e ,   S i m p l e   N a m e ,   i m p o rt )   1 5 2 5   (1 7 . 5 7 % )   M e t h o d   I n v o c a t i o n   (M e t h o d   R e n a m i n g ,   M e t h o d   i n v o c a t i o n ,   F o r )   3 5 6 2   (4 1 . 0 4 % )   (A r g u m e n t   T y p e   Ch a n g e ,   A r g u m e n t   l i s t ,   M e t h o d   i n v o c a t i o n )   (S t a t e m e n t   u p d a t e ,   S u p e c o n s t ru c t o r   i n v o c a t i o n ,   M e t h o d )   (S t a t e m e n t   i n s e r t ,   M e t h o d   i n v o c a t i o n ,   I f )   (A r g u m e n t   In s e rt ,   A r g u m e n t   L i s t ,   M e t h o d   i n v o c a t i o n )   M e t h o d   D e c e l e ra t i o n   (Re t u r n   T y p e   C h a n g e ,   S i m p l e   T y p e ,   M e t h o d   D e c e l e ra t i o n )   3 1 8   (3 . 6 6 % )   (P a ra m e t e r   T y p e   Ch a n g e ,   P a ra m e t e l i s t ,   M e t h o d   D e c e l e ra t i o n )   In s t a n c e   Cre a t i o n   (S t a t e m e n t   U p d a t e ,   s i m p l e   t y p e ,   c l a s s   i n s t a n c e   c r e a t i o n )   1 8 6 2   (2 1 . 4 5 % )   IF   (S t a t e m e n t   In s e r t ,   I f,   fo r)   1 1 5 8   (1 3 . 3 5 % )   (Co n d i t i o n   e x p r e s s i o n   c h a n g e ,   I f ,   F o r)   Re t u r n   (S t a t e m e n t   In s e r t ,   R e t u rn ,   I f )   2 5 4   (2 . 9 3 % )   T o t a l   8 6 7 9   (1 0 0 % )         O b s e r v a t i o 1 :   76. 9 3%   o f   t h e   a d a pt i v e   c h a nge s   f i t   i n t o   o nl y   12  c o n c i s e   A S T   c ha n ge s ,   m e a ni n g   t ha t   de ve l o pe r s   n e e t o   f o c us   o n   t h e s e   c o n c i s e   c ha n ge s   t o   c o l l e c t   r e a l   qua l i f i e e xa m pl e s   t o   c o n s t r uc t   h i g h   c o r r e c t n e s s   e xa m p l e - b a s e t r a n s f o r m a t i o n   rul e s .       3. 2 .    R Q 2:   Wh a a r e   th e   m o s c o mmo n   ad ap ti v e   c h an g e   p atte r n s ?   H e r e ,   R Q 2   i s   i m po r t a n t   t o   de t e c t   c o m m o c h a n ge   pa t t e rn s   a p pe a r e d   i t h e   hi s t o ri c a l   a d a p t i v e   c ha n ge s   of   C+ +   a n J a v a   o pe n - s o ur c e   s y s t e m s ,   a n s o   w e   c o ul ob s e r v e   w h i c h   p a t t e rn s   a r e   t h e   m o s t   c o rr e l a t e w i t API - m i g ra t i o t a s ks .   M o r e ov e r ,   a l t h o ugh  t h e   c ha n ge   p a t t e rn s   p r o po s e i t h e   l i t e ra t u r e   a r e   r e l e v a nt   w i t   n o n - a d a pt i v e   m a i n t e na n c e   t a s ks   (e . g . ,   b ug - f i a n d   r e f a c t o r i n g   t a s ks ),   R Q 2   i s   i nt e r e s t i n g   by   i n v e s t i ga t i n g   w hi c of   t h e s e   pr e v i o us l y   pr o po s e pa t t e rn s   a r e   a l s o   s t r o n gl y   r e l a t e w i t h   A P I - m i g r a t i o n s .   A n s w e r i ng  R Q 2   ha s   t w Evaluation Warning : The document was created with Spire.PDF for Python.
                                IS S N :   2088 - 8708   Int   J   E l e c   &   Co m E n g ,   V o l .   10 ,   N o .   3 J u n e   2 020   :     27 19   -   2 73 3   2728   m a i n   c o m po n e n t s .   T h e   f i r s t   i s   t h e   i de nt i f i c a t i o o f   c h a n ge   pa t t e rn s   t ha t   c o ul b e   s ugge s t e a s   po t e n t i a l   pa t t e rn s   fo r   t h e   m a j o r i t y   o f   a da pt i v e   c h a nge s .   T h e   s e c o n i s   t h e   v a l i da t i o o f   t h o s e   s ugge s t e pa t t e rn s   t hr o ug h   e v a l ua t i n g   t h e i r e pe t i t i v e n e s s   i t h e   c ha n ge   h i s t o r y   of   o t h e a r b i t r a r y   o pe s o ur c e   s y s t e m s   t ha t   w e r e   n o t   us e i n   t h e   i de nt i f i c a t i o n   s t e o f   pa t t e rn s .   T o   unde rt a ke   t h e   f i r s t   c o m po n e n t   t h a t   i s   o ut l i n e a b o ve ,   w e   s ur v e y e pr i o r   w o r ks   t ha t   ha v e   fo c us e o n   s t udy i n po s s i b l e   c h a n ge   pa t t e rn s   o f   s of t w a r e   e vo l ut i o n,   a n t h e w e   h a v e   l e v e r a ge t h e   k n o w l e dge   f r o m   s e v e r a l   v a l u a b l e   pri o r   s t udi e s   [ 21 - 23 34 - 3 6 ] ,   w h e r e   w e   e xpos e n um e r o us   kn o w n   c ha n ge   p a t t e rn s   t h a t   w e r e   f r e que nt l y   o c c urr e i t h e   e v o l ut i o n   h i s t o r i e s   o f   o pe n - s o u r c e   s y s t e m s .     T h e n,   w e   h a v e   us e t h e   o b t a i n e r e s ul t s   f r o m   R Q 1   t o   na rr o w   o ur  i n v e s t i ga t i o n   o f   t h e   po s s i b l e   c ha n ge   p a t t e rn s   t h a t   m i g ht   b e   s t r o n g l y   r e l e v a n t   w i t h   a d a pt i v e   c h a n ge s .   T h a t   i s ,   w e   h a v e   m a de   a t t e nt i o n s   o n l y   t o   t h e   pa t t e rn s   t h a t   a r e   r e l e v a nt   t o   t h o s e   t o A S T   c ha n ge s   a nd  s t a t e m e nt   k i n d s   t h a t   w e r e   fo un d   a s   m o s t   po pul a r   i t h e   a d a pt i v e   c o m m i t s ,   s uc a s   i f - r e l a t e a n d   m e t h o c a l l   p a t t e rn s ,   w hi l e   w e   i g n o r e d   t h e   pa t t e rn s   r e l e v a n t   t o   t h e   s t a t e m e n t s   w i t h   i n s i g n i f i c a n t   r e pe t i t i v e n e s s .   E xa m pl e s   o f   i g n o ra b l e   pa t t e rn s   i n c l u de   c ha n ge s   t o   c a t c h,   t r y ,   s w i t c h ,   a n d   e l s e   s t a t e m e n t s .   I p a r t i c ul a r,   b a s e o t h e   r e s ul t s   o f   R Q 1 ,   w e   c a h y po t h e s i z e   t h a t   a   l a rge   po r t i o o f   a d a pt i v e   c h a nge s   a r e   i n s t a n c e s   of   t h e   f o l l ow i n c ha n ge   p a t t e rn s ,   w hi c w e r e   o r i g i na l l y   pr o po s e i n   t h e   l i t e r a t u r e ,   a s   f o l l ow s :     M e t h o C a l l   w i t D i f f e r e n t   N u m b e r   o f   P a ra m e t e r s   o r   D i f f e r e nt   T y pe s   of   P a ra m e t e r s   (M C - D N P ):   A   c ha n ge   of   a   m e t h o i n v o c a t i o n   s t a t e m e nt   b y   c a l l i n t h e   s a m e   m e t ho b ut   w i t a   di f f e r e n t   n u m b e r   o r   a   d i f f e r e n t   t y p e   o f   a r g um e n t s ,   w h i c i s   b e c a us e   o f   a u pda t i ng   o f   t h e   m e t h o d   i nt e r f a c e   o c a l l i ng   a o v e r l o a de m e t h o d.   T h i s   pa t t e rn   w a s   p r o po s e fo r   b ug  f i xi ng  c h a nge s   by   P a e t   a l .   [21] .     A ddi t i o o f   P r e c o n di t i o M e t h o I n v o c a t i o (IF - MC - A D D ):     c h a nge   t ha t   a dds   a   n e w   IF   b l o c t h a t   i n v o l ve s   a   m e t h o i n v o c a t i o n   s t a t e m e nt .   T h i s   p a t t e rn  w a s   p r o po s e fo r   b ug   f i xi n g   c h a nge s   by   M a r t i n e z   e t . a l   [3 4].     Cha n ge   o f   M e t h o D e c e l e r a t i o n   (M D - CH G ):   A   c ha n ge   o f   t h e   de c l a r e i nt e r f a c e   fo r   a   m e t h o by   us i n g   a   di f f e r e n t   r e t u rn  t y pe   o r   di f f e r e n t   n u m b e o t y p e s   o f   pa ra m e t e r s .   T hi s   pa t t e rn  w a s   p r o po s e a s   a   s i g n a t u r e   c h a nge   pa t t e rn  by   K i m   e t . a l   [23 ].   A l s o ,   t h i s   pa t t e rn  w a s   c o n s i de r e a s   a   b ug - f i p a t t e rn  by   P a e t   a l .   [21] .       Cha n ge   o f   M e t h o Ca l l   t o   a   Cl a s s   I n s t a n c e   (M C - D M ) :   A   c ha n ge   t ha t   c a l l s   a   d i f fe r e n t   m e m b e r   m e t h o of  t h e   s a m e   o bj e c t   v a ri a b l e .   F o e xa m pl e ,   t hi s   p a t t e rn  i s   b e c a us e   of   a   m e t h o b e i n r e p l a c e o r e na m e by   a   n e w   m e t h o i n   t h e   n e w   A P r e l e a s e .   T h e   pa t t e rn   w a s   i n t r o du c e by   P a n   e t   a l .   [2 1]  a nd  a l s o   i t   w a s   s ugge s t e d   a s   a   r e f a c t o r i n g   p a t t e rn  by   T s a n t a l i s   e t   a l .   [22] .     A dd  P r e c o n di t i o C h e c w i t h   J u m p   (IF - A P CJ ):   A   c h a nge   t ha t   a d ds   a   n e w   i f   b l o c t h a t   i n v o l v e s   a   j um p   s t a t e m e n t .   I o ur  s t udy ,   w e   o n l y   f oc us   o n   r e t u rn  a s   a   j um s t a t e m e n t .   T hi s   p a t t e rn  w a s   c o n s i de r e a s     b ug - f i pa t t e rn  by   P a e t   a l .   [21] .     U pda t e   o f   S upe r   Co n s t r uc t o I n v o c a t i o n   (CO N S - U P ):   A   c ha n ge   t ha t   m o di f i e s   t h e   i n v o c a t i o o f   a   s upe r   c l a s s   c o n s t r uc t o r .   T hi s   c ha n ge   i s   r e l a t e d   t o   a   c h a n ge   i t h e   c l a s s   de c e l e r a t i o b y   upda t i ng   t h e   s upe c l a s s   o a   g i v e s ub   c l a s s .   T h i s   p a t t e rn  w a s   p r o po s e F l u ri   e t . a l   [35]   a s   a   ge n e r a l   c ha n ge   pa t t e rn  a nd   a l s o   by   M a rt i n e z   e t . a l   [3 4]  a s   a   b ug  f i x   pa t t e rn.     Ini t i a l i z i n g   a O b j e c t   (IA O ):   A   c l a s s   i n s t a n c e   i ni t i a l i z a t i o s t a t e m e n t ,   w h i c i n v o l v e s   t h e   o pe ra t o r   n e w ,   i s   c ha n ge b e c a us e   o f   a   c a l l i n o f   di f fe r e n t   c o n s t r uc t o r   a nd/ o r   c h a ngi n g   t h e   t y pe   of   a   de c l a r e o b j e c t .     T h i s   pa t t e rn   i s   p r o po s e by   S o t o   e t . a l   [ 36].     Cha n ge   o f   If   Co n d i t i o E x p r e s s i o (IF - CC) :   A   c ha n ge   t ha t   m o di f i e s   t h e   e xp r e s s i o o f   a If   c o n di t i o n   s t a t e m e n t .   T hi s   p a t t e rn  w a s   c o n s i de r e a s   b ug - f i pa t t e rn  by   P a n   e t   a l .   [21] .   O t h e   o t h e h a nd,   s i n c e   t h e   r e s ul t s   o f   R Q 1   s h o w   t h a t   t h e   c ha n ge s   t o   i n c l ude / i m po rt   s t a t e m e n t s   h a v e   s i g n i f i c a n t   r e pe t i t i v e n e s s   i n   a da pt i v e   c o m m i t s ,   w e   s ugge s t   a   n e w   m e a ni n gf ul   c h a n ge   p a t t e rn  t h a t   w o ul b e   a   po t e n t i a l   p a t t e rn  f o r   a da p t i v e   c ha n ge s .   T h e   s ugge s t e pa t t e rn  i s   a s   f o l l o w s :     Cha n ge   o f   In c l ude / Im po r t   S t a t e m e n t s   (IS - CH G ):   T h e   A P I - m i g r a t i o c h a nge s   t h e   a f fe c t   t h e   i n c l ude / i m po r t   s t a t e m e n t s   o f   A P l i b r a ri e s ,   c l a s s e s ,   a nd  i nt e r f a c e s .   T hi s   ki nd   of   c h a n ge s   ge n e ra l l y   l e a ds   t o   c h a n ge s   a t   c a l l   s i t e s   t o   A P f e a t u r e s .   O ur  h y po t h e s i s   i s   t h a t   t h e   pa t t e rn s   a f o r e m e n t i o n e a r e   go o c a n d i da t e s   f o r   A P I - m i g ra t i o c ha n ge   pa t t e rn s .   T o   v a l i d a t e   t hi s   h y po t h e s i s ,   a s   i [ 21 ],   w e   n e e t o   e xpl o r e   t h e   hun k   c o v e r ag e ,   w h i c h   r e p r e s e nt s     t h e   pe r c e n t a ge   o f   t h e   a d a pt i v e   c ha n ge   hu n ks   t ha t   c o n t a i a t   l e a s t   o n e   pa t t e rn  f r o m   a m o n g   t h e   s ugge s t e d   pa t t e rn s   po s t e a b o ve .   A l s o ,   i t   i s   i m po rt a nt   t o   kn o w   i f   t h e   fr e que n c i e s   of   t h e   s ugge s t e pa t t e rn s   a r e   s i m i l a a c r o s s   m a n y   o pe n - s o ur c e   s y s t e m s .   If   t h e   f r e que n c i e s   a r e   s i m i l a r,   t hi s   w o ul p r o v i de   a u n de r s t a n d i n g   o   t h e   m o s t   c o m m o n   t y pe s   of   a da pt i v e   c h a n ge s   o c c ur r i ng  i s o f t w a r e   s y s t e m s .   A s   s uc h ,   t h e   s e c o n c o m po n e nt   o RQ 2   w o ul b e   t h e   e v a l ua t i o o f   t h e   r e pe t i t i v e n e s s   o f   t h e   c h a n ge   p a t t e rn s   u n de c o n s i de r a t i o i t h e   hi s t o ri c a l   API - m i g ra t i o c ha n ge s   a t   t h e   g ra n ul a ri t y   of   h u nks .   S i n c e   w e   ha v e   b a s e o n   t h e   d a t a s e t   o f   K e xi ,   O S G ,   a nd  J a s pe r R e po r t s   s y s t e m s   i n   o u r   a b ov e m e n t i o n e h y po t h e s i s ,   t h i s   d a t a s e t   i s   s t i l l   n o t   e n o ug h   t o   s ub s t a n t i v e l y   a n s w e r   R Q 2   a nd  h e n c e   v a l i da t i n o u r   h y po t h e s i s A c c o r di n g l y ,   i n   a ddi t i o n   t o   t h e   e a r l y   us e da t a s e t ,   w e   n ow   n e e t o   e xt e n d   o ur  d a t a s e t   by   n e w   a da p t i v e   c ha n ge s   f r o m   a rb i t ra r y   C+ +   a n d   J a v a   o pe n   s o ur c e   s y s t e m s   o t h e Evaluation Warning : The document was created with Spire.PDF for Python.