Galin Iliev's blog

Software Architecture & Development

"Software is Hard"

" main conclusion after spending ten years of my life on the TeX project is that software is hard. It's harder than anything else I've ever had to do."
Donald Knuth (read more)

It is not big, hot news right?! :)  I knew it is not just me:)

But here is one: If you think that software is very different than other engineering areas you're wrong! You think that software is very different because it is hard to estimate?! well... keep reading.

The most massive cost overrun in history: Boston Big Dig highway was initially estimated at $5.8 billion.

"Eventual cost overruns were so high that the chairman of the Massachusetts Turnpike Authority, James Kerasiotes, was fired in 2000. His replacement had to commit to an $8.55 billion cap on federal contributions. Total expenses eventually passed $15 billion. Interest brought this cost to $21.93 billion."
Source: Wikipedia

How Visual Studio & C# are tested

Lately Microsoft put a lot effort in testing and this combined with the whole process & dogfooding create better products. Even better they do not hide it but are generous and share details with us. Recently a new test center was announced.

The Microsoft Tester Center showcases the test discipline as an integral part of the application lifecycle, describes test roles and responsibilities, and promotes the test investments required to deliver high-quality software.


Kirill Osenkov - SDET @ C# team shares some facts about his job:

    • We develop all of our test code using most recent builds of Visual Studio "10" and C# 4.0.
    • We do almost no manual testing - almost all of our tests are automated, which means they can run on a lab machine unattended.
    • We run our tests on a variety of operating systems, languages and VS SKUs (e.g. Visual C# Express 2008 on Japanese Vista or VSTS on Windows Server 2008 with Visual Studio 2005 already installed side-by-side).
    • The Visual Studio Managed Languages Team has about 30000 functional C# and VB tests which run overnight for about 12 hours on 5 to 10 lab machines (paralleled).
    • C# tests are written in C#, VB tests are written in VB, F# tests are written in F#.
    • We have a lot of automated UI tests - where mouse moves automatically and keyboard "types" on its own - its fun to sit and watch a test creating a C# project, opening files, typing, using refactorings, navigating, etc.
    • We prefer testing on the component level, bypassing the UI.
    • Our developers write unit-tests, while we concentrate on the functional testing and end-to-end scenarios.
    • We reach more than 70% code coverage with our tests - this is a required minimum for our team.
    • We use TFS (Team Foundation Server) for source control and work item tracking.
    • Many of our tests use a new data-driven test framework where our test scripts are written in XML and are interpreted by a script-like engine.
    • Most of Visual Studio tests are out-of-process - our tests attach to a Visual Studio process and control it using Remoting.
    • We have a "bug-bash" day about once a month where the entire team just uses Visual Studio and logs bugs.
    • We also have AppWeeks, where we form groups and build applications using our product.

ASP.NET Configuration @

I came across an article which covers some details of how ASP.NET web sites hosted by Microsoft are configured:

Key things are:

  1. Set the Compilation Switch Appropriately
  2. Use Medium Trust in ASP.NET 2.0
  3. Restrict Download of Specified File Types
  4. Be Careful When Adding Assembly References
  5. Remove Manually Set MaxConnection Values
  6. Beware of Unhandled Exceptions
  7. Ensure Proper Proxy Server Configuration
  8. Do Not Display Custom Errors to Everyone
  9. Know When to Enable Tracing
  10. Disable Session State Web Farms

Read full article for detailed explanations.

MS SQL Server 2008 Beta Exams - Open Invitation

It's been a long time since I went on MCP exam. I've been pretty busy these days but now is time to update my certification. Let's start with MS SQL Server 2008 exams. The best thing is these exams on beta stage now so this is a chance to be certified one idea before official release (or at least when the exams are released).

Gerry O'Brien posted an open invitation for two MS SQL beta exams that are extended to July 31, 2008 so hurry up.

The exams are:

NB: You need promo codes in order to register for these exams. These codes can be found on Gerry's blog post.

P.S. Note that you won't get exams results on exam completion as the criteria /scoring/ is not clear :). Setting scores is one of the goals of beta exams. Results will be announced in about 2 months from the end of beta period or around  exam release date.

Good luck!

LINQ to SQL, Web.config and Connection Strings

I had some interesting adventures and in one of them I had to figure out the connection string key for LINQ to SQL DataContext class. I found this interesting blog post by Rick Strahl.

In short he describes that LINQ to SQL designer uses different approaches for web site project and class library one. Here is like the website project designer file is:

public DataClassesDataContext() :
        base(global::System.Configuration.ConfigurationManager.ConnectionStrings["TimeTrackerConnectionString"].ConnectionString, mappingSource)

while the class library one is:

public TimeTrakkerContext() :
 base(global::TimeTracker.Properties.Settings.Default.TimeTrackerConnectionString, mappingSource)

and you should overwrite it by adding connection string in web.config with name TimeTracker.Properties.Settings.TimeTrackerConnectionString like this

<?xml version="1.0" encoding="utf-8" ?>
        <add name="TimeTracker.Properties.Settings.TimeTrackerConnectionString"
            connectionString="Data Source=.;Initial Catalog=TimeTracker;Integrated Security=True"
            providerName="System.Data.SqlClient" />

Hmm it works with me too but I remember I had one record in my web.config like this TimeTracker.Properties.Settings.Default.TimeTrackerConnectionString and it worked till I made some change. Go find...

How To - Run a (huge) software company

Software business is quite different than other businesses. Mainly this is because in software there are very few routines that can be set as standardized actions, write action plans for them or so on. Let's take retail business - although it has it's own specifics in major part the manager can define in what threshold of goods availability make order to suppliers, or when to put some goods on sale and so on..

In software is different. While in others micromanagement (although bad in general) can be applied in software is impossible.

This is why we have so many methodologies: Waterfall model, Spiral model, Extreme programming and so on...

But where is the secret to success? There is no single answer to this question. But Joel Spolsky shared his experience working with BillG - more especially having him making a design review...

Bill Gates was amazingly technical, and he knew more about the details of his company's software than most of the people who worked on those details day in and day out. He understood Variants and COM objects and IDispatch and why Automation is different than vtables -- and why this might lead to dual interfaces. He worried about date and time functions. He didn't meddle in software if he trusted the people who were working on it, but you couldn't bullshit him for a minute because he was a programmer. A real, actual programmer.

and more

Bill doesn't really want to review your spec, he just wants to make sure you've got it under control. His standard M.O. is to ask harder and harder questions until you admit that you don't know, and then he can yell at you for being unprepared. Nobody was really sure what happens if you answer the hardest question he can come up with because it's never happened before.

Read the whole story (here too) and you will learn some interesting things as how Microsoft made such great product as Excel, how deeply the management should be involved in the details; What is F-counter and how it is related to design reviews :).

