SlideShare une entreprise Scribd logo
1  sur  74
Télécharger pour lire hors ligne
Can You Hear Me Now?

       Tackling Testing Telephony
                                          Ben Klang
                                    bklang@mojolingo.com




Friday, August 10, 12
How Telephony Testing Is Different




Friday, August 10, 12
How Telephony Testing Is Different
        • Apps are long-running code




Friday, August 10, 12
How Telephony Testing Is Different
        • Apps are long-running code
        • Inputs may be more constrained (DTMF)




Friday, August 10, 12
How Telephony Testing Is Different
        • Apps are long-running code
        • Inputs may be more constrained (DTMF)
        • Or they may be less constrained (IM, Voice)




Friday, August 10, 12
How Telephony Testing Is Different
        • Apps are long-running code
        • Inputs may be more constrained (DTMF)
        • Or they may be less constrained (IM, Voice)
        • Lots of things are happening concurrently




Friday, August 10, 12
How Telephony Testing Is Different
        • Apps are long-running code
        • Inputs may be more constrained (DTMF)
        • Or they may be less constrained (IM, Voice)
        • Lots of things are happening concurrently
             • External call interactions (conf, barge)



Friday, August 10, 12
How Telephony Testing Is Different
        • Apps are long-running code
        • Inputs may be more constrained (DTMF)
        • Or they may be less constrained (IM, Voice)
        • Lots of things are happening concurrently
             • External call interactions (conf, barge)
             • XMPP Events

Friday, August 10, 12
How Telephony Testing Is Familiar




Friday, August 10, 12
How Telephony Testing Is Familiar
        • Same Tooling: rspec, mocha, cucumber,
          factory_girl, guard, rcov, rake




Friday, August 10, 12
How Telephony Testing Is Familiar
        • Same Tooling: rspec, mocha, cucumber,
          factory_girl, guard, rcov, rake
        • Still draw lines between M, V and C




Friday, August 10, 12
How Telephony Testing Is Familiar
        • Same Tooling: rspec, mocha, cucumber,
          factory_girl, guard, rcov, rake
        • Still draw lines between M, V and C
        • Good class design is important




Friday, August 10, 12
How Telephony Testing Is Familiar
        • Same Tooling: rspec, mocha, cucumber,
          factory_girl, guard, rcov, rake
        • Still draw lines between M, V and C
        • Good class design is important




Friday, August 10, 12
How Telephony Testing Is Familiar
        • Same Tooling: rspec, mocha, cucumber,
          factory_girl, guard, rcov, rake
        • Still draw lines between M, V and C
        • Good class design is important


        • It’s Just Ruby


Friday, August 10, 12
Philosophy: SRP




Friday, August 10, 12
Philosophy: SRP
        • Single Responsibility Principle




Friday, August 10, 12
Philosophy: SRP
        • Single Responsibility Principle
        • If you need to use “and” to describe the
          purpose of a class, you are probably
          breaking this rule




Friday, August 10, 12
Philosophy: SRP
        • Single Responsibility Principle
        • If you need to use “and” to describe the
          purpose of a class, you are probably
          breaking this rule
        • SRP is key to making classes testable




Friday, August 10, 12
SRP Example




Friday, August 10, 12
SRP Example
                        • Class purpose: “To
                          schedule calls and to
                          place them”




Friday, August 10, 12
SRP Example
                        • Class purpose: “To
                          schedule calls and to
                          place them”
                        • Testing requires mocking
                          methods within the same
                          class




Friday, August 10, 12
SRP Example
                        • Class purpose: “To
                          schedule calls and to
                          place them”
                        • Testing requires mocking
                          methods within the same
                          class
                        • Non-trivial work to swap
                          calling mechanism

Friday, August 10, 12
Philosophy: Tell, Don’t Ask




Friday, August 10, 12
Philosophy: Tell, Don’t Ask
        • Tell an object to do its work




Friday, August 10, 12
Philosophy: Tell, Don’t Ask
        • Tell an object to do its work
        • Don’t ask for its state then ask it to do
          something




