World Conference –
Next Generation Testing
08 – 12 July, Le-Meridien, Bangalore
Agile Test Automation
Anti-patterns & Rescue Strategies
www.unicomlearning.com
Speaker:
Karthik Sirasanagandla
Agile/Lean Coach
Industrial Logic
1
What do you expect out of this
session?
Is anyone having a painful story to
share?
2
The Big Things That Go Wrong..
The Details That Go Awry...
The Rescue Strategies..
3
www.unicomlearning.com
The Big Things That Go Wrong!
4
It’s So SCARY!!!
www.unicomlearning.com
5
• Nothing in life is to be feared, it is only to be
understood. -- Marie Curie
– You’re not afraid to try again, you’re just afraid of
getting hurt.
• In Everyday Scripting with Ruby, Brian Marick
advises to learn to program by writing one.
#FailProof
• Learn By Doing
6
Silos
www.unicomlearning.com
Scrum MasterManager Developer
QA
...
7
Results Over Reasoning
www.unicomlearning.com
8
• Cost: Manual Versus Automation
• Business Value of Deliverable
• Automate Everything That Is Repeatable
9
Discontinuous Integration
10
CI in Progress
11
What’s Your Test Architecture?
www.unicomlearning.com
12
Skewed Test Architecture
www.unicomlearning.com
13
14
15
16
Quiz Time
• What is the wolf that can huff and puff your hay stack in
your test pyramid?
• What is the wolf that can break your wooden stack in
your test pyramid?
• Who is the wolf that can break you brick stack in your
test pyramid?
• What is the moral of the story? Just build unit
tests???
17
Old Is Gold
www.unicomlearning.com
18
One Huge Monolithic Test Suite
19
The Details That Go Awry!
www.unicomlearning.com
20
I Love Se IDE
www.unicomlearning.com
21
X-Path Rocks
www.unicomlearning.com
22
Where’re The Page Objects?
www.unicomlearning.com
23
Page-Object Littered With Assertions
www.unicomlearning.com
24
Bad Code
#my_target_page.rb
def verify_edit_link_presence
//BAD: Assertion in Page-Object
has_link?("Edit").should be_true
end
#my_target_spec
it "blah blah blah"
@my_target_page.do_some_action
@my_target_page.verify_edit_link_presence
end
25
Good Code
#my_target_page.rb
def has_edit_link?
has_link?("Edit")
end
 
#my_target_spec
it "blah blah blah"
@my_target_page.do_some_action
@my_target_page.has_edit_link?.should
be_true
end
26
I love to sleep
www.unicomlearning.com
27
Scenario To Code: Good Versus Bad
As a user
I should be able to add notes to the table
so that the information is recorded for future reference.
def add_and_save_notes notes
fill_in("my_target_text_box", :with => notes)
click_button "Save" # This makes an AJAX request and
adds new row to the table upon successfully saving
sleep(3) #<-- This is BAD code.
end
def add_and_save_notes notes
...
wait_until { has_text?(notes) } #<-- This is GOOD
practice that enables test stability and hence faith in
test results
end
28
Asserting message for exactness
• #my_target_spec.rb
 
describe "save notes" do
it "should add notes as new row to table upon successful save" do
notes = "sample notes"
expected_update_message = "Your note is added successfully!"
@my_target_page. add_and_save_notes notes
@my_target_page.update_message.should == expected_update_message
end
end
Why measure
exactness???
29
Duplication makes life easy
30
Long live dead code!!!
31
Rescue Strategies
www.unicomlearning.com
32
Didn’t we discuss about it all the way?
...Do you want to know anything more?
33
References Resources
• Agile Testing by Lisa Crispin and Janet Gregory
– Driving Selenium Safely from http://
elearning.industriallogic.com
• http://patrickwilsonwelsh.com/
• http://kartzontech.blogspot.in/
• Everyday scripting with Ruby for Teams, Testers and
You.
34
Thank You
World Conference – Next Generation Testing
UNICOM Trainings & Seminars Pvt. Ltd.
contact@unicomlearning.com
Images Source:
http://www.geograph.org.uk/photo/122440
http://www.flickr.com/photos/philipbitnar/3194364095/
http://www.flickr.com/photos/un_photo/3331240051/in/photostream/
http://www.synnovatia.com/business-coaching-blog/bid/132417/Getting-Past-Your-Fears-and-Growing-a-Successful-Business
http://www.global-integration.com/cartoons/silos/
http://www.kent.ac.uk/secl/philosophy/jw/reasoning/club/
http://www.freefoto.com/preview/904-22-3505/White-clouds-and-blue-sky
http://www.flickr.com/photos/nagesh_kamath/4714936714/
http://blogs.agilefaqs.com/2011/02/01/inverting-the-testing-pyramid/
http://www.flickr.com/photos/w9ned/3958782404/
http://commons.wikimedia.org/wiki/File:Selenium_IDE.png
http://commons.wikimedia.org/wiki/File:XPath_example.svg
http://www.flickr.com/photos/betobaibich/266557188/
http://commons.wikimedia.org/wiki/File:Littering_in_Stockholm.jpg
http://commons.wikimedia.org/wiki/File:Gray_paper_bag_with_sad_smiley_over_head.jpg
http://www.flickr.com/photos/byronpeebles/3337412761/in/photostream/
http://www.fotopedia.com/items/flickr-24930799
http://www.flickr.com/photos/asterix611/5120445522/in/photostream/
http://philby.deviantart.com/art/Threatening-Behaviour-lines-72724012
http://martinfowler.com/bliki/TestPyramid.html
35

