Search This Blog

Tuesday 19 April 2016

API Testing Interview Questions

1) What is API testing?
API (Application Programming Interface) specifies how some software components should interact with other, in other words it’s a set of functions and procedures that allows the creation of applications which access the features or data of an application or operating system.   Testing of these functions is known as API testing.
2) What are the tools used for API testing?
The tools used for various API testing are
  • SoapUI Pro
  • LoadUI Pro
  • Alertsite API monitoring
3) What are the common tests performed on API’s?
The common tests performed on API’s
  • Verification of the API whether it is updating any data structure
  • Verify if the API does not return anything
  • Based on input conditions, returned values from the API’s are checked
  • Verification of the API whether it triggers some other event or calls another API
4) Mention the key difference between UI level testing and API testing?
UI ( User Interface) refers to testing graphical interface such as how user interacts with the applications, testing application elements like fonts, images, layouts etc. UI testing basically focuses on look and feel of an application.
While, API enables communication between two separate software systems. A software system implementing an API contains functions or sub-routines that can be executed by another software system
5) Explain what is SOAP?
SOAP-stands for Simple Object Access Control, and it is an XML based protocol for exchanging information between computers.
API1
6) Explain what is REST API?
It is a set of functions to which the developers performs requests and receive responses. In REST API interaction is made via HTTP protocol
REST – stands for Representational State Transfer, it is quickly becoming defacto standard for API creation.
7) Difference API and Unit Testing?
                            API testing                         UNIT testing
  • API is owned by QA team
  • Unit testing is owned by development team
  • API is mostly black box testing
  • Unit testing is white box testing
  • Full functionality of the system is considered in API testing as it will be used by the end-user (external developers who will use your API )
  • Unit testing is done to verify whether each unit in isolation performs as expected or not
  • API test are often run after the build is ready and authors do not have access to the source code
  • For each of their module the developers are expected to build unit tests for each of their code modules and have to ensure that each module pass unit test before the code is included in a build
8) How to test API’s ?
To test the API’s you should follow the following steps
  • Select the suite in which you want to add the API test case
  • Choose test development mode
  • Develop test cases for the desired API methods
  • Configure application control parameters
  • Configure test conditions
  • Configure method validation
  • Execute API test
  • View test reports
  • Filter API test cases
  • Sequence API test cases
9) Mention what the main areas to be taken in consideration while writing API document ?
The key area to be considered when writing API documents are
  • Source of the content
  • Document plan or sketch
  • Delivery layout
  • Information required for each function in the document
  • Automatic document creation programs
10) In API document explain how to document each function ?What are the tools used for documentation?
  • Description: Small description about what a function does
  • Syntax: Syntax about the parameter of the code, the sequence in which they occur, required and optional elements etc.
  • Parameters: Functions parameters
  • Error Messages: Syntax of error messages
  • Example Code: Small snippet of code
  • Related Links: Related functions


11) Explain API framework?
API framework is self-explanatory. Values for test run and for holding the configurable parts, config file is used.  Automated test cases must represent in “ parse-table” format within config file.  When testing API, it is not necessary to test each API so the config file have some section whose all API are activated for that specific run.
12) How does the API Builder work?
API Builder is a PLSQL program consists of four SQL files
  • For setting API parameters and starting the process one file is responsible
  • Two files are created for temporary tables and Master package to create the outputted code
  • Fourth file creates “spooled” output of the code into a file called “output_script_.sql
13) Explain what is TestApi ?
TestApi is a library of utility and test APIs that enables testers and developers to create testing tools and automated tests for .NET and Win32 application.  It provides a set of common test building blocks, types, data-structure and algorithms.
14) What is Input injection and what are different ways of doing it ?
Input Injection:  It is the act of simulating user input, in several ways you can simulate user input.
  • Direct Method Invocation
  • Invocation using an accessibility interface
  • Simulation using low-level input
  • Simulation using a device driver
  • Simulation using a robot
15) What are the main challenges of API testing?
The main challenges in API testing is
  • Parameter Selection
  • Parameter Combination
  • Call sequencing
16) What is API testing with runscope ?
Runscope is a web application that provides backend services and easy to use interface for testing APIs.
17) Explain what are the principles of API test design?
The principle for API test design are
  • Setup : Create objects, start services, initialize data etc
  • Execution: Steps to exercise API or scenario, also logging
  • Verification: Oracles to evaluate execution outcome
  • Reporting: Pass, failed or blocked
  • Clean up: Pre-test state