Friday, August 10, 12
Philosophy: Tell, Don’t Ask
        • Tell an object to do its work
        • Don’t ask for its state then ask it to do
          something
        • Works Hand-in-Hand with SRP




Friday, August 10, 12
Philosophy: Tell, Don’t Ask
        • Tell an object to do its work
        • Don’t ask for its state then ask it to do
          something
        • Works Hand-in-Hand with SRP




Friday, August 10, 12
Philosophy: Tell, Don’t Ask
        • Tell an object to do its work
        • Don’t ask for its state then ask it to do
          something
        • Works Hand-in-Hand with SRP




Friday, August 10, 12
Philosophy: Prefer/Share Immutable




Friday, August 10, 12
Philosophy: Prefer/Share Immutable
        • Methods should only use passed-in data




Friday, August 10, 12
Philosophy: Prefer/Share Immutable
        • Methods should only use passed-in data
        • Avoid instance vars or other shared state




Friday, August 10, 12
Philosophy: Prefer/Share Immutable
        • Methods should only use passed-in data
        • Avoid instance vars or other shared state
        • Especially helpful with concurrent code




Friday, August 10, 12
Philosophy: Prefer/Share Immutable
        • Methods should only use passed-in data
        • Avoid instance vars or other shared state
        • Especially helpful with concurrent code
        • ... but makes testing in general easier




Friday, August 10, 12
Prefer/Share Immutable Example




Friday, August 10, 12
Prefer/Share Immutable Example




Friday, August 10, 12
Prefer/Share Immutable Example




Friday, August 10, 12
Prefer/Share Immutable Example




Friday, August 10, 12
Levels of Testing




Friday, August 10, 12
Levels of Testing


                         Integration




Friday, August 10, 12
Levels of Testing


                         Integration
                             Functional




Friday, August 10, 12
Levels of Testing


                         Integration
                             Functional
                                Unit




Friday, August 10, 12
Levels of Testing




Friday, August 10, 12
Levels of Testing
        • Integration Testing




Friday, August 10, 12
Levels of Testing
        • Integration Testing
             • End-to-End




Friday, August 10, 12
Levels of Testing
        • Integration Testing
             • End-to-End
             • Provide predefined inputs




Friday, August 10, 12
Levels of Testing
        • Integration Testing
             • End-to-End
             • Provide predefined inputs
             • Verify outputs




Friday, August 10, 12
Levels of Testing
        • Integration Testing
             • End-to-End
             • Provide predefined inputs
             • Verify outputs
             • Mock as little as possible



Friday, August 10, 12
Integration Testing Tools for Telephony




Friday, August 10, 12
Integration Testing Tools for Telephony
             • sipp:
               sipp.sourceforge.net




Friday, August 10, 12
Integration Testing Tools for Telephony
             • sipp:
               sipp.sourceforge.net
             • Loadbot:
               github.com/mojolingo/ahn-loadbot




Friday, August 10, 12
Integration Testing Tools for Telephony
             • sipp:
               sipp.sourceforge.net
             • Loadbot:
               github.com/mojolingo/ahn-loadbot
             • Cucumber-VoIP:
               github.com/benlangfeld/cucumber-voip




Friday, August 10, 12
Functional Testing




Friday, August 10, 12
Functional Testing
        • Test just one unit in isolation




Friday, August 10, 12
Functional Testing
        • Test just one unit in isolation
        • Typical unit is a single class




Friday, August 10, 12
Functional Testing
        • Test just one unit in isolation
        • Typical unit is a single class
        • Test function of class
          but do not make
          assertions about
          internal state



Friday, August 10, 12
Unit Testing




Friday, August 10, 12
Unit Testing
        • Most common form of testing




Friday, August 10, 12
Unit Testing
        • Most common form of testing
        • Test that a given unit (typically: method)
          behaves the way you expect




Friday, August 10, 12
Unit Testing
        • Most common form of testing
        • Test that a given unit (typically: method)
          behaves the way you expect
        • Make sure to test:




Friday, August 10, 12
Unit Testing
        • Most common form of testing
        • Test that a given unit (typically: method)
          behaves the way you expect
        • Make sure to test:
             • Valid inputs




