SlideShare a Scribd company logo
1 of 36
Download to read offline
TESTING
                     ADHEARSION
                     APPLICATIONS
                               Luca	
  Pradovera
                      Voice	
  Applica1on	
  Developer
                               Mojo	
  Lingo	
  LLC




venerdì 1 marzo 13
About me
                        - Rubyist from Italy
                        - Voice Application
                          Developer at Mojo
                          Lingo




venerdì 1 marzo 13
ADHEARSION
       DICTATION CARRIER
       APPLICATIONS CALL   APPS
       CENTERS      CRM
       CUSTOMER SUPPORT
                            ARE
       TRANSLATION          FUN
                       DISTRIBUTED
       C O M M U N I C A T I O N S
       S C H E D U L I N G AND
       CONVERGENCE
                         USEFUL
venerdì 1 marzo 13
BUT...



venerdì 1 marzo 13
THEY
                     MUST BE
                     STABLE!


venerdì 1 marzo 13
THE VILLAINS

                     -   Application exceptions
                     -   Wrong call flow
                     -   Dropped calls
                     -   Integration errors




venerdì 1 marzo 13
THE GOOD GUYS

                     - Unit Testing
                     - Functional Testing
                     - Load Testing



venerdì 1 marzo 13
UNIT TESTING



venerdì 1 marzo 13
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




venerdì 1 marzo 13
Unit testing Ahn apps

                     -   Call Controllers are an application’s core
                     -   RSpec recommended
                     -   Mock at the controller level
                     -   Support classes are just Ruby!




venerdì 1 marzo 13
Adding RSpec
                                  - Generated apps are
                     Gemfile:        RSpec ready
                 group :test do
                   gem 'rspec'
                                  - Your choice of mocking
                 end
                                    framework
                                  - Just bundle install



venerdì 1 marzo 13
Spec File
           require 'spec_helper'

           describe 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
             end
           end




venerdì 1 marzo 13
Our controller

     class 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}"
       end
     end




venerdì 1 marzo 13
Passing? COOL!




venerdì 1 marzo 13
FUNCTIONAL
                       TESTING


venerdì 1 marzo 13
Functional Testing
                             101

                     - Needs defining
                     - Quite difficult to approach
                     - Not solved by any single tool



venerdì 1 marzo 13
OK, WE ARE IN BAD
                          SHAPE...


venerdì 1 marzo 13
...but here comes
                         some help!
                     SIPp

                        ahn-loadbot

                                  PJSUA

venerdì 1 marzo 13
SIPp...




                     ... is about as user friendly as the above lion.

venerdì 1 marzo 13
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

venerdì 1 marzo 13
SIPp sample run
                      sudo 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
venerdì 1 marzo 13
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



venerdì 1 marzo 13
AHN-LOADBOT



venerdì 1 marzo 13
Friendly
                Neighborhood Robot




venerdì 1 marzo 13
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
                     - Metrics that can be used: duration of calls,
                         ASR for presence of audio


venerdì 1 marzo 13
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


venerdì 1 marzo 13
PJSUA



venerdì 1 marzo 13
Someone has to
                       answer too!




venerdì 1 marzo 13
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


venerdì 1 marzo 13
Sample PJSUA
                     command line
                     pjsua --config-file options.conf

                     options.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




venerdì 1 marzo 13
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



venerdì 1 marzo 13
LOAD TESTING



venerdì 1 marzo 13
Is my system strong
                          enough?




venerdì 1 marzo 13
Load Testing is...

                     - Running a high amount of concurrent calls
                     - Decide what you are looking for
                     - Tool of choice, SIPp or Loadbot



venerdì 1 marzo 13
Load testing metrics

                     - Failed calls
                     - Average call times getting too long
                     - Exception tracking, not everything happens
                       visibly




venerdì 1 marzo 13
Thank you!
                               http://mojolingo.com
                            https://github.com/polysics
                                Twitter: lucaprado
                     XMPP and Email: lpradovera@mojolingo.com

                                ...and please...
                                   NO MAKE KITTY SAD

                                       ...go rate my talk at
                                     http:/spkr8.com/17421

venerdì 1 marzo 13

More Related Content

Similar to Testing Adhearsion Applications