18) What are the types of Bugs will API testing finds?
The types of Bugs, API will find
  • Missing or duplicate functionality
  • Fails to handle error conditions gracefully
  • Stress
  • Reliability
  • Security
  • Unused flags
  • Not implemented errors
  • Inconsistent error handling
  • Performance
  • Multi-threading issues
  • Improper errors
19) What are the tools used for API test automation?
While testing Unit and API testing,  both target source code, if an API method is using code  based on .NET then the tool which is supporting should have .NET
Automation tools for API testing can be used are
  • NUnit for .NET
  • JUnit for Java
  • HP UFT
  • Soap UI
20) Mention the steps for testing API ?
API testing steps
  • Select the test case that has to be fulfilled
  • For API call develop a test case
  • To meet the test case configure the API parameters
  • Determine how will you validate a successful test
  • Using programming language like PHP or .NET execute the API call
  • Allow the API call to return the data to validate
21) What are the common protocols that are testing in API tesing ?
  • HTTP
  • JMS
  • REST
  • SOAP
  • UDDI
—————————————————————————————————————————————————-
What is API Testing?
An API (Application Programming Interface) is a collection of software functions and procedures, called API calls, that can be executed by other software applications. Application developers code that links to existing APIs to make use of their functionality. This link is seamless and end-users of the application are generally unaware of using a separately developed API.
During testing, a test harness-an application that links the API and methodically exercises its functionality-is constructed to simulate the use of the API by end-user applications. The interesting problems for testers are:
1. Ensuring that the test harness varies parameters of the API calls in ways that verify functionality and expose failures. This includes assigning common parameter values as well as exploring boundary conditions.
2. Generating interesting parameter value combinations for calls with two or more parameters.
3. Determining the content under which an API call is made. This might include setting external environment conditions (files, peripheral devices, and so forth) and also internal stored data that affect the API.
4. Sequencing API calls to vary the order in which the functionality is exercised and to make the API produce useful results from successive calls.

What is meant by API Testing? Explain the API Testing process.

API testing is to make sure that the basic units of the software application function perfectly well. Reason why we perform API testing right from the initial stages of the product cycle to the final phase, ensuring that the product release in the market is error-free and worth every penny you invested. API testing process involves testing the methods of NET, JAVA, J2EE APIs for any valid, invalid, and inopportune inputs, plus testing the APIs on Application servers.

During testing, a test harness-an application that links the API and methodically exercises its functionality-is constructed to simulate the use of the API by end-user applications. The interesting problems for testers are:
1. Ensuring that the test harness varies parameters of the API calls in ways that verify functionality and expose failures. This includes assigning common parameter values as well as exploring boundary conditions.
2. Generating interesting parameter value combinations for calls with two or more parameters.
3. Determining the content under which an API call is made. This might include setting external environment conditions (files, peripheral devices, and so forth) and also internal stored data that affect the API.
4. Sequencing API calls to vary the order in which the functionality is exercised and to make the API produce useful results from successive calls.
During testing, a test harness-an application that links the API and methodically exercises its functionality-is constructed to simulate the use of the API by end-user applications. The interesting problems for testers are:
1. Ensuring that the test harness varies parameters of the API calls in ways that verify functionality and expose failures. This includes assigning common parameter values as well as exploring boundary conditions.
2. Generating interesting parameter value combinations for calls with two or more parameters.
3. Determining the content under which an API call is made. This might include setting external environment conditions (files, peripheral devices, and so forth) and also internal stored data that affect the API.
4. Sequencing API calls to vary the order in which the functionality is exercised and to make the API produce useful results from successive calls.
how tester can do API testing by manually ,cloud u please explain it.
API testing is specifically the testing of API functions. One should design the test cases even before the completion of API functions. The process typically includes the following steps.
1 Path testing. Path testing is to check each independent path that a code module could possibly execute. It indicates the low bound value of the test cases that should be written.
2. Equivalence partitioning and boundary value analysis. Whenever a number is required as an input of a API function, one should be alert for the need of EP and BVA.
3. Coverage testing. Coverage testing is operated on a more detailed level. There are several aspects of a API functions that requires the check of percentage of being cover. Statement coverage checks the percentage of statements in a API that are covered by test cases. Branch coverage is to make sure each predicate in a API is checked for both true and false condition. Condition coverage is to pass a predetermined input for every condition of every predicate in a API and check if it can get a predetermined output. For a very large code block, only 50% of condition coverage can be achieved.
—————————————————————————————————————————————————-
How do you test a backend API?
How you approach testing an API depends on a lot of things. Will the API be a public API that will be consumed by some external people/systems, or is it a part of a larger product’s infrastructure? API is a general term that is sometimes used to describe anything from a COM interface, to a DLL or JAR you can reference, to a REST web service. Different approaches can be applied to testing these different things.
Often, if the API is part of your infrastructure you can test it pretty thoroughly through unit testing and the use of the product that consumes it.
If it is an externally consumable API then you need to be much more thorough because people could use it in different ways than you might expect and send data in much different formats, etc. It also usually needs to make sense, be intuitive and be well documented if it is externally consumable. You would also need to be more cautious about what is private and public, which may not be as important for an API that is only used by a single product.
Testing an API nearly always requires you to create some sort of consumer for testing purposes. You have to create an application to interact with the API. The application is usually very simple and driven by automated test cases and not manual user interaction, although I have seen cases where people created a complex GUI app for testing purposes, and cases where the testing was still mostly manual through exercising that app.
If the API has dependencies, you may choose to mock those dependencies out so you can more thoroughly test all of those interactions and hit all of the positive and negative code paths. For instance, if the API interacts with a database and has the ability to create, modify and delete data you may want to mock the interaction with the database to more easily test cases such as deleting a record when it does not exist, or when it is the final record, or when it is unable to be deleted because of dependencies or even when the connection to the database is unavailable – you can then see how your API would handle these situations.

