Deck #1 Flashcards

1
Q

Name the essential parts of an application

A
  • Data Layer
  • Logic Layer
  • Presentation Layer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the data layer?

A

Where data is retrieved from the database and file system and then stored.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the logic layer

A

The brain of the application, this processes the data between the layers, coordinating the application, processing commands, and making logical decisions. This layer is made of the API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the presentation layer?

A

This top layer of the app is the user interface, which translates tasks into something the user understands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an API?

A

Application Programming Interface:

- An API acts as an interface between two different applications so that they can communicate with each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is API testing?

A

testing that APIs and the integrations they enable work in the most optimal manner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Techincal def of an API

A

Http based service that returns JSON or XML data by default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to test APIs?

A

make API calls in order to receive an output before observing and logging the system’s response.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to increase test coverage and accuracy of APIs?

A

Since APIs are the central hub of data for many applications, data-drive testing for APIs can help

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why is API testing important?

A

The API is what gives value to the application.

  • If any API doesn’t work efficiently and effectively, it will never be adopted, regardless if it is a free and open API or one that you charge per call or group of calls.
  • if an API breaks because errors weren’t detected, it could not only break a single application but a chain of business processes hinged to it.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Define a smoke test for an API

A

make a call and verify you receive a response

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the typical output of an API?

A
  • A Pass or Fail status
  • Data or information
  • A call to another API
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Questions to ask yourself when testing an API

A
  • Who is your target audience? Who is your API consumer?
  • What environment/s should the API typically be used?
  • What is defined as a Pass or a Fail? What data is the desired output? What is the chain of events?
  • What other APIs could this API interact with?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is load testing of an API?

A

verify the API can handle a large amount of calls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Creativity Test of an API?

A

the API can be used in different ways (Called by other APIs)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is Security Testing of an API?

A

verifying security requirements including authentication, permissions and access controls

17
Q

What is API documentation testing?

A

also called discovery testing, the API documentation easily guides the user.

18
Q

What are some test case examples for an API?

A
  • Checking API return values based on the input condition.
  • Verifying if the API doesn’t return anything at all or the wrong results.
  • Verifying if the API triggers some other event or calls another API.
  • Verifying if the API is updating any data structures.
19
Q

What types of testing of an API can be automated?

A
  • Creating loads of dynamic data to throw into your API testing.
    .- Using multiple data sets at the same time to cover different test scenarios.
  • Error testing, where you throw forced errors at the API to understand how it will react.
  • Testing in multiple languages.
20
Q

Best Practices for testing an API?

A
  • Test first for the typical or ordinary results, for what happens consistently and what doesn’t.
  • Add stress to the system through a series of API load tests.
  • Test for failure. Keep working and working until you get a Fail output, making sure the API fails consistently and gracefully.
  • Prioritize API function calls so that it will be easy for testers to test in a timely fashion.
  • Limit the tests from as many variables as possible by keeping it as isolated as possible.
  • run through the documentation tests, making sure the documentation makes sense for all levels of user experience.
  • Throw anything you can at the API to test for how it handles unforeseen problems and loads.
  • Perform well-planned call sequencing.
    Later on, get creative! For complete test coverage, create test cases for all possible API input combinations.
21
Q

What is an API request?

A

A request to a resource on the server which is exposed via an API

22
Q

Give an example of an API request

A

I need to get list of all the users from a database and assume there is an API written in any language that pulls the required data, transforms it into either xml or JSON and returns it back. say :

http://host:port/api/users : here api/users is the endpoint which is deployed in a server and invokes the program to get the data and creates a response in JSON/XML format, once response is ready it can be sent back to caller.

When I call this API from a browser using it’s qualified URL (another term for the exact url) it would be called an API request, and as a result I would get a list of users as either JSON or XML format which can then be used as required, there are other formats as well but they are out of scope for this question.

23
Q

What is the URI in the request:

http://domain.com/path/to/resource

A

everything after http://domain.com

24
Q

What are the HTTP methods for RESTful Services?

A
  • POST (Create)
  • GET (Read)
  • PUT (Update/Replace)
  • PATCH (Update/Modify)
  • DELETE (Delete)