Friday, August 10, 12
Unit Testing
        • Most common form of testing
        • Test that a given unit (typically: method)
          behaves the way you expect
        • Make sure to test:
             • Valid inputs
             • Invalid inputs



Friday, August 10, 12
Unit Testing
        • Most common form of testing
        • Test that a given unit (typically: method)
          behaves the way you expect
        • Make sure to test:
             • Valid inputs
             • Invalid inputs
             • Error Conditions

Friday, August 10, 12
Unit Testing Example




Friday, August 10, 12
Unit Testing Example




Friday, August 10, 12
Testing Concurrency




Friday, August 10, 12
Testing Concurrency
        • Design with a concurrency model or library




Friday, August 10, 12
Testing Concurrency
        • Design with a concurrency model or library
             • Celluloid, EventMachine




Friday, August 10, 12
Testing Concurrency
        • Design with a concurrency model or library
             • Celluloid, EventMachine
        • Use State Machines to guarantee sequence




Friday, August 10, 12
Testing Concurrency
        • Design with a concurrency model or library
             • Celluloid, EventMachine
        • Use State Machines to guarantee sequence
        • Mock non-blocking dependent operations
          with blocking mocks




Friday, August 10, 12
Testing Concurrency
        • Design with a concurrency model or library
             • Celluloid, EventMachine
        • Use State Machines to guarantee sequence
        • Mock non-blocking dependent operations
          with blocking mocks
        • Always provide a timeout


Friday, August 10, 12
Testing Concurrency




                    https://github.com/benlangfeld/countdownlatch


Friday, August 10, 12
Testing Concurrency




                    https://github.com/benlangfeld/countdownlatch


Friday, August 10, 12
http://adhearsion.com/conference/2012




Friday, August 10, 12
Can You Hear Me Now?

       Tackling Testing Telephony                 Ben Klang
                                            bklang@mojolingo.com
       spkr8.com/t/12971                    @bklang Github/Twitter
        Thanks to Ben Langfeld for his
        assistance with this presentation
        @benlangfeld




Friday, August 10, 12

Contenu connexe

Similaire à Can You Hear Me Now? Tackling Telephony Testing

Keeping your users happy with testable apps - Greg Shackles
Keeping your users happy with testable apps - Greg ShacklesKeeping your users happy with testable apps - Greg Shackles
Keeping your users happy with testable apps - Greg ShacklesXamarin
 
Are Your Tests Really Helping You?
Are Your Tests Really Helping You?Are Your Tests Really Helping You?
Are Your Tests Really Helping You?LB Denker
 
Kostentreiber bei der iOS Entwicklung
Kostentreiber bei der iOS EntwicklungKostentreiber bei der iOS Entwicklung
Kostentreiber bei der iOS EntwicklungReto Zenger
 
Kostentreiber bei der iOS-Entwicklung
Kostentreiber bei der iOS-EntwicklungKostentreiber bei der iOS-Entwicklung
Kostentreiber bei der iOS-Entwicklungxrb
 
Words, Pictures & Pixels: Put Your Best Foot Forward Online
Words, Pictures & Pixels: Put Your Best Foot Forward OnlineWords, Pictures & Pixels: Put Your Best Foot Forward Online
Words, Pictures & Pixels: Put Your Best Foot Forward Onlinebethgsanders
 
How To Build an Online Community
How To Build an Online CommunityHow To Build an Online Community
How To Build an Online CommunityDigital Wax Works
 
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"SCRUMguides
 

Similaire à Can You Hear Me Now? Tackling Telephony Testing (10)

Keeping your users happy with testable apps - Greg Shackles
Keeping your users happy with testable apps - Greg ShacklesKeeping your users happy with testable apps - Greg Shackles
Keeping your users happy with testable apps - Greg Shackles
 
SPRINT3R-SWPSDLC2556-CLOSING
SPRINT3R-SWPSDLC2556-CLOSINGSPRINT3R-SWPSDLC2556-CLOSING
SPRINT3R-SWPSDLC2556-CLOSING
 
Week 6 october 8
Week 6 october 8Week 6 october 8
Week 6 october 8
 
