As a tester, quality is what matter most to me. Interestingly, quality is pretty much the hardest thing to evaluate. One way, which I find useful, is to aggregate the metrics from multiple aspects of quality to have an overall view.

Some important aspects of quality:

Reliability

Functionality

Usability

Efficiency

Maintainability

Portability

Learnability

Analyzability

Testability

Debugability

 

What do you think?


 

With the new TaskFactory class from .Net 4.0 it has become incredibly easy to manage dependencies between multiple tasks.
In below code sample, the TaskFactory receive 6 tasks to execute. Additional logic is added as:
- Task A will only be run when Task B and C are completed.
- Task C will only be run when Task F, E or D is completed.

If you are confused with the ‘=>’ have a look at lambda expression.

using System;
using System.Threading;
using System.Threading.Tasks;

namespace TasksDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            UseTask demoTask = new UseTask();
            Console.ReadKey();
        }
    }

    class UseTask
    {
        public UseTask()
        {
            // Set the TaskFactory - Create and schedule objects
            var tf = new TaskFactory(
                TaskCreationOptions.AttachedToParent,
                TaskContinuationOptions.AttachedToParent);

            var F = tf.StartNew(() => DoSomething(‘F’));
            var E = tf.StartNew(() => DoSomething(‘E’));
            var D = tf.StartNew(() => DoSomething(‘D’));

            // C will be started only when F, E or D has been completed
            var C = tf.ContinueWhenAny(new Task[]{F, E, D}, tasks => DoSomething(‘C’)); 

            var B = tf.StartNew(() => DoSomething(‘B’));

            // A will only happens once B and C are completed.
            var A = tf.ContinueWhenAll(new Task[] {B, C}, tasks => DoSomething(‘A’));
        }

        private void DoSomething(char @char)
        {
            Console.WriteLine(“DoSomething called - {0}”, @char);
            Random rd = new Random();
            Thread.Sleep(rd.Next(1000, 3000));
            Console.WriteLine(“DoSomething called - {0} - DONE”, @char);
        }
    }
}

 

Isn’t that beautiful?


 

Since I moved to Zurich, two years ago, I sadly did not have the time to see most of my friends I have in Geneva. This post will hopefully explain you what I am doing in Zurich as an Engineer in Test at Microsoft. I know that even the people who know me well do not really understand what my role is and what testing is about.  Defining testing is not quite easy so let me start by quoting Wikipedia’s definition of software testing:

Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test. Software testing also provides an objective, independent view of the software to allow the business to appreciate and understand the risks at implementation of the software. Test techniques include, but are not limited to, the process of executing a program or application with the intent of finding software bugs.

To resume, I bring information about quality and objective view of the software I work on (the next generation of Office Communication ServerResponse Group Service). I own the testing of some feature of RGS for this feature I should always be able to answer the question: ‘Can we ship it?’.
To answer this question I have two main approaches:

  1. Develop automated test that will run scenario at a code level, this test being automated I can make sure that no regression would be added these feature and related area.
  2. Do some manual testing on complex scenarios representing the customers most important scenarios.

 

Finding ‘bugs’ effort is only the half of my work. The other half is dedicated at understanding the defects and drive to their resolution. To do so I am helped by developers (fixing the bug) and project managers (to give clear vision on how a feature should work in every details).

As the goal of this post is to be as clear as possible in won’t go further in my explanation :-)

I hope you know understand better what software testing is how I spent my time at work.

 

Interesting video (from Channel 9) showing a preview of the winPhone 7 OS.

Get Microsoft Silverlight

I am just a bit worried about the localized version of Bing. So far I have seen it working in the US. Does that mean that Bing will be updated for a worldwide support or that the winPhone7 will be available only in the US until it is done?

 

After playing with Pivot, I have been really existed by the possibilities that Pivot offers.

Pivot makes it easier to interact with massive amounts of data in ways that are powerful, informative, and fun.

Simply speaking, Pivot is a tool that helps us visually browse collections of information.

Pivot screenshot 1

Figure 1: Item view in Pivot while browsing the mathematics section of Wikipedia

What really excite me is that Pivot is based on the concept of collections (group of objects that have common attributes). For website with huge amount of information, as Wikipedia, it is really a great way of browsing because you can apply filter information and have a visual result. These collection can also be assembled manually (it is a simple XML file) so it could be a great way to share an important amount of information easily.

Pivot screenshot 2

