RSS 2.0 Feed

Monday, October 22, 2007

最近不断有猎头联系我,问我有没有兴趣看看其他的机会,其中包括AutoDesk,Morgan Stanley(软件研发部门),等等。职位都是QA Lead/Manager一类的。不是没有考虑过去微软外面看看。自从2004年秋天离开上海去北京的工程院开始正式作SDE/T(以及现在的测试主管)至今,已经三年了。这三年里面,一直是埋头做公司里面的产品,埋头做自己的事情,埋头学习,从我所在组积累的方法和经验里学习,从接触到的其他组学习。这三年里,再也没有去关心过微软以外的其他地方是怎么做软件的。

2004年秋天之前,我在工作中一直接触到国内各种各样的软件公司:2002年冬天的软件开发管理大会,2003年和全球技术中心的同事在各个软件园讲软件项目管理和软件测试,以及自己的编写培训材料,2004年上半年和微软中国的同事一起配合支持北方区的ISV(独立软件供应商)合作伙伴。那段时间里面,一直感受到微软内和微软外之间的碰撞。当时我总结了在各种对外培训、投标、会议等中收到听到的问题,应该说是当时国内做软件的人的普遍问题:

  1. 市场前景与产品功能
    • 如何进行市场预测和用户需求调查
    • 如何平衡市场前景和产品功能
    • 如何得出产品的Feature List
  2. 开发流程和团队
    • 如何在资源不足的中小企业中实施开发流程?如何裁剪?做项目时间紧,不能跟着整套流程做,有什么办法可以解决?微软的经验有什么精简的实现方法?
    • 对用户订制的软件应用系统的开发管理。
    • 怎么解决人员流动带来的问题,怎么在架构、设计中加入人员流动风险控制?如何保证极少数核心技术人员的流失或意外事件不给公司造成严重的损失?关键技术人员以离职要求涨工资怎么办?国营软件企业内无法突破工资与奖励的制度瓶颈怎么办?
    • 如何形成企业内知识共享环境?如何积累历次项目的经验?微软的“师徒关系”在团队管理中的应用。
    • 十几年以来,微软的开发流程是怎么一步步进化的?微软组织结构是如何一步步从小到大进化的?微软在软件开发管理方面从失败中获得的经验?
    • 有哪些典型的错误开发方式,并提出可行的解决方案及办法
    • 微软开发流程与CMM的区别?
    • 怎么做变更管理?开发团队管理组织中的决策模型和流程?一个项目被取消的原因和评判标准?
  3. 开发
    • 开发团队如何划分任务?如何预估和控制进度?
    • 开发团队的管理,如何科学的评估开发人员的级别、绩效?统计哪些指标?
    • 是否一定要Daily Build?
    • 代码库的管理,如何、何时上锁,权限如何控制?
    • 开发后期发现很多或者还有很多Bug怎么办?
    • 可扩展性应用程序的设计方法,思路。
  4. 测试
    • 测试应从哪些方面考虑?如何选择测试方法与工具(自动化测试/压力测试/性能测试等)?如何进行具体的测试,比如CPU性能?性能测试?有没有测试的实例?
    • Test Lead怎么考核?Tester的考核与量化管理,数据如何采集?如何培养测试经理?测试经理的培训?
    • 如何提高Test Team的地位?
    • QA部门何时、何种形式、如何参与到整个项目中?
    • 希望提供Bug管理工具和测试工具。
  5. 文档
    • 微软如何做需求管理?微软做不做、怎么做用户需求文档?软件项目(而非产品)开发初期怎么做需求文档?
    • 整个项目一共有哪些文档?如何管理文档?文档何时、何种原因可以修改?文档修改后怎么通知所有人?
    • “需求说明”、“概要设计”、“详细设计”与“Feature List”、“Function Spec”、“Implementation Spec”的区别?其中要定义哪些内容?Function Spec和Implementation Spec要详细到什么程度?希望结合实例讲解文档。
  6. PM
    • PM做不做产品设计?PM是否写代码?PM是否能同时参加多个项目,如果是,有什么成功经验?
    • PM是否、如何担当产品市场分析、决定产品的技术实现、决定Developer使用的工具和技术路线?
    • 产品达不到客户需求怎么办?PM夹在客户和Developer之间怎么处理两方面的要求?
    • 如何培养一个PM?如何考核PM的工作业绩?
  7. 其他
    • 希望了解实际的开发管理案例,以及与其他公司的案例比较;详细的行动指南、Check List等工具。
    • 想获得软件企业的管理软件和工具软件。
    • 希望获得面向不同发展阶段、不同规模大小的企业的更有针对性的培训。