Integrating Voice Through Adhearsion
Integrating Voice Through AdhearsionIntegrating Voice Through Adhearsion
Integrating Voice Through AdhearsionMojo Lingo
 
Testing Adhearsion Applications
Testing Adhearsion ApplicationsTesting Adhearsion Applications
Testing Adhearsion ApplicationsLuca Pradovera
 
The Future of JRuby - Baruco 2013
The Future of JRuby - Baruco 2013The Future of JRuby - Baruco 2013
The Future of JRuby - Baruco 2013Charles Nutter
 
Use Ruby to Write (and Test) Your Next Android App
Use Ruby to Write (and Test) Your Next Android AppUse Ruby to Write (and Test) Your Next Android App
Use Ruby to Write (and Test) Your Next Android AppJoel Byler
 
Puppet @ Nedap
Puppet @ NedapPuppet @ Nedap
Puppet @ NedapPuppet
 
Strata lightening-talk
Strata lightening-talkStrata lightening-talk
Strata lightening-talkDanny Yuan
 
Introduction to node.js by Ran Mizrahi @ Reversim Summit
Introduction to node.js by Ran Mizrahi @ Reversim SummitIntroduction to node.js by Ran Mizrahi @ Reversim Summit
Introduction to node.js by Ran Mizrahi @ Reversim SummitRan Mizrahi
 
Intravert atx meetup_condensed
Intravert atx meetup_condensedIntravert atx meetup_condensed
Intravert atx meetup_condensedzznate
 
Applying Evolutionary Architecture on a Popular API
Applying Evolutionary Architecture on a  Popular APIApplying Evolutionary Architecture on a  Popular API
Applying Evolutionary Architecture on a Popular APIPhil Calçado
 
Microservices and functional programming
Microservices and functional programmingMicroservices and functional programming
Microservices and functional programmingMichael Neale
 
Forget Ruby. Forget CoffeeScript. Do SOA
Forget Ruby. Forget CoffeeScript. Do SOAForget Ruby. Forget CoffeeScript. Do SOA
Forget Ruby. Forget CoffeeScript. Do SOAMichał Łomnicki
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Puppet
 
High Performance Ruby - E4E Conference 2013
High Performance Ruby - E4E Conference 2013High Performance Ruby - E4E Conference 2013
High Performance Ruby - E4E Conference 2013Charles Nutter
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...NETWAYS
 
Improving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornImproving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornSimon Bagreev
 
Osdc 2011 michael_neale
Osdc 2011 michael_nealeOsdc 2011 michael_neale
Osdc 2011 michael_nealeMichael Neale
 

Similar to Testing Adhearsion Applications (20)

Integrating Voice Through Adhearsion
Integrating Voice Through AdhearsionIntegrating Voice Through Adhearsion
Integrating Voice Through Adhearsion
 
Testing Adhearsion Applications
Testing Adhearsion ApplicationsTesting Adhearsion Applications
Testing Adhearsion Applications
 
The Future of JRuby - Baruco 2013
The Future of JRuby - Baruco 2013The Future of JRuby - Baruco 2013
The Future of JRuby - Baruco 2013
 
Plumbr case study
Plumbr case studyPlumbr case study
Plumbr case study
 
Use Ruby to Write (and Test) Your Next Android App
Use Ruby to Write (and Test) Your Next Android AppUse Ruby to Write (and Test) Your Next Android App
Use Ruby to Write (and Test) Your Next Android App
 
When Tdd Goes Awry
When Tdd Goes AwryWhen Tdd Goes Awry
When Tdd Goes Awry
 
Daemons in PHP
Daemons in PHPDaemons in PHP
Daemons in PHP
 
Puppet @ Nedap
Puppet @ NedapPuppet @ Nedap
Puppet @ Nedap
 
Strata lightening-talk
Strata lightening-talkStrata lightening-talk
Strata lightening-talk
 
Introduction to node.js by Ran Mizrahi @ Reversim Summit
Introduction to node.js by Ran Mizrahi @ Reversim SummitIntroduction to node.js by Ran Mizrahi @ Reversim Summit
Introduction to node.js by Ran Mizrahi @ Reversim Summit
 
Intravert atx meetup_condensed
Intravert atx meetup_condensedIntravert atx meetup_condensed
Intravert atx meetup_condensed
 