VS2008 seminars in New Horizons Bulgaria

Yesterday was last seminar from VS2008 series held in the New Horizons Bulgaria office with Microsoft Bulgaria support.

The seminars was very interesting (not only from my perspective of trainer) but also from audience perspective we see in their feedback. During high demand I am publishing presentations and demo scripts where available. It is always good to write code in live (although not very easy - try it ;) ) and this is why I cannot provide working demos - I have only my own cheat lists which I use in cse I am stuck somewhere.

Deep Dive in LINQ - Here I talked about new features in C# in details and how they are build internally(also described in my Introduction in LINQ and C# 3.0 (In Bulgarian) ). Also I covered LINQ to SQL, LINQ to XML.  In demos we took a look at C# syntax sugar, new ways to work with XML as well as some problems stated in Project Euler and solved with C# 3.0. Slides + Demo scripts (PPTX+DOCX - 1.22MB)

Develop Dynamic Web Sites with ASP.NET 3.5 - This session was focused on web development. Here I show new controls to work with LINQ to SQL data source declaratively. We took a look at ASP.NET Extensions (aka Futures): ASP.NET MVC, ASP.NET Dynamic Data, ASP.NET AJAX Integration, ADO.NET Data Services. All features was shown in code except ADO.NET Data Services. For ASP.NET AJAX was shown how to control Browser's Back Button from both server-side and client-side. Slides+Demo Scripts (PPTX+DOCX - 3.23 MB).

