Trunk	
  Based	
  Development	
  
           Explored	
  
       	
                                	
  
       	
                                	
  
  Carlos	
  Lopes	
              Guilherme	
  Lacerda	
  
 ThoughtWorks	
                  FACENSA/UniRi@er	
  
                        TargetTrust/Surya	
  SoBware	
  InnovaEon	
  
agenda	
  

the	
  problem	
  

impacts	
  

solu2ons!	
  

when	
  to	
  branch?	
  
the	
  problem	
  
different	
  streams,	
  
 same	
  codebase	
  
branches!	
  
Ronald	
  Widha	
  
merge	
  hell	
  
syntac2c	
  conflict	
  

class	
  BlaBlaBla	
  {	
  
	
  
<<<<<<<	
  HEAD	
  
      	
  public	
  void	
  bla(Bla	
  oldBla,	
  New	
  newBla)	
  {	
  
      	
   	
  oldBla.bla();	
  
      	
   	
  newBla.newBla();	
  
=======	
  
      	
  public	
  void	
  bla(Bla	
  oldBla,	
  Other	
  otherBla)	
  {	
  
      	
   	
  oldBla.bla();	
  
      	
   	
  otherBla.otherBla();	
  
>>>>>>>	
  other	
  commit	
  
      	
  }	
  
	
  
}	
  
seman2c	
  conflict	
  

class	
  BlaBlaBla	
  {	
  
	
  
      	
  public	
  void	
  something(Bla	
  bla)	
  {	
  
<<<<<<<	
  HEAD	
  
      	
   	
  bla	
  =	
  bla.plus(14);	
  
=======	
  
      	
   	
  bla	
  =	
  bla.minus(7);	
  
>>>>>>>	
  change	
  
      	
   	
  //other	
  stuff	
  
      	
  }	
  
	
  
}	
  
integra2on	
  conflicts	
  
     main.jsp:	
  <%@include	
  file="bla.jspf"	
  %>	
  
     	
  
     	
  
     	
  
master:	
                  agivenbranch:	
  
	
                         	
  
new-­‐file.jsp:	
           bla.jspf	
  -­‐>	
  ble.jspf	
  
<%@include	
               	
  
file="bla.jspf"	
  %>	
     main.jsp:	
  
	
                         <%@include	
  
	
                         file="ble.jspf"	
  %>	
  
	
                         	
  
                           	
  
                           	
  
the	
  merge	
  man/monkey	
  
promiscuous	
  integra2on	
  




                         Mar6n	
  Fowler	
  
$$$$	
  
Jon	
  Wolter	
  
regressions	
  
Jon	
  Wolter	
  
Jon	
  Wolter	
  
the	
  bigger	
  the	
  apparent	
  
reason	
  to	
  branch,	
  the	
  more	
  
  you	
  shouldn’t	
  branch. 	
  


                            Jez	
  Humble	
  /	
  David	
  Farley	
  
don't	
  separate	
  differing	
  
concerns	
  by	
  using	
  a	
  VCS,	
  use	
  
  an	
  abstrac6on	
  instead. 	
  


                                         Stacy	
  Curl	
  
feature	
  branching	
  is	
  a	
  poor	
  man's	
  modular	
  
   architecture,	
  instead	
  of	
  building	
  systems	
  
   with	
  the	
  ability	
  to	
  easy	
  swap	
  in	
  and	
  out	
  
features	
  at	
  run6me/deploy6me	
  they	
  couple	
  
 themselves	
  to	
  the	
  source	
  control	
  providing	
  
 this	
  mechanism	
  through	
  manual	
  merging 	
  
                                    	
  
                                                            Dan	
  Bodart	
  
all	
  right,	
  but	
  how	
  to
         solve	
  this?	
  
branch	
  by	
  	
  
source	
  control?	
  
there’s	
  hope!	
  
approaches	
  
hide	
  new	
  func2onality	
  
abstrac2on	
  
big	
  bang	
  




                  Paul	
  Hammant	
  
itera2ve	
  




               Paul	
  Hammant	
  
small	
  releasable	
  changes	
  
componen2za2on	
  
enable	
  flow	
  
across	
  teams	
  
KEEP	
  IT	
  ALWAYS	
  RELEASABLE	
  
KEEP	
  IT	
  ALWAYS	
  RELEASABLE	
  
CONTINUOUS	
  INTEGRATION	
  
CONTINUOUS	
  INTEGRATION	
  
program	
  level	
  	
  
        product	
  owner/champion	
  	
  
                       	
  

knows	
  each	
  project	
  champion	
  and	
  
        how	
  to	
  reach	
  people	
  
Uncle	
  Bob	
  
when	
  to	
  branch?	
  	
  
	
  
	
  
large	
  change	
  	
  
	
  
spikes	
  
	
  
new	
  release	
  	
  
	
  
	
  
when	
  to	
  branch?	
  	
  
	
  
	
  
large	
  change	
  	
  
	
  
spikes	
  
	
  
new	
  release	
  	
  
	
  
	
  
when	
  to	
  branch?	
  	
  
	
  
	
  
large	
  change	
  	
  
	
  
spikes	
  
	
  
new	
  release	
  	
  
	
  
	
  
Paul	
  Hammant	
  
branching	
  vs.	
  freezing	
  
more	
  info	
  

www.codingbyexample.org	
  
thanks!	
  
Trunk Based Development Explored

Trunk Based Development Explored