SHIFT LEFT @ mp ila eten Michaël Pila eten
X X X X X X V V
SHIFT LEFT 4 ty pes WHY ?
21% o pr ojects f ail due to  r equir eme nts Standish Gr oup C HA OS  R epor t 57% o f de f ects  ar e made  be f or e c oding starts Lauese n Vin ter Pr e v enti ng R equir ement s De f ect s W orking So ftwar o v er  C ompr ehen siv Docum ent ation Agil Manif esto
SHIFT LEFT 4 ty pes TYPES
TRADITIONAL
MODEL - BASED
INCREMENT AL VVVVVV
SHIFT LEFT 4 ty pes 3 FLA V OURS
De v elop er   T esting User  T esting TDD A TDD BDD
UNIT  TESTING TES FIRST A PPR O A CH RED  / GRE EN   / REF A CT OR OBJECTIV E:  HIGH  QUA LITY C ODE
Unit   T ests  ar e c on structed  wit h as serti on th at  c an   check That   functi on   perf orms  calcula ti on  and  r et urns a e xpected  r esult That   functi on   chang es  th e stat o f an  appl icat io n That   functi on   call an ot her  functi on Unit   T ests  shoul d be : Automat ed Easy  to  implemen an d mai nt ai n W rit te n in  th same  la nguag as the   pr oductio c ode Simple  (easy)   to   run V ery  f ast  to  e x ecute
Eff ecti v e Unit  T ests  T rustw ort hy  Unit   T ests T be  trustw ort hy the ar e e xpec te to   be  FR AID - F ast For immedi ate   fe edb ack It  should  be   po ss ib le  to  run  ma ny   tes ts  in very  lit tle  time . - R epea ta ble The  tes c an   be   r an   at  an time autom ati c a l l or  user tr igger ed - At omic Al l unit  tes ts  or  a subs et  c an   be   r an   in any   r an dom  order,  without  af fe cting  the  resul ts - Isol at ed The  Un it  Te st   shoul st riv to  exer cis onl y   the  in ten ded  code - Det ermini stic E ve ry  time   the  tes is   r an it  should  produce  the  sa me  resul t
3 - step  pat te rn f or Unit   T esti ng:  Arr ang - A ct  - As sert Arr ang e:  Pr epa r th e x ecutio en vir on ment Not  al wa ys  nec es sary A ct:  Ex ecute  th e ope r at io bei ng  te sted Mandat ory As sert:  Check  th r esult  pr oduc ed  b th e ope r at io n Mandatory unit   te st  as serti on
Si ngle  ite r at io ns  o f e w minute s, i steps: 1. DEV c onsider the   c hang up ha nd 2. DEV i dent if ies  th small est  chang e 3. DEV w rit es  a (f ai li ng) uni te st Des crib in an ide nti f y in an   ex am p le   of   the  code be hav ior  neede for  the  change 4. DEV w rit es  th e c ode 5. DEV run th e unit   te st  to  v erif th chang e 6. DEV r e f acto r s 7. DEV i mpr o v es  th design
All unit t es ts  automated be f or e c oding starts Immed iate f ee dback R e f actor ed c ode Le gacy c ode Lar g bodies o Unit T es ts W e ha v build the thing right
DEV  METHODOL OG Y A C CEPT ANCE   TES TING SP ECIFICA TION  B Y EXA MPLE C OLLABORA TIVE  W ORKSH OPS
All ac c eptanc e tests r eady  be f or e c oding starts Automati on  not r equ ir ed F r ame w ork s Does n ’t embr ac e chang e Dupl icat e automation (UT  & A T)
DEV  METHODOL OG Y USE ST ORIES &  SCEN ARIOS DOMAIN SPE CIFIC  LAN GUA GE CUS T OMER  CEN TRIC  AP PR O A CH
F ea tur <ti tl e> AS  <r ol e> I W ANT  <acti on> SO  TH A <bu sin ess v al ue > Scenar io   <ti tl e> GIVE <c on t e x t> A ND  <m or e c on t e x t> WHE <acti on> A ND  <other  ac ti on> TH EN  <ou t c ome> A ND  <m or e out c omes> Descri p ti on  of  the   F ea tur e St ak ehol der  and/ or  user  r ol e Action  t be undert ak en Busine ss  v al ue   pr o vide (r a ti ona le ) Descri p ti on  of  the   Scenar io P r ec ondi ti ons Actions Expect ed  out c omes
Us er  St ori es  captur busines r equir ement & H functi on al it y Sc ena rio ar deriv ed  fr om  Us er  St ori es, wit mor deta il an d specifi cs Us er  St ori es  (and  ac c ept an c cr it eria ) may   be  aut omat ed Sc ena rio mus be  aut omat ed Us er  St ori es  ar e docum ent ed  visual ly   (task  boa r d) Sc ena rio ar docum ent ed  in  c ode  (or  phr ase  te mpla te s) Us er  St ories  vs BDD  Sc enari os
Les s docume ntation L ink  with iter ativ e SD L C F r ame w ork s Le arn ing curv e Chang docume ntation style
SHIFT LEFT 4 ty pes SUMMAR Y
TDD :  by de v eloper s A TDD & BDD :  by user s TDD & BDD  r equir e automation A TDD:  automation optional TDD  not prior it iz ed A TDD & BDD: prior it by user A TDD & BDD support  c ollabor ation  D e v elopment Automated tests ar NO the g oa l GO AL : push  de f ect  curv e to  the le ft