Overview of WCF, WF, WPF - Although these technologies are not new there is still some improvements in .NET 3.5. These components are very useful but their adoption is not very fast. We talked about the architectural decisions and challenges behind them. The demos show how to work with WCF in VS2008, How to create REST Service and how to expose JSON as result. WF demos show how to create simple sequential workflow. WPF demo presented project structure, generated code, XAML (of course) and WPF data binding basics. Slides+Demo Scripts (PPTX+DOCS - 10.8 MB).

Hope you'll find it useful.
As always any comments and feedback are very welcome.

Master - Jedi Master or Microsoft Certified Master

I've just read a blog post pointed to new Microsoft Certified Master program. It seems that MCA is too high and to generalized but MCPD, MCIT Pro are not enough high...

Here are the tracks so far:
  • Microsoft Certified Master: Exchange Server 2007
  • Microsoft Certified Master: SQL Server 2008
  • Microsoft Certified Master: Windows Server 2008
  • Microsoft Certified Master: Office Communications Server 2007
  • Microsoft Certified Master: Office SharePoint Server 2007
Where is the dev one?

Visual Studio 2008 and .NET Framework 3.5 Service Pack 1 Beta

There is no doubt that VS 2008 and .NET 3.5  totally rocks! ScottGu's division keeps pushing these products and constantly improving developer's productivity and shortening development cycle.

This time MS is preparing to release .NET 3.5 SP1 and VS 2008 SP1 releases.

In short here are improvements:

Improvements for Client Development
  • ASP.NET Data Scaffolding Support (ASP.NET Dynamic Data)
  • SP.NET Routing Engine (System.Web.Routing)
  • ASP.NET AJAX Back/Forward Button History Support
  • ASP.NET AJAX Script Combining Support - Omar Al Zabir wrote an extensive article about this approach.
  • Visual Studio 2008 Performance Improvements HTML Designer and HTML Source Editor
  • Visual Studio 2008 JavaScript Script Formatting and Code Preferences
  • Better Visual Studio Javascript Intellisense for Multiple Javascript/AJAX Frameworks - who can blame MS that force us to use their JS framework now?!
  • Visual Studio Refactoring Support for WCF Services in ASP.NET Projects
  • Visual Studio Support for Classic ASP Intellisense and Debugging - I am wondering when this technology will be declared dead :) (This is what I used in my first web apps too :))
Improvements for Client Development
  • Application Startup and Working Set Performance Improvements
  • New .NET Framework Client Profile Setup Package
  • New .NET Framework Setup Bootstrapper for Client Applications
  • ClickOnce Client Application Deployment Improvements
  • Windows Forms Controls
  • WPF Performance Improvements
  • WPF Data Improvements
  • WPF Extensible Shader Effects
  • WPF Interoperability with Direct3D
VS 2008 for WPF Improvements
  • Several performance improvements
  • Events tab support within the property browser
  • Ability to sort properties alphabetically in the property browser
  • Margin snaplines which makes form layout much quicker
  • Better designer support for TabControl, Expander, and Grid
  • Code initiated refactoring now updates your XAML (including both control declarations and event declarations in XAML)
  • Go to Definition and Find All References now support things declared in XAML
Data Development Improvements
  • SQL 2008 Support
  • ADO.NET Entity Framework and LINQ to Entities
  • ADO.NET Data Services
WCF Development Improvements
  • Significant scalability improvements (5-10x) in Web-hosted application scenarios
  • Support for using ADO.NET Entity Framework entities in WCF contracts
  • API usability improvements with DataContract Serializers, and with the UriTemplate and WCF web programming models
  • Enhanced TestClient support within VS 2008 SP1
  • New Hosting Wizard in VS 2008 SP1 for WCF Service Projects
  • Improved debugging support in partial trust scenarios
VB and C# Improvements !!!
Team Foundation Server Improvements

Pretty impressive...

Read full novel by Scott Guthrie here :)