Cracking OCPJP 7 exam
Cracking OCPJP 7 examCracking OCPJP 7 exam
Cracking OCPJP 7 exam
 
Applying Evolutionary Architecture on a Popular API
Applying Evolutionary Architecture on a  Popular APIApplying Evolutionary Architecture on a  Popular API
Applying Evolutionary Architecture on a Popular API
 
Microservices and functional programming
Microservices and functional programmingMicroservices and functional programming
Microservices and functional programming
 
Forget Ruby. Forget CoffeeScript. Do SOA
Forget Ruby. Forget CoffeeScript. Do SOAForget Ruby. Forget CoffeeScript. Do SOA
Forget Ruby. Forget CoffeeScript. Do SOA
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...
 
High Performance Ruby - E4E Conference 2013
High Performance Ruby - E4E Conference 2013High Performance Ruby - E4E Conference 2013
High Performance Ruby - E4E Conference 2013
 
Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...Building scalable applications while scaling your infrastructure by rhommel l...
Building scalable applications while scaling your infrastructure by rhommel l...
 
Improving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornImproving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and Unicorn
 
Osdc 2011 michael_neale
Osdc 2011 michael_nealeOsdc 2011 michael_neale
Osdc 2011 michael_neale
 

More from Mojo Lingo

ConnectJS 2015: Video Killed the Telephone Star
ConnectJS 2015: Video Killed the Telephone StarConnectJS 2015: Video Killed the Telephone Star
ConnectJS 2015: Video Killed the Telephone StarMojo Lingo
 
AstriCon 2015: WebRTC: How it Works, and How it Breaks
AstriCon 2015: WebRTC: How it Works, and How it BreaksAstriCon 2015: WebRTC: How it Works, and How it Breaks
AstriCon 2015: WebRTC: How it Works, and How it BreaksMojo Lingo
 
FreeSWITCH, FreeSWITCH Everywhere, and Not A Phone In Sight
FreeSWITCH, FreeSWITCH Everywhere, and Not A Phone In SightFreeSWITCH, FreeSWITCH Everywhere, and Not A Phone In Sight
FreeSWITCH, FreeSWITCH Everywhere, and Not A Phone In SightMojo Lingo
 
Now Hear This! Putting Voice, Video, and Text into Ruby on Rails
Now Hear This! Putting Voice, Video, and Text into Ruby on RailsNow Hear This! Putting Voice, Video, and Text into Ruby on Rails
Now Hear This! Putting Voice, Video, and Text into Ruby on RailsMojo Lingo
 
Using Asterisk to Create "Her"
Using Asterisk to Create "Her"Using Asterisk to Create "Her"
Using Asterisk to Create "Her"Mojo Lingo
 
Tipping the Scales: Measuring and Scaling Asterisk
Tipping the Scales: Measuring and Scaling AsteriskTipping the Scales: Measuring and Scaling Asterisk
Tipping the Scales: Measuring and Scaling AsteriskMojo Lingo
 
WebRTC Overview by Dan Burnett
WebRTC Overview by Dan BurnettWebRTC Overview by Dan Burnett
WebRTC Overview by Dan BurnettMojo Lingo
 
AdhearsionConf 2013 Keynote
AdhearsionConf 2013 KeynoteAdhearsionConf 2013 Keynote
AdhearsionConf 2013 KeynoteMojo Lingo
 
Speech-Enabling Web Apps
Speech-Enabling Web AppsSpeech-Enabling Web Apps
Speech-Enabling Web AppsMojo Lingo
 
WebRTC: What? How? Why? - ClueCon 2013
WebRTC: What? How? Why? - ClueCon 2013WebRTC: What? How? Why? - ClueCon 2013
WebRTC: What? How? Why? - ClueCon 2013Mojo Lingo
 
Infiltrando Telecoms Usando Ruby
Infiltrando Telecoms Usando RubyInfiltrando Telecoms Usando Ruby
Infiltrando Telecoms Usando RubyMojo Lingo
 
Enhancing FreePBX with Adhearsion
Enhancing FreePBX with AdhearsionEnhancing FreePBX with Adhearsion
Enhancing FreePBX with AdhearsionMojo Lingo
 
Connecting Adhearsion
Connecting AdhearsionConnecting Adhearsion
Connecting AdhearsionMojo Lingo
 