When Tdd Goes Awry
When Tdd Goes AwryWhen Tdd Goes Awry
When Tdd Goes Awry
 
Are Your Tests Really Helping You?
Are Your Tests Really Helping You?Are Your Tests Really Helping You?
Are Your Tests Really Helping You?
 
Kostentreiber bei der iOS Entwicklung
Kostentreiber bei der iOS EntwicklungKostentreiber bei der iOS Entwicklung
Kostentreiber bei der iOS Entwicklung
 
Kostentreiber bei der iOS-Entwicklung
Kostentreiber bei der iOS-EntwicklungKostentreiber bei der iOS-Entwicklung
Kostentreiber bei der iOS-Entwicklung
 
Words, Pictures & Pixels: Put Your Best Foot Forward Online
Words, Pictures & Pixels: Put Your Best Foot Forward OnlineWords, Pictures & Pixels: Put Your Best Foot Forward Online
Words, Pictures & Pixels: Put Your Best Foot Forward Online
 
How To Build an Online Community
How To Build an Online CommunityHow To Build an Online Community
How To Build an Online Community
 
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
Agileee 2013: Andrii Dzynia "How To Manage Testing in Agile World"
 

Plus de Adhearsion Foundation

Plus de Adhearsion Foundation (10)

Ruby Conf 2011
Ruby Conf 2011Ruby Conf 2011
Ruby Conf 2011
 
Ahn Conf 2011 - Day 2 Keynote
Ahn Conf 2011 - Day 2 KeynoteAhn Conf 2011 - Day 2 Keynote
Ahn Conf 2011 - Day 2 Keynote
 
Adhearsion Astricon October 2010
Adhearsion Astricon October 2010Adhearsion Astricon October 2010
Adhearsion Astricon October 2010
 
Ruby Kaigi July 2009 Tokyo (Japanese)
Ruby Kaigi July 2009 Tokyo (Japanese)Ruby Kaigi July 2009 Tokyo (Japanese)
Ruby Kaigi July 2009 Tokyo (Japanese)
 
N2Y4 Mobile Challenge May 2009 San Jose
N2Y4 Mobile Challenge May 2009   San JoseN2Y4 Mobile Challenge May 2009   San Jose
N2Y4 Mobile Challenge May 2009 San Jose
 
Eu Ru Ko Tutorial May 2009 Barcelona
Eu Ru Ko Tutorial May 2009   BarcelonaEu Ru Ko Tutorial May 2009   Barcelona
Eu Ru Ko Tutorial May 2009 Barcelona
 
Amoocon Tutorial May 2009 Germany
Amoocon Tutorial May 2009   GermanyAmoocon Tutorial May 2009   Germany
Amoocon Tutorial May 2009 Germany
 
Amoocon May 2009 Germany
Amoocon May 2009   GermanyAmoocon May 2009   Germany
Amoocon May 2009 Germany
 
Adhearsion @ eComm 2009 Final
Adhearsion @ eComm 2009   FinalAdhearsion @ eComm 2009   Final
Adhearsion @ eComm 2009 Final
 
Adhearsion Overview February 2009
Adhearsion Overview February 2009Adhearsion Overview February 2009
Adhearsion Overview February 2009
 

Dernier

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
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
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
 
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
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Dernier (20)

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):
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
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
 
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
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Can You Hear Me Now? Tackling Telephony Testing

  • 1. Can You Hear Me Now? Tackling Testing Telephony Ben Klang bklang@mojolingo.com Friday, August 10, 12
  • 2. How Telephony Testing Is Different Friday, August 10, 12
  • 3. How Telephony Testing Is Different • Apps are long-running code Friday, August 10, 12
  • 4. How Telephony Testing Is Different • Apps are long-running code • Inputs may be more constrained (DTMF) Friday, August 10, 12
  • 5. How Telephony Testing Is Different • Apps are long-running code • Inputs may be more constrained (DTMF) • Or they may be less constrained (IM, Voice) Friday, August 10, 12
  • 6. How Telephony Testing Is Different • Apps are long-running code • Inputs may be more constrained (DTMF) • Or they may be less constrained (IM, Voice) • Lots of things are happening concurrently Friday, August 10, 12
  • 7. How Telephony Testing Is Different • Apps are long-running code • Inputs may be more constrained (DTMF) • Or they may be less constrained (IM, Voice) • Lots of things are happening concurrently • External call interactions (conf, barge) Friday, August 10, 12
  • 8. How Telephony Testing Is Different • Apps are long-running code • Inputs may be more constrained (DTMF) • Or they may be less constrained (IM, Voice) • Lots of things are happening concurrently • External call interactions (conf, barge) • XMPP Events Friday, August 10, 12
  • 9. How Telephony Testing Is Familiar Friday, August 10, 12
  • 10. How Telephony Testing Is Familiar • Same Tooling: rspec, mocha, cucumber, factory_girl, guard, rcov, rake Friday, August 10, 12
  • 11. How Telephony Testing Is Familiar • Same Tooling: rspec, mocha, cucumber, factory_girl, guard, rcov, rake • Still draw lines between M, V and C Friday, August 10, 12
  • 12. How Telephony Testing Is Familiar • Same Tooling: rspec, mocha, cucumber, factory_girl, guard, rcov, rake • Still draw lines between M, V and C • Good class design is important Friday, August 10, 12
  • 13. How Telephony Testing Is Familiar • Same Tooling: rspec, mocha, cucumber, factory_girl, guard, rcov, rake • Still draw lines between M, V and C • Good class design is important Friday, August 10, 12
  • 14. How Telephony Testing Is Familiar • Same Tooling: rspec, mocha, cucumber, factory_girl, guard, rcov, rake • Still draw lines between M, V and C • Good class design is important • It’s Just Ruby Friday, August 10, 12
  • 16. Philosophy: SRP • Single Responsibility Principle Friday, August 10, 12
  • 17. Philosophy: SRP • Single Responsibility Principle • If you need to use “and” to describe the purpose of a class, you are probably breaking this rule Friday, August 10, 12
  • 18. Philosophy: SRP • Single Responsibility Principle • If you need to use “and” to describe the purpose of a class, you are probably breaking this rule • SRP is key to making classes testable Friday, August 10, 12
  • 20. SRP Example • Class purpose: “To schedule calls and to place them” Friday, August 10, 12
  • 21. SRP Example • Class purpose: “To schedule calls and to place them” • Testing requires mocking methods within the same class Friday, August 10, 12
  • 22. SRP Example • Class purpose: “To schedule calls and to place them” • Testing requires mocking methods within the same class • Non-trivial work to swap calling mechanism Friday, August 10, 12
  • 23. Philosophy: Tell, Don’t Ask Friday, August 10, 12
  • 24. Philosophy: Tell, Don’t Ask • Tell an object to do its work Friday, August 10, 12
  • 25. Philosophy: Tell, Don’t Ask • Tell an object to do its work • Don’t ask for its state then ask it to do something Friday, August 10, 12
  • 26. Philosophy: Tell, Don’t Ask • Tell an object to do its work • Don’t ask for its state then ask it to do something • Works Hand-in-Hand with SRP Friday, August 10, 12
  • 27. Philosophy: Tell, Don’t Ask • Tell an object to do its work • Don’t ask for its state then ask it to do something • Works Hand-in-Hand with SRP Friday, August 10, 12
  • 28. Philosophy: Tell, Don’t Ask • Tell an object to do its work • Don’t ask for its state then ask it to do something • Works Hand-in-Hand with SRP Friday, August 10, 12
  • 30. Philosophy: Prefer/Share Immutable • Methods should only use passed-in data Friday, August 10, 12
  • 31. Philosophy: Prefer/Share Immutable • Methods should only use passed-in data • Avoid instance vars or other shared state Friday, August 10, 12
  • 32. Philosophy: Prefer/Share Immutable • Methods should only use passed-in data • Avoid instance vars or other shared state • Especially helpful with concurrent code Friday, August 10, 12
  • 33. Philosophy: Prefer/Share Immutable • Methods should only use passed-in data • Avoid instance vars or other shared state • Especially helpful with concurrent code • ... but makes testing in general easier Friday, August 10, 12
  • 38. Levels of Testing Friday, August 10, 12
  • 39. Levels of Testing Integration Friday, August 10, 12
  • 40. Levels of Testing Integration Functional Friday, August 10, 12
  • 41. Levels of Testing Integration Functional Unit Friday, August 10, 12
  • 42. Levels of Testing Friday, August 10, 12
  • 43. Levels of Testing • Integration Testing Friday, August 10, 12
  • 44. Levels of Testing • Integration Testing • End-to-End Friday, August 10, 12
  • 45. Levels of Testing • Integration Testing • End-to-End • Provide predefined inputs Friday, August 10, 12
  • 46. Levels of Testing • Integration Testing • End-to-End • Provide predefined inputs • Verify outputs Friday, August 10, 12
  • 47. Levels of Testing • Integration Testing • End-to-End • Provide predefined inputs • Verify outputs • Mock as little as possible Friday, August 10, 12
  • 48. Integration Testing Tools for Telephony Friday, August 10, 12
  • 49. Integration Testing Tools for Telephony • sipp: sipp.sourceforge.net Friday, August 10, 12
  • 50. Integration Testing Tools for Telephony • sipp: sipp.sourceforge.net • Loadbot: github.com/mojolingo/ahn-loadbot Friday, August 10, 12
  • 51. Integration Testing Tools for Telephony • sipp: sipp.sourceforge.net • Loadbot: github.com/mojolingo/ahn-loadbot • Cucumber-VoIP: github.com/benlangfeld/cucumber-voip Friday, August 10, 12
  • 53. Functional Testing • Test just one unit in isolation Friday, August 10, 12
  • 54. Functional Testing • Test just one unit in isolation • Typical unit is a single class Friday, August 10, 12
  • 55. Functional Testing • Test just one unit in isolation • Typical unit is a single class • Test function of class but do not make assertions about internal state Friday, August 10, 12
  • 57. Unit Testing • Most common form of testing Friday, August 10, 12
  • 58. Unit Testing • Most common form of testing • Test that a given unit (typically: method) behaves the way you expect Friday, August 10, 12
  • 59. Unit Testing • Most common form of testing • Test that a given unit (typically: method) behaves the way you expect • Make sure to test: Friday, August 10, 12
  • 60. Unit Testing • Most common form of testing • Test that a given unit (typically: method) behaves the way you expect • Make sure to test: • Valid inputs Friday, August 10, 12
  • 61. Unit Testing • Most common form of testing • Test that a given unit (typically: method) behaves the way you expect • Make sure to test: • Valid inputs • Invalid inputs Friday, August 10, 12
  • 62. Unit Testing • Most common form of testing • Test that a given unit (typically: method) behaves the way you expect • Make sure to test: • Valid inputs • Invalid inputs • Error Conditions Friday, August 10, 12
  • 66. Testing Concurrency • Design with a concurrency model or library Friday, August 10, 12
  • 67. Testing Concurrency • Design with a concurrency model or library • Celluloid, EventMachine Friday, August 10, 12
  • 68. Testing Concurrency • Design with a concurrency model or library • Celluloid, EventMachine • Use State Machines to guarantee sequence Friday, August 10, 12
  • 69. Testing Concurrency • Design with a concurrency model or library • Celluloid, EventMachine • Use State Machines to guarantee sequence • Mock non-blocking dependent operations with blocking mocks Friday, August 10, 12
  • 70. Testing Concurrency • Design with a concurrency model or library • Celluloid, EventMachine • Use State Machines to guarantee sequence • Mock non-blocking dependent operations with blocking mocks • Always provide a timeout Friday, August 10, 12
  • 71. Testing Concurrency https://github.com/benlangfeld/countdownlatch Friday, August 10, 12
  • 72. Testing Concurrency https://github.com/benlangfeld/countdownlatch Friday, August 10, 12
  • 74. Can You Hear Me Now? Tackling Testing Telephony Ben Klang bklang@mojolingo.com spkr8.com/t/12971 @bklang Github/Twitter Thanks to Ben Langfeld for his assistance with this presentation @benlangfeld Friday, August 10, 12