Advertisment

Testing Cloud Apps Developed on Azure

author-image
PCQ Bureau
New Update

Abhishek Agrawal, Senior Program Manager, Microsoft India Development Center

Advertisment

The Windows Azure Cloud platform is made of services that enable developers to build rich applications without the need to deploy and maintain their own hardware or infrastructure. The following are the key services provided by Azure:

Windows Azure Compute and Storage: At the very core, Windows Azure provides compute and storage services. Developers can create three kinds of roles, such as web role, worker role, and VM role to model their application computing needs. Azure storage enables developers to create and store data in blobs, queues and tables.

SQL Azure: Many applications need access to a relational database for storing their application data. SQL Azure provides a relational database in the Cloud (similar to SQL Server in the on-premise scenario).

Advertisment
Applies to:

Developers, Testers, Quality Assurance Pros



USP: Learn how to test Azure based apps with VS 2010


Primary link: www.microsoft.com/azure
Related articles:

> Securing Apps with Win Azure: http://tinyurl.com/3ota83h

> Data-tier Apps in Visual Studio 2010: http://bit.ly/aPPKwz





Azure AppFabric: AppFabric is a collection of services and technologies that simplify building connected distributed applications on the Azure platform. It currently provides services like service bus, access control and data caching.

Developers will typically need to use a combination of above services to build their Azure application. To develop application for Azure, developers will need Visual Studio 2010 and Windows Azure SDK. The next step is to design the architecture for the application using web roles/worker roles and Azure storage, SQL Azure, etc.

Advertisment

When a developer uses Visual Studio to develop Azure apps, VS provides a local Azure Development and Storage Emulator that can be used to test applications locally before deploying to Azure.

Quality Lifecycle

Quality is a key component throughout the development lifecycle of an Azure application. A good developer/tester team should follow the best practices that are required to ensure high quality for any software project. These include (but not limited to): One, following Test Driven Development and writing a good set of fast lightweight unit-tests for the application. Two, adopting continuous integration. Producing daily builds and running automated integration tests against the build. Three, performing exploratory manual testing on a regular basis on builds.

Advertisment

Four, once the product is mature, perform end to end scenario testing and functional testing and automated them

The above list is not exhaustive but a good representation of quality related practices that should be enforced in each phase of the application development. The practices are applicable to any software development and also extend to development of Azure applications.

Testing Azure applications

Advertisment

Visual Studio 2010 provides various tools for doing unit-testing, manual testing and functional testing of Azure apps. Here are a few tips on how to use VS effectively to do these tests.

1. Unit-testing: Developers can use .NET Framework when writing code for their Azure roles. A good practice to follow is to adopt test driven development when writing code and write a good set of unit-tests for the code. Since the code is standard .NET, they can use Visual Studio's MSTEST framework for writing their unit-tests. Another popular practice when developing unit-tests is to use a Mocking framework. Developers can continue to use their favorite mocking framework ( TypeMock, Moq, and RhinoMock, for instance) for .Net to write their unit-tests. One advantage of using Mocking framework is that, these tests can run without the need for deploying the application. These tests can run fast and should be used to validate basic and core functionality.

2. Integration Testing: Once the key roles of the Azure application is developed, it is important to write automated integration tests for the application. If the application is a web service, then these integration tests can also be functional tests. Developers can again use Visual Studio's MSTEST framework to write these tests.

Advertisment

One challenge in running these tests is that they require the application to be deployed. The following are some recommendations/best practices: One, when running the test from Visual Studio, a developer can deploy the application on the development emulator and start an instance before running the tests. Two, if these tests need to run as part of a build server, such as the Build Agent that is available with Team Foundation Server, then the guidance is to configure the Build Agent to run as an interactive service, invoke command line utility csrun.exe (available as part of Windows SDK) to start an instance of the application under test and then run the integration tests.

3. Functional Testing: Test teams can use Microsoft Test Manager tool, which is available with Visual Studio 2010 Ultimate, to plan and execute their manual testing. Early on in the lifecycle, they can deploy the application on the development emulator locally and then use MTM to test the application. towards the end of a milestone the test team should create a test deployment of the application on the actual Azure service and use it for testing. Developers/testers can also use Visual Studio 2010's Coded UI Test feature to develop automated functional UI tests for their application.

Development emulator vs hosted service

Advertisment

One of the key questions that comes up in developing an Azure application is deciding when to switch to using a hosted instance of the application for testing. A hosted test instance will cost the development team just like the final instance. So careful budget planning for testing is advised. The following are some recommendations: one, use development emulator during early phase of the project and when running tests as part of daily build. Two, realize limitations of development emulator. For example, it does not provide SQL Azure and cannot be used for load or performance testing. Three, plan a test budget for a hosted test instance of the application. Once the application is mature, perform scheduled bug bashes, manual and functional test runs against the hosted test instance of the application.

Summary

Windows Azure cloud platform enables developers to focus on their core strength of building great applications. By using VS 2010 with Azure SDK, developers can leverage their existing skills to develop high quality applications for Azure.

Advertisment