Sunday 23 December 2012

API Testing - Part 2

API Testing - Part 2

      Hi to all,  In last post we had a introduction, best practices and challenges of API testing. In todays post we also want to focus on other aspects of API testing.

Test cases for API Testing:
Test case of API testing are based on the output.
API Test Development.
API test case specification.

1. Create / Select the Suite in which you want to add the API test case(s).
2. Choose Test Development Mode ( Isolation or Sequence ).
3. Develop Test case(s) for the desired API methods.
4. Configure Application Control Parameters.
5. Configure Test Conditions.
6. Configure Method Validation.
7. Execute API test.
8. View Test Reports.
9. Filter API test cases.
10. Sequence API test cases.

While API tests should strive for a high level of code coverage (structural testing) a more important goal is test coverage. For example API tests of this same method might include a series of data-driven tests that:
  • test every known alpha-numeric character defined.
  • test character casing
  • test pan grams, and special signals (e.g. end of message, attention, received, etc)
  • test boundary conditions.
  • test strings with invalid or characters that are not defined.
  • test strings with non-ASCII letters.
  • test performance to provide baseline measures of individual methods
More complex APIs such as this MessageBox.Show method that have several parameters with variable argument values might benefit from additional testing techniques such as combinatorial testing.

 You can also test the API's through some automation tolls and observe the input and expected output.

1. Xocean tool.
2. Soup UI
3. Jmeter.





Sunday 4 November 2012

API Testing



API Testing

What is an API?

API is an acronym for Application Programming Interface.
It enables communication between two separate software system. 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 checking Application Programming Interface of a Software System.
In order to check API , it needs to be called from the calling software . Necessary test environment, database, server, application setup needs to be prepared before doing API Testing.
 API testing is focused on the functionality of the software’s business logic and it is entirely different from GUI testing. It mainly concentrates on the business logic layer of the software architecture. This testing won’t concentrate on the look and feel of an application.
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.

Set-up of API environment and different types of test cases:

Normally, setting up the API environment is very complex as it doesn’t involve user interface. Database and server should be configured as per the application requirements. API Function should be called to check whether that API is working.
Output of API could be
  • Any type of data
  • Status (say Pass or Fail)
  • Call to another API function.
The output is compared with the expected outcome. API test cases are written based on the input data that users are expected to key-in.
For example –
There is an API function which should add two integer numbers .
1.Long add(int a, int b)
The numbers have to be given as input parameters. Output should be summation of two integer numbers . This output needs to be verified with expected outcome.
Calling needs to be done such as
1.add (12345656)

Exceptions have to be handled if number is exceeding the integer limit.

Consider the below API function -
  1. Lock()
  2. Unlock()
  3. Delete()

They return any value such as True (in case of success) or false (In case of error) as an output .
A more accurate test case would be , can call the functions in any of the script and later check for changes either in the database or the Application GUI.

Calling of another API / Event

In this case , we call one of the API function which in turn will call another function.
For example – First API function can be used for deleting a specified record in the table and this function in turn call another function to REFRESH the database.


Approach of API Testing:


Following points helps the user to do API Testing approach:
  1. Understanding the functionality of the API program and clearly define the scope of the program
  2. Apply testing techniques such as equivalence classes, boundary value analysis and error guessing and write test cases for the API
  3. Input Parameters for the API need to be planned and defined appropriately
  4. Execute the test cases and compare expected and actual results.

 

Difference between Unit and API Testing:

Following are the differences between unit testing and API testing

Unit Testing
API Testing
Performed by developers
Performed by testers
Separate functionality is tested
End to End functionality has been tested
Developer can access the source code
Testers usually cannot access the code
UI testing is also involved
Only API functions are tested
Only Basic functionalities are tested
All functional issues are tested

API Test Automation:


Since API and unit testing both target source code, similar tools can be used for testing both.
If an API method is using .NET code, then the tool which is supporting should have .NET
Example for Automation tools are
  • NUnit for .Net
  • JUnit for Java

There are two distinct typesof API testing:
API Functional Testing:
Functional testing takes an external perspective of the API, using the API Specification and published Use Cases to determine the valid inputs and expected outputs.This is classic "black box" testing, without an intimate knowledge of the API's internal structure. A typical API Test developed by INNOMINDS covers the following areas:
  • Baseline Tests
  • Task-Oriented Tests
  • Forced Error Tests
