Testing Adhearsion Applications
Upcoming SlideShare
Loading in...5
×
 

Testing Adhearsion Applications

on

  • 504 views

My pre

My pre

Statistics

Views

Total Views
504
Slideshare-icon Views on SlideShare
504
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • all of those have been built with Adhearsion and are around now\n
  • \n
  • people get very angry when phone calls do not work. the same ancestral instincts that make voice our best tool to communicate makes users react very badly when something goes wrong.\n
  • of course not the only ones\n
  • \n
  • \n
  • of course unit testing and TDD have another million good reasons\n
  • of course unit testing and TDD have another million good reasons\n
  • of course unit testing and TDD have another million good reasons\n
  • of course unit testing and TDD have another million good reasons\n
  • \n
  • \n
  • \n
  • \n
  • configure RSpec in spec_helper as usual. Guard is recommended too.\n
  • configure RSpec in spec_helper as usual. Guard is recommended too.\n
  • configure RSpec in spec_helper as usual. Guard is recommended too.\n
  • kept it as simple as possible. how many in the audience are familiar with rspec?\n
  • how many are familiar with adhearsion 2 controllers? explain if not many\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • let’s see what we know about sipp\n
  • let’s see what we know about sipp\n
  • \n
  • Command line does not fit on screen.\n
  • \n
  • \n
  • \n
  • Ahn can also be a client\nSuitable for anything but load testing Adhearsion itself\n
  • \n
  • \n
  • otherwise you end up like the girl above\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Testing Adhearsion Applications Testing Adhearsion Applications Presentation Transcript

  • TESTINGADHEARSIONAPPLICATIONS Luca PradoveraVoice Application Developer Mojo Lingo LLC
  • About me
  • About me - Rubyist from Italy
  • About me - Rubyist from Italy
  • About me - Rubyist from Italy
  • About me - Rubyist from Italy
  • About me - Rubyist from Italy - Voice Application Developer at Mojo Lingo
  • ADHEARSION APPS ARE FUN AND USEFUL
  • ADHEARSIONDICTATION CARRIERAPPLICATIONS CALL APPSCENTERSCUSTOMER CRM SUPPORT ARETRANSLATION FUN DISTRIBUTEDC O M M U N I C A T I O N SS C H E D U L I N G ANDCONVERGENCE USEFUL
  • BUT...
  • THEYMUST BESTABLE!
  • THEYMUST BESTABLE!
  • THE VILLAINS
  • THE VILLAINS- Application exceptions- Wrong call flow- Dropped calls- Integration errors
  • THE GOOD GUYS
  • THE GOOD GUYS- Unit Testing- Functional Testing- Load Testing
  • UNIT TESTING
  • Our goals for unit testing:
  • Our goals for unit testing:- Confidence at the class level
  • Our goals for unit testing:- Confidence at the class level- Prevent regression errors
  • Our goals for unit testing:- Confidence at the class level- Prevent regression errors- Promote proper code structure
  • Our goals for unit testing:- Confidence at the class level- Prevent regression errors- Promote proper code structure- Provide CI with something to help us with
  • Unit testing Ahn apps
  • Unit testing Ahn apps- Call Controllers are an application’s core
  • Unit testing Ahn apps- Call Controllers are an application’s core- RSpec recommended
  • Unit testing Ahn apps- Call Controllers are an application’s core- RSpec recommended- Mock at the controller level
  • Unit testing Ahn apps- Call Controllers are an application’s core- RSpec recommended- Mock at the controller level- Support classes are just Ruby!
  • Adding RSpec
  • Adding RSpecGemfile:
  • Adding RSpecGemfile:group :test do gem rspecend
  • Adding RSpec - Generated apps areGemfile: RSpec readygroup :test do - Your choice of gem rspec mocking frameworkend - Just bundle install
  • Spec Filerequire spec_helperdescribe DemoController do let(:mock_call) { mock Call } subject do DemoController.new mock_call end let(:dtmf) { "1" } it "should answer, ask for a result, and say it" do subject.should_receive(:answer).once subject.should_receive(:ask).with("What is your favorite number?", :timeout =>10000, :limit => 1).once.and_return(dtmf) subject.should_receive(:say).with("Your favorite number seems to be #{dtmf}") subject.run endend
  • Our controllerclass DemoController < Adhearsion::CallController def run answer result = ask "What is your favorite number?", :timeout =>10000, :limit => 1 say "Your favorite number seems to be #{result}" endend
  • Passing? COOL!
  • Passing? COOL!
  • FUNCTIONAL TESTING
  • Functional Testing 101
  • Functional Testing 101- Needs defining
  • Functional Testing 101- Needs defining- Quite difficult to approach
  • Functional Testing 101- Needs defining- Quite difficult to approach- Not solved by any single tool
  • OK, WE ARE IN BAD SHAPE...
  • ...but here comes some help!
  • ...but here comes some help!SIPp
  • ...but here comes some help!SIPp ahn-loadbot
  • ...but here comes some help!SIPp ahn-loadbot PJSUA
  • SIPp...
  • SIPp...
  • SIPp...... is about as user friendly as the above lion.
  • SIPp (seriously)- http://sipp.sourceforge.net/- Free and OSS Test tool and traffic generator- Can run XML scenarios defined by the user- Can play audio and interact- Requires good knowledge of SIP
  • SIPp sample runsudo sipp -sn uac -s 1 -l 10 -r 5 -m 100 127.0.0.1- Built-in scenario- Audio is PCAP, raw network capture of an RTP session- In custom scenarios, PCAP files are built with Wireshark/tcpdump- Ability to set call rate, concurrent calls, maximum number of calls, many other options
  • SIPp options- -trace_err gives you an error log- -trace_stat outputs a CSV report- -rtp_echo echoes RTP back to the source- An XML scenario file can play PCAP, pause, and perform general call control
  • AHN-LOADBOT
  • FriendlyNeighborhood
  • FriendlyNeighborhood
  • The LoadBot- https://github.com/mojolingo/ahn- loadbot- Adhearsion 1 plugin- Drives calls though an Asterisk server- Can simulate a call, listen for audio, and record results
  • Loadbot scenario config: agi_server: 127.0.0.1 prefix: SIP/mycarrier plans: plan 1: number: 1231231234 answers: - 1- Can be driven through DRb or directly through the Ahn1 API
  • PJSUA
  • Someone has to answer too!
  • Someone has to answer too!
  • PJSUA at a glance- Can make single or multiple connection to SIP server- Can auto-answer, play audio, and record- Suitable for test support- Also is a handy tool for QoS- Does not run a “true” scenario
  • Sample PJSUAcommand linepjsua --config-file options.conf
  • Sample PJSUAcommand linepjsua --config-file options.confoptions.conf:--null-audio--realm adhearsion.com--registrar sip.adhearsion.com--id sip:999@adhearsion.com--username 999--password AdhearsionConf--nameserver 8.8.8.8--auto-answer 200--auto-loop--play-file monkeys.wav
  • Functionaltakeaways
  • Functional takeaways- Set a specific goal for each scenario
  • Functional takeaways- Set a specific goal for each scenario- Take advantage of CDR and APIs to do integration testing
  • Functional takeaways- Set a specific goal for each scenario- Take advantage of CDR and APIs to do integration testing- Less automated than web functional testing
  • LOAD TESTING
  • Is my systemstrong enough?
  • Is my systemstrong enough?
  • Load Testing is...
  • Load Testing is...- Running a high amount of concurrent calls
  • Load Testing is...- Running a high amount of concurrent calls- Decide what you are looking for
  • Load Testing is...- Running a high amount of concurrent calls- Decide what you are looking for- Tool of choice, SIPp or Loadbot
  • Load testing metrics
  • Load testing metrics- Failed calls
  • Load testing metrics- Failed calls- Average call times getting too long
  • Load testing metrics- Failed calls- Average call times getting too long- Exception tracking, not everything happens visibly
  • Thank you! http://mojolingo.com https://github.com/polysics Twitter: lucapradoXMPP and Email: lpradovera@mojolingo.com ...and please...
  • Thank you! http://mojolingo.com https://github.com/polysics Twitter: lucapradoXMPP and Email: lpradovera@mojolingo.com ...and please... NO MAKE KITTY SAD
  • Thank you! http://mojolingo.com https://github.com/polysics Twitter: lucapradoXMPP and Email: lpradovera@mojolingo.com ...and please... NO MAKE KITTY SAD ...go rate my talk at http:/spkr8.com/17421