<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Omar AL Zabir blog on ASP.NET Ajax and .NET 3.5 : ideas</title><link>http://msmvps.com/blogs/omar/archive/tags/ideas/default.aspx</link><description>Tags: ideas</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>How to convince developers and management to use automated unit test for AJAX websites</title><link>http://msmvps.com/blogs/omar/archive/2008/10/27/how-to-convince-developers-and-management-to-use-automated-unit-test-for-ajax-websites.aspx</link><pubDate>Mon, 27 Oct 2008 14:00:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1652113</guid><dc:creator>omar</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=1652113</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2008/10/27/how-to-convince-developers-and-management-to-use-automated-unit-test-for-ajax-websites.aspx#comments</comments><description>&lt;p&gt;Everyone agrees that unit testing is a good thing, we should all write unit tests. We read articles and blogs to keep us up-to-date on what’s going on in the unit test world so that we can sound cool talking to peers at lunch. But when we really sit down and try to write unit tests ourselves – “Naaah, this is waste of time, let’s ask my QA to test it; that’s much more reliable and guaranteed way to test this. What’s the point testing these functions when there are so many other functions that we should unit test first?” Had such moment yourself or with someone else? Read on.&lt;/p&gt;  &lt;p&gt;I had a conversation with our development lead Mike (using a highly generic name since my &lt;a title="Tips and Tricks to rescue overdue projects" href="http://msmvps.com/blogs/omar/archive/2008/10/20/tips-and-tricks-to-rescue-overdue-projects.aspx"&gt;last post&lt;/a&gt; caused some trouble), who runs “the show” in our engineering team. As usual there was reservation in introducing unit test to regular development schedule. Mike also had valid points about lack of powerful tools for doing unit test on AJAX websites. He also had confusion on ‘what’ and ‘how’ to unit test our code so that we aren’t just testing database failures but real user actions that executes both business and rendering logics. So, the discussion has a lot of useful information, that will help you take the right decision when you want to sell unit test to your ASP.NET and/or AJAX development team and finally to higher management so that you can buy enough time for the effort.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Friday, Jan 2007 – hallway&lt;/u&gt;&lt;strong&gt;      &lt;br /&gt;Omar&lt;/strong&gt;: Hey Mike, we need to start doing unit testing at least on our web services. We are wasting way too much time on manual QA. Since we are an AJAX shop, unit testing all our web services should give us pretty well coverage. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Sure, that sounds fun. I will do some feasibility check and see how can we chip this in into our next sprint.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Friday, Feb 2007 – washroom&lt;/u&gt;&amp;#160; &lt;br /&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Hey Mike, let’s start doing unit tests. I haven’t seen any tests last month. Can we start from this sprint?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Sure, we can surely start from this sprint. Let me find out which tool is the right one for us.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Friday, March 2007 – meeting room&lt;/u&gt;     &lt;br /&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Hey Mike, haven’t seen any unit tests in the solution so far. Let’s seriously start writing unit tests. Did you make any plan how you want to start unit testing the webservices?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Yeah, I did some digging around and found some tools. But most of them are for non-AJAX sites where you can programmatically hit a URL or programmatically do HTTP POST on a URL. You can also record button clicks and form posts from the browser. There’s &lt;a title="Introduction to Visual Studio Web Test" href="http://msdn.microsoft.com/en-us/library/ms364077.aspx"&gt;Visual Studio’s Web Test&lt;/a&gt;, which does pretty good job recording regular ASP.NET site, but poor on AJAX sites. Moreover, you need to buy Team Suite edition to get that Web Test feature. Besides, recording tests and playing them back really does not help us because all those tests contain hard coded data. We can’t repeat a particular step many times with random data, at least not using any off-the-shelf tools. We need to test things carefully and systematically using random data set and sometimes use real data from database. For example, a common scenario is loading 100 random user accounts from database and programmatically log those users into their portal and test whether the portal shows those users’ personalized data. All these need to be done from AJAX, without using any browser redirect or form post, because there’s one page that allows user to login using Ajax call and then dynamically renders the portal on the same page after successful login. The UI is rendered by Javascript, so only a real browser can render it and we have to test the output looking at the browser.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: I see, so you can’t use Visual Studio Web Test to run unit tests on a browser because it does not let you access the html that browser renders. You can only test the html that’s returned by webserver. As we are AJAX website, most of our stuffs are done by Javascripts – they call Webservice and they render the UI. Hmm, thinking how we can do this using VS. We can at least hit the webservices and see if they are returning the right JSON. This way we can pretty much test the entire webservice, business and data access layer. But it does not really replace the need&amp;#160; for manual QA since there’s a lot of rendering logic in Javascript.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Now there’s a new project called &lt;a title="Watin - browser based web test" href="http://watin.sourceforge.net/"&gt;Watin&lt;/a&gt; that seems promising. You can write C# code to instruct a browser to do stuffs like click on a button, run some javascript and then you can check what the browser rendered in its DOM and run your tests. But still, it’s in its infancy. So, there’s really no good tool for unit testing AJAX sites. Let’s stick to manual QA, which is proven to be more accurate than anything developers can come up with. We can handover a set of data to QA and ask them to enter and check the result.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: We definitely need to figure out ways to reduce our dependency on manual QA. It simply does not scale. Every sprint, we have to freeze code and then hand over to QA. They run their gigantic test scripts for a whole day. Then next day, we get bug reports to fix. If there’s severe regression bug we have to either cancel sprint or work whole night to fix it and run overnight QA to meet deployment date. For last one year, every sprint we ended up having some bug that made dev and QA work over night. We have to empower our developers with automated unit test tool so that they can run the whole regression test script automatically.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: You are talking about a very long project then. Writing so many unit tests for complete regression test is going to be more than a month long project. We have to find the right set of tool, plan what areas to unit test and how, then engage both dev and QA to work together and prepare the right tests. And then we have to keep the test suite up-to-date after every sprint to catch the new bugs and features.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Yes, this is certainly a complex project. We have to get to a stage that can empower a developer to run automated unit tests and not ask QA to test every task for regression bugs. In fact, we should have automated build that runs all unit tests and does the regression test for us automatically after every checkin. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: We have automated build and deploy. So, that’s done. We need to add automated unit test to it. Seriously, given our product size, this is absolutely impossible to engage in writing so many unit tests so that we can do the entire regression test automatically. It’s not worth the time and money. Our QA team is doing fine. They can take one day leave after deployment when they do overnight work.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Actually QA team is at the edge of quitting. They seem to have endless work load. After deployment, they have to do manual regression test on production site to ensure nothing broke on production. While they are at it, they have to participate in sprint initiation meetings and write test plans. When they are about to complete that, devs checkin stuffs and ask for regression test of different modules. Before they can finish that , we reach code freeze and they have to finish all those task level tests as well as the entire regression test. So, they end up working round-the-clock several days every sprint. They simply can’t take it anymore.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: How is it different than our life? After spending sleepless night on the deployment date, next day we have to attend 8 hours long sprint planning meeting. Then we have to immediately start working on the tasks from the next day and have to reach code-freeze within a week. Then QA comes up with so many bugs at the last moment. We have to work round-the-clock last 3 days of sprint to get those bugs fixed. Then after a nerve wrecking deployment day, we have to stay up at night to wait for QA to report any critical bug and fix it immediately on production. We are at the brink of destruction as well.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: That’s understood. The whole team is surely getting pushed to their limit. So, that’s why we urgently need automated test so that it addresses the problems of both dev and QA team. Dev will get tests done at a faster rate so that they don’t get bug reports at the very end and then work over-night to fix them. Similarly, we offload QA team’s continuous overwork by letting the system do the bulk of their test. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: This is going to kill the team for sure. We have so many product features and bug fixes to do every sprint. Now, if we ask everyone to start writing unit tests for every task they do, it’s a lot of burden. We can’t do both at the same time.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Agree. We have to cut down product features or bug fixes. We have to make room in every sprint to write unit tests.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Good luck with that. Let’s see how you convince product team.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: First let me convince you. Are you convinced that we should do it.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Not yet. I don’t really see its fruit in near future, even after two months. There’s so many features we have to do and so many customers to ship to, we just can’t do enough unit tests that will really shed off QA load. It’ll just be a distraction and delay in every sprint, heck, in every task.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Let me show you a graph which I believe is going to make an impact:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Howtowriteusefulunittest.NETAJAXwebsites_5F00_A4C6/image_5F00_2.png"&gt;&lt;img title="image" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="241" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Howtowriteusefulunittest.NETAJAXwebsites_5F00_A4C6/image_5F00_thumb.png" width="387" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So, you see the more automates test we write, the less time spent on Manual QA. That time can be spent on doing new tests or task level tests and increase quality of every new feature shipped and drastically reduce new bugs shipped to production. Thus we get less and less bugs after every successful sprint.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Ya, I get it, you don’t need to convince me for this. But I don’t see the benefit from overall gain perspective. Are we shipping better product faster over next two months? We aren’t. We are shipping less features and bug fixes by spending a lot of time on writing unit tests that has no impact on end-user. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Let me see if your assumption is correct:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Howtowriteusefulunittest.NETAJAXwebsites_5F00_A4C6/image_5F00_4.png"&gt;&lt;img title="image" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="244" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Howtowriteusefulunittest.NETAJAXwebsites_5F00_A4C6/image_5F00_thumb_5F00_1.png" width="453" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You see here, the more automated tests kick in, the more time QA can spend on new features or new bugs. I agree that the speed of testing new features/bugs decrease first one or two sprints, but then they gradually get picked up and get even better. In the beginning, there’s a big overhead of getting started with automated test. But as sprints go by, the number of unit tests to write gradually gets stable and soon it becomes proportional to new features/bugs. No more time spent on writing tests for old stuff. So, the number of unit tests you write after four sprints is exactly what needed for the new tasks you did on that sprint.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Let’s see what if we just don’t do any automated test and keep things manual. How does the graph look like?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Howtowriteusefulunittest.NETAJAXwebsites_5F00_A4C6/image_5F00_10.png"&gt;&lt;img title="image" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="277" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Howtowriteusefulunittest.NETAJAXwebsites_5F00_A4C6/image_5F00_thumb_5F00_4.png" width="423" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: The future looks quite gloomy. We will be spending so much time on regression test as we keep adding stuffs to the product that at some point QA will end up doing regression test full time. They will not spend time on new features and we will end up having a lot more new bugs slipped from QA to production due to lack of attention from QA.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: OK, how do we start?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: First step is to get the regression tests done so that we can get rid of that 24 hour long marathon QA period end of every sprint. Moreover, I see too many devs asking QA to do regression test here and there after they commit some tasks. So, QA is always doing regression tests from the beginning to the end of each sprint. They should only test new things for which automated test is not yet written and let the automated test do the existing tests. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: This will be hard to sell to management. We are going to say “Look for next one month, we will be half productive because we want to spend time automating our QA process so that from second month, we can do tests automatically and QA can have more free time.”&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: No, we say it like this, “We are going to spend 50% of our time automating QA for next oen month so that QA can spend 50% more time on testing new features. This will prevent 50% new bugs from occurring every sprint. This will give developers 50% more time to build new features after one month.” We show them this graph:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Howtowriteusefulunittest.NETAJAXwebsites_5F00_A4C6/image_5F00_12.png"&gt;&lt;img title="image" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="279" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Howtowriteusefulunittest.NETAJAXwebsites_5F00_A4C6/image_5F00_thumb_5F00_5.png" width="406" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Seems like this will sell. But for first couple of sprints, we will be so dead slow that some of us might get fired. Think about it, from management point of view, the development team has suddenly become half productive. They aren’t building only few new features and bugs are not getting fixed as fast rate. Customer are screaming, investors asking for money back. It’s going to get really dirty. Do you want to take this risk? &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: I can see that this decision is a very hard decision to take. I know what CEO will say, “We need to be double productive from tomorrow, otherwise we might as well pack our bags and go home. Tell me something that will make us double productive from tomorrow, not half productive.” But you can see what will happen after couple of months. Situation will be so bad that doing this after couple of months will be out of question. We won’t be in a position to even propose this. Now, at least we can argue and they still have the mind to listen to long term ideas. But in future, when our QA team is doing full time regression test, new buggy features going to production, ratio of new bugs increasing after every release, more customers screaming, half baked features running on the production – we might have to shut down the company to save our life. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: We should have started doing automated tests from day one.&lt;/p&gt;  &lt;p&gt;Omar: Yes, unfortunately we haven’t and the more we delay, the harder it is going to get. I am sure we will write automated tests from day one in our next project, but we have to rescue this project.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: OK, I am sold. How do we start? We surely need to unit test the business and data access layer. Do we start writing unit test for every function in DAL and Business layer?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Writing unit test for DAL seems pointless to me. Remember, we have very little time. We will get max two sprints to automate unit tests. After that, we won’t get the luxury to spend half of our time writing unit tests. We will have to go back to our feature and bug fix mode. So, let’s spend the time wisely. How about we only test the business layer function?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: So, we test functions like CreateCustomer, EditCustomer, DeleteCustomer, AddNewOrder in business layer?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Is that the final layer in business layer? Is there another high level layer that aggregates such CRUD like functions?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: For many areas, it’s like CRUD, a dumb wrapper on DAL with some minor validation and exception handling. But there are places where there are complex functions that do a lot of different DAL call. For example, UpdateCustomerBalance – that calls a lot of DAL classes to figure out customer’s current balance. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Does webservices call multiple business classes? Do they act like another level that aggregates business layer?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Yes, webservices are called mostly from user actions and they generally call multiple business layer classes to get the job done.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Where’s the caching done?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Webservice layer.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: That sounds like a good place to start unit testing. We will write small number of unit tests and still test majority of business layer and data access classes and we ensure validation, caching, exception handling code are working fine.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: But there are other tools and services that call the business layer. For example, we have a windows service running that directly calls the business layer. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Can we refactor it to call webservices instead?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: No, that’ll be like creating 10 more webservices. A lot more development effort. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: OK, let’s write unit tests for those business layer classes separately then. I suppose there will be some overlap. Some webservice call will test those business classes as well. But that’s fine. We *should be* unit testing from business layer. But we don’t have time, so we are starting from one level up. Webservices aren’t really “unit” but you have to do what you have to do. At least testing webservices will give us guarantee that we covered all user actions under unit test.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Yes, testing webservices will at least ensure user actions are tested. The background windows service is not much of our headache. Now how do we test presentation logic? We have ASP.NET pages and there’s all those Javascript rendering code.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Let’s use Watin for that. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: How to make that part of a unit test suite?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Watin integrates nicely with NUnit, mbUnit. mbUnit is pretty good. I used it before. It has more test attributes and Assert functions than NUnit.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: OK, so how do we unit test UI? A test function will click on Login link, fill up the email, password box and click “OK”. Then wait for one sec and then see if Javascript has rendered the UI correctly?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Something like that. We can discuss later exactly how we test it. But how do you test if UI is rendered correctly?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: We check from browser’s DOM for user’s data like name, email, balance etc are available in browser’s HTML.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Does that really test presentation logic? What if the data is misplaced? What if due to CSS error, it does not render correctly.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Well, there’s really no way to figure it out if things are rendered correctly. We can ask the QA guys to keep watching the UI while Watin runs the tests on the browser. You can see on the browser what Watin is doing.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: OK, that’s one way and certainly faster than QA doing the whole step. But can it be done automatically like matching browser’s screen with some screenshot?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Yeah, we need AI for that.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Seriously, can we write a simple UI capture and comparison tool? Say we take a screenshot of correct output and then clear up some areas which can vary. Then Watin runs the test, it takes the screenshot of current browser’s view and then matches with some screenshot? Here’s the idea:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Howtowriteusefulunittest.NETAJAXwebsites_5F00_A4C6/image_5F00_14.png"&gt;&lt;img title="image" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="308" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Howtowriteusefulunittest.NETAJAXwebsites_5F00_A4C6/image_5F00_thumb_5F00_6.png" width="586" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Say this is a template screenshot that we want to match with the browser. We are testing Google’s search result page to ensure the page always returns a particular result when we provide some predefined query. So, when Watin runs the test and takes browser to Google search result page, it takes a screenshot and ignores whatever is on those gray area. Then it does a pixel by pixel match on the rest of the template. So, no matter what the search query is and no matter what ad Google serves on top of results, as long as the first result is the one we are looking for, test passes.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: As I said, this is AI stuff. Some highly sophisticated being will be matching two screenshots to say, Yah, they more or less match, test pass.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: I think a pretty dumb bitmap matching will work in many cases. Just an idea, think about it. This way we can test if CSS is giving us pixel perfect result. QA takes a screenshot of expected output and then let the automated test to match with browser’s actual output.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: OK, all good ideas. Let’s see how much we can do. We will be starting from webservice unit testing. Then we will gradually move to Watin based testing. Now it’s time to sell this proposal to product team and then to management team.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Yep, at least get the webservices tested, that will catch a lot of bugs before QA spends time on testing. Goal is to get as much testing done by developers, really fast, automatically then letting QA spend time on them.&amp;#160; Also we can run those webservice unit tests in a load test suite and load test the entire webservice layer. That’ll give us guaranty our code is production quality and it can survive the high traffic.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Understood, see ya.&lt;/p&gt;  &lt;p&gt;. . .&lt;/p&gt;  &lt;p&gt;&lt;u&gt;March 2008, Friday - The Code Freeze Day&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Hey Mike, how are we doing this sprint?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mike&lt;/strong&gt;: Pretty good. 3672 unit tests out of 3842 passed. We know why some of them failed. We can get them fixed pretty soon and run the complete regression tests once during lunch and once before we leave. QA has completed testing new features pretty well yesterday and they can check again today. We got some of the new features covered by unit tests as well. Rest we can finish next sprint, no worries. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Omar&lt;/strong&gt;: Excellent. Enjoy your weekend. See you on Monday.&lt;/p&gt;  &lt;p&gt;------------------------------&lt;/p&gt;  &lt;p&gt;Suggested Reading:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title="Web Application testing in .Net - WatiN" href="http://watin.sourceforge.net/"&gt;Web Application testing in .Net - WatiN&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="Data Driven Web Testing With Visual Studio 2008 Team System" href="http://www.codeproject.com/KB/aspnet/VS08DataDrivenWebTests.aspx"&gt;Data Driven Web Testing With Visual Studio 2008 Team System&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="Sean Lumley’s blog on Visual Studio Web Test and Load Test" href="http://blogs.msdn.com/slumley/"&gt;Sean Lumley’s blog on Visual Studio Web Test and Load Test&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="Ed Gla’s Blog on VSTS Load Testing" href="http://blogs.msdn.com/edglas/"&gt;Ed Gla’s Blog on VSTS Load Testing&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a title="Bill Barnett’s Blog on Visual Studio Web Test and Load Test" href="http://blogs.msdn.com/billbar/"&gt;Bill Barnett’s Blog on Visual Studio Web Test and Load Test&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;div class="wlWriterHeaderFooter" style="text-align:left;margin:0px;padding:4px 4px 4px 4px;"&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://msmvps.com/blogs/omar/archive/2008/10/27/how-to-convince-developers-and-management-to-use-automated-unit-test-for-ajax-websites.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://msmvps.com/blogs/omar/archive/2008/10/27/how-to-convince-developers-and-management-to-use-automated-unit-test-for-ajax-websites.aspx&amp;amp;bgcolor=0080C0&amp;amp;fgcolor=FFFFFF&amp;amp;border=000000&amp;amp;cbgcolor=D4E1ED&amp;amp;cfgcolor=000000" alt="DotNetKicks Image" border="0/" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1652113" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/ideas/default.aspx">ideas</category><category domain="http://msmvps.com/blogs/omar/archive/tags/misc/default.aspx">misc</category><category domain="http://msmvps.com/blogs/omar/archive/tags/ajax/default.aspx">ajax</category><category domain="http://msmvps.com/blogs/omar/archive/tags/unit+test/default.aspx">unit test</category></item><item><title>Tips and tricks to rescue overdue projects</title><link>http://msmvps.com/blogs/omar/archive/2008/10/20/tips-and-tricks-to-rescue-overdue-projects.aspx</link><pubDate>Mon, 20 Oct 2008 18:08:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1651416</guid><dc:creator>omar</dc:creator><slash:comments>18</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=1651416</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2008/10/20/tips-and-tricks-to-rescue-overdue-projects.aspx#comments</comments><description>&lt;p&gt;One of my friends, who runs his own offshore development shop, was having nightmare situation with one of his customers. He&amp;#39;s way overdue on a release, the customer is screaming everyday, he&amp;#39;s paying his team from his own pocket, customer is sending an ever increasing list of changes and so on. Here&amp;#39;s how we discussed some ideas to get out of such a situation and make sure it does not repeat in future: &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Hey, can you help me? My customer is making us work for free for extra two months to fix bugs from our last delivery. We did what he said. But after he saw the output, he came up with hundred changes, which he somehow presents as bugs or missing features and make them look like they are all our fault and making us work for last two months for free. He is sending new changes every week. We have no idea when we will complete the iteration. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: I see. Did you get a signed list of requirements from customer before you started the development? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Of course, I did. He sent us a word document explaining what he wants and we sent him a task breakup with hour estimates and total duration of three months. Now after three months when we showed him the product, he said, it&amp;#39;s no where close to what he had expected. Then he sent a gigantic list of things to change. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: All of those are bugs? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Of course not. Most of them are new features. &lt;/p&gt;  &lt;p&gt;Omar: Then why don&amp;#39;t you say those are new features? You have the original word document to prove. Just ask him to show where in the word document did he said X needs to be done? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Well..., he&amp;#39;s tricky. He somehow makes things look like it is obvious that X needs to be done and he&amp;#39;s not going to accept a requirement as done until X is done. For example, he said there must be a complete login form in the homepage. So, we did a typical login form with user name, password and OK, Cancel button. Now he says where&amp;#39;s the email verification thing? We said, you did not ask for it. He said, &amp;quot;this is obvious, every login form has a forgot password and email verification; I said *complete* login form, not half-baked login form&amp;quot;. So, you see, we can&amp;#39;t really argue to keep our image. Then, we did the login form exactly how he said. Now he says, where the client side validations of proper email address, username length, password confirmation? We said, you never asked for it! He says, &amp;quot;come on, every single website nowadays has AJAX enabled client side validation, do I have to tell you every single thing? Aren&amp;#39;t you guys smart enough to figure this out? You are already doing this for the third time, can&amp;#39;t you do it really well this time?&amp;quot; &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: OK, stop. I see what&amp;#39;s your problem. Some customer will always try to make you work more for less money. They will try to squeeze out every bit of development they can for their bucks. So, you have to be extra careful on how much you commit to them and make sure they cannot chip in more requirements while development is going on or when you deliver a version. Mockups are one good way to make sure things are crystal clear between you and customer.&amp;#160; Did you not show him mockups of the features that you will be building and make him sign those mockups? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Yes, I made some mockups. But they were simple mockups. I did not show the validations or all those side jobs like sending verification emails. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Did you run those mockups through your engineers? They could have told you about those details. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: No, I did not because developers don&amp;#39;t work on the project until I get a signoff from client. So, I prepare all the mockups myself to save cost.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: So, this is the first problem. The mockups were as ambiguous as the customer&amp;#39;s word document. Basically the mockups just reflected the sentences in word document. Mockups did not really show all possible navigations (ok, cancel, forgot, signup), system messages, system actions behind the scene, workflows etc. Are you getting what I am saying? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Yes. Come on, I am not a developer. I can&amp;#39;t think of every single details. That&amp;#39;s what developers do when they start working on it. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: But you provide estimates based on your mockups right? So, if mockup shows there&amp;#39;s only a simple login form and change password link, you charge 5 hours for it. But then when you realize you have to send email for change password, email needs to contain a tokenized URL, that URL needs to show a change password form, where you need to validate using CAPTCHA etc, it becomes 20 hours of work. Right? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Well yes. Generally I multiply all estimates by 1.5 just to be safe. But things have gone 3X to 10X off original estimate. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Yes, I just gave you an example how a login form estimate can go 4X off when the mockup is not run through an engineer and the important issues are not addressed. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: So, you are saying I have to prepare all mockup with an engineer? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: In general, yes, since you aren&amp;#39;t good enough to figure those out yourself; no offence. You will get good enough after you build couple of products and get your a** kicked couple of times, like mine. Mine got kicked about 17 times. After that it became so hard that when I sit on it, I produce really good mockups. After some more kicks, I hope to get 100% perfect in my mockups. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Ok, so the process is, I get word doc from customer. I produce mockups from it. Then I run them through engineers to add more details to them. Then after review with customer, I run them through engineers again to estimate. Then I ask customer to sign-off on the mockups and the estimate, correct?&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Well, first let me say, you don&amp;#39;t do a three month long iteration since you are far away from your customer. You do short two weeks sprints. Do you know SCRUM? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Yes, one of our team does it. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: I assume the team that got their a** kicked don&amp;#39;t do it? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: right, they don&amp;#39;t. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: OK, then first you start doing SCRUM. I won&amp;#39;t teach you details. You can study about SCRUM online. Now, you collect &amp;#39;user stories&amp;#39; from customer. If customer does not give you user stories, just vague paras of requirements, you break the requirements into small user stories. Understood? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: No, give example. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: OK, say customer wants a *complete* login form. You break it into couple of stories like: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;User clicks on &amp;quot;login&amp;quot; link from homepage so that user can login to the system      &lt;ul&gt;       &lt;li&gt;User enters username (min 5, max 255 chars, only alphanumeric) in the username text field &lt;/li&gt;        &lt;li&gt;User enters password (min 5, max 50 chars, only alphanumeric) in the password field &lt;/li&gt;        &lt;li&gt;User clicks on &amp;quot;OK&amp;quot; button after entering username and password. &lt;/li&gt;        &lt;li&gt;System validates username and password and shows the secure portal if credential is valid and user has permission to login and account is not locked. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Understood what user stories are? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Yes, but you are missing all the validations that we also overlooked and now we are working two months for free. This “user stories” do not help at all. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Hold on, you just saw basic steps of a user story. Now you describe each user story with the following: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;All possible inputs of user and their valid format &lt;/li&gt;    &lt;li&gt;All possible system generated messages for invalid input &lt;/li&gt;    &lt;li&gt;All possible alternate navigation from the main user story. For example, while entering password, user can click on a help icon so that user can see what kind of passwords are allowed. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Got it? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Now it&amp;#39;s starting to make sense. Then what? Show these user stories to customers? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: No, show them to your lead engineer who has enough experience to identify if you missed something. Your Engr should point out all the alternative system actions at least. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: What if my Engr can&amp;#39;t figure them out? What if he&amp;#39;s just as dumb as me? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Fire him. Get a pay cut for yourself. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Seriously, what do I do if that&amp;#39;s the case? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Your engineers will *always* come up with issues with your mockups. You should always use another pair of eyes to verify your mockups and add more details to it. You aren&amp;#39;t the only smart guy in the world you know? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: I thought I was, ok. What&amp;#39;s next? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: File those user stories in your issue tracking system in some special category. Say &amp;quot;User Stories&amp;quot; category. What do you use for your issue tracking system? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Flyspray &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Good enough. Create a new project in Filespray named &amp;quot;User Stories&amp;quot;. File tasks for user stories. Each story, one task. Attach the mockup to the tasks. Then create one account for your customer so that customer can login and see the user stories, make comments, suggest changes etc. You will get the conversation with your customer recorded as comments in the task. This comes handy for engineers and for resolving dispute later on. Moreover, get your customer to prioritize the tasks properly. Understood? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: I don&amp;#39;t think customer will go through that trouble. Customer will ask for some word document that has all the user stories and she will write in the document what are the changes. I will have to reflect them in Flyspray. Is it really necessary to file user stories in Flysrpay? Can&amp;#39;t I just maintain one word doc with customer? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Absolutely not. Word documents suffer from versioning problem. You have one version, your customer has another version, your engineers have another version. it becomes a nightmare to move around with word docs which has many user stories in it and keep them in sync all the time. Moreover, referencing a particular use case also becomes a problem. Say at later stage of the project, there&amp;#39;s a bug which needs to refer to User Story #123. You will have to say User Story #123 in &lt;a&gt;\\centralserver\fileshare\user&lt;/a&gt; stories1.doc. Now if &lt;a&gt;\\centralserver&lt;/a&gt; dies, or you put it somewhere else, all these references are gone. Don&amp;#39;t go for word doc. Keep everything on the web that you can refer to it using a URL or small number. Another problem is numbering stories in Word Doc. Word won&amp;#39;t produce unique ID for you. You will end up with duplicate user story numbers. If you use Flyspray, it&amp;#39;s will generate unique ID for you. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: OK, let me see how I convince my customer to use Flyspray. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Yes, you should. If Flyspray is hard for customers, use some simple issue tracking system that&amp;#39;s a no-brainer for non-engineers. Some fancy AJAX based todolist site will be good enough if it has picture attachment feature and auto task number feature. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: OK, I will find such a website. So, I got the user stories done. Now I show them to customer, review, make changes. Finally I get customer to sign off on User story #X to #Y for a two weeks sprint. Then what happens? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: On your first day of sprint, you do a sprint planning meeting where you present those user stories to your engineers and ask them to break each story into small tasks and estimate each task. Make sure no engineer put 1 day or 2 day for any task. Break them into even smaller tasks like 4 hours of tasks. This will force your engineers to give enough thought into the stories and identify possible problems upfront. Generally when someone says this is going to take a day or two, s/he has no idea how to do it. S/he has not thought about the steps need to be done to complete that task. Your are getting an estimate that&amp;#39;s either overestimated or underestimated. Forcing an engineer to allocate tasks in less than 4 hours slot makes an engineer think about the steps carefully.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: If engineers do this level of estimate, they will think about each task for at least an hour. This is going to take days to finish estimating so many tasks. How do you do it in a day? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: We do 4 hours Planning meeting where Product Owner explains the stories to engineers and then after 30 mins break, another 4 hours meeting where engineers pickup stories and breaks them into tasks and estimate on-the-fly. This 4 hours deadline is strictly maintained. If Product team cannot explain the tasks for a sprint in 4 hours, we don&amp;#39;t do the tasks in the sprint. If the tasks are so complex or there are so many tasks that they cannot be explained in 4 hours, engineers unlikely to do them within one/two week long sprint. Similarly if engineers cannot estimate the tasks in their 4 hours slot, the tasks are just too complex to estimate and thus have high probability of not getting done in the sprint. So, we drop them as well. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: This is impossible! No one&amp;#39;s going to attend 8 hours meeting on a day. Besides, telling them to estimate a task on the spot is super inefficient. They won&amp;#39;t produce more than 60% correct estimates. They will give some lump sum estimate and then go away. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Incorrect, if engineers cannot make estimates of a task in 10 to 20 minutes, they don&amp;#39;t have the capability of estimating at all. If your engineers are habituated to take a task from you for estimating and then go to their office, talk to their friends on the phone, drink soda, walk around, gossip with colleagues and end of the day if they have the mood to sit and think about the estimate then open a new mail, write some numbers and email it to you; they better learn to do this on-demand, when requested, within time constraint. It&amp;#39;s a discipline that they need to learn and implement in their life. Estimates are something they do from the moment they wake up to the moment they go to sleep. Besides, the planning meeting is the best place to estimate tasks - all engineers are there, product team is there, your architects should be there, QA team is there. It&amp;#39;s easy to ask questions, get ideas and helps from others. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: I have engineers who just can&amp;#39;t do well under pressure. They need some undisturbed moment, where they can sit and think about tasks without anyone staring at them. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Train them to learn how to keep their head cool and do their job in the midst of attention. Anyway, let&amp;#39;s stop talking about these auxiliary issues and talk about the most important issues. Where were we? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;:About dropping tasks, I already negotiated with customer that we are going to do story A, B, C in this sprint. Now after the sprint planning meetings, engineers say they can&amp;#39;t do B. Problem is I have already committed to deliver A, B, and C to customer within 2 weeks and sent him the invoice. How do I handle this? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: How do you commit when you don&amp;#39;t know how long A, B, and C are going to take? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Customer tells me to do A, B, C within two weeks. And after doing some preliminary discussion with engineers, I commit to customer and then do the sprint planning meeting. I can’t wait until the sprint meeting is done and developers have given me estimates of all the tasks.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Wrong. You commit to customer after the sprint planning meeting is done. Before that, you give customer just a list of things that you believe you can try to do in following two weeks. Tell customer that you will be able to confirm after the sprint planning meeting. The time to do a sprint meeting is only 8 hours = a day. So, end of the day, you have some concrete stuff to commit to customer. From your model where you give engineers days to estimate, it won’t work. You have to finish planning within a day and end of the day, commit to customer. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: What if customer does not agree? What if he says, &amp;quot;I must get A, B and C in two weeks, otherwise I am going somewhere else?&amp;quot; &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: This is a hard situation. I am tempted to say that you tell your customer, &amp;quot;Go away!&amp;quot;, but in reality you can&amp;#39;t. You have to negotiate and come to a mutual agreement. You cannot just obey customer and say &amp;quot;Yes Mi Lord, we will do whatever you say&amp;quot; because you clearly cannot do it. The fact is, end of the sprint, you *will* get only A and C done and B not done. Then customer will Fedex you his shoes so that you can ask someone to kick you with it. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Correct, so what do I do? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: There are tricky solutions and non-tricky honest solutions to this. Tricky solution is, say you engaged 5 engineers in the project who can get A and C done in time. But you realize you need another engineer to do B, otherwise there&amp;#39;s no way you can finish A, B and C in two weeks. So, you invoice customer with 6 engineers and get A, B and C done. Now customer may not agree with you paying for the 6th engineer. Then you do a clever trick. You engage the 6th engineer free of cost in this sprint. Don&amp;#39;t tell customer that there&amp;#39;s an extra head working in the project. Or you can tell customer that out of good will, you want to engage another engineer free of cost to make sure customer gets a timely delivery. This boosts your image. Later on, when you get a sprint that&amp;#39;s more or less relaxed and 4 engineers can do the job, you secretly engage one engineer to some other project but still charge for 5 engineers to your customer. This way&amp;#160; you cover the cost for the 6th engineer that you secretly engaged earlier sprint. This is dirty. But when you have so hard a** customer who&amp;#39;s forcing you &amp;quot;what&amp;quot;, &amp;quot;when&amp;quot; and &amp;quot;how&amp;quot; all at the same time and not open to negotiation, you have no choice but to do these dirty tricks. You can also add extra one hour to every task for every engineer in a sprint or add some vague tasks like &amp;quot;Refactor User object to allow robust login&amp;quot;. This way you will get quite some amount of extra hours that will compensate for the hidden free engineer that you engage. You get the idea right? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Ingenious! And what&amp;#39;s the honest and clear way to do these? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: You negotiate with customer. You tell your customer that he or she can only have any two choices from Money-Scope-Time. This is called the project management triangle. Do you know about this? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Googling... &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Read this article: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://office.microsoft.com/en-us/project/HA010211801033.aspx"&gt;http://office.microsoft.com/en-us/project/HA010211801033.aspx&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It shows a triangle like this: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Whathappensbeforeasprintstarts_5F00_11338/clip_5F00_image002_5F00_2.gif"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="141" alt="clip_image002" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Whathappensbeforeasprintstarts_5F00_11338/clip_5F00_image002_5F00_thumb.gif" width="171" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So, your customer can specify any two. If customer specifies Scope and Time (&amp;quot;what&amp;quot; and &amp;quot;when&amp;quot;), then customer must be flexible on Money or &amp;quot;how&amp;quot; you do it within those two constraints. If customer specifies Money and Scope, then you are free to decide on time. You engage lower resource and take more time to get things done. Got the idea? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Yes, understood. Nice, I can show this to customer and educate him. Is there any book for the evil tricks that you just gave me? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: No, I might write one soon. I will name it &amp;quot;Customers are evil, so be you&amp;quot;. &lt;/p&gt;  &lt;p&gt;Raisul: Hey, I have fixed people engaged in a project. I can&amp;#39;t change the number of people sprint-to-sprint to compensate for change in money. So, the triangle does not work for me. What do I do here? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: Right. I also made a slightly different version of it. Here&amp;#39;s my take: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Whathappensbeforeasprintstarts_5F00_11338/image_5F00_10.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="196" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Whathappensbeforeasprintstarts_5F00_11338/image_5F00_thumb_5F00_4.png" width="260" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This is for situation where you have fixed resource engaged for a particular customer. In that case, you cannot reduce people on-demand because you cannot reassign them. Such a case requires different strategy. If customer forces you Quality and Time, customer must be willing to sacrifice Quantity. Customer cannot say, produce perfect login form in 2 weeks and add cool ajax effects to it. Customer has to sacrifice cool ajax effects, or sacrifice *perfection* of login form, or sacrifice number of days. &lt;/p&gt;  &lt;p&gt;From the above two triangles, which one&amp;#39;s more appropriate for you? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Second one because customer hires 5 engineers from me. I cannot take one away and engage in a different project. Well, not openly of course. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: OK, sounds fair. What else do you need from me? &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Kabir&lt;/u&gt;: Let me think about all these. This is definitely worth thinking. I have to figure out whether to play fair or play clever. End of the day, I need to produce great product, so that, I get good recommendation and future projects from customer. So, I need to do whatever it takes. It&amp;#39;s hard to run an offshore dev shop where we kinda have to work like slaves and like a bunch of zombies mumble every 10 mins - &amp;quot;Customer is always right&amp;quot;. You are very lucky to have your own company. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Omar&lt;/u&gt;: I had two offshore dev shops before &lt;a href="http://www.pageflakes.com"&gt;Pageflakes&lt;/a&gt;. I know how it feels. Wish you good luck. I have seen your product, you guys are building a great ASP.NET MVC+jQuery application. Release it. It&amp;#39;s worth showcasing. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Raisul&lt;/u&gt;: Thank you very much. See ya...&lt;/p&gt;  &lt;p&gt;(End of chat) &lt;/p&gt;  &lt;p&gt;This is the diagram my friend produced, which shows the steps to do before a sprint is started:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Whathappensbeforeasprintstarts_5F00_11338/image_5F00_2.png" target="_blank"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="399" alt="Workflow for Product Manager" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Whathappensbeforeasprintstarts_5F00_11338/image_5F00_thumb.png" width="620" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Handy for Product Managers. Enlightening for developers.&lt;/p&gt; &lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fmsmvps.com%2fblogs%2fomar%2farchive%2f2008%2f10%2f20%2ftips-and-tricks-to-rescue-overdue-projects.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmsmvps.com%2fblogs%2fomar%2farchive%2f2008%2f10%2f20%2ftips-and-tricks-to-rescue-overdue-projects.aspx" border="0" /&gt;&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1651416" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/ideas/default.aspx">ideas</category><category domain="http://msmvps.com/blogs/omar/archive/tags/misc/default.aspx">misc</category></item><item><title>An Agile Developer's workflow when SCRUM is used</title><link>http://msmvps.com/blogs/omar/archive/2008/10/11/an-agile-developer-s-workflow-when-scrum-is-used.aspx</link><pubDate>Sat, 11 Oct 2008 07:21:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650562</guid><dc:creator>omar</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=1650562</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2008/10/11/an-agile-developer-s-workflow-when-scrum-is-used.aspx#comments</comments><description>&lt;p&gt;If you are planning to start SCRUM at your company, you might need to train developers and QA to get into the mindset of an Agile developer. SCRUM is only successful when the developers and QA get into the habit of following the principles of SCRUM by heart. So, sometimes you need to offer training or do trial sprints to give some room to your developers how to get used to the working fashion of SCRUM. Giving them a handy workflow diagram that shows how they should work helps soothe the steep learning curve required for non-super star developers. I made such a workflow while I was teaching SCRUM at my friend&amp;#39;s company. The following diagram was printed and hung over the desk of each and every developer to help them grasp the culture of SCRUM quickly:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.AnAgileDevelopersworkflowwhenSCRUMisused_5F00_10FF6/image_5F00_2.png"&gt;&lt;img border="0" width="604" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.AnAgileDevelopersworkflowwhenSCRUMisused_5F00_10FF6/image_5F00_thumb.png" alt="image" height="1045" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We use Flyspray for issue tracking, so you will see the mention of it frequently. &lt;/p&gt;
&lt;p&gt;You will see the step to &amp;quot;Update Sprint backlog with remaining hours&amp;quot; is missing. This is done kinda verbally and scrum master (sometimes same person who is the product owner) keeps track of it.&lt;/p&gt;
&lt;p&gt;Hope you find this useful.&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fmsmvps.com%2fblogs%2fomar%2farchive%2f2008%2f10%2f11%2fan-agile-developer-s-workflow-when-scrum-is-used.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmsmvps.com%2fblogs%2fomar%2farchive%2f2008%2f10%2f11%2fan-agile-developer-s-workflow-when-scrum-is-used.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650562" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/ideas/default.aspx">ideas</category><category domain="http://msmvps.com/blogs/omar/archive/tags/misc/default.aspx">misc</category></item><item><title>Using multiple broadband connections without using any special router or software</title><link>http://msmvps.com/blogs/omar/archive/2008/10/05/using-multiple-broadband-connections-without-using-any-special-router-or-software.aspx</link><pubDate>Sun, 05 Oct 2008 10:29:18 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1649771</guid><dc:creator>omar</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=1649771</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2008/10/05/using-multiple-broadband-connections-without-using-any-special-router-or-software.aspx#comments</comments><description>&lt;p&gt;I have two broadband connections. One cheap connection, which I mostly use for browsing and downloading. Another very expensive connection that I use for voice chat, remote desktop connection etc. Now, using these two connections at the same time required two computers before. But I figured out a way to use both connections at the same time using the same computer. Here&amp;#39;s how:&lt;/p&gt; &lt;p&gt;Connect the cheap internet connection that is used mostly for non-critical purpose like downloading, browsing to a wireless router.&lt;/p&gt; &lt;p&gt;Connect the expensive connection that is used for network latency sensitive work like Voice Conference, Remote Desktop directly via LAN.&lt;/p&gt; &lt;p&gt;When you want to establish a critical connection like starting voice conf app (Skype) or remote desktop client, momentarily disconnect the wireless. This will make your LAN connection the only available internet. So, all the new connections will be established over the LAN. Now you can start Skype and initiate a voice conference or use Remote Desktop client and connect to a computer. The connection will be established over LAN.&lt;/p&gt; &lt;p&gt;Now turn on wireless. Wireless will now become the first preference for Windows to go to internet. So, now you can start Outlook, browser etc and they will be using the wireless internet connection. During this time, Skype and Terminal Client is still connected over the LAN connection. As they use persisted connection, they keep using the LAN connection and do not switch to the wireless. &lt;/p&gt; &lt;p&gt;This way you get to use two broadband connections simultaneously.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Usingmultiplebroadbandconnectionswithout_5F00_E7D0/image_5F00_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="267" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Usingmultiplebroadbandconnectionswithout_5F00_E7D0/image_5F00_thumb.png" width="162" border="0" /&gt;&lt;/a&gt;&amp;nbsp; &lt;/p&gt; &lt;p&gt;Here you see I have data transfer going on through two different connection. The bottom one is the LAN which is maintaining a continuous voice data stream. The upper one is the wireless connection that sometimes consumes bandwidth when I browse.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Usingmultiplebroadbandconnectionswithout_5F00_E7D0/image_5F00_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="304" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/omar.Usingmultiplebroadbandconnectionswithout_5F00_E7D0/image_5F00_thumb_5F00_1.png" width="343" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Using Sysinternal&amp;#39;s TCPView, I can see some connection is going through LAN and some through Belkin router. The selected ones - the terminal client and the MSN Messenger is using LAN where the Internet Explorer and Outlook is working over Wireless connection. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1649771" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/performance/default.aspx">performance</category><category domain="http://msmvps.com/blogs/omar/archive/tags/ideas/default.aspx">ideas</category><category domain="http://msmvps.com/blogs/omar/archive/tags/misc/default.aspx">misc</category></item><item><title>Webcast + Podcast + Blog + Widgets = Pagecast</title><link>http://msmvps.com/blogs/omar/archive/2007/05/25/webcast-podcast-blog-widgets-pagecast.aspx</link><pubDate>Fri, 25 May 2007 07:42:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:924774</guid><dc:creator>omar</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=924774</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2007/05/25/webcast-podcast-blog-widgets-pagecast.aspx#comments</comments><description>&lt;p&gt;You have seen webcasts and&amp;nbsp;heard Podcasts. Skype introduced
Skypecast. Pageflakes now gives you Pagecast. Using the Page
publishing feature in Pageflakes, you can make your pages public
and share with the world and thus make Pagecast! On your page, you
can put almost anything you want. Put news feeds, photos, audio,
podcasts, movies etc. You can put&amp;nbsp;cool widgets like Calendar,
To-do-list, Blog, Notes. You are no longer limited to providing
video via Webcast or audio via Podcasts. You can deliver rich
interactive content via Pagecast. Pagecast is a lot more powerful
than blogging or vblogging because you can deliver blog content
along with video, audio, and hundreds of rich interactive
components (flakes).&lt;/p&gt;
&lt;p&gt;
&lt;img height="235" src="http://omar.mvps.org/images/WebcastPodcastBlogWidgetsPagecast_DCE5/image01.png" width="227" alt="" /&gt;
&lt;/p&gt;
&lt;p&gt;Check out my Pagecast at: 
&lt;a href="http://www.pageflakes.com/omar"&gt;http://www.pageflakes.com/omar&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Similarly you can create .NET Pagecast with .NET contents from
all over the web, AJAX podcast with all Ajax content, Java
pagecast, PHP pagecast, ...&lt;/p&gt;
&lt;p&gt;There are thousands of Pagecasts in Pageflakes public page
directory at:&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.pageflakes.com/Community/Pages/Page.aspx"&gt;http://www.pageflakes.com/Community/Pages/Page.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Example Public Pagecasts:&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;David Strom&amp;rsquo; Web Informant (Journalist): &amp;nbsp;
&lt;a href="http://www.pageflakes.com/davidstrom"&gt;http://www.pageflakes.com/davidstrom&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Second Life Addict: 
&lt;a href="http://www.pageflakes.com/windfeemail/10432298"&gt;http://www.pageflakes.com/windfeemail/10432298&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Amy Winehouse (Musician): 
&lt;a href="http://www.pageflakes.com/amywinehouse"&gt;http://www.pageflakes.com/amywinehouse&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Buddhism: 
&lt;a href="http://www.pageflakes.com/newzaogao/10287762"&gt;http://www.pageflakes.com/newzaogao/10287762&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Adopting Children from Ethiopia 
&lt;a href="http://www.pageflakes.com/Texasselect191-Widgets/9473779"&gt;
http://www.pageflakes.com/Texasselect191-Widgets&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;LINUX Help: 
&lt;a href="http://www.pageflakes.com/yrcjaya"&gt;http://www.pageflakes.com/yrcjaya&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Bargain Shopping (Business): 
&lt;a href="http://www.pageflakes.com/marcos1"&gt;http://www.pageflakes.com/marcos1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Wine Lover 
&lt;a href="http://www.pageflakes.com/ericlflau"&gt;http://www.pageflakes.com/ericlflau&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Ultimate Metal Homepage: 
&lt;a href="http://www.pageflakes.com/rodslater"&gt;http://www.pageflakes.com/rodslater&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Dog Frisbee 
&lt;a href="http://www.pageflakes.com/ole1"&gt;http://www.pageflakes.com/ole1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;African-American Entertainment: 
&lt;a href="http://www.pageflakes.com/bronzetrinity"&gt;http://www.pageflakes.com/bronzetrinity&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Trekkie: 
&lt;a href="http://www.pageflakes.com/codelayer/10325410"&gt;http://www.pageflakes.com/codelayer/10325410&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Example Group Pagecasts:&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;Ralph Posadas Family 
&lt;a href="http://www.pageflakes.com/ralph4/10106645"&gt;http://www.pageflakes.com/ralph4/10106645&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;East Lothian School District (Scotland): 
&lt;a href="http://www.pageflakes.com/edubuzz/6523900"&gt;http://www.pageflakes.com/edubuzz/6523900&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Onsted High School: 
&lt;a href="http://www.pageflakes.com/akharsh/9789898"&gt;http://www.pageflakes.com/akharsh/9789898&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Parker Family: 
&lt;a href="http://www.pageflakes.com/ljp530/10001056"&gt;http://www.pageflakes.com/ljp530/10001056&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=924774" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/ideas/default.aspx">ideas</category></item><item><title>Database connection string wrong in MSDN Subscription website</title><link>http://msmvps.com/blogs/omar/archive/2006/12/17/database-connection-string-wrong-in-msdn-subscription-website.aspx</link><pubDate>Sun, 17 Dec 2006 14:53:25 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:428270</guid><dc:creator>omar</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=428270</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2006/12/17/database-connection-string-wrong-in-msdn-subscription-website.aspx#comments</comments><description>&lt;p&gt;This is one of those moments in history which you must be really lucky to witness. Can you believe MSDN actually had a connection string problem in their website which were exposed wide open to the public? Also they deployed the site in debug mode in order to see the error. Moreover, they actually turned on showing remote errors. Must have been really hard to find what was wrong with the site.&lt;/p&gt; &lt;p&gt;&lt;img height="334" src="http://omar.mvps.org/images/DatabaseconnectionstringwronginMSDNSubsc_1418A/MSDNdown11.gif" width="500" alt="" /&gt; &lt;/p&gt; &lt;p&gt;So, what we learn from here?&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Don&amp;#39;t deploy production site in debug mode  &lt;li&gt;Do not set &amp;quot;off&amp;quot; to &amp;lt;customErrors&amp;gt;. Anyone can see stack trace of your web application. Hackers can collect valuable information from these stack traces  &lt;li&gt;Put enough logging in your code so that you can analyze server side log in order to find out what&amp;#39;s wrong with your web app. Don&amp;#39;t just turn off custom errors in order to see why the site is not working.  &lt;li&gt;Put a good custom error page which apologizes to users and gives them enough links to either contact support or go to some other pages.  &lt;li&gt;Produce error alerts via email, SMS or IM Client when your site experiences such problems. This is the best way to learn about fatal errors on site and take action quickly.&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=428270" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/ideas/default.aspx">ideas</category></item><item><title>Reduce web site build time</title><link>http://msmvps.com/blogs/omar/archive/2006/12/07/reduce-web-site-build-time.aspx</link><pubDate>Thu, 07 Dec 2006 16:43:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:401979</guid><dc:creator>omar</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=401979</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2006/12/07/reduce-web-site-build-time.aspx#comments</comments><description>&lt;p&gt;When you have a pretty large web site in Visual Studio 2005, the
site build time grows dramatically and it becomes very difficult to
change code and then hit F5 (or Ctrl+Shift+B) in order to see if
the project builds properly or not. In 
&lt;a href="http://www.pageflakes.com"&gt;Pageflakes&lt;/a&gt;, we have a giant
web site. It takes so long to build the site that we generally
issue the build command, go to kitchen and make a cup of tea, drink
it, come back and see the site still building. Generally when we do
this 20 to 30 times per day,&amp;nbsp;we start feeling sick (not
because of VS 2005 instead of too much tea).&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a cool idea we tried.&amp;nbsp;You can make
folders&amp;nbsp;hidden by going to Windows Explorer, go to Folder
properties, check mark &amp;quot;Hidden&amp;quot; and click OK and then select &amp;quot;Apply
to current item only&amp;quot;. This will make the folder hidden and the
folder will disappear from Windows Explorer unless you have turned
on the option to show hidden files and folders. You will also see
the folders disappeared from Visual Studio. Now we use Total
Commander instead of Windows Explorer so hidden folders are not a
problem to us. Bascially none of us remember anymore how to use
Windows Explorer because we are so used to 
&lt;a href="http://www.ghisler.com/"&gt;Total Commander&lt;/a&gt; now. Try it,
it will change your life.&lt;/p&gt;
&lt;p&gt;When you make folders hidden, Visual Studio will not build them!
So you can make App_Data, App_Themes, images, stylesheets,
javascripts, html files hidden and Visual Studio will skip them.
Around 70% of our web site is non C# code. So, we gained dramatical
reduction in web site build time by trying this idea. Another idea
is to move all classes from App_Code to external DLL project. Thus
they will build once and VS will not build them again and again if
you make some changes in some codebehind file or some .aspx or
.ascx file. This will also give you significant build time
reduction.&lt;/p&gt;
&lt;p&gt;Of course you can turn off Build Website and use Build Page
option. But that does not help. We want to ensure the web site code
is not broken due to any change. So, we need Build Website
option.&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=401979" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/ideas/default.aspx">ideas</category></item><item><title>How to become a really experienced developer overnight</title><link>http://msmvps.com/blogs/omar/archive/2006/11/09/How-to-become-a-really-experienced-developer-overnight.aspx</link><pubDate>Thu, 09 Nov 2006 09:51:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:269447</guid><dc:creator>omar</dc:creator><slash:comments>43</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/omar/rsscomments.aspx?PostID=269447</wfw:commentRss><comments>http://msmvps.com/blogs/omar/archive/2006/11/09/How-to-become-a-really-experienced-developer-overnight.aspx#comments</comments><description>&lt;p&gt;I get a lot of request from a lot of people who see my works and
get inspired and ask me how can they do the same? The questions I
generally get are following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How can I become a developer like you?&lt;/li&gt;
&lt;li&gt;How can I develop projects like you did?&lt;/li&gt;
&lt;li&gt;What do I need to learn in C# to become like you?&lt;/li&gt;
&lt;li&gt;Does Microsoft Certifications help? Should I go for the
exams?&lt;/li&gt;
&lt;li&gt;What did you do to become MVP? I want to become MVP too.&lt;/li&gt;
&lt;li&gt;I am 23 (or 24) and I want to become like you. What do I need
to do?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Generally the questions are like this. Everyone asks me for a
&amp;quot;shortcut&amp;quot; way to becoming a really good developer. So, here&amp;#39;s the
magical secret for becoming a really good developer and achieve
everything I have achieved:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Work&amp;nbsp;18 hours per day, 7 days a week, 360 days a year for
13 years.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes! That&amp;#39;s the secret. It&amp;#39;s pretty easy. The only thing you
need to do is &amp;quot;work&amp;quot; and do nothing else and you will achieve
everything that I have achieved. Pretty easy. I did that, so you
can do it too! Piece of cake.&lt;/p&gt;
&lt;p&gt;If you want to go for the &amp;quot;long&amp;quot; way then here&amp;#39;re the things you
can try:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Take part in open source projects or make several yourselve.
This is the best way to learn really useful things.&lt;/li&gt;
&lt;li&gt;If you can, try setting up your own company. I have setup 3
companies so far. 2 were not that succesful,&amp;nbsp;1 is very
successful. It helped me learn so many things that I would have
never learnt by working in other&amp;#39;s companies as an employee.&lt;/li&gt;
&lt;li&gt;Read articles everyday. There are thousands of articles to read
from 
&lt;a href="http://www.codeproject.com"&gt;www.codeproject.com&lt;/a&gt;&amp;nbsp;and
msdn.microsoft.com. I still read almost all the articles that get
published in codeproject every week. If you read 10 articles per
week and do it for&amp;nbsp;a year&amp;nbsp;weeks, you have the knowledge
of 480 articles! Who can beat you then?&lt;/li&gt;
&lt;li&gt;Not only read articles, but try out the attached source codes.
Make similar projects yourselves and use the ideas presented in the
articles in your own project. I spend everyday at least 1 hour in
trying out new technologies. This not only increases my knowledge
but also makes me more experienced in doing things better and helps
me do my office work better and faster.&lt;/li&gt;
&lt;li&gt;Get into companies which gives you exciting projects to work on
and you get to do something in everything. For example, join a
company which gives you the freedom to design your modules, develop
it, test it, document it etc. The idea is to gain experience from
all stages of development. Make sure the company has enough bright
stars to learn from. If you just become another cow in a big dairy
farm, no benefit.&lt;/li&gt;
&lt;li&gt;Don&amp;#39;t leave a company if you are underpaid but you do a lot for
the company. Have patience. Build yourself up and you will one day
get what you deserve. I used to get $250 per month in my first
company which used to do outsourced projects for a really big
company in US. I worked day and night in that company and worked in
8 projects in 7 years. I did not leave the company only because of
the technologies I could learn and apply and the variety of things
I could do there. Best of all, I could work on many outsourced
projects myself from various countries which exposed me to a wide
variety of technologies.&amp;nbsp;So, when I left the company and
joined another one, with the vast experience I had gathered from my
previous underpaid company, my salary became $200/day in the new
company. See the difference. If I had left earlier seeking higher
salary instead of technologies, I would not have learned all the
cool things and I would not become so expensive as I am
now.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;This is very important for those who cost $200/day now. Don&amp;#39;t
change yourself once you start earning this much. Be the same
person as you were when you used to get $200/month. Remember, it
was&amp;nbsp;the attitude and the burning desire to learn and grow that
made you become what you are now. If the burning sun inside you
becomes a dying candle, you lose.&lt;/li&gt;
&lt;li&gt;Don&amp;#39;t start your career in a company where you are given nice
specs to read on, you have&amp;nbsp;lead developers to decide all
input/output/pseudocodes,&amp;nbsp;you have a solid QA team to test
your work, you have managers and administrators to take care of
every management and administrative issues etc. In such a company,
the only thing you become is a &amp;quot;smart typist&amp;quot;. You basically
translate English to C#. The right side of your brain does not
develop at all. Start your career with small companies which deal
with lots of challenges and you get the chance to burn your brain
and fingers out. The sweet smell of your roasted brain is far
better than the sweet scent of your polished cubicle inside a
decorated corporate office.&lt;/li&gt;
&lt;li&gt;I have seen the following evolutionary cycle of developers and
see where you fit in:&lt;/li&gt;
&lt;li style="list-style:none;display:inline;"&gt;
&lt;ul&gt;
&lt;li&gt;Beginner: Does not wear shoes, comes to office on sandles.
Looks very sober. Shirt is outside pant.&amp;nbsp; When you ask them,
do you know .NET events and delegates? They say, &amp;quot;uh, ummm, no I
don&amp;#39;t think so. Is it birthday events?&amp;quot;&lt;/li&gt;
&lt;li&gt;Beginner+: Gives you &amp;quot;I know it all&amp;quot; look whenever you talk
about programming. Wears shiny shoes, full sleve&amp;nbsp;shirt is
nicely put inside dockers pants.&amp;nbsp;Back brushed&amp;nbsp;hair wtih
&amp;quot;Set Wet&amp;quot; gel and always on $300 sunglasses. When you ask them, &amp;quot;do
you know .NET events and delegates?&amp;quot; They say, &amp;quot;Events and
delegates are coooool man! You can do anything with them and mark
my word man, &amp;quot;anything&amp;quot;. I haved used them in sooooo many
projects.&amp;nbsp;Did you just learn about&amp;nbsp;.NET events and
delegates?&amp;quot;&lt;/li&gt;
&lt;li&gt;Intermediate: Clothing turns a bit pale. Sunglass is
old-school. No hair gel. Anytime you speak about some terms like
EJB, Spring, Design Patterns, their eyes sparkle like the brightest
star in the November sky. They start doing a lot of off-the-record
work inside office. They start going to online groups, start
working with friends on open source projects, start reading MSDN
Magazines etc. If you ask them, &amp;quot;Can you make it?&amp;quot; They always
reply, &amp;quot;Sure, you will get it tomorrow.&amp;quot; But usually you get it
after a month.&lt;/li&gt;
&lt;li&gt;Intermediate+: Generally you get it within 1 or 2 weeks overdue
schedule.&lt;/li&gt;
&lt;li&gt;Advanced: They&amp;nbsp;wear the same&amp;nbsp;&amp;quot;I am a Geek&amp;quot;
or&amp;nbsp;&amp;quot;Microsoft Windows XP&amp;quot; logo T-shirts everyday (until it
stinks and you can smell it as soon as they enter the
office)&amp;nbsp;and shiny sports shoes. They start talking about
software development processes, RUP,&amp;nbsp;Extreme Programming,
Agile Development&amp;nbsp;etc. If you ask them to do something, they
reply &amp;quot;Give me a functional specification, a technical
specification, test plans, milestones, release plans, mockups and N
number of developers and I will get it done.&amp;quot;&lt;/li&gt;
&lt;li&gt;Very advanced: Does not wear shoes, comes to office on sandles.
Looks very sober. Shirt is outside pant.&amp;nbsp; When you ask them,
do you know .NET events and delegates? They say, &amp;quot;They seem to
suffer from bi-directional&amp;nbsp;strong reference problem which
prevents garbage collectors from collecting the listener properly
and the only way to release the reference is to bring down the app
domain&amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Do take Microsoft Certifications without cheating. You will
learn a lot.&lt;/li&gt;
&lt;li&gt;Write articles &amp;amp; blogs. Share everything you learn. Someone
out there will benefit from it someday. Don&amp;#39;t hesitate thinking
that you don&amp;#39;t know much to write about.&lt;/li&gt;
&lt;/ul&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=269447" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/omar/archive/tags/ideas/default.aspx">ideas</category></item></channel></rss>