API Performance Testing:
Performance API testing encompasses a wide range of activities, including creating a test environment, setting realistic performance targets, developing test scenarios, generating high quality test input data, test execution, and root cause analysis. Innominds with years of experience in performing Performance and Load Testing of disparate application and systems is well positioned to serve your API performance testing needs. Our services in this spectrum includes
  • Load Testing
  • Stress Testing
  • Endurance Testing and
  • Scalability Testing
Innominds API testing methodology includes the following steps:
  • Detailed review of the API specification and any related use case documentation.
  • Test Specification Development
  • Test Framework Development
  • Test Case Development
  • Test Execution and Reporting

Best Practices of API Testing:

There are some best practices for effective API testing:
  • Planning the test cases – What and How to test the API functions.
  • Important to organize the test properly so that those API can be organized properly.
  • Parameters selection should be explicitly mentioned in the test case itself.
  • Call sequencing should be performed and well planned.
  • Prioritize API function calls so that it will be easy for testers to test.
  • Proper testing and test cases should be done while handling one time call functions like – Delete, CloseWindow, etc….

Challenges of API testing:

There are various challenges when we are doing API testing:
  • No GUI available to test the application which is difficult to give input values.
  • Verifying and validating the output in different system is little difficult for testers.
  • Parameters selection and categorization needs to be known to the testers.
  • Exception handling function needs to utilized and used properly.
  • Testers should be knowledgeable in coding.
  • Parameter selection.
  • Parameter combination.
  • Call sequencing.

 

Conclusion:

API consists of set of classes / functions / procedures which represent the business logic layer. If API is not tested properly, it may cause problems not only the API application but also in the calling application.

I am very thankfull to all the groups who shared this valuable API Testing information.  Thank you.

Tuesday 30 October 2012

PANDA 3D - Open source Game Engine

PANDA 3D - Open source Game Engine


Panda 3 D is a open source game engine as of May 28, 2008, free software under the revised BSD license, a good framework for 3D rendering and 3 D game development for the languages like Python and C++ programs. Its a free to use and including commercial ventures.

Panda3D is a scene graph engine. This means that the virtual world is initially an empty Cartesian space into which the game programmer inserts 3D models. Panda3D does not distinguish between "large" 3D models, such as the model of an entire dungeon or island, and "small" 3D models, such as a model of a table or a sword. Both large and small models are created using a standard modeling program such as Blender3ds Max or Maya, loaded into Panda3D, and then inserted into the Cartesian space.

The Panda3D scene graph exposes the functionality of OpenGL and DirectX in a fairly literal form. For instance, OpenGL and DirectX both have fog capabilities. To enable fog in Panda3D, one simply stores the fog parameters on a node in the scene graph. The fog parameters exactly match the parameters of the equivalent calls in the underlying APIs. In this way, Panda3D can be seen as a thin wrapper around the lower-level APIs. Where it differs from them is that it stores the scene, whereas OpenGL and DirectX do not. Of course, it also provides higher-level operators, such as loading models, executing animations, detecting collisions.

Capabilities of Panda 3D are:
  • Performance analysis tools.
  • Scene graph exploration tools.
  • Debugging tools.
  • A complete art export/import pipeline.
  • 3D Audio, utilizing either FMODOpenAL or Miles Sound System.
  • Collision detection.
  • Physics system, and full integration for the Open Dynamics Engine, experimental PhysX and Bullet integration.
  • Keyboard and Mouse support.
  • Support for I/O devices.
  • Finite state machines.
  • GUI, libRocket integration.
  • Networking.
  • Artificial intelligence.

Operating System:
Windows
Linux
Mac OS X
Sun OS

Graphics API's:
Open GL
DirectX

Website:

Supported Features:

General:
  • Object-Oriented Design
  • Other
  • Support for ARtoolkit
  • Development in C++ or Python
  • Web plugin for deployment over the web
  • "all-into-one" application packaging system
  • Wide range of user-provided features and examples (PhysX integration, AI, GUI, particle system etc.)
  • Fixed-function
  • Stereo Rendering
  • GUI Rendering for red/cyan stereo glasses
  • Particle System
  • Motion Blur
  • Fog Post-effects (bloom, blur, volumetric lighting, cartoon look etc.)
Lighting:
  • Per-vertex
  • Per-pixel
  • Volumetric A variety of lights that work by vertex lighting
Texturing:
  • Basic
  • Animated textures
  • Support for video textures (AVI, MPG, MOV)
  • Pointer textures (direct access to graphics card memory)
  • 3D textures