Figure 2 – National parks, filtered by type

Get more information and download pivot from Pivot’s website.

 

This mobile personal assistant looks awesome!
Unfortunately, for business model reason (the application is free and make money on referrals fees whenever someone buy through the service), the service works only in the US…

Interesting interview to watch with the Siri CEO and VP engineering.

Still is a great application to have on your pocket :)
Currently the application is available only on the iPhone but they claim to have support for other mobile platform coming soon.

If you are interested in getting more news about Siri, register.

 

 For developers the quality of a program can be often express in the time used to finish the computation. With current multicore processor we have to move our thinking from a serial execution to a concurrent execution. Using delegates in an asynchronous way can force the CLR to allocate multiple threads to your computation.

In below code sample, you will see that I call one method multiple times. This method simply waits 5 seconds. Calling 6 times this method in a synchronous way makes the time to finish obvious: at least 30 seconds! Now using the BeginInvoke method from my delegate I can add multiple threads to these computations. On my machine the time to achieve this is now 9 seconds only!

using System;
using System.Diagnostics;
using System.Text;
using System.Threading;

 

namespace Threads

{

    class Program

    {

        public delegate string myDelegate(string txt);

 

        static void Main(string[] args)

        {

            SynchronousDelegateSample();

            AsynchronousDelegateSample();

 

            Console.WriteLine(“Main thread exits.”);

            Console.ReadKey();

        }

 

        static void SynchronousDelegateSample()

        {

            Stopwatch sw = new Stopwatch();

            sw.Start();

 

            /*

             * All the calls to the delegate will be synchronous

             * This mean that the order will always be 1,2,3,4,5,6

             * The thread used will always be the same.

             */           

            myDelegate dm = new myDelegate(DelegateMethod);

            Console.WriteLine(dm(“calling delegate (1)”));

            Console.WriteLine(dm(“calling delegate (2)”));

            Console.WriteLine(dm(“calling delegate (3)”));

            Console.WriteLine(dm(“calling delegate (4)”));

            Console.WriteLine(dm(“calling delegate (5)”));

            Console.WriteLine(dm(“calling delegate (6)”));

 

            sw.Stop();

            Console.WriteLine(“All work was done in: {0} milliseconds.\n\n”, sw.ElapsedMilliseconds);

        }

 

        static void AsynchronousDelegateSample()

        {

            Stopwatch sw = new Stopwatch();

            sw.Start();

 

            /*

             * All the work will be invoked in a blink.

             * Multiple thread will be used to compute the result of the method.

             */

            myDelegate dm = new myDelegate(DelegateMethod);

            IAsyncResult result1 = dm.BeginInvoke(“calling delegate (1)”, null, null);

            IAsyncResult result2 = dm.BeginInvoke(“calling delegate (2)”, null, null);

            IAsyncResult result3 = dm.BeginInvoke(“calling delegate (3)”, null, null);

            IAsyncResult result4 = dm.BeginInvoke(“calling delegate (4)”, null, null);

            IAsyncResult result5 = dm.BeginInvoke(“calling delegate (5)”, null, null);

            IAsyncResult result6 = dm.BeginInvoke(“calling delegate (6)”, null, null);

 

            /*

             * EndInvoke is synchronous we force to wait for the asynchronous results.

             */

            string r1 = dm.EndInvoke(result1);

            string r2 = dm.EndInvoke(result2);

            string r3 = dm.EndInvoke(result3);

            string r4 = dm.EndInvoke(result4);

            string r5 = dm.EndInvoke(result5);

            string r6 = dm.EndInvoke(result6);

 

            sw.Stop();

            Console.WriteLine(“All asynchronous  work was done in: {0}”,

                sw.ElapsedMilliseconds);

        }              

 

        /// <summary>

        /// Method called by our delegate

        /// Will wait for a random time (between 1 and 10000 milliseconds).

        /// </summary>

        /// <param name=”txt”>Any string are okay.</param>

        /// <returns>A string confirming the end of the process.</returns>

        static string DelegateMethod(string txt)

        {

            // Wait 5 seconds.

            Thread.Sleep(5000);

 

            // Work is finished

            Console.WriteLine(txt + ” \n> Thread ID is: {0}”,

                Thread.CurrentThread.ManagedThreadId.ToString());

            return “>> “ + txt + ” Done !”;

        }

    }

}

Delegate can also be used to call method from different classes. I let you check at the documentation on Msdn.