Testing Telephony: It's Not All Terrible
Testing Telephony: It's Not All TerribleTesting Telephony: It's Not All Terrible
Testing Telephony: It's Not All TerribleMojo Lingo
 
Rayo for XMPP Folks
Rayo for XMPP FolksRayo for XMPP Folks
Rayo for XMPP FolksMojo Lingo
 
Talking To Rails
Talking To RailsTalking To Rails
Talking To RailsMojo Lingo
 
Building Real Life Applications with Adhearsion
Building Real Life Applications with AdhearsionBuilding Real Life Applications with Adhearsion
Building Real Life Applications with AdhearsionMojo Lingo
 
Keeping It Realtime!
Keeping It Realtime!Keeping It Realtime!
Keeping It Realtime!Mojo Lingo
 
Infiltrating Telecoms Using Ruby
Infiltrating Telecoms Using RubyInfiltrating Telecoms Using Ruby
Infiltrating Telecoms Using RubyMojo Lingo
 
Telephony Through Ruby Colored Lenses
Telephony Through Ruby Colored LensesTelephony Through Ruby Colored Lenses
Telephony Through Ruby Colored LensesMojo Lingo
 

More from Mojo Lingo (20)

ConnectJS 2015: Video Killed the Telephone Star
ConnectJS 2015: Video Killed the Telephone StarConnectJS 2015: Video Killed the Telephone Star
ConnectJS 2015: Video Killed the Telephone Star
 
AstriCon 2015: WebRTC: How it Works, and How it Breaks
AstriCon 2015: WebRTC: How it Works, and How it BreaksAstriCon 2015: WebRTC: How it Works, and How it Breaks
AstriCon 2015: WebRTC: How it Works, and How it Breaks
 
FreeSWITCH, FreeSWITCH Everywhere, and Not A Phone In Sight
FreeSWITCH, FreeSWITCH Everywhere, and Not A Phone In SightFreeSWITCH, FreeSWITCH Everywhere, and Not A Phone In Sight
FreeSWITCH, FreeSWITCH Everywhere, and Not A Phone In Sight
 
Now Hear This! Putting Voice, Video, and Text into Ruby on Rails
Now Hear This! Putting Voice, Video, and Text into Ruby on RailsNow Hear This! Putting Voice, Video, and Text into Ruby on Rails
Now Hear This! Putting Voice, Video, and Text into Ruby on Rails
 
Using Asterisk to Create "Her"
Using Asterisk to Create "Her"Using Asterisk to Create "Her"
Using Asterisk to Create "Her"
 
Tipping the Scales: Measuring and Scaling Asterisk
Tipping the Scales: Measuring and Scaling AsteriskTipping the Scales: Measuring and Scaling Asterisk
Tipping the Scales: Measuring and Scaling Asterisk
 
WebRTC Overview by Dan Burnett
WebRTC Overview by Dan BurnettWebRTC Overview by Dan Burnett
WebRTC Overview by Dan Burnett
 
AdhearsionConf 2013 Keynote
AdhearsionConf 2013 KeynoteAdhearsionConf 2013 Keynote
AdhearsionConf 2013 Keynote
 
Speech-Enabling Web Apps
Speech-Enabling Web AppsSpeech-Enabling Web Apps
Speech-Enabling Web Apps
 
WebRTC: What? How? Why? - ClueCon 2013
WebRTC: What? How? Why? - ClueCon 2013WebRTC: What? How? Why? - ClueCon 2013
WebRTC: What? How? Why? - ClueCon 2013
 
Infiltrando Telecoms Usando Ruby
Infiltrando Telecoms Usando RubyInfiltrando Telecoms Usando Ruby
Infiltrando Telecoms Usando Ruby
 
Enhancing FreePBX with Adhearsion
Enhancing FreePBX with AdhearsionEnhancing FreePBX with Adhearsion
Enhancing FreePBX with Adhearsion
 
Connecting Adhearsion
Connecting AdhearsionConnecting Adhearsion
Connecting Adhearsion
 
Testing Telephony: It's Not All Terrible
Testing Telephony: It's Not All TerribleTesting Telephony: It's Not All Terrible
Testing Telephony: It's Not All Terrible
 
Rayo for XMPP Folks
Rayo for XMPP FolksRayo for XMPP Folks
Rayo for XMPP Folks
 