我是带着这些问题去北京的工程院的。当时我给我的经理的邮件是这么写的:“过去一年多我做了很多开发流程、测试、配置管理等的培训,我很热爱培训工作,能够给中国的软件业者解决困惑他们很久的问题让我觉得非常有意义、有价值、有成就感。培训过程中感觉training skill已经不再是做好培训的瓶颈,而是觉得知识不够用。例如,培训中有一些学员很关心的问题(也是很关键的问题)我自己也找不到很好的答案,例如怎么做单元测试、自动化测试、怎么写好Implementation Spec等。我很想能够再多一些实际的锻炼,在开发、项目中寻找这些问题的答案”。

当时我也把这些问题转发给了邹欣。我不敢说这个问题列表对邹欣写《移山之道》有很大帮助,但我看到《移山之道》已经回答了这里面的很多问题。

我不知道今天的中国软件行业,带头的公司里,是不是已经都建立了必要的基础架构,例如:缺陷管理,代码库,文档库,测试自动化,等等。2003年,我接触到的还有很多公司在用Word/Excel填写“缺陷单”,还有很多公司没有做daily build,还有很多做测试的人还停留在把黑盒白盒挂在嘴上的阶段。如果有机会的话,我很想看看现在国内软件企业的项目管理水平是什么样子的。是不是还有很多人在争论到底是CMM好还是RUP好?

我也很想看看其他的跨国公司是怎么做软件的,比如IBM、GOOGLE、SAP、Adobe、etc。我很想知道EA等是怎么测试他们的游戏的:也用大量的自动化么?怎么自动化?怎么自动化的测试“帝国时代”或Call of Duty 3?Adobe是怎么测试Photoshop的?还有Google呢?

今年八月份的时候看到这么一封内部邮件:

I worked with a Test Architect here at MS a few years ago who is very highly regarded in the software testing industry … very much top of his game.  He left MS about 2.5 years ago for Google to help them create a testing discipline and launch quality assurance practices.  He just got in touch with me this morning and has left Google (Looking for another job in the area, but not necessarily MS.)  I asked him why he left Google, and he said: “The short version of the Google story is that they don't have the people, the background, or the infrastructure for advanced testing, so my work didn't fare well there.”

既然一个如此very highly regarded的测试架构师都对Google的测试摇头了,我也不必去淌这趟浑水了。最合适我的,还是继续呆在微软做我的测试:既然当时我选择做测试的原因是我想要回答我自己心中关于测试的那些问题,既然微软这些年所积累下来的测试方法、经验、教训和内部工具是如此的丰富,我又有什么理由要自己到一个不成熟的环境中去重新探索呢?

正如那个Test Architect所评论的,我也相信,虽然Google已经是一个商业上的成功,但就整体软件工程水平来说,微软仍然代表了这个星球上的最高水平,虽然微软自己的方法论和实践不如学院派的理论那么高妙,虽然微软操作系统的名声一直被苹果和Linux压一头,虽然大家都喜欢说微软要用三个版本才能完善一个产品,虽然大家都嘲笑Office里80%的用户只用其20%的功能,虽然微软没有写过航天飞机的控制系统,虽然微软的数据库仍然不能取代IBM的Mainframe在银行里的位置,虽然微软的软件总是延期发布。

微软在软件工程上的经验不是一本书能讲的完的,也不是几本书能讲得完的。《移山之道》是一个缩影,是一个很好的入门。看《移山之道》的同时,还可以再看《软件开发的科学与艺术》、《软件开发项目管理》,以及《微软项目:求生法则》(一套三本,红绿蓝)。此外,Steve McConnell的所有著作都值得看。虽然Steve McConnell并不完全是一个微软的人,但微软的实践与他的书里的阐述非常有内在的一致性。举例来说,我自己最近一年以来就从他的《Software Estimation》中受益极多极多。

但是,光看这些书是绝对不够的。这些都只是paper knowledge,即便这些书本身来自于作者们多年的摸爬滚打。实践,只有实践才通向领悟。实践,反思,交流,尝试,再实践,然后才能真正达到know-how,否则,只会流于“形似而神不似”(《移山之道》,第319页)。

posted @ | Feedback (24) | Filed Under [ Software Engineering ]

Monday, August 13, 2007

这是我前阵子自己遇到的一个问题。当时有一个表,表大致是长这样的:

GroupID     SectionID   CreatedTime               TextValue 
----------- ----------- ------------------------ -----------
1           1           2007-07-10 00:00:00.000   1-1-07-10
1           1           2007-07-11 00:00:00.000   1-1-07/11
1           2           2007-07-05 00:00:00.000   1-2-07/05
1           2           2007-07-11 00:00:00.000   1-2-07-11
1           3           2007-07-13 00:00:00.000   1-3-07-13
2           1           2007-07-10 00:00:00.000   2-1-07-10
2           1           2007-07-11 00:00:00.000   2-1-07-11
2           4           2007-07-09 00:00:00.000   2-4-07-09

