Automated Testing With Newman - cat /dev/random | Prakhar Srivastav
Steve Klabnik, the developer at Balanced recently put up a post on the company blog talking about doing TDD for APIs where he advocates a strong case for following Test Driven Development for APIs. For a lot of companies like Balanced, Stripe, Parse etc the API is their primary product. Hence, it makes sense to have strong development and testing practices for these APIs.
TDD has taken off quite well with DHH and the ruby community strongly making claims of it solving a lot of problems and guaranteeing robust code. With tools like rspec and cucumber the ruby community has certainly been one of the most vocal proponents of this development methodology.
After trying a couple of solutions, Steve finally settles down with Cucumber to write specs that test his APIs. Now if you're a Postman user and have Jetpacks installed surely his approach seems too tedious. Compared to setting up Cucumber and writing verbose specs, writing simple JS code to run after the API gets a response seems extremely easy and productive - and all of this, right inside postman. Near the end of the article, Steve hits the point home with these lines
Read full article from Automated Testing With Newman - cat /dev/random | Prakhar Srivastav
No comments:
Post a Comment