News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Chris Hartjes' Blog:
Thoughts on Testing APIs
February 23, 2012 @ 08:53:14

In this new post to his blog Chris Hartjes offers up a few of his own thoughts about testing APIs and some of the issues/concerns he's come across in his own testing (via Behat).

I have been asked a few times on Twitter for some advice on how to use testing tools in order to test APIs. It just so happens that I am writing a bunch of tests for an API at work so perhaps this is a very timely blog post. [...] When you are testing an API you main concern is your ability to reproduce the results of a specific API call. If your API is such that repeating a call several times will give you different results, you do have some challenges on your hands.

He talks about functional testing, the "moving parts" they involve, using only known data sources and the creation of integration tests. He also mentions the testing of your local application to ensure it's handling (or transforming) the results of the API calls into something useful.

In the end, it doesn't really matter what tools you are using to test either your own APIs or ones that your application depends on. Be clear in your mind about what it is you are actually trying to accomplish and don't get create tests that provide very little value to your application.
0 comments voice your opinion now!
api testing opinion suggestion behat functional integration


blog comments powered by Disqus

Similar Posts

Test.ical.ly Blog: PHP 5.3 and the Symfony2 UniversalClassLoader - Where to load?

Full Stack Radio: 11: Jeffrey Way - "But how does it feel?"

Anthony Ferrara's Blog: The Power of Technical Debt

SitePoint PHP Blog: How to Create Your Own Twitter Widget in PHP, Part 3

Reddit.com: About to start learning my 1st MVC framework... What are your recommendations?


Community Events

Don't see your event here?
Let us know!


php7 library install community framework xdebug language introduction unittest api series laravel extension podcast release example interview version voicesoftheelephpant opinion

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework