Printer Friendly Version      Send     
Click to Rate and Give Feedback
Related Articles
This time James McCaffrey sets up a virtual environment to use for configuration testing to introduce you to software configuration testing with Microsoft Virtual Server

By Dr. James McCaffrey (September 2008)
We introduce you to the EDI functionality within BizTalk Server 2006 R2, illustrating schema creation, document mapping, EDI delivery and transmission, and exception handling.

By Mark Beckner (August 2008)
This month James McCaffrey builds a test harness for WCF applications that really puts them through the paces.

By Dr. James McCaffrey (July 2008)
In this column the author outlines some approaches to threat modeling that can be employed by development teams of any size.

By Adam Shostack (July 2008)
More ...
Articles by this Author
This month Toolbox provides help with error logging, finds an app that helps you write LINQ queries, and explores the non-technical side of development.

By Scott Mitchell (September 2008)
Serialize and Deserialize Fixed Length and Delimited Files, Scott Allen's blog, inspecting Web Pages, and more.

By Scott Mitchell (August 2008)
Host a wiki the easy way, get the screen shots you need and mark them up, and read about LINQ this month in Toolbox.

By Scott Mitchell (July 2008)
This month the Toolbox column takes a look at database logging, Joel Spolsky's blog, printing code projects, and ASP.NET reading.

By Scott Mitchell (May 2008)
See how to log Web application errors for better health monitoring, what to read if you’re thinking about LINQ, and which blog Scott recommends reading this month.

By Scott Mitchell (April 2008)
This month, a better design-time experience for Web apps, Scott Guthrie's blog, extending Extend Lutz Roeder's Reflector, and more.

By Scott Mitchell (March 2008)
This month, more of the tools you need to get your job done.

By Scott Mitchell (December 2007)
This time: Windows Forms grids, professional-looking date textboxes, file merging, and more.

By Scott Mitchell (November 2007)
More ...
Popular Articles
Here we explain how the new hierarchyID data type in SQL Server 2008 helps solve some of the problems in modeling and querying hierarchical information.

By Kent Tegels (September 2008)
Here the author answers questions regarding the Entity Framework and provides an understanding of how and why it was developed.

By Elisa Flasko (July 2008)
Systems that handle failure without losing data are elusive. Learn how to achieve systems that are both scalable and robust.

By Udi Dahan (July 2008)
Here the author uses Document Information Panels in the Microsoft 2007 Office system to manipulate metadata from Office docs for better discovery and management.

By Ashish Ghoda (April 2008)
More ...
Read the Blog
SQL Server 2008 supports a new data type, HierarchyID, that helps solve some of the problems in modeling and querying hier­archical information. In the September 2008 issue of MSDN Magazine, Kent Tegels introduces you to the ...
Read more!
Many people using SharePoint technologies don't realize that there is auditing support built directly into the Windows SharePoint Services (WSS) 3.0 platform. In the September 2008 issue of MSDN Magazine, Ted Pattison walks you through a ...
Read more!
The September 2008 issue of MSDN Magazine is now available online. Here's what's in the issue: Hierarchy ID: Model ...
Read more!
Silverlight 2 features a rich and robust control model that is the basis for the controls included in the platform and for third-party control packages. You can also use this control model to build controls of your own. In the August 2008 issue of MSDN Magazine, Jeff Prosise describes how to ...
Read more!
In the August 2008 issue of MSDN Magazine, Matt Milner covers several topics regarding development with Windows Workflow Foundation, some that are intended to address specific reader questions, such as how to safely share a persistence database ...
Read more!
LINQ is a powerful tool enabling quick filtering data based on a standard query language. It can tear through a structured set of data using a simple and straightforward syntax. In the August 2008 issue of MSDN Magazine, Jared Parsons demonstrates a ...
Read more!
More ...
Toolbox
Cross Browser Testing, Mock Objects, and Raymond Chen
Scott Mitchell


Better Browser Compatibility Testing
When Web developers sleep at night they dream that all Web browsers follow HTML standards to the letter. They imagine a world where every Web surfer has the same monitor resolution, color depth, and font size. Unfortunately, reality could not be more different. During waking hours, Web developers must design their Web applications to function properly in a seemingly infinite number of configurations.
Creating a thorough Web testing environment can be tedious and time consuming, requiring installation of several different browsers, versions, and operating systems. Remote Web-based testing environments take this burden off the developer.
One such service is Browsershots. After specifying a URL, Browsershots takes and displays screenshots using the selected browser, version, and operating system combinations. There are 53 different combinations available, plus you can specify client settings such as screen size, color depth, and JavaScript support. The Browsershots service is free, but there can be wait times ranging from less than a minute to half an hour or more, depending on the number of requests being processed. For $15 per month, you can sign up for priority processing, which shuttles your requests to the front of the queue.
While screenshots are useful for seeing how a Web site looks in a specific browser, it does not reveal how the site behaves as the user interacts with it. To perform this type of testing, use BrowserCam. BrowserCam offers screenshots like Browsershots, but also includes remote access to a variety of operating systems and browsers. This allows you to log into a machine, configure its settings, and interact with your Web site.
Price: Browsershots (free); BrowserCam ($89.95/month for Premium).
Microsoft.com in Browsershots (Click the image for a larger view)

Blogs of Note
Have you ever wondered why it is that you have to click the Start button to shut down your computer? Or how about why the Windows® operating system debugger is called "Dr. Watson?" Do you know what computer game's inoperability issues threatened to delay the Windows XP SP2 beta release? And does anybody know why the registry is called a "hive?" Raymond Chen knows.
Raymond joined Microsoft in 1992 as a software engineer for Windows 95, and he's a virtual repository of historical Windows information. In his blog, The Old New Thing, he answers these questions and tackles lots of other Windows legacies. Raymond was there when many of the Windows design decisions were made, so he has first-hand knowledge of the thinking behind them. His insider knowledge and dry wit make Raymond's blog an entertaining and educational read.
Oh, and by the way: the Windows registry is called a "hive" because one of the Windows NT® developers hated bees, and the joke was on him. But the really important decisions, however, were made with one goal in mind: to ensure backward compatibility. Raymond does a great job of highlighting the intense effort that has gone into backward compatibility to ensure that your old 16-bit Visual Basic® application or your favorite MS-DOS® game still works as expected in the more modern versions of Windows.
In addition to his blog entries on the history of Windows, Raymond writes the popular Windows Confidential column for TechNet Magazine (.com) and he regularly posts an assortment of tips and tricks for Windows programmers.
Raymond Chen’s Blog: The Old New Thing (Click the image for a larger view)

Unit Testing with Mocks
Good unit tests are terse, execute quickly, and are independent of one another. When testing any functionality that has external dependencies, such as databases, Web services, or configuration files, extra steps must be taken to achieve these goals. One option is to record the state of the external dependency prior to executing each unit test, then restore that state after each test completes. Such excessive setup and teardown tasks can dramatically slow the execution of unit tests and shift the focus from writing unit tests to managing the state of external dependencies.
An alternative option is to simulate calls to the external dependencies using mock objects. During a unit test, the mock object replaces the actual logic used to access the external dependency. Because the code being tested works with the mock object instead of the actual external dependency, there's no need for complicated setup and teardown logic. What's more, mocked objects allow the interactions between your code and the external dependency to be tested explicitly.
There are several open-source and commercial mocking frameworks with varying syntax requirements for mocking objects. Some frameworks use hardcoded strings for specifying the objects to be mocked and the functionality to be simulated. Others use strongly typed objects, which help identify errors at compile time rather than run time.
Typemock Isolator (version 4.2) is a mocking framework that offers you both approaches. Regardless of which approach you decide to choose, the semantics of using mock objects in your unit tests are the same: you begin by defining the mock object, then specify how the tested code will interact with it, execute the code, and then verify that the results are in line with your expectations.
Typemock distinguishes itself from many other mocking frameworks with its tools and integration support. It can be difficult to debug unit tests that use mocked objects because it's not always clear when the mocked object is being used in place of the actual external dependency.
The Trace Utility helps to resolve that difficulty by identifying how the mocked objects are being used. It records and displays the mocked types and all of the calls made to them during the execution of the unit tests. When it's debugging unit tests, Typemock reveals what's being mocked by outlining the mocked members in the IDE. Additionally, Typemock also integrates into the Visual Studio® shell and help systems and includes support for automating your unit tests with NAnt and MSBuild.
Typemock supports the Microsoft® .NET Framework versions 1.1 and later, and it offers a free Community Edition, along with the more feature-rich Professional and Enterprise editions.
Price: Free Community Edition; $449 for Enterprise Edition.
Typemock Trace Utility (Click the image for a larger view)

The Bookshelf
Since the .NET Framework 2.0, subsequent versions have added new features while keeping the core functionality in place. This poses a dilemma for authors writing books on post-2.0 versions of the .NET Framework: do you focus on just the new features or do you create a book that covers the new features plus the stuff that's been around since version 2.0?
At nearly 1,500 pages, it's eminently clear that Matthew MacDonald and Mario Szpuszta, coauthors of Pro ASP.NET 3.5 in C# 2008 (Apress, 2007), chose the latter. The book's 33 chapters cover it all, from creating the simplest Web Forms to using cutting- edge features like AJAX and Silverlight™.
The book begins with an overview of ASP.NET fundamentals such as Web Forms, Web controls, and state management, then moves on to ADO.NE T, LINQ, ASP.NET AJAX, Silverlight, and more. The authors discuss virtually all the features in ASP.NET, but focuses on those most commonly used.
If you are an intermediate to advanced developer with past Web development experience and are interested in learning ASP.NET 3.5, pick up a copy of Pro ASP.NET 3.5 in C# 2008.
Price: $59.99.
(Click the image for a larger view)

Send your questions and comments for Scott to toolsmm@microsoft.com.

Scott Mitchell, author of numerous books and founder of 4GuysFromRolla.com, is an MVP who has been working with Microsoft Web technologies since 1998. Scott is an independent consultant, trainer, and writer. Reach him at Mitchell@4guysfromrolla.com or via his blog at ScottOnWriting.NET.

© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.
Page view tracker