Wednesday 25 July 2012

API Testing

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.

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 other testing types as GUI is rarely involved in API Testing. Even if GUI is not involved in API testing, you still need to setup initial environment, invoke API with required set of parameters and then finally analyze the result. Setting initial environment become complex because GUI is not involved. In case of API, you need to have some way to make sure that system is ready for testing.

Test Cases for API Testing:
The test cases on API testing are based on the output.
•Return value based on input condition
Relatively simple to test as input can be defined and results can be validated. Example: It is very easy to write test cases for int add( int a, int b) kind of API. You can pass different combinations of int a and int b and can validate these against known results.
•Does not return anything
 Behavior of API on the system to be checked when there is no return value.
Example: A test case to delete (List Element) function will probably require validating size of the list or absence of list element in the list.
•Trigger some other API/event/interrupt
 The output of an API if triggers some event or raises some interrupt, then those events and interrupt listeners should be tracked. The test suite should call appropriate API and declarations should be on the interrupts and listener.
•Update data structure
This category is also similar to the API category which does not return anything. Updating data structure will have some effect on the system and that should be validated.
•Modify certain resources
 If API call is modifies some resources, for example makes update on some database, changes registry, kills some processes etc., then it should be validated by accessing the respective resources.

API Testing Approach
An approach to test the Product that contains an API.
Step I: Understand that API Testing is a testing activity that requires some coding and is usually beyond the scope of what developers are expected to do. Testing team should own this activity.
Step II: Traditional testing techniques such as equivalence classes and boundary analysis are also applicable to API Testing, so even if you are not too comfortable with coding, you can still design good API tests.
Step III: It is almost impossible to test all possible scenarios that are possible to use with your API. Hence, focus on the most likely scenarios, and also apply techniques like Soap Opera Testing and Forced Error Testing using different data types and size to maximize the test coverage. Main Challenges of API Testing can be divided into following categories.

In Automation API Testing shows in the following picture.




Wednesday 18 July 2012

How to write the Test Cases

How to write the Test Cases


Level 1: In this level you will write the basic test cases from the available specification and user documentation.
Level 2: This is the practical stage in which writing test cases depend on actual functional and system flow of the application.
Level 3: This is the stage in which you will group some test cases and write a test procedure. Test procedure is nothing but a group of small test cases maximum of 10.
Level 4: Automation of the project. This will minimize human interaction with system and thus QA can focus on current updated functionalities to test rather than remaining busy with regression testing.

Thursday 12 July 2012

Tasks of the test leader and tester


Tasks of the test leader and tester

Test leader tasks may include:

Ø   Coordinate the test strategy and plan with project managers and others.
Ø   Write or review a test strategy for the project, and test policy for the organization.
Ø  Contribute the testing perspective to other project activities, such as integration planning.
Ø  Plan the tests – considering the context and understanding the test objectives and risks –including selecting test approaches, estimating the time, effort and cost of testing, acquiring resources, defining test levels, cycles, and planning incident management.
Ø  Initiate the specification, preparation, implementation and execution of tests, monitor the test results and check the exit criteria.
Ø  Adapt planning based on test results and progress (sometimes documented in status reports) and take any action necessary to compensate for problems.
Ø  Set up adequate configuration management of testware for traceability.
Ø  Introduce suitable metrics for measuring test progress and evaluating the quality of the testing and the product.
Ø  Decide what should be automated, to what degree, and how.
Ø  Select tools to support testing and organize any training in tool use for testers.
Ø  Decide about the implementation of the test environment.
Ø  Write test summary reports based on the information gathered during testing.

Tester tasks may include:

Ø  Review and contribute to test plans.
Ø  Analyze, review and assess user requirements, specifications and models for testability.
Ø  Create test specifications.
Ø  Set up the test environment (often coordinating with system administration and network management).
Ø  Prepare and acquire test data.
Ø  Implement tests on all test levels, execute and log the tests, evaluate the results and document the deviations from expected results.
Ø  Use test administration or management tools and test monitoring tools as required.
Ø  Automate tests (may be supported by a developer or a test automation expert).
Ø  Measure performance of components and systems (if applicable).
Ø  Review tests developed by others.

Defect submission process


Defect submission process

Testing Process


Testing Process

Levels of documents prepared at project testing


Levels of documents prepared at project testing




Project & Product

Project & Product
Examples:

Project: Any Company, Bank..etc sites
                                             
                                                  In the above examples that sites are based on their own requirements for example take Kotak Bank and HDFC Bank sites they seems to be different & their functionality also different. Here only that particular bank gives the requirements to the website developing company. And that site is maintained by only that bank.      

Product: Printers,Scanners,Mobiles etc

                                       In the above examples that are used by so many clients for example take mobile phones every mobile manufacturing company firstly launches the basic models and takes the requirements from the clients(people) like feedback and prepares the mobile according to the clients(peoples) requirements and the cost also differs according to the requirements.