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                 ...
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- P...
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...
Adding RSpec
Adding RSpecGemfile:
Adding RSpecGemfile:group :test do  gem rspecend
Adding RSpec                 - Generated apps areGemfile:            RSpec readygroup :test do   - Your choice of  gem rspe...
Spec Filerequire spec_helperdescribe DemoController do  let(:mock_call) { mock Call }  subject do    DemoController.new mo...
Our controllerclass DemoController < Adhearsion::CallController  def run    answer    result = ask "What is your favorite ...
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 define...
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  ...
SIPp options- -trace_err gives you an error log- -trace_stat outputs a CSV report- -rtp_echo echoes RTP back to the  sourc...
AHN-LOADBOT
FriendlyNeighborhood
FriendlyNeighborhood
The LoadBot- https://github.com/mojolingo/ahn-  loadbot- Adhearsion 1 plugin- Drives calls though an Asterisk  server- Can...
Loadbot scenario         config:           agi_server: 127.0.0.1           prefix: SIP/mycarrier         plans:           ...
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- Suitab...
Sample PJSUAcommand linepjsua --config-file options.conf
Sample PJSUAcommand linepjsua --config-file options.confoptions.conf:--null-audio--realm adhearsion.com--registrar sip.adh...
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 testi...
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 L...
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  happen...
Thank you!          http://mojolingo.com       https://github.com/polysics           Twitter: lucapradoXMPP and Email: lpr...
Thank you!          http://mojolingo.com       https://github.com/polysics           Twitter: lucapradoXMPP and Email: lpr...
Thank you!          http://mojolingo.com       https://github.com/polysics           Twitter: lucapradoXMPP and Email: lpr...
Upcoming SlideShare
Loading in …5
×

Testing Adhearsion Applications

649 views
510 views

Published on

My pre

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
649
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \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&amp;#x2019;s see what we know about sipp\n
  • let&amp;#x2019;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

    1. 1. TESTINGADHEARSIONAPPLICATIONS Luca PradoveraVoice Application Developer Mojo Lingo LLC
    2. 2. About me
    3. 3. About me - Rubyist from Italy
    4. 4. About me - Rubyist from Italy
    5. 5. About me - Rubyist from Italy
    6. 6. About me - Rubyist from Italy
    7. 7. About me - Rubyist from Italy - Voice Application Developer at Mojo Lingo
    8. 8. ADHEARSION APPS ARE FUN AND USEFUL
    9. 9. 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
    10. 10. BUT...
    11. 11. THEYMUST BESTABLE!
    12. 12. THEYMUST BESTABLE!
    13. 13. THE VILLAINS
    14. 14. THE VILLAINS- Application exceptions- Wrong call flow- Dropped calls- Integration errors
    15. 15. THE GOOD GUYS
    16. 16. THE GOOD GUYS- Unit Testing- Functional Testing- Load Testing
    17. 17. UNIT TESTING
    18. 18. Our goals for unit testing:
    19. 19. Our goals for unit testing:- Confidence at the class level
    20. 20. Our goals for unit testing:- Confidence at the class level- Prevent regression errors
    21. 21. Our goals for unit testing:- Confidence at the class level- Prevent regression errors- Promote proper code structure
    22. 22. 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
    23. 23. Unit testing Ahn apps
    24. 24. Unit testing Ahn apps- Call Controllers are an application’s core
    25. 25. Unit testing Ahn apps- Call Controllers are an application’s core- RSpec recommended
    26. 26. Unit testing Ahn apps- Call Controllers are an application’s core- RSpec recommended- Mock at the controller level
    27. 27. Unit testing Ahn apps- Call Controllers are an application’s core- RSpec recommended- Mock at the controller level- Support classes are just Ruby!
    28. 28. Adding RSpec
    29. 29. Adding RSpecGemfile:
    30. 30. Adding RSpecGemfile:group :test do gem rspecend
    31. 31. Adding RSpec - Generated apps areGemfile: RSpec readygroup :test do - Your choice of gem rspec mocking frameworkend - Just bundle install
    32. 32. 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
    33. 33. 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
    34. 34. Passing? COOL!
    35. 35. Passing? COOL!
    36. 36. FUNCTIONAL TESTING
    37. 37. Functional Testing 101
    38. 38. Functional Testing 101- Needs defining
    39. 39. Functional Testing 101- Needs defining- Quite difficult to approach
    40. 40. Functional Testing 101- Needs defining- Quite difficult to approach- Not solved by any single tool
    41. 41. OK, WE ARE IN BAD SHAPE...
    42. 42. ...but here comes some help!
    43. 43. ...but here comes some help!SIPp
    44. 44. ...but here comes some help!SIPp ahn-loadbot
    45. 45. ...but here comes some help!SIPp ahn-loadbot PJSUA
    46. 46. SIPp...
    47. 47. SIPp...
    48. 48. SIPp...... is about as user friendly as the above lion.
    49. 49. 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
    50. 50. 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
    51. 51. 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
    52. 52. AHN-LOADBOT
    53. 53. FriendlyNeighborhood
    54. 54. FriendlyNeighborhood
    55. 55. 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
    56. 56. 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
    57. 57. PJSUA
    58. 58. Someone has to answer too!
    59. 59. Someone has to answer too!
    60. 60. 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
    61. 61. Sample PJSUAcommand linepjsua --config-file options.conf
    62. 62. 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
    63. 63. Functionaltakeaways
    64. 64. Functional takeaways- Set a specific goal for each scenario
    65. 65. Functional takeaways- Set a specific goal for each scenario- Take advantage of CDR and APIs to do integration testing
    66. 66. 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
    67. 67. LOAD TESTING
    68. 68. Is my systemstrong enough?
    69. 69. Is my systemstrong enough?
    70. 70. Load Testing is...
    71. 71. Load Testing is...- Running a high amount of concurrent calls
    72. 72. Load Testing is...- Running a high amount of concurrent calls- Decide what you are looking for
    73. 73. Load Testing is...- Running a high amount of concurrent calls- Decide what you are looking for- Tool of choice, SIPp or Loadbot
    74. 74. Load testing metrics
    75. 75. Load testing metrics- Failed calls
    76. 76. Load testing metrics- Failed calls- Average call times getting too long
    77. 77. Load testing metrics- Failed calls- Average call times getting too long- Exception tracking, not everything happens visibly
    78. 78. Thank you! http://mojolingo.com https://github.com/polysics Twitter: lucapradoXMPP and Email: lpradovera@mojolingo.com ...and please...
    79. 79. Thank you! http://mojolingo.com https://github.com/polysics Twitter: lucapradoXMPP and Email: lpradovera@mojolingo.com ...and please... NO MAKE KITTY SAD
    80. 80. 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

    ×