Shaders:
  • High Level
  • Support Cg
  • GLSL support
  • Shader generator for basic shaders and combinations (bump, parallax, specular etc.)
Meshes:
  • Mesh Loading
  • Skinning
  • Supports 3D Studio Max, Maya, and blender models via plug-ins.
  • Low-level mesh manipulation
Animation:
  • Skeletal Animation Soft skin animation and a sophisticated actor interface for character animation
Terrain:
  • Rendering
  • Generate terrain meshes from heighfields.
  • GeoMipMapping
Physics:
  • Basic Physics
  • Collision Detection
  • Rigid Body
  • Vehicle Physics
  • Very basic physics engine that may apply forces to classes. The physics engine can handle angular or linear forces, as well as viscosity
  • There are two ways to go about collision detection: Bounding volumes & allow collisions against all geometry
  • support for ODE physics
Networking:
  • Client-Server a networking library and a mmo-grade patching system
Artificial Intelligence:
  • Finite State Machines
  • Built-in AI library with basic behaviours
  • Two different finite state machine systems: FSM & ClassicFSM
Sound:
  • 2D Sound
  • 3D Sound
  • Streaming Sound
  • Sound using the FMOD library
  • Support for OpenAL
Tools & Editors:
  • Direct tools for GUI-based scene editing
  • Particle effects API and GUI-based particle panel
  • Future plans: An easy to use but powerful and generic scene/level editing tool
Scripting:
  • Python scripting interface
  • Programming on the fly using interactive scripting in the Python shell


Sunday 21 October 2012

Monkeyrunner


Monkeyrunner


In the testing of mobile applications, we always search for new tools which make the testing easier, efficient and effective in terms of providing quality. Now android provides a free tool for automated testing named as "Monkeyrunner". 

This will help us to make the android applications more qualitative. All the related information is available on the android website which i found very useful.


Try to explore this. Thank you.


Thursday 20 September 2012

Box2D Engine

Box2D Engine

Box2D is a free open source 2-dimensional physics simulator engine and it is written in C++ engine for simulating rigid bodies in 2D. Box2D is developed by Erin Catto and has the zlib license.
We can use this engine while developing 2D games. this is very good engine to do the 2d animation games which I came across.

Box2D features are as follows:

Collision

  • Continuous collision detection
  • Contact callbacks: begin, end, pre-solve, post-solve
  • Convex polyons and circles.
  • Multiple shapes per body
  • One-shot contact manifolds
  • Dynamic tree broadphase
  • Efficient pair management
  • Fast broadphase AABB queries
  • Collision groups and categories

Physics

  • Continuous physics with time of impact solver
  • Persistent body-joint-contact graph
  • Island solution and sleep management
  • Contact, friction, and restitution
  • Stable stacking with a linear-time solver
  • Revolute, prismatic, distance, pulley, gear, mouse joint, and other joint types
  • Joint limits, motors, and friction
  • Momentum decoupled position correction
  • Fairly accurate reaction forces/impulses

System

  • Small block and stack allocators
  • Centralized tuning parameters
  • Highly portable C++ with no use of STL containers

Testbed

  • OpenGL with Freeglut
  • Graphical user interface with GLUI
  • Easily switch between tests using GUI
  • Test framework for easily adding new tests
  • Mouse picking and the bomb!
  • CMake build system files
 Well i have tried to mention the features of Box2d engine here.

Monday 17 September 2012

Mobile Application Testing Key Factors

Mobile Application Testing Key Factors

Mobile Appli­ca­tion Soft­ware Overview
  • Overview Mobile OS and Platforms
  • Types Of Mobile Application
  • Overview on Mobile test­ing (Android / iPhone / Blackberry)
  • Mobile Web Test­ing Guide­lines and Approach
  • Scope of Mobile Appli­ca­tion Testing
Android Appli­ca­tion Testing
  • Android OS Ver­sions and Features
  • Android Device Fragmentation
  • Choos­ing devices for Testing
  • Android Envi­ron­ment Set Up
  • Intro­duc­tion to DDMS
  • Cap­tur­ing logs
  • Installing Android App
  • Android Test­ing Criteria
  • Android Market(Play Store) Sub­mis­sion Process
iPhone Appli­ca­tion Testing
  • Gen­er­a­tions of Apple devices
  • Human Inter­face Guidelines
  • Soft­ware Requirements
  • Installing Apple Apps
  • What is UDID, Impor­tance of Pro­vi­sion­ing Profile
  • Apple Sub­mis­sion Process
  • Apple Review Process
