API Testing

Posted by: Prince in QA/Testing No Comments »

What is API Testing?
An API (Application Programming Interface) is a collection of software functions and procedures, called API calls, which can be executed by other software applications. API testing is mostly used for the system which has collection of API that needs to be tested. The system could be system software, application software or libraries.
API testing is different from Unit, white box and UI testing, UI is rarely involved in API Testing. Tester need to setup initial environment, invoke API with required set of parameters and then finally analyze the result.
Initial environment means test environment setup and application setup, database creation, server configuration, config and properties file setup and deployment of application or any coding (if it is required).

Usually people or company synonym as Unit or white box testing but there is huge difference between API, Unit and while box testing. Tester need to or may need to do coding during API testing.

Difference between Api Testing and Unit Testing
Unit testing is an activity that is owned by the development team; developers are expected to build unit tests for each of their code modules (these are typically code may or may not contains classes, functions, stored procedures, or some other ‘atomic’ unit of code), and to ensure that each module passes its unit tests before the code is included in a build.
Unit tests are typically designed by the developers to verify the functionality of each unit. The scope of unit testing often does not consider the system-level interactions of the various units; the developers simply verify that each unit in isolation performs as it should.

API testing is typically an activity owned by the QA team, API tests are often run after the build has been created, and it is common that the authors of the tests do not have access to the source code; they are essentially creating black box tests against an API rather than the traditional GUI.

In API testing, QA team must consider the ‘full’ functionality of the system, as it will be used by the end user. This means that API tests must be far more extensive than unit tests, and take into consideration the sorts of ’scenarios’ that the API will be used for, which typically involve interactions between several different modules within the application.

API is mostly black box testing where as unit testing is essentially kind of white box testing. Unit test cases are typically designed by the developers and there scope is limited to the unit under test. In API testing, test cases are designed by the QE team and there scope is not limited to any specific unit, but it normally covers complete system.

So a tester should able to identify before start API testing…

*Find the way to approach the task?
*Do boundary analysis.
*Create or focus on the most likely usage scenarios (Functional Scenario).
* Check Return Values
*Focus also on negative testing to get exception and error handling.

*Check Event triggers (Optional and depends on API Type)
*Modify resources (Optional and depends on API Type)

Type of API and how to approach them:
API can be called directly or it can be called because of some event or in response of some exception. Output of API could be some data or status or it can just wait for some other call to complete in a-synchronized environment.

A. IF API return value based on input condition:
- In this condition, test cases will be based on the input and relative output.
- This is relatively simple to test as input can be defined and results can be validated against expected return value.
- User can pass different combinations of values or parameters and validate these against known results.

B. If API does not return anything:
-
In this situation tester should need to identify some mechanism to check behavior of API on the system.
- For example, if you need to write test cases for delete (List Element) function you will probably validate size of the list, absence of list element in the list.

C. If API Trigger some other API/event/interrupt:
-
If API is triggering some event or raising some interrupt, then you need to listen for those events and interrupt listener.
- Test suite should call appropriate API and asserts should be on the interrupts and listener.

D. If API is used to Update data structure:
- Updating data structure will have some effect on the system and that should be validated.
- If you have other means of accessing the data structure, it should be used to validate that data structure is updated.

E. If API is Modifying certain resources:
-
If API call is modifying some resources, for example updating some database, changing registry, killing some process etc, then it should be validated by accessing those resources.

Challenges of API Testing:

a.     Parameter Selection:
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.

b.     Parameter combination:
Generating interesting parameter value combinations for calls with two or more parameters.

c.     Setting environment:
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.

d.     Call sequencing:
Sequencing API calls to vary the order in which the functionality is exercised and to make the API produce useful results     from successive calls.

Most common seniors in API Testing:

a.     Test Response: Each API method in isolation using only the mandatory elements and typical content so if system calls        any API then it send any response so tester need to check valid response from API.

b.     Test Limit: These tests exercise each API method using all optional elements and maximum allowable content lengths        and/or instances of repeated elements.

c.     Test Business Logic: This is where the business application logic is simulated in the test code. Each API method will         have a defined set of test cases that explore its interaction and influence on other API methods and any underlying         database.

d.     Test Negative or Illegal: These tests contain a sampling of typical error scenarios, such as missing required elements,     empty content, and content exceeding maximum limits, across a representative sampling of the API methods, so API         should enough intelligent to handle exception, errors and missing parameters issues.

e.     Test Load: Most of applications are web 2.0 and running on internet and access by number of users so API should able     to take heavy load and should not break during peak time when number of people will use application, tester also             measure response time, through put , latency, memory leak and any other factor according to requirement

If you were to ask testers how to test API, you would get several different perspectives. Every people have different thinking and approaches to solve problems and every approach have option for enhancements.

BusinessWeek and market researcher YouNoodle have teamed up to identify 50 tech startups flying under the radar. The list includes fledgling tech companies most started in 2005 and later from the U.S., China, India, Israel, and Russia that are attracting some early buzz and are poised to grow beyond their regional or niche-market origins.

*A YouNoodle Score is a measurement, on a scale of 0 to 100, of a startup’s progress as an early-stage company. Typically, a 0-15 company is just getting started, a 30-60 company has experienced some very strong growth (through traffic, funding, or revenue), and a 90-plus company is a strong IPO or acquisition candidate. The score is based on a sophisticated algorithm using information from thousands of online sources: traffic, level of mainstream media coverage, funding, blogosphere activity, and other key factors.

Company Headquarters *YouNoodle

