Qafoo GmbH - passion for software quality

Help you and your team benefit from new perspectives on cutting-edge quality engineering techniques and tools through the Qafoo team weblog.

By Tobias Schlitt, first published at Wed, 05 Jun 2013 12:59:13 -0400

Pragmatic REST & BDD at IPC

Pragmatic REST

Pragmatic RESTPragmatic REST

The web community has spoken, REST is the way to go for web service interfaces and that is a good thing. But behind the shiny theory of web services, there quite a bit of complexity hidden and some aspects of REST might not suite your specific use case best. In my talk I walked through creating a web service on basis of REST giving hints on the issues you might run into.

Behave! - Behavior Driven Development

Behave! - Behavior Driven DevelopmentBehave! - Behavior Driven Development

The aspects of Behavior Driven Development can fill some of the gaps that the established unit testing methodology leaves for teams. Making specification executable can safe you from outdated specs and feature descriptions and, in an optimal case, your team gets a very good communication tool from BDD. In my talk I introduced the basics behind this testing method and its application on basis of the Behat framework.


  • Maximilian Berghoff on Sat, 15 Jun 2013 06:05:36 -0400

    It is a little bit hard to understand the slides without a speaker talking to it ;-) but do i understand it right that hypermadia makes a specifation of the api? describes the resources and its relations?
    There is an onther question for me, how would make an RESTful request for subcollections?
    Example an articles has got category an i wants to ask for a specific category. Should i use queries for it like this:
    to get a subcollection of the whole collection of articles.

  • Toby on Sat, 15 Jun 2013 07:20:06 -0400

    In REST you should use a hypermedia format to encode the state of your resources, in order to allow a REST client to auto-discover the API. The format therefore also describes the relations, yes.

    Regarding the category question: Please look into the first example of the category resource. You see there, how you can get a list of the products in a category. Essentially, a category ships with a list of links to the products contained in it.

  • Maximilian Berghoff on Sat, 15 Jun 2013 09:38:07 -0400

    With state you mean:
    - properties
    - depending resources
    Looks like a sitemap of an homepage.
    Is it that what you mean with auto-discovering of the resources?
    Like a resourcemap?

    Sound very interesting. Usuallyi think the advantage of REST is the easy API - you know the resources -> you are able to work on it. But i asked my self how to interact with more complicated resources with some relations. Now i know.

    But where should this hypermedia file be served/delivered?
    There must e a point, when the client doesn't know the API, to get this data from the hypermedia.

  • Maximilian Berghoff on Sat, 15 Jun 2013 10:31:17 -0400

    Ahhhh EDIT:
    I watched the slides again. The infomation is Directory embedet in the answer with the data of the resource.
    Thats very cool
    On the One hand i know how i get subresource infomation on the othe hand i know how these are related.
    I saw the slides with JSON, but don't understand them. Is that possible with JSON, too? I like them more, cause of my JavaScript things, that used my own Little API.

  • Toby on Mon, 17 Jun 2013 04:35:28 -0400

    JSON as the format for encoding entities in REST has fundamental drawbacks compared to XML. However, a resource embedding approach can be worked out here, too, if needed.

    I would not recommend to use JSON, except for if the primary focus of your REST API is to talk to it from the browser.

  • Christoph on Fri, 28 Jun 2013 02:53:44 -0400

    Your linked pdf seems to be broken? I cant open it! Got error messages withe the acrobat reader. And the size of pdf ist only 184kByte?