Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How I tested EMail and SMS?

How I tested EMail and SMS?

This talk mainly focusses on reducing the dependency on third party service which sends EMail and SMS. Also, to know how does the service under test behave in case of any failures on a external service. It also talks on the areas which are to be concentrated while automating the service which triggers Email and SMS.

abinayasakthi

April 25, 2016
Tweet

More Decks by abinayasakthi

Other Decks in Technology

Transcript

  1. Agenda ➢ Email testing ➢ SMS testing ➢ Problem statement

    and my solution ➢ Building Email and SMS stubs ➢ How did stubs help? ➢ Q & A
  2. Application Application Service to trigger EMail/SMS Service to trigger EMail/SMS

    To be tested Third party service For EMail/SMS Third party service For EMail/SMS
  3. Application Application Service Service To be tested Third party service

    For Email/SMS Third party service For Email/SMS
  4. TEST TEST Service Service To be tested Third party service

    For Email/SMS Third party service For Email/SMS
  5. Tool used MOUNTEBANK • Create imposters - Port - Protocol

    • Stub - Responses - Predicates • Used for mock verification by saving the requests http://www.mbtest.org/
  6. { "port": 4546, "protocol": "http", "stubs": [ { "responses": [{"is":

    { "statusCode": 201, "headers": { "Location": "http://example.com/resource" }, "body": "The time is ${TIME}", "_mode": "text" } }], "predicates": [{ "equals": { "method": "GET", "path": "/example" } }]} ] }
  7. Building Email Stubs • Refer Documentation of Third party API

    • Get the different status codes or response they provide to the service • Stub for most frequently used success and failure cases But.. • Do a bit of white box testing to check the codes
  8. SMS stubs • Provide response in terms of templates •

    Store the response provided by third party service in database • Example 1: <!DOCTYPE RESULT SYSTEM "http://bulkpush.mytoday.com/BulkSms/BulkSmsRespV1.00.dtd"> <RESULT REQID="4390475648"> <MID SUBMITDATE="2015-05-06 15:33:37" ID="1" TAG="null" TID="8096014983" /> </RESULT> • Example 2: <!DOCTYPE RESULT SYSTEM "http://bulkpush.mytoday.com/BulkSms/BulkSmsRespV1.00.dtd"> <RESULT> <REQUEST-ERROR> <ERROR> <CODE>-1</CODE> <DESC>Message is empty</DESC> </ERROR> </REQUEST-ERROR> </RESULT> • Example 3: Status=1,Template not matched
  9. How did stubs help? • Validate how our system behaves

    in case of failures on external system • Verify other behaviours like EMAIL and SMS 'Retry' • Minimize hitting an external service • Reduce the time taken for tests to provide us feedback
  10. Workarounds • When third party API is not exposed, Look

    for • Test Mail address E.g [email protected] • Test mode of the service provider
  11. Putting together... • Automation - To send Emails/ SMS to

    our inboxes via Service - Stubs - Test email addresses - Test mode • Manual - End to end flow - White box testing