Mobile Test­ing Generics
  • Net­work Related Testing
  • Bat­tery Con­sump­tion Testing
  • Inter­rup­tion Testing(Call Handling,SMS)
  • Ver­i­fy­ing Mem­ory usage by app
  • Test­ing on dif­fer­ent types of devices
  • Test­ing on dif­fer­ent types of devices
  • Stress Test­ing
Remote Device Services
  • Overview:- Cloud based Mobile Test­ing Solutions
  • Intro­duc­tion to Device Anywhere
  • Per­fecto Mobile
  • Nokia RDA
Mobile Test­ing Utilities
  • Screen­shots cap­tur­ing tools
  • UDID Find­ers
  • Mem­ory Usage Tools
  • File Explor­ers in Android
  • Stress Test­ing Tools
  • Unit Test­ing Tool for iphone
  • Log Col­lec­tors
Here are few Automation tools which are used during mobile application testing. 

Mobile Test­ing Automa­tion Tool
You may find many more apart from this but I have tried to list down few tools which are helpful for QA in his/her mobile application testing. Please Let us know your feedback on the same into the comments section.

Monday 3 September 2012

Pros & Cons of Watir, Selenium or Sahi tools


Watir

Pros:
  • It’s a Ruby library
  • Multi browser (& OS) support
  • Has a rich API
  • Has a ‘Simple’ class (for non-tech users)
  • Watij & Watin (Java & .NET)
  • gives more stable and straightforward feeling
  • automatically waits for the page to finish loading
  • can detect when it's finished loading
  • Watir's API more. It's richer than Selenium's
  • provides an "attach" method which lets me programmatic access both
    the original domain window and the linked domain window from the same test.
Cons:
  • Have to learn Ruby (unless you choose
    Watij or Watin)
  • Every browser requires a different
    library

Selenium

Pros:
  • Multi browser, OS & language support
  • Install server-side or as FF add-on
  • Has its own IDE, which speed up development
  • Record and playback tests
  • selenium rc + selenium ide (firefox plugin) for recording and playback of test case is great for generating test case on the fly
  • Choice of programming language
  • using JAVA through CruiseControl, make it easy to conver the selenium test code to JAVA
Cons:
  • Have to learn a vendorscript => Selenese (Unless you write tests
    in another language which it supports. Then you just have to use the API
    reference which is straightforward.)
  • has a lot of timing problems
  • have to use the pause command (or Thread.sleep() if you use it in Java to wait for the loading to complete
  • with Selenium is that it is very difficult to test complex multi-site apps
  • clickAndWait is not helping when working with Ajax technology
  • runs fine in firefox but had different problem on PC with IE6 and IE7
  • learning curve is on the higher side
  • IDE is nothing but a FireFox plugin...and it works only on FireFox
  • record and play back only on FireFox and only if you install the plugin
  • automation engineer needs to have reasonable experience on the chosen language
  • need to implement most of the things including logging mechanisms
  • Extensible Javascript APIs need a rebuild
  • Selenium needed a lot of hand holding
  • selenium doesn't support IE
Remarks:
  • use clickAndWait to wait for the page to load
  • using Java language
  • Selenium 1.0 uses Javascript
  • can use Python to run IE7 with Selenium Webdriver.

Sahi

Pros:
  • Multi browser support
  • Has its own IDE
  • Record and playback tests
  • Data-driven test via jdbc:odbc bridge (this allows to exploits data
    file as xls, mdb, csv, and .. every supportend jdbc:odbc driver)
  • active community (fast replies to bugs/problem/suggestions)
  • test success/failure reporting in html files
  • capabilities to run test using batch file or ant script
  • lightweight and not stress too much the host server.
  • install once and use anywhere
  • After Sahi server is running, tester can access Sahi Controller (aka IDE) from any supported browsers, no need for local installation
  • including a script recorder, object inspector, log broser, debugger, utility to test code without recording
  • Easy to learn, simple, powerful APIs
  • Built-in color coded HTML logs
  • Extensible Javascript APIs
  • Extensible on the server with Java
  • Parallel execution of tests
  • Multiple domain scripting
  • its not using x path
  • supported IE
Cons:
  • Confusing interface
  • Least developed/smallest community
  • documentation needs to be enhanced 
  • need to be improved reporting
  • needs more visibility on the web
  • controller can be a bit quirky need some learning curve
Remarks:
  • Javascript as the scripting language
  • similar in concept to Selenium