webapp acceptance testing a case study

18
Eemeli Kantola Website acceptance testing – a case study 10.11.2012

Upload: ekantola

Post on 13-Jul-2015

526 views

Category:

Documents


1 download

TRANSCRIPT

Eemeli  Kantola  

Website  acceptance  testing  –  a  case  study  10.11.2012  

About  me  

›  Eemeli  Kantola  

›  Web  dev,  consulting,  lean/agile  enthusiasm  

›  Customer  projects  in  Futurice  

I  like  to  create  awesome  web  apps  for  (human)  end  users  

ATDD  

ATDD:  “The  practice  of  expressing  functional  story  requirements  as  

concrete  examples  or  expectations  prior  to  story  development”  

–  Jennitta  Andrea,  http://www.stickyminds.com/sitewide.asp?Function=edetail&ObjectId=16315      

Goals  

›  Crystallize  acceptance  criteria:  shared  understanding  of  reqs  and  def.  of  done  [1]  

›  Win  bug  battle  with  complicated  systems  [2]:  early  regression  detection  

[1]  E.  Hendrickson,  http://testobsessed.com/blog/2008/12/08/acceptance-­‐test-­‐driven-­‐development-­‐atdd-­‐an-­‐overview    [2]  J.  E.  Boal,  http://testdrivendeveloper.com/2011/12/27/AutomatedTestsAreTheKeyToScalingAgile.aspx  

Find  out  most  important  thing  to  do,  write  a  user  story  

Steps  

34  10.11.2012   Futurice  

Design  how  to  fulfill  the  requirement  

Design  Story  Write  tests   Code  

Formulate  test  cases,  most  probable  path  first  

Implement:  hammer  the  keyboard  until  all  tests  pass  (incl.  other  tests)  

Case  study  

Steps  in  real  life  

Jenkins  CI  »  Open-­‐source  continuous  integration  server  

»  Java  based,  lotsa  plugins  and  stuff  

»  Distributed  test  running  

»  Getting  started:  download  .war  and  fire  up  

37  10.11.2012   Futurice  

Selenium  »  Automation  of  browsers  

›  E.g.  for  testing  purposes,  or  for  repetitive  admin  tasks  

»  Selenium  IDE  for  recording  scripts  (=playing  ariound)  

»  Scaling  and  distributing  test  running  

»  Java-­‐based,  with  wide  support  for  other  langs  &  testing  frameworks  

38  10.11.2012   Futurice  

Robot  Framework  »  Generic  test  automation  framework  for  various  domains  

›  Web  part  backed  by  Selenium,  but  also  Java  GUI,  SSH,  running  processes...  

»  Tabular  test  data  syntax  

»  Extensible  with  Python/Java  

39  10.11.2012   Futurice  

Given-­‐When-­‐Then  (GWT)  Example  of  a  popular  approach:  

»  Given  the  shopping  cart  is  visible  and  has  three  items  in  it,  

»  When  the  user  clicks  an  item’s  trashcan  icon,  

»  Then  the  item  should  disappear  from  the  list  and  a  notification  should  be  shown  with  the  item’s  name  and  an  “Undo”  link.  

40  10.11.2012   Futurice  

Demo  

Is  this  worth  all  this  hassle?  

›  Yes!  No  time  not  to  automate  testing  

Enables:  

›  Fairly  liberal  refactoring  

›  Finding  regression  bugs  long  before  going  to  prod  

›  TDD  =>  knowing  early  what  you  are  supposed  to  code  

›  And  writing  less  useless  code  

›  Taking  in  new  devs  easily  

›  Continuous  deployment?  

›  …but  not  quite  yet  

Issues?  Sure:  

›  Different  mindset  required  

›  Intermittent,  hard  to  reproduce  test  failures  

›  Asynchronity,  other  weirdness  

›  Requires  lotsa  mad  skillz  

›  …and  then  some  

Thanks!  @ekantola  github.com/ekantola