其中GroupID, SectionID和CreatedTime是联合主键。当时希望写一个简单的查询,不用CURSOR、不用临时表和临时表变量,希望能得到这样的查询结果:

GroupID     SectionID   CreatedTime               TextValue 
----------- ----------- -------------------------- ---------
2           4           2007-07-09 00:00:00.000   2-4-07-09
2           1           2007-07-11 00:00:00.000   2-1-07-11
1           3           2007-07-13 00:00:00.000   1-3-07-13
1           2           2007-07-11 00:00:00.000   1-2-07-11
1           1           2007-07-11 00:00:00.000   1-1-07/11

也就是说,对于每一种(GroupID, SectionID)的组合,取出最后插入的那行。当时一下子还真没想出来怎么写。后来才找到答案的。现在这个问题是我最近使用最多的面试题。

答案如下:

SELECT *
FROM TableInterview AS t1
Where EXISTS
(
   SELECT MAX(CreatedTime)
   FROM TableInterview AS t2
   GROUP BY GroupId, SectionId
   HAVING GroupId = t1.GroupId 
	and SectionId = t1.SectionId 
	and max(CreatedTime) = t1.CreatedTime
)

好像也不算很难写的样子。

posted @ | Feedback (42) | Filed Under [ Dot NET ]

Wednesday, April 18, 2007

This is a bug.

On Windows 2003, World Wide Web Publishing Service depends on HTTP SSL and IIS Admin Service, which is to say, if HTTP SSL is stopped, World Wide Web Publishing Service cannot be running. However, recently, for multiple times, on my test machine, after running "iisreset", I see that World Wide Web Publishing Service is "Started" while HTTP SSL is "Stopped".

The event log tells us the answer:

From 12:58:19AM ("The HTTP SSL service was successfully sent a stop control") to 12:58:21AM ("The HTTP SSL service entered the stopped state"), the status of HTTP SSL service is "Stopping". Windows was kind of cheated. Windows thought that it's Ok to start FTP and WWW services as long as HTTP SSL is not "Stopped". The code might be like this:

    if ( none of the depended service is "Stopped")
        start the service;
    else
        raise error;

The code should have been like this:

    if ( every depended service is "Started")
        start the service;
    else
        raise error;

This issue could be repro-ed on busy machines: do iisreset frequently and at meanwhile high volumn HTTP/S requests keep coming. I heard that this issue was found way back to 2004 or earlier. Until it's fixed someday, the workaround is to force start HTTP SSL service after every iisreset.

posted @ | Feedback (4) | Filed Under [ Dot NET ]

Friday, April 13, 2007

Lots of people have seen the client certificate selection dialog when we use IE to browser HTTPS resources. Few people have thought about and understand why the certificate selection dialog doesn't include all certificate in personal store. The fact is: IE has received an acceptable issuer list from the web server side. IE will show nothing in the certificate selection dialog if there is no certificate which has "Client Authentication" usage and issued by any issuer (aka CA, root or intermediate CA) on that acceptable issuer list.

Knowing the acceptable issuer list of a certain web server is one of the key factors to troubleshotting HTTPS connectivity issues. We can tracing the acceptable issuers list by the C# code as below (sorry for long paragraph, joycode use to fancy code collapse feature which seems gone) :

 

using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using System.Net.Security;
using System.Security.Authentication;
using System.Text;
using System.Security.Cryptography.X509Certificates;
using System.IO;

namespace ListServerTrustedCAs
{
   class Program
   {
      static void Main(string[] args)
      {
         if (args.Length != 1)
         {
            Console.WriteLine("\r\nUsage: ListServerTrustedCAs <servername>\r\n");
            return;
         }

         string serverName = args[0];
         TcpClient client = new TcpClient(serverName, 443);
         Console.WriteLine("Client connected.");
         SslStream sslStream = new SslStream(
            client.GetStream(),
            false,
            new RemoteCertificateValidationCallback(ValidateServerCertificate),
            new LocalCertificateSelectionCallback(SelectLocalCertificate)
            );

         try
         {
            sslStream.AuthenticateAsClient(serverName);
         }
         catch (AuthenticationException e)
         {
            Console.WriteLine("Exception: {0}", e.ToString());
            client.Close();
            return;
         }
         client.Close();
         Console.WriteLine("Client closed.");
      }

      public static bool ValidateServerCertificate(
           object sender,
           X509Certificate certificate,
           X509Chain chain,
           SslPolicyErrors sslPolicyErrors)
      {
         Console.WriteLine("ValidateServerCertificate. \r\n   Server-side cert: " + certificate.Subject);
         return true; // do nothing.
      }

