Talk given at Typeform for the Barcelona Bug busters meetup.
How to Automate API Testing guides you through a possible API Testing workflow for API Functional Testing exploring different tools and approaches.
2. Summary
• types of API testing
• functional testing
• API exploration
• writing and running tests locally
• automating test execution
3. 3 types of API Testing
• unit testing
• functional testing
• load testing
increased
complexity
4. Unit Testing
• part of the development process
• usually written by developers
• tests how local code integrates with the API
• focused on request and response handling
• automated by a CI process
5. Unit Testing: mocking
• actual API response is saved locally
• test uses local copy of API response
• several tools for different programming languages
• VCR (Ruby)
• nock (Node.js)
6. Functional Testing
• part of the QA process
• a kind of black-box testing
• focused on response generation
• often executed periodically
• tests how the API behaves under a controlled input
7. Functional Testing: identification
• which API calls should be tested
• how are those calls used by the application
• what should be tested
• who should be notified if tests fail
8. Functional Testing: input
• usually fake data
• information that resembles real usage
• often obtained by studying user input
• updated often
9. Functional Testing: output
• tests should be similar to unit tests
• but performed on real API calls
• additional output
• response time
• specific API responses during testing
10. Functional Testing: execution
• manual crafting
• manually triggered
• potentially executed periodically
• result flags CI process
11. API Exploration
• starts in the product development phase
• part of the product definition
• confirmed in the development process
• validated by QA
12. API Exploration: questions
• why are you using the API
• what API calls are used
• how does the product integrate with the API
• what happens if the API fails or is unresponsive
13. API Exploration: hands-on
• getting a list of all the relevant API calls
• obtaining authorization credentials if needed
• preparing fake input data
• exploring the API calls manually
25. Wrap up
• unit and functional API testing
• identification, input, output and execution
• API exploration and introduction to Postman
• local testing with Postman
• automating tests with runscope
27. +
Sean O’Connor
Lead Engineer
It's great to see a tool like API Changelog
come along. (…) as an API provider, it's always
a challenge to communicate to users when
changes happen.
bpedro@apichangelog.com
Get in touch!
Bruno Pedro
Thank you