Agile Test Automation Anti-patterns and Rescue Strategies

  • 1.
    World Conference – NextGeneration Testing 08 – 12 July, Le-Meridien, Bangalore Agile Test Automation Anti-patterns & Rescue Strategies www.unicomlearning.com Speaker: Karthik Sirasanagandla Agile/Lean Coach Industrial Logic 1
  • 2.
    What do youexpect out of this session? Is anyone having a painful story to share? 2
  • 3.
    The Big ThingsThat Go Wrong.. The Details That Go Awry... The Rescue Strategies.. 3
  • 4.
  • 5.
  • 6.
    • Nothing inlife is to be feared, it is only to be understood. -- Marie Curie – You’re not afraid to try again, you’re just afraid of getting hurt. • In Everyday Scripting with Ruby, Brian Marick advises to learn to program by writing one. #FailProof • Learn By Doing 6
  • 7.
  • 8.
  • 9.
    • Cost: ManualVersus Automation • Business Value of Deliverable • Automate Everything That Is Repeatable 9
  • 10.
  • 11.
  • 12.
    What’s Your TestArchitecture? www.unicomlearning.com 12
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
    Quiz Time • Whatis the wolf that can huff and puff your hay stack in your test pyramid? • What is the wolf that can break your wooden stack in your test pyramid? • Who is the wolf that can break you brick stack in your test pyramid? • What is the moral of the story? Just build unit tests??? 17
  • 18.
  • 19.
    One Huge MonolithicTest Suite 19
  • 20.
    The Details ThatGo Awry! www.unicomlearning.com 20
  • 21.
    I Love SeIDE www.unicomlearning.com 21
  • 22.
  • 23.
    Where’re The PageObjects? www.unicomlearning.com 23
  • 24.
    Page-Object Littered WithAssertions www.unicomlearning.com 24
  • 25.
    Bad Code #my_target_page.rb def verify_edit_link_presence //BAD:Assertion in Page-Object has_link?("Edit").should be_true end #my_target_spec it "blah blah blah" @my_target_page.do_some_action @my_target_page.verify_edit_link_presence end 25
  • 26.
    Good Code #my_target_page.rb def has_edit_link? has_link?("Edit") end   #my_target_spec it"blah blah blah" @my_target_page.do_some_action @my_target_page.has_edit_link?.should be_true end 26
  • 27.
    I love tosleep www.unicomlearning.com 27
  • 28.
    Scenario To Code:Good Versus Bad As a user I should be able to add notes to the table so that the information is recorded for future reference. def add_and_save_notes notes fill_in("my_target_text_box", :with => notes) click_button "Save" # This makes an AJAX request and adds new row to the table upon successfully saving sleep(3) #<-- This is BAD code. end def add_and_save_notes notes ... wait_until { has_text?(notes) } #<-- This is GOOD practice that enables test stability and hence faith in test results end 28
  • 29.
    Asserting message forexactness • #my_target_spec.rb   describe "save notes" do it "should add notes as new row to table upon successful save" do notes = "sample notes" expected_update_message = "Your note is added successfully!" @my_target_page. add_and_save_notes notes @my_target_page.update_message.should == expected_update_message end end Why measure exactness??? 29
  • 30.
  • 31.
    Long live deadcode!!! 31
  • 32.
  • 33.
    Didn’t we discussabout it all the way? ...Do you want to know anything more? 33
  • 34.
    References Resources • AgileTesting by Lisa Crispin and Janet Gregory – Driving Selenium Safely from http:// elearning.industriallogic.com • http://patrickwilsonwelsh.com/ • http://kartzontech.blogspot.in/ • Everyday scripting with Ruby for Teams, Testers and You. 34
  • 35.
    Thank You World Conference– Next Generation Testing UNICOM Trainings & Seminars Pvt. Ltd. contact@unicomlearning.com Images Source: http://www.geograph.org.uk/photo/122440 http://www.flickr.com/photos/philipbitnar/3194364095/ http://www.flickr.com/photos/un_photo/3331240051/in/photostream/ http://www.synnovatia.com/business-coaching-blog/bid/132417/Getting-Past-Your-Fears-and-Growing-a-Successful-Business http://www.global-integration.com/cartoons/silos/ http://www.kent.ac.uk/secl/philosophy/jw/reasoning/club/ http://www.freefoto.com/preview/904-22-3505/White-clouds-and-blue-sky http://www.flickr.com/photos/nagesh_kamath/4714936714/ http://blogs.agilefaqs.com/2011/02/01/inverting-the-testing-pyramid/ http://www.flickr.com/photos/w9ned/3958782404/ http://commons.wikimedia.org/wiki/File:Selenium_IDE.png http://commons.wikimedia.org/wiki/File:XPath_example.svg http://www.flickr.com/photos/betobaibich/266557188/ http://commons.wikimedia.org/wiki/File:Littering_in_Stockholm.jpg http://commons.wikimedia.org/wiki/File:Gray_paper_bag_with_sad_smiley_over_head.jpg http://www.flickr.com/photos/byronpeebles/3337412761/in/photostream/ http://www.fotopedia.com/items/flickr-24930799 http://www.flickr.com/photos/asterix611/5120445522/in/photostream/ http://philby.deviantart.com/art/Threatening-Behaviour-lines-72724012 http://martinfowler.com/bliki/TestPyramid.html 35