      public static X509Certificate SelectLocalCertificate(
         object sender,
         string targetHost,
         X509CertificateCollection localCertificates,
         X509Certificate remoteCertificate,
         string[] acceptableIssuers)
      {
         if (acceptableIssuers != null)
         {
            foreach (string issuer in acceptableIssuers)
            {
               Console.WriteLine("<" + issuer + ">");
            }
         }
         return null;
      }
   }
}

The code above can also print out the IIS's Server Certificate.

The last but most important thing is: if your web server is IIS, you get to turn on SSLAlwaysNegoClientCert in IIS. Otherwise, the code above gets empty acceptable issuer list. The command line to turn on SSLAlwaysNegoClientCert is:

  Cscript.exe adsutil.vbs SET w3svc/SSLAlwaysNegoClientCert “true”

But the trick thing is: even without SSLAlwaysNegoClientCert turned on, IE still can get IIS's trusted CA list (so that IE shows eligible certificates in the selection dialog). I don't know how IE talks to IIS and force IIS to send back trusted CA list. Could be a undocumented flag in the hello message?

Reference (Must-Read!):
RFC 2246 "The TLS Protocol Version 1.0", section 7.4.4 "Certificate request".

 

posted @ | Feedback (3) | Filed Under [ Dot NET ]

Monday, March 05, 2007

很久以来,Microsoft的email alias只支持最多八个字母。例如,姓名叫作Eric Zheng的员工,邮件帐号只能被缩成ericzhen(即ericzhen@microsoft.com);Rebecca Christianson的邮件帐号被缩写成rebecchr;Drew DeBruyne的邮件帐号是adebruyn;等等。这显然是一件很不方便的事情,印在名片上也不容易记、不容易读。所以,大概一两年前,我们的IT部门终于可以让每个人选择一个长邮件名,效果等同原来最多八个字母的短邮件名。例如,Eric Zheng就可以用zheng.ziying@microsoft.com

我也不理解为什么我们的邮件系统只支持八个字母的alias。或者换句话说,我们的AD为什么只支持最多八个字母的用户名。好在26^8= 208827064576,去掉那些没有可能和实际姓名联系起来的组合,也有足够多的选择可以支撑到Microsoft倒闭。在这些组合里面,有四个被我消耗掉了:v-zyzhe(我做实习生时候的帐号),ericzhen(我的第一个正式员工帐号),t-ericzh(关于这个帐号的由来不想再提),ericzhe(我现在的帐号)。

最长八个字母的限制产生了很多有趣的邮件名,例如:

Kip Ng,PREMIER FIELD ENGINEER,king@Microsoft.com
Van Vanslette,WRITER,java@microsoft.com
Mario Matiev,ex-Microsoftie,was mama@microsoft.com
Window Snyder,ex-Microsoftie,was windows@microsoft.com。此人后来离开微软去Mozilla当security spokesperson了。
Chris Treadaway,SENIOR PRODUCT MANAGER,christ@microsoft.com。曾经有一次,他收到一封邮件,asking if the alias belonged to BillG。

从姓名里抽一些字母出来做邮件帐号,并非越短越好。Ben Smith,Xbox Live的GROUP PROGRAM MANAGER,他现在的帐号是bensmi,他六年前刚刚进Microsoft的时候,他想要ben@microsoft.com。但HR的人劝阻了他,因为ben@microsoft.com会招来非常多的垃圾邮件。"ben"实在是太容易被枚举出来了。而Adam Morris,ESCALATION MANAGER,他的帐号adam@microsoft.com "receives more spam in one day than many of us receive in a full year"。

posted @ | Feedback (27) | Filed Under [ Cool Stuffs ]

Friday, January 12, 2007

CNET网站今天登载了一篇题为“Microsoft loses top executive in China”的文章,作者是Ina Fried

文中写道:

    

这段话翻译成中文大概是:

    

在微软的法律文件中,微软称李开复曾建议公司尽快招募宫力,原因之一是Google可能也在接触宫力。

李开复在2005年5月6日给同事的邮件中写道:“一些间接的消息显示,他(宫力)可能已经和Google谈过关于在中国开辟一块新业务的事情。我们得动作快一点”。

根据法庭文件,第二天(5月7日),李开复写信给Eric Schmidt(Google的CEO),信中说他听说Google正在进入中国。

2005年7月,Google宣布雇佣李开复。

注:转载并翻译并不代表本人或本人所服务的公司同意或证实文中所述观点或事件。

 

posted @ | Feedback (21) | Filed Under [ Cool Stuffs ]