Score
Total Funding
(in Millions of Dollars)
Year Funded CEO
Zynga San Francisco 97 39 2007 Mark Pincus
Tudou Shanghai 96 84.5 2005 Gary Wang
Ning Palo Alto, Calif. 96 104 2004 Gina Bianchini
OpenDNS San Francisco 93 2.5 2005 David Ulevitch
Etsy Brooklyn, N.Y. 91 31.6 2005 Maria Thomas
Sonico Buenos Aires 91 4.3 2007 Rodrigo Teijeiro
Scribd San Francisco 91 12.8 2007 Trip Adler
Slide San Francisco 91 58 2005 Max Levchin
RockYou Redwood City, Calif. 89 68.5 2006 Lance Tokuda
Komli Media Mumbai, India 83 7 2006 Amar Goel
Justin.tv San Francisco 81 4 2006 Michael Siebel
Ibibo Gurgaon, Haryana, India 77 N/A 2007 Ashish Kashyap
AdMob San Mateo, Calif. 76 47.2 2006 Omar Hamoui
Jajah Mountain View, Calif. 68 28 2005 Trevor Healy
Daylife New York 67 8.3 2007 Upendra Shardanand
TheFind Mountain View, Calif. 66 26 2006 Siva Kumar
QueBarato Brazil 65 6 2007 Pending confirmation
Adconion Media Group London 64 80 2005 T. Tyler Moebius
Kosmix Mountain View, Calif. 60 55 2005 Venky Harinarayan
Evernote Mountain View, Calif. 60 13.5 2005 Phil Libin
Yola San Francisco 60 25 2007 Vinny Lingham
PBworks San Mateo, Calif. 57 2.5 2005 Jim Groff
Spotify Stockholm 51 20 2006 Daniel Ek
TokBox San Francisco 51 14 2007 Ian Small
Loopt Mountain View, Calif. 48 13.3 2005 Sam Altman
Xobni San Francisco 48 14.6 2006 Jeff Bonforte
KupiVIP Moscow 48 11 2008 Oskar Hartmann
Fon Madrid 44 48 2005 Martin Varsavsky
Metaweb Technologies San Francisco 42 57 2005 Thomas Layton
Huddle.net London 38 4 2006 Alaisdair Mitchell
Mochi Media San Francisco 37 14 2005 George Garrick
Boxee New York 36 4 2008 Avner Ronen
Better Place Palo Alto, Calif. 33 200 2007 Shai Agassi
Palantir Technologies Palo Alto, Calif. 31 36.7 2004 Alex Karp
SecondMarket New York 31 N/A 2004 Barry E. Silbert
Livescribe Oakland, Calif. 30 18.6 2007 Jim Marggraff
Inrix Kirkland, Wash. 29 31.1 2004 Bryan Mistele
Sermo Cambridge, Mass. 29 37.5 2006 Daniel Palestrant
Modu Kfar-Saba, Israel 27 85 2007 Dov Moran
SynapSense Folsom, Calif. 26 11 2006 Peter Van Deventer
Pelago Seattle 25 22.4 2006 Jeff Holden
Raydiance Petaluma, Calif. 24 20 2005 Barry Schuler
Fusion-io Salt Lake City 23 66.5 2006 David Bradford
Cloudera Burlingame, Calif. 22 11 2008 Michael Olson
Bloom Energy Sunnyvale, Calif. 22 N/A 2002 K.R. Sridhar
Positive Energy Arlington, Va. 22 15.5 2007 Daniel Yates
Nila Los Angeles 22 0.6 2004 Jim Sanfilippo
Monitise London 21 19 2004 Alastair Lukies
Proclivity Systems New York 16 6.2 2006 Sheldon Gilbert
Cotendo San Carlos, Calif. 12 7 2008 Ronni Zehavi

I am mentioning all known ad networks in India which display ads directly or indirectly on the own website or publishers (client) site, this is partial list and welcome for all suggestions.
1. Google Ad Sense
2. Network Play
3. Komli Media
4. mKhoj
5. Tyroo Media
6. Ozone Media
7. DGM India
8. Tribal Fusion
9. PubMatic
10. Ad Magnet
11. AdRevenue
12. Integrid Media
13. IndiAds
14. Kyphy
15. Social Media Exchange (Formally Axill India)
16. AdChakra
17. Tonic Tag
18. Ruipzads
19. Sulekha
20. Quikr (free Classifieds site)
21. Oridian (A Ybrant Digital Network – The Group of Ad Networks)
22. Jivox
23. PayPod
24. Adaptive Ads (Glam Media Company)
25. mGinger

Gul ki tarah muskurao saathi,

Kato ke beech panaah pao saathi…

Ambar saa hraday pao saathi,

Jis ke niche duniya panaah paati…

Jal prapaat se bane jo saathi,

Jis se pyaaso ki trishnaa har jaati…

Ravi ki tarah jagmagao saathi,

Jis se timir ki galiyaan bhi ghabrati…

Kuch aisa kar jao saathi,

Hume tho kya jag ko yaad aao saathi.

(Prince)

Quotes by Herman Cain

Posted by: Prince in Thoughts No Comments »

“Success is not the key to happiness. Happiness is the key to success. If you love what you are doing, you will be successful.”

“Nobody motivates today’s workers. If it doesn’t come from within, it doesn’t come. Fun helps remove the barriers that allow people to motivate themselves.”

“My motivation for running for Senate was not for the stature of being a senator, but because I wanted to make a difference on issues I feel passionate about.”

“We’re not coming into Virginia to be a one-note Johnny.”

“I didn’t know I was a conservative when it didn’t matter to me growing up.”

“In order to fix Social Security, we must restructure it so that we continue to provide for our Nation’s seniors that are approaching retirement age, but allow for younger taxpayers to invest a portion of their Social Security taxes in private accounts.

“Americans need accurate information in order to consider Social Security reform. Too bad the media can’t be counted upon to provide it.