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

Free API debugging and testing tools you should know about.

Free API debugging and testing tools you should know about.

Free and OSS tools for inspecting traffic, debugging webhooks, writing automated tests and more. Presented at API Strategy and Practice SF 2013.

John Sheehan

October 24, 2013
Tweet

More Decks by John Sheehan

Other Decks in Technology

Transcript

  1. John Sheehan
    CEO, Runscope
    Free API debugging
    and testing tools
    you should know
    about.
    Thursday, October 24, 13

    View Slide

  2. Software is eating
    lunch and APIs are
    for dessert!
    Thursday, October 24, 13

    View Slide

  3. Traffic and Weather
    API Podcast
    LIVE Today at 5:40 in Room 1
    Thursday, October 24, 13

    View Slide

  4. RequestBin requestb.in
    Thursday, October 24, 13

    View Slide

  5. ngrok.com
    Thursday, October 24, 13

    View Slide

  6. mitmproxy.org
    Thursday, October 24, 13

    View Slide

  7. getpostman.com
    Thursday, October 24, 13

    View Slide

  8. hurl.it
    Thursday, October 24, 13

    View Slide

  9. PonyDebugger
    PDDebugger  *debugger  =  [PDDebugger  defaultInstance];
    [debugger  enableNetworkTrafficDebugging];
    [debugger  forwardAllNetworkTraffic];
    Thursday, October 24, 13

    View Slide

  10. frisby.js
    Thursday, October 24, 13

    View Slide

  11. require  'rubygems'
    require  'test/unit'
    require  'vcr'
    VCR.configure  do  |c|
       c.cassette_library_dir  =  'fixtures/vcr_cassettes'
       c.hook_into  :webmock  #  or  :fakeweb
    end
    class  VCRTest  <  Test::Unit::TestCase
       def  test_example_dot_com
           VCR.use_cassette('synopsis')  do  
               url  =  'http://yourapihere.com'
               response  =  Net::HTTP.get_response(URI(url))
               assert_match  /Example  domains/,  response.body
           end
       end
    end
    VCR github.com/vcr/vcr
    Thursday, October 24, 13

    View Slide

  12. mocky.io
    Thursday, October 24, 13

    View Slide

  13. aspec github.com/songkick/aspec
    # no users have pending notifications
    GET /users/with-pending-notifications 200 application/json []
    # users with events on their calendar have pending notifications
    POST /users/764/metro-areas/999 204
    POST /users/764/artists/123 204
    POST /events/5?artist_ids=123&metro_area_id=999 204
    POST /events/5/enqueue-notifications 204
    GET /users/with-pending-notifications 200 application/json [[764, "ep"]]
    # users are unique in the response
    POST /users/764/artists/123 204
    POST /users/764/artists/456 204
    POST /users/764/metro-areas/999 204
    POST /events/5?artist_ids=123,456&metro_area_id=999 204
    POST /events/5/enqueue-notifications 204
    GET /users/with-pending-notifications 200 application/json [[764, "ep"]]
    Thursday, October 24, 13

    View Slide

  14. service  "http://localhost:4567"  do
       def  responds_with_json_where
           JSON.parse(response.body)
       end
       resource  "/lolz"  do
           get  do
               it  {  responds_with.status  :ok  }
               it  {  responds_with_json_where['lolz'].must_be_instance_o
               with_query("q=monorail")  do
                   it  "only  lists  lolz  that  match  the  query"  do
                       responds_with_json_where['lolz'].wont_be_empty
                       responds_with_json_where['lolz'].each  do  |lol|
                           lol['title'].must_match  /monorail/
                       end
                   end
               end
    HyperSpec
    Thursday, October 24, 13

    View Slide

  15. Thursday, October 24, 13

    View Slide

  16. Thursday, October 24, 13

    View Slide