Alik Levin's

Clarity, Technology, and Solving Problems | 

June, 2009

  • Alik Levin's

    How To Generate Unit Test Using WCF Load Test – Quick Steps

     Alik Levin    This is quick summary of steps for creating WCF Unit Tests using WCF Load Test available for free on Codeplex. This quick summary created based on the Lab materials that ship with the tool.

    Quick Resource Box

    Summary of steps

    • Step 1. Configure message tracing in the app.config file on client side.
    • Step 2. Run WCF client to invoke the remote methods and generate trace file.
    • Step 3. Generate Unit test based on trace file.

    Step 1. Configure message tracing in the app.config file on client side.

    1. Select the Diagnostics folder.
    2. Under Message Logging click Enable Message Logging.
    3. Click Log Level and check Service messages. The other options can be unchecked.
    4. Click ServiceModelMessageLoggingListener and change the file name to be “WCFClient.svclog”.
    5. Under the Message Logging folder enable LogEntireMessage.
    6. Save the configuration file.

    Step 2. Run WCF client to invoke the remote methods and generate trace file.

    Run your WCF client. Make sure WCFClient.svclog generated. This log file will be used in the next step to generate Unit Tests

    Step 3. Generate Unit test based on trace file.

    • Create a new test project in Visual Studio.
    • Add a reference to the following assemblies:
      • System.ServiceModel
      • System.Runtime.Serialization (version
    • In the directory containing the test project create a file called SampleConfig.xml with the following contents: 
    <?xml version='1.0' encoding='utf-8' ?>
    <WcfUnitConfiguration xmlns=''
           <assembly fileName="C:\Client\bin\Debug\ConsoleClient.exe"/>
         <soapActions soapActionMode='Include'>
    • Open an SDK command prompt and change the directory to the one containing the test project.
    • Execute the following command:
      svcutil /o:proxy.cs /config:app.config http://localhost:8090/service?wsdl
    • Run the command-line tool using the following command:
      “c:\program files\wcfunit\wcfunit” CompileTimeScenario <trace file> SampleConfig.xml where the <trace file> is the path to the WCFClient.svclog file created in the previous exercise.
    • Add generated files (CompileTimeScenario.cs and CompileTimeScenario.stubs) to the test project.
    • Rename CompileTimeScenario.stubs to CompileTimeScenario.Stubs.cs.
    • Also add the proxy.cs and app.config files located in the client project folder to the test project.
    • Build the solution and a Unit Test called CompileTimeScenario should appear in the Test View.
  • Alik Levin's

    Architects UG: 16 Case Studies of ASP.NET Web Performance


    Alik Levin    Below is a slide deck for the talk I gave today on Architect UG. The presentation focused on 16 case studies of performance that is less than optimal. The session is focused on baking performance engineering into the development lifecycle.

    Each case study has a link to the detailed walkthrough and relevant resources on how to improve performance.


  • Alik Levin's

    Free Web Performance Tools From Microsoft, Google, Yahoo, And IBM

     Alik Levin    This post is a quick overview of free performance tools available from Microsoft, Yahoo, Google, and IBM. It also contains a pointers to related articles that go deeper regarding the best practices and how the tools can help in identifying compliance to the best practices.

    Quick Resource Box:

    Microsoft’s Fiddler

    Fiddler is a free web performance tool, it is not really a property of Microsoft rather a side project by Eric Lawrence, a PM with Microsoft. I used Fiddler for both security testing and now for performance. I love it a lot. Must mention it requires Net Fx 2.0 as a prerequisite so it is limited to Windows OS. Recently Eric added support to Firefox – Fiddler Hook For Firefox, so the tool is great for both IE and FF. My related posts:

    Microsoft’s VRTA

    VRTA is a free web performance tool and it stands for Visual Round Trip Analyzer created by Microsoft’s Jim Pierson and used internally for sometime. It was made available for public use during last PDC 2008. Jim has written very detailed article about the tool and how it solves performance problems - 12 Steps To Faster Web Pages With Visual Round Trip Analyzer. VRTA installs and uses under the hood free Microsoft Network Monitor (Netmon) to capture and analyze network captures.

    Yahoo’s YSlow

    YSlow is a free performance analysis tool created by Steve Souders when he was with Yahoo. Steve created another good tool called Cuzilion. YSlowl comes with extremely good set of performance guidance that can be found here - rules for high performance web pages. YSlow requires Firebug as a prerequisite, meaning it is restricted to Firefox only.

    IBM’s Page Detailer

    Page Detailer is a free web performance tool from IBM. I was not able to identify any good articles that cover it – if you share with me please, or better off publish one. It does not have any prerequisites, consider it as an advantage.

    Google’s Page Speed

    Recently I stumbled on Page Speed from Google. It reminds me a Yahoo’s YSlow lot  that makes me believe it comes from Steve Souders that works now for Google. It also requires Firebug as a prerequisite and works with FireFox only. It comes with nice guidance found here - Web Performance Best Practices. Must admit – I adore the concept of the tool although in most cases I cannot use it as I work for customers that IE is their target browser. Nevertheless the guidance is tool agnostic and I recommend bookmarking it for quick reference.

Page 1 of 2 (4 items) 12