What is an API?

API stands for Application Programming Interface, which specifies how one component should interact with the other. It consists of a set of routines, protocols and tools for building the software applications.

What is an API Testing?

The API Testing is performed for the system, which has a collection of API that ought to be tested. During Testing, a test of following things is looked at.
  • Exploring boundary conditions and ensuring that the test harness varies parameters of the API calls in ways that verify functionality and expose failures.
  • Generating more value added parameter combinations to verify the calls with two or more parameters.
  • Verifying the behaviour of the API which is considering the external environment conditions such as files, peripheral devices, and so forth.
  • Verifying the Sequence of API calls and check if the API’s produce useful results from successive calls.

Common Tests performed on API’s

  • Return Value based on input condition – The return value from the API’s are checked based on the input condition.
  • Verify if the API’s does not return anything.
  • Verify if the API triggers some other event or calls another API. The Events output should be tracked and verified.
  • Verify if the API is updating any data structure.
—————————————————————————————————————————————————-

What is an API?

API is an acronym for Application Programming Interface.
It enables communication and data exchange between two separate software systems. A software system implementing an API contains functions/sub-routines which can be executed by another software system.

What is API testing?

API testing is entirely different from GUI testing and mainly concentrates on the business logic layer of the software architecture. This testing won’t concentrate on the look and feel of an application.
Instead of using standard user inputs(keyboard) and outputs, in API Testing, you use software to send calls to the API, get output, and note down the system’s response.
API Testing requires an application to interact with API. In order to test an API, you will need to
  • Use Testing Tool to drive the API

  • Write your own code to test the API

The API Testing is performed for the system, which has a collection of API that ought to be tested. During Testing, a test of following things is looked at.
  • Exploring boundary conditions and ensuring that the test harness varies parameters of the API calls in ways that verify functionality and expose failures.
  • Generating more value added parameter combinations to verify the calls with two or more parameters.
  • Verifying the behaviour of the API which is considering the external environment conditions such as files, peripheral devices, and so forth.
  • Verifying the Sequence of API calls and check if the API’s produce useful results from successive calls.

API testing is entirely different from GUI testing and mainly concentrates on the business logic layer of the software architecture. This testing won’t concentrate on the look and feel of an application.
Instead of using standard user inputs(keyboard) and outputs, in API Testing, you use software to send calls to the API, get output, and note down the system’s response.
API Testing requires an application to interact with API. In order to test an API, you will need to
  • Use Testing Tool to drive the API

  • Write your own code to test the API

The API Testing is performed for the system, which has a collection of API that ought to be tested. During Testing, a test of following things is looked at.
  • Exploring boundary conditions and ensuring that the test harness varies parameters of the API calls in ways that verify functionality and expose failures.
  • Generating more value added parameter combinations to verify the calls with two or more parameters.
  • Verifying the behaviour of the API which is considering the external environment conditions such as files, peripheral devices, and so forth.
  • Verifying the Sequence of API calls and check if the API’s produce useful results from successive calls.

No comments:

Post a Comment