Skip to main content

Posts

Showing posts with the label test

Running Load Tests on Microsoft Azure with IP Switching feature

One year ago I started to investigate how we could use Load Test feature that is available on Visual Studio 2013 Ultimate and Microsoft Azure on our own project. The main idea was to develop a mechanism to test complex scenarios (especially written in C#) that can simulate 10k, 20k and even 100k users. The idea was accepted by client and we end up with a great and interesting application that can block a system witch worth millions. This is great from both sides. Mission complete for the team that defined the load tests, because they were able to define the load tests. But in the same time great for the development team and especially for the support team because they know the limits of the system. Now, we stuck with another problem. Because we are using Microsoft Azure infrastructure to run Load Tests (having our own hardware would be to expensive), we cannot simulate calls from multiple IP address. This is a current limitation Visual Studio Online - IP Switching feature is not yet...

Load Test - Binding Context Parameters

The new Load Tests features that are coming with Visual Studio 2013 are great. In combination with Windows Azure and TFS Controllers, you can run load test using cloud infrastructure without having to deploy or configure something things on the cloud. When developers start to create different web test that will be used for load tests they usually them in sub-tests and reuse them when is possible. For example very easily you can end up with something like this: Foo1WebTest Foo2WebTest Foo3WebTest BigFooWebTest Where BigFooWebTest make calls to Foo1WebTest and Foo2WebTest. If you started to extract context parameters from each web test you will observer a pretty odd behavior. By default it is not possible to bind a context parameter. This means that you will not be able to fetch data for a context parameter from a data source like a csv file or data base. Even if you will write to the value of the parameter context the binding command (“{{..#TableName.CollumnName}}”) you will...

Load Test using Windows Azure and Visual Studio 2013

In a perfect world I would except to be able to run a load test or a stress test using a cloud provider without being forced to change any line code from my tests.  In this article we will find out how to do this thing using the new cloud service. How a person without knowledge of cloud will be able to run a load test with 50.000 users for 24 hours with minim costs, without being obliged to purchase and configure 10, 20 nodes. What is a load test? What is a load test in fact? An expression that I think it fits when we need to answer this question would be: ”Are you ready to be so popular?”.  The main scope of this kind of test is to define and validate the maximum load that a system can have without affecting the performance. Even though the developer tells that the system can handle without any problem 1000 users in the same time, the load test can prove the contrary even on simple scenarios. There is a tiny difference between the load test and stress test. Many times t...

How to write unit-tests for async methods

All developer that works with .NET heard about Task, async, await – Task Parallel Library (TPL). Great library when we need to write code that runs in parallel. With TPL, writing code that run in parallel is pretty simple. This is great, but of course, all code that run in parallel need to be tested also – unit tests. Do you know how you need to write unit tests for async calls? I so pretty strange way of unit tests for async methods. Some of them were ugly and complicated. Why? Because the unit test method is a sync one and there we try to run and wait a response from an async call. This is why we can end up with something like this: [TestMethod] public void MoveFile_ExistingFile_ResultsFileMovedAndOriginalFileDeleted() { StorageFolder destinationFolder = null; Task.Run(() => destinationFolder = CreateFolderAsync(_originalFolder).Result) ...

Windows Azure Storage Emulator and testing servers

When you start to work with Windows Azure Storage Services like blobs or table you will need to specify an account name and a secret key. Working with the Windows Azure Storage Emulator you ask yourself what credentials I should use. The good part of the story is that Microsoft offers us a default account name and key that can be used to access the storage. This can be used with success whey you want to use the local storage emulator: Account Name: devstoreaccount1 Account Key: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw== Basically these are universal credentials that can be used on all the Windows Azure Emulator instances. The purpose of this is only for development and testing. When you are staring development an application you should know that the path to the resources is a little bit different between the Windows Azure and your local machine. Your local resources are accessed using a path in the following format: http(s)://127.0.0.1...

How to test a connection string on the server

De cate ori nu ati patiti sa ajungeti pe un server unde ati facut deploy la o aplicatie si sa va treziti ca nu aveti conexiune la baza de date? O soluție simpla pentru a testa conectivitatea la o baza de date SQL Server, fără sa fie nevoie sa instalați sau copiați o aplicație este sa ne folosim de un fișier uld (Universal Data Link). Creați un fișier cu extensia udl (fisier nou in nodepad si "save as" cu extensia udl) Dublu click pe el, iar apoi mergeți la tab-ul "properties" Selectați providerul (in cazul nostru SQL Express) Adaugați datele de conexiune (ip, user parola) Apăsați butonul de "Test Connection" Daca testul de conexiune se termina fără succes înseamna ca baza de date nu este accesibila.