Talking To Rails
Talking To RailsTalking To Rails
Talking To Rails
 
Building Real Life Applications with Adhearsion
Building Real Life Applications with AdhearsionBuilding Real Life Applications with Adhearsion
Building Real Life Applications with Adhearsion
 
Keeping It Realtime!
Keeping It Realtime!Keeping It Realtime!
Keeping It Realtime!
 
Infiltrating Telecoms Using Ruby
Infiltrating Telecoms Using RubyInfiltrating Telecoms Using Ruby
Infiltrating Telecoms Using Ruby
 
Telephony Through Ruby Colored Lenses
Telephony Through Ruby Colored LensesTelephony Through Ruby Colored Lenses
Telephony Through Ruby Colored Lenses
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

Testing Adhearsion Applications

  • 1. TESTING ADHEARSION APPLICATIONS Luca  Pradovera Voice  Applica1on  Developer Mojo  Lingo  LLC venerdì 1 marzo 13
  • 2. About me - Rubyist from Italy - Voice Application Developer at Mojo Lingo venerdì 1 marzo 13
  • 3. ADHEARSION DICTATION CARRIER APPLICATIONS CALL APPS CENTERS CRM CUSTOMER SUPPORT ARE TRANSLATION FUN DISTRIBUTED C O M M U N I C A T I O N S S C H E D U L I N G AND CONVERGENCE USEFUL venerdì 1 marzo 13
  • 5. THEY MUST BE STABLE! venerdì 1 marzo 13
  • 6. THE VILLAINS - Application exceptions - Wrong call flow - Dropped calls - Integration errors venerdì 1 marzo 13
  • 7. THE GOOD GUYS - Unit Testing - Functional Testing - Load Testing venerdì 1 marzo 13
  • 9. 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 venerdì 1 marzo 13
  • 10. Unit testing Ahn apps - Call Controllers are an application’s core - RSpec recommended - Mock at the controller level - Support classes are just Ruby! venerdì 1 marzo 13
  • 11. Adding RSpec - Generated apps are Gemfile: RSpec ready group :test do gem 'rspec' - Your choice of mocking end framework - Just bundle install venerdì 1 marzo 13
  • 12. Spec File require 'spec_helper' describe 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 end end venerdì 1 marzo 13
  • 13. Our controller class 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}" end end venerdì 1 marzo 13
  • 15. FUNCTIONAL TESTING venerdì 1 marzo 13
  • 16. Functional Testing 101 - Needs defining - Quite difficult to approach - Not solved by any single tool venerdì 1 marzo 13
  • 17. OK, WE ARE IN BAD SHAPE... venerdì 1 marzo 13
  • 18. ...but here comes some help! SIPp ahn-loadbot PJSUA venerdì 1 marzo 13
  • 19. SIPp... ... is about as user friendly as the above lion. venerdì 1 marzo 13
  • 20. 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 venerdì 1 marzo 13
  • 21. SIPp sample run sudo 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 venerdì 1 marzo 13
  • 22. 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 venerdì 1 marzo 13
  • 24. Friendly Neighborhood Robot venerdì 1 marzo 13
  • 25. 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 - Metrics that can be used: duration of calls, ASR for presence of audio venerdì 1 marzo 13
  • 26. 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 venerdì 1 marzo 13
  • 28. Someone has to answer too! venerdì 1 marzo 13
  • 29. 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 venerdì 1 marzo 13
  • 30. Sample PJSUA command line pjsua --config-file options.conf options.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 venerdì 1 marzo 13
  • 31. 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 venerdì 1 marzo 13
  • 33. Is my system strong enough? venerdì 1 marzo 13
  • 34. Load Testing is... - Running a high amount of concurrent calls - Decide what you are looking for - Tool of choice, SIPp or Loadbot venerdì 1 marzo 13
  • 35. Load testing metrics - Failed calls - Average call times getting too long - Exception tracking, not everything happens visibly venerdì 1 marzo 13
  • 36. Thank you! http://mojolingo.com https://github.com/polysics Twitter: lucaprado XMPP and Email: lpradovera@mojolingo.com ...and please... NO MAKE KITTY SAD ...go rate my talk at http:/spkr8.com/17421 venerdì 1 marzo 13