<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9443485</id><updated>2011-12-15T02:41:52.174Z</updated><category term='software failure'/><category term='data mining'/><category term='git'/><category term='software engineering'/><category term='programming'/><category term='coding'/><category term='tutorial'/><category term='failure causes'/><category term='requirements engineering'/><category term='project management'/><category term='version control'/><category term='testing'/><category term='algorithms'/><title type='text'>Programmer</title><subtitle type='html'>What programming is and what programming is not</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programmer.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://programmer.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Michal</name><uri>http://www.blogger.com/profile/00977612876422593833</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9443485.post-16014778345384168</id><published>2011-09-07T08:52:00.000+01:00</published><updated>2011-09-07T08:52:51.444+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='data mining'/><title type='text'>Data Mining</title><content type='html'>As I mentioned in one of my previous posts, I am not only going to write about development process, but also to present other useful stuff like tutorials or algorithms.&lt;br /&gt;&lt;br /&gt;Today this will be a link to &lt;a href="http://www.autonlab.org/tutorials/"&gt;Statistical Data Mining Tutorials&lt;/a&gt; by Andrew Moore.&lt;br /&gt;&lt;br /&gt;Why &lt;a href="http://en.wikipedia.org/wiki/Data_mining"&gt;Data Mining&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Machine_learning"&gt;Machine Learning&lt;/a&gt; are useful? It's stuff for those who deal with data to discover some knowledge not apparently visible or obvious - either to predict future stock or just to select best ads to show to a visitor on your site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9443485-16014778345384168?l=programmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmer.blogspot.com/feeds/16014778345384168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programmer.blogspot.com/2011/09/data-mining.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/16014778345384168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/16014778345384168'/><link rel='alternate' type='text/html' href='http://programmer.blogspot.com/2011/09/data-mining.html' title='Data Mining'/><author><name>Michal</name><uri>http://www.blogger.com/profile/00977612876422593833</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9443485.post-5699259479924448958</id><published>2011-08-31T19:11:00.001+01:00</published><updated>2011-08-31T19:12:45.822+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software failure'/><category scheme='http://www.blogger.com/atom/ns#' term='project management'/><category scheme='http://www.blogger.com/atom/ns#' term='failure causes'/><category scheme='http://www.blogger.com/atom/ns#' term='requirements engineering'/><title type='text'>Requirements I</title><content type='html'>As discussed in my introductory posts, requirements engineering is one of the most important factors of projects' success (or failure). If we take a look at &lt;a href="http://www1.standishgroup.com/newsroom/chaos_2009.php"&gt;The Standish Group CHAOS reports&lt;/a&gt; (well you have to have $99 to spend for a recent copy; some old reports are available for free "for academic purposes") we will see, that over 44% of failures occur due to lack of proper requirements management (i.e. lack of user input, incomplete requirements, unrealistic expectations, changing specification etc.). Another&amp;nbsp; 26% are related problems like: lack of proper planning, lack of resources (how can you plan activities and manage your resources, time, and money if you don't know what really needs to be done? How do you create budget and set up price the customer is going to pay?). Surprisingly almost 8% of project are terminated because the customer does not need it any longer - a problem also related to requirements specification, as if they were performed properly in the beginning, many such instances would be detected much earlier.&lt;br /&gt;&lt;br /&gt;But what &lt;i&gt;requirements&lt;/i&gt; really are? The short answer is that requirements define what users, customers, suppliers, and business routines (lets call them &lt;i&gt;stakeholders&lt;/i&gt; for now) need from the system, so it is useful and helpful for them. However, be careful as requirements from different stakeholders may be contradicting, ambiguous, or incomplete!&lt;br /&gt;&lt;br /&gt;Why do we need requirements in a first place? As mentioned before - we need them for &lt;i&gt;planning&lt;/i&gt; and &lt;i&gt;risk management&lt;/i&gt;. We also need them to do proper &lt;i&gt;acceptance testing&lt;/i&gt;, to manage trade-offs to be made (and justify them!) and to &lt;i&gt;manage change&lt;/i&gt; within the organization that is going to use the deployed system. &lt;br /&gt;&lt;br /&gt;We cannot think solely about the software when we start to collect our requirements. Lets imagine, that we are building a very complicated web application. The application is going to deliver a vast amount of data to some other systems around the globe. The application alone is not able to perform the task - if the server and uplink are to slow, than even the best application will not be able to send the data as quickly as it needs to be. Similarly if the third party systems are expecting different format than we send they will not be able to use the data. As we see the correct result - requirement - can be achieved only if we think about the whole system - software, hardware, and human along with interactions between them. &lt;br /&gt;&lt;br /&gt;Very important thing to remember is, that requirements management is not a single step in development (like often shown by &lt;a href="http://en.wikipedia.org/wiki/Waterfall_model"&gt;waterfall model&lt;/a&gt;), but rather they are constantly involved in all phases of the project: planning, development, testing etc. Requirements also help to track the progress of the project - not only by developers, but also management staff. They help understanding (at fairly high-level) what is developed and in many cases might help reuse of components across projects, coordinate activities, or share resources.&lt;br /&gt;&lt;br /&gt;Another thing to consider is that &lt;i&gt;business requirements&lt;/i&gt; (usually what our stakeholders talk about) is not equal to &lt;i&gt;engineering requirements&lt;/i&gt; (what we need to develop a system). In general we can say that there are at least 3 layers of requirements analysis. First &lt;i&gt;stakeholders view&lt;/i&gt; (their expectations and objectives) are translated into set of &lt;i&gt;stakeholders requirements&lt;/i&gt; - defining what stakeholders want to achieve by having the system. In this step we are focusing on the &lt;i&gt;problem domain, &lt;/i&gt;usually trying to avoid any particular solution. In next step we translate these requirements into set of &lt;i&gt;system requirements&lt;/i&gt; - defining (at high-level, without specific details) how the system will meet the stakeholders needs. Than we &lt;i&gt;design&lt;/i&gt; the system effectively translating the system requirements into architecture of the system. At this step we define how this specific design will meet stakeholders needs. The 2 latter steps are expressed in the &lt;i&gt;solution domain&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;For example lets consider a case, when a stakeholder is in need of a personal safety system for a excursion vessel. They might express their need by saying that they need means of ensuring personal safety should he vessel sunk, yet the item their customers have to wear while boarding should not impair their comfort and ability to move freely. At the system requirements level we will consider all possible solutions such as vests, life rings, or Personal Anti-Gravity Module (given it was already invented) to pick one solution that will best suit the stakeholder needs. We will discuss how this solution is going to fulfil stakeholder needs, but we will not go to much into design details. At the design level we will think about this specific solution, and design an instance of this solution - like a specific dimensions, material, shape, and colour of the vest (or life ring, or PAGM). &lt;br /&gt;&lt;br /&gt;Moreover in many cases we need to translate high level requirements (goals or expectations) in a set of low level requirements. The relations are often quite complicated (many-to-many), hence understanding of relationships between different layers  (it is called &lt;i&gt;traceability&lt;/i&gt;) of information is needed.&lt;br /&gt;&lt;br /&gt;It is often the case, that stakeholders not only specify their needs in terms of a particular solution - usually one of more IT literal person has read something about this new cool thing called 'peer-to-peer' and they want it even though they do not know what it means, but also focus on very low level issues such as colour of buttons and their shape, rather than clearly state their needs and goals to achieve. In such case the requirements engineering should lead to justification of particular demands (maybe simple client-server approach would suffice?), or we will not be able to find the most optimal solution. Also a clear distinction of solution and problem domains needs to be made. Otherwise the discussion will be taken over by developers, as the only description will be really done in solution domain, resulting in lack of deep understanding of the goals to be achieved and functionality to include in the system.&lt;br /&gt;&lt;br /&gt;In a summary I will give an example of things going slightly wrong because of unclear specification. A few years ago I was leading development of an auction system. The initial requirement was to have possibility to bid on items until the given deadline. After some time the requirement changed, so that if the bidding was done within last 30 seconds, than the deadline is extended by additional 30 seconds (effectively the more people bid, the longer the auction). Connected with that was demand of having a real time clock displayed on the bidding page showing time to end of the auction. Everything was OK at this point. However later the requirement changed again to have possibility to have 30, 15 and 5 seconds extension times - and here the problem started to be visible. The typical round-trip time to server the customer had was over 600ms, moreover the load of the server was enormous due to number of bidders (+ overhead from the clock update). The customer wanted the clock to be precise (means he had 4 laptops on one desk and he wanted all the clocks to be counting EXACTLY the same with millisecond agreement). A requirement impossible to satisfy - simply because such synchronization is not possible to achieve (see article &lt;a href="http://www.springerlink.com/content/j5250h34013874jv/"&gt;Probabilistic Clock Synchronization&lt;/a&gt; by F. Cristian if you are interested). The best we could do (along with mathematical proof!) was about 200ms - a small, but visible lag between the terminals. So we had everything - unrealistic expectations, changing requirements, incomplete requirements, and in the initial part of the project lack of customer input... The project was deployed successfully (with small delay), but the customer went out of business soon afterwards due to complete lack of marketing (and lack of budget as they have not done any budget predictions...).&lt;br /&gt;&lt;br /&gt;Summarising: this post was again pretty theoretical. The next will be discussing a practical ability to write down requirements. We will also discuss some approaches to modelling, as it is often very useful in supporting requirements management (and many other activities as well). &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9443485-5699259479924448958?l=programmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmer.blogspot.com/feeds/5699259479924448958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programmer.blogspot.com/2011/08/requirements-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/5699259479924448958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/5699259479924448958'/><link rel='alternate' type='text/html' href='http://programmer.blogspot.com/2011/08/requirements-i.html' title='Requirements I'/><author><name>Michal</name><uri>http://www.blogger.com/profile/00977612876422593833</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9443485.post-2187835857630891918</id><published>2011-08-14T22:33:00.002+01:00</published><updated>2011-08-14T22:36:47.634+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='version control'/><category scheme='http://www.blogger.com/atom/ns#' term='git'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorial'/><title type='text'>Backup and version control</title><content type='html'>I said my next post will be about requirements specification, however I also said I will try to discuss issues I encountered. Here is one: HDD failure in my laptop. Obviously I have backups (3 to be precise: 1 on my main PC, 1 on external HDD, and one slightly older on DVDs). This is not my first HDD failure - I had quite a few already (yes, &lt;i&gt;your HDDs will fail, the question is when&lt;/i&gt;). Obviously without the backups... (dont even want to think about that).&lt;br /&gt;&lt;br /&gt;So we all understand the need for backups (I hope!), if you do not have your backup done today than do it now. An important part of my backup was an old &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Apache_Subversion"&gt;SVN&lt;/a&gt;&lt;/i&gt; repository. A few weeks ago I had a discussion with my friend about the versioning systems so I thought "SVN makes me mad sometimes, so why not take a look at other solutions - I need to rebuild my workspace anyways, so I can swap &lt;i&gt;SVN&lt;/i&gt; at the same time". And I have used BitKeeper before... so I know version control is not just a fancy way of doing backups.&lt;br /&gt;&lt;br /&gt;Don't get me wrong &lt;i&gt;SVN&lt;/i&gt; is not an evil - it just does not match the needs I have for research and experimental stuff I'm doing. &lt;i&gt;SVN&lt;/i&gt; might be a better choice in some cases - it all depends on the needs, workflows, procedures etc.&lt;br /&gt;&lt;br /&gt;After discarding all proprietary (and dead) systems only a few choices were left: &lt;i&gt;Bazaar, Codeville, CVS, SVN, darkcs, git, GNU arch, mercurial&lt;/i&gt; and &lt;i&gt;monotone&lt;/i&gt;. &lt;i&gt;CVS&lt;/i&gt; and &lt;i&gt;SVN&lt;/i&gt; were out of question as it is what I wanted to get rid of. &lt;i&gt;GNU Arch&lt;/i&gt; is still maintained, but not extended anymore. The rest seems to be moreless the same on the paper (the same access protocols available, distributed architecture, actively in development etc). I decided to go for &lt;i&gt;git&lt;/i&gt; - just because a lot of people is using it (and my friend told me I should;]).&lt;br /&gt;&lt;br /&gt;I wanted distributed model as I work on several different equally important PCs, I share the stuff with a lot of equally important people, and I develop experimental things that I want to commit, but I do not want to propagate to other repositories. I also need easy branching (&lt;i&gt;SVN&lt;/i&gt; gives me that) with easy merge (that is something &lt;i&gt;SVN&lt;/i&gt; is not so good at in my opinion) - at least for my research projects as they are very *experimental* in their nature, and they require me to do a lot of branching (e.g. 3 versions of the same article: internal report, conference paper and thesis chapter). &lt;i&gt;Git&lt;/i&gt; gives me a possibility to work on different PCs, having own  repository on each of them and possibility to merge them when needed. A nice explanation of differences between centralized and distributed model of version control can be found in "&lt;a href="http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/" target="_BLANK" title="Permanent Link: Intro to Distributed Version Control (Illustrated)"&gt;Intro to Distributed Version Control (Illustrated)&lt;/a&gt;". &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;Instead of saying why I thought changing SVN to distributed model will be better, I will just paste a recording of a lecture Linus Torvalds gave at Google;] Some of the problems Linus presented are slightly outdated (video is from 2007) as &lt;i&gt;SVN&lt;/i&gt; does things better now than it used to 4 years ago. It is still worth watching anyways.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://3.gvt0.com/vi/4XpnKHJAok8/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/4XpnKHJAok8&amp;fs=1&amp;source=uds" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266"  src="http://www.youtube.com/v/4XpnKHJAok8&amp;fs=1&amp;source=uds" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;The conversion of SVN repository to GIT was easy. Much easier than I thought it would: just checkout from SVN, removing all .svn folders, initializing git repository (on the first revision only, git add otherwise) and commit. Resolving problems with files disappearing from version-to-version was much easier than it was with SVN. It took me about 1 day to convert all my stuff (about 20Gb of resources related to various projects I did over last&amp;nbsp; few years). I decided to use rsync to backup my photos though - I think version control is not needed there as Lightroom has nice tools to have version control and non-destructive editing. I also decided to drop history of some of the projects so I just converted the last revision to &lt;i&gt;git&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;As there is a lot of tutorials and manuals on &lt;i&gt;git&lt;/i&gt;, I will not even try to build a comprehensive guide here. Instead I will shortly show how to start. Lets assume I have a directory &lt;i&gt;~/WORKSPACE&lt;/i&gt; on my PC. Creating a repository takes just one command:&lt;br /&gt;&lt;i&gt;#~/WORKSPACE&amp;gt; git init-db&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;So eaaaasy. Now just add the files:&lt;br /&gt;&lt;i&gt;#~/WORKSPACE&amp;gt; git add .&lt;/i&gt;&lt;br /&gt;&lt;i&gt;#~/WORKSPACE&amp;gt; git commit&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;and my directory is already under version control.&lt;br /&gt;&lt;br /&gt;Than on the second PC I just do:&lt;br /&gt;&lt;i&gt;#~/&amp;gt; git clone PROTOCOL://ADDR_TO_SECOND_PC/repository ./WORKSPACE&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;and I have the stuff on the second PC now. After doing some work I just do:&lt;br /&gt;&lt;i&gt;#~/WORKSPACE&amp;gt; git commit&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;And the stuff is commited. It is not updated on the first PC as we have distributed model!!! We can push repository there:&lt;br /&gt;&lt;i&gt;#~/WORKSPACE&amp;gt; git push origin&lt;/i&gt; &lt;br /&gt;&lt;br /&gt;if you get error like:&lt;br /&gt;&lt;pre style="border: 1px solid #ccc; font-size: 0.8em; margin: 10px; padding-left: 30px; padding: 5px;"&gt;Counting objects: 8, done.&lt;br /&gt;Delta compression using up to 4 threads.&lt;br /&gt;Compressing objects: 100% (5/5), done.&lt;br /&gt;Writing objects: 100% (5/5), 674 bytes, done.&lt;br /&gt;Total 5 (delta 3), reused 0 (delta 0)&lt;br /&gt;Unpacking objects: 100% (5/5), done.&lt;br /&gt;remote: error: refusing to update checked out branch: refs/heads/master&lt;br /&gt;remote: error: By default, updating the current branch in a non-bare repository&lt;br /&gt;remote: error: is denied, because it will make the index and work tree inconsistent&lt;br /&gt;remote: error: with what you pushed, and will require 'git reset --hard' to match&lt;br /&gt;remote: error: the work tree to HEAD.&lt;br /&gt;remote: error: &lt;br /&gt;remote: error: You can set 'receive.denyCurrentBranch' configuration variable to&lt;br /&gt;remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into&lt;br /&gt;remote: error: its current branch; however, this is not recommended unless you&lt;br /&gt;remote: error: arranged to update its work tree to match what you pushed in some&lt;br /&gt;remote: error: other way.&lt;br /&gt;remote: error: &lt;br /&gt;remote: error: To squelch this message and still keep the default behaviour, set&lt;br /&gt;remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.&lt;br /&gt;To REPOSITORY/&lt;br /&gt;&amp;nbsp;! [remote rejected] master -&amp;gt; master (branch is currently checked out)&lt;br /&gt;error: failed to push some refs to ' REPOSITORY/'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;than on the first PC do:&lt;br /&gt;&lt;i&gt;#~/WORKSPACE&amp;gt; git config --bool core.bare true&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The &lt;i&gt;git push&lt;/i&gt; operation should work now. So far so good, but it is not where the true power is. &lt;br /&gt;&lt;br /&gt;To create a patch just do: &lt;br /&gt;&lt;i&gt;#~/WORKSPACE&amp;gt; git diff HEAD^ HEAD &amp;gt; patch.diff&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;and to synchronize with origin (by downloading the things, rather than uploading the changes):&lt;br /&gt;&lt;i&gt;#~/WORKSPACE&amp;gt; git pull origin&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;What more can be done? All the stuff like add, remove, untrack, and of course branching! The true power however lies in the distribution.&lt;br /&gt;&lt;br /&gt;I will not make a comprehensive guide here, instead will just give a couple of links:&lt;br /&gt;&lt;a href="http://git.wiki.kernel.org/" target="_BLANK" title="Git FAQ"&gt;Git FAQ&lt;/a&gt; at git.wiki.kernel.org&lt;br /&gt;&lt;a href="http://help.github.com/" target="_BLANK" title="GitHub tutorials"&gt;Tutorials on GitHub&lt;/a&gt; including one about &lt;a href="http://help.github.com/ignore-files/" target="_BLANK" title="GitHub tutorial: how to ignore files during add operation"&gt;how to ensure some files are ignored by git add &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.kernel.org/pub/software/scm/git/docs/v1.7.6/gittutorial.html" target="_BLANK" title="Git documentation and tutorial"&gt;Git tutorial&lt;/a&gt; and &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/" target="_BLANK" title="git documentation"&gt;git documentation&lt;/a&gt; on www.kernel.org.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9443485-2187835857630891918?l=programmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmer.blogspot.com/feeds/2187835857630891918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programmer.blogspot.com/2011/08/backup-and-version-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/2187835857630891918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/2187835857630891918'/><link rel='alternate' type='text/html' href='http://programmer.blogspot.com/2011/08/backup-and-version-control.html' title='Backup and version control'/><author><name>Michal</name><uri>http://www.blogger.com/profile/00977612876422593833</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9443485.post-2538095579686787126</id><published>2011-08-13T17:00:00.000+01:00</published><updated>2011-08-13T17:00:25.038+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software failure'/><category scheme='http://www.blogger.com/atom/ns#' term='project management'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='failure causes'/><title type='text'>Why software fails?</title><content type='html'>In my previous post I described a project that was about to fail. In this post I will try to discuss what does it mean that software development is successfull and what are the resons (both immediate and these less apparent) of some spectacular software failures.&lt;br /&gt;&lt;br /&gt;To start with lets ask a question: "what does it mean that development was successful?" Firstly, we have to consider purly economical criteria i.e. &lt;i&gt;cost in terms of time and money&lt;/i&gt;. Simply speaking, we need the software to be completed within a prescribed timeframe and within an accepted budget. Both are equally important, as our customers do not want to pay too much and they also do not want to wait for years.&lt;br /&gt;&lt;br /&gt;Secondly, the software delivered has to meet the needs of its users. This one seems to be obvious - if the software does not do what it needs to do, than it is obviously useless. However in many cases it is hard to tell what software has to do (we will be discussing this issue soon). For now just assume that software has to perform certain functions required by the users (so it has correct scope) and it has to execute them correctly (so the quality is right).&lt;br /&gt;&lt;br /&gt;Lets set up a suitable background for further discussion by presenting a few spectacular examples of software failures. We will start with one that is often presented on various occasions - &lt;a href="http://en.wikipedia.org/wiki/Ariane_5"&gt;Ariane 5&lt;/a&gt; explosion (or self-destruction to be precise) on June, 4th 1996. The immediate reason of the crash was a software error. The Failure Report (available here as PDF: &lt;a href="http://esamultimedia.esa.int/docs/esa-x-1819eng.pdf"&gt;Ariane 5 Flight 501 Failure, Report by the Inquiry Board&lt;/a&gt;) states: "A data conversion from 64-bit floating point value to 16-bit signed integer value to be stored in a variable representing horizontal bias caused a processor trap (operand error)". The conversion caused an exception, simply because the smaller datatype (16 bit) was not able to store values of the operand (which was 64-bit long). As the software was originally written for Ariane 4, the values were not checked and protected prior the conversion due to assumption that they are&amp;nbsp; "physically limited or that there was a  large margin of error". The check was not implemented to ensure meeting a requirement of sufficiently low load on the main flight computer. The funny thing is, that the piece of code that caused the explosion was not needed by Ariane 5 at all - it was there because of reusing of whole Ariane 4 subsystem...&lt;br /&gt;The result was spectacular fireworks show worth 350 000 000$ founded by French Arianespace.&lt;br /&gt;&lt;br /&gt;Less funny was however a similar failure of &lt;a href="http://en.wikipedia.org/wiki/MIM-104_Patriot"&gt;MM-104 Patriot&lt;/a&gt; system in Dhahran on February, 25th 1991, when an Iraqi &lt;a href="http://en.wikipedia.org/wiki/Scud"&gt;Scud&lt;/a&gt; missile killed 28 soldiers. Even though the approaching Scud was detected, the Patriot failed to intercept it due to a software error. Put simple, the radar detected the missile, the software predicted where it will be next... and it was not there. Why? The prediction procedure was OK, however it relied on an accurate calculation of time in the systems clock - and this part was buggy (cumulating &lt;a href="http://en.wikipedia.org/wiki/Roundoff_error"&gt;roundoff error&lt;/a&gt;) causing &lt;a href="http://en.wikipedia.org/wiki/Clock_drift"&gt;clock drift&lt;/a&gt; (i.e. clock was not running at the correct speed). As the MM-104 station was up for over 100 hours, the clock was off about 1/3 of a second - enough for the Scud to travel over 600 meters. As the subsequent scans of the radar have not detected the incoming missile in the predicted areas, the system assumed it was a false alarm... while the Scud has hit the barracks already. Sadly the problem was identified a few days earlier, with a temporary solution suggested (i.e. rebooting the station every few hours) and the patch was delivered by the producent a few hours after the people died.&lt;br /&gt;&lt;br /&gt;Another example of failure (but with no explosion this time) is FBI Virtual Case File. As the bureau was having troubles with sharing the data among its agents and divisions (and it was strongly criticised for that) it was decided to develop a system, where all the case files will be stored and all the agents with suitable access level will be able to quickly find them. The project started in 2001 just before 9/11 and was supposed to be finished in 2003. After several delays it was finally completed in 2004, but ... had only partial functionality, that did not match the requirements emerging after the terrorist attacks. 170 000 000$ spent on a project that was scrapped eventually.&lt;br /&gt;&lt;br /&gt;Next example - Sainsbury supply chain management. Prior 2000 Salisbury had a centralised mainframe warehouse management. The new CEO claimed the server has had low utilisation, it used too many applications and outsourcing the IT departament to Accenture would lead to a new open, scalable, high performance architecture with strong security at low cost. In 2004 the contract with Accenture was renewed until 2010 as "the relationship with Accenture worked so well", however 2 month later CEO resigns because of poor financial performance. Soon after it is discovered that the warehouse management system under the development is not even able to track the stock correctly. The project was cancelled and the in-house IT departament restored. 1.8 billion $ wasted, Accenture blames Salisbury and vice versa.&lt;br /&gt;&lt;br /&gt;I can probably give many more examples - but there are books full of them already (and really good article by Robert Charette titled "&lt;a href="http://spectrum.ieee.org/computing/software/why-software-fails/"&gt;Why software fails&lt;/a&gt;" published in IEE Spectrum a few years ago). It is much more interesting to look at the reasons of these failures. Before we do that, lets consider them with relation to the criteria we set in the beginning:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Project&lt;/td&gt;&lt;td&gt;Delivered on time?&lt;/td&gt;&lt;td&gt;Within budget?&lt;/td&gt;&lt;td&gt;Meets requirements?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Araine&lt;/td&gt;&lt;td&gt;YES&lt;/td&gt;&lt;td&gt;Probably&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;MM-104&lt;/td&gt;&lt;td&gt;Probably&lt;/td&gt;&lt;td&gt;Probably&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;FBI Case File&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Salisbury warehouse mgmt.&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;So as we can see the failures are not always the same - even if the final user gets a software on time and for the money he intended to pay, it does not mean it is a successful project (although in general your PC will not blow up when programs fail, so &lt;b&gt;small&lt;/b&gt; number of bugs is usually acceptable given very high cost of identifying them prior release).&lt;br /&gt;&lt;br /&gt;So what are the reasons this failures happen? In case of Araine, we might say the reason was insufficient testing. However, if we take a deeper look we will see that it is not the only problem: we can point out insufficient/erroneous specification of requirements - the software provided did something completely uncesessary (as it was developed for different spacecraft, with completely different launch procedure); moreover the requirements were contradicting or impossible to meet (low load vs. need for error detection and correction). Secondly, a blind software reuse was most probably caused by an urge to meet deadlines - this software was proven and tested (but on different spacecraft!), so it was easier to copy&amp;amp;paste (regardless of its suitability) than write it from scratch - somebody however forgot to ask if it can be reused directly without modification (or asked, but had no time to re-test properly).&lt;br /&gt;&lt;br /&gt;Similarly, we might say an insufficient testing was the reason of the Patriot failure. But the bug was known at this time, and the immediate problem was lack of information how to deal with it - effectively an insufficient training of the soldiers managing the station - which was a command chain/management issue.&lt;br /&gt;&lt;br /&gt;In case of the FBI Case File the reasons are quite obvious:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;poorly defined, changing requirements,&amp;nbsp;&lt;/li&gt;&lt;li&gt;overcommitment to an ambitious project, that was (in fact) ment to be a fast fix to a broader management/communitaction problem within the FBI itself,&lt;/li&gt;&lt;li&gt;poor quality of work done by contractors without sufficient expertise.&lt;/li&gt;&lt;/ul&gt;Moreover there were some 'political reasons' contributing to the failure: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;neglecting existance of off-the-shelf solutions,&lt;/li&gt;&lt;li&gt;14 (sic!) project managers over the 3 years of project life time (so a manager changing something like every 2.5 months),&lt;/li&gt;&lt;li&gt;hardware setup, waiting for software (hence pressure for fast delivery on unrealistic deadlines)&lt;/li&gt;&lt;/ul&gt;Similar problems might be found in case of Salisbury:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;weak outsourcing strategy,&lt;/li&gt;&lt;li&gt;'big-bang' approach,&lt;/li&gt;&lt;li&gt;politics,&amp;nbsp;&lt;/li&gt;&lt;li&gt;software meant to be a fix for poor business management&lt;/li&gt;&lt;/ul&gt;In addition loss of staff with knowledge about exisiting solution contributed to some of the problems (Accenture claimed the software failed due to faulty Salisbury subsystems that were not outsourced to them).&lt;br /&gt;&lt;br /&gt;I will also quickly list the problems with the project I wrote about last time. As I said, the first problem was lack of understanding of the customer needs - poor specification of requirements. Secondly, the project was approached in 'big-bang' fashion and without any suitable management policy. Well, there was lack of management at all. At the time I took over, the pressure to deliver fast was already growing, with an urge for scallable and efficient solution resulting with insufficient testing and poor overall quality. Thankfully we managed to sort it out - and the lesson was learnt.&lt;br /&gt;&lt;br /&gt;We can generally say, that failure or success of the project depends critically on following factors:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;organisational - being the culture and workflow within the organization&amp;nbsp; the software is developed for. In general the software should not be a fix to the problems of completely different nature (such as lack of suitable procedures, communication, poor business management);&lt;/li&gt;&lt;li&gt;project management - overcommitment and pressures of any kind do not help in efficient project management. Moreover lack of suitable management, broad overview and understanding of the project and its scope also contributes to failure.&amp;nbsp; &lt;/li&gt;&lt;li&gt;conduct of the project - errors in each of the phases of the project development - including initial stages (e.g. underestimating complexity, lure for a particular solution without a sensible reason), specification and design (e.g. poor requirements engineering, poor design, poor consulatation), and later in development (e.g. poor contractors quality, lack of suitable knowledge, communication etc.) and implementation (e.g. insufficient testing and users training) all contribute to a final result of the project.&lt;/li&gt;&lt;/ul&gt;From now on I will try to write more 'practical' and less theoretical posts that will address various issues presented here. I will try not to stick to 'natural' &lt;a href="http://en.wikipedia.org/wiki/Waterfall_model"&gt;waterfall model&lt;/a&gt; (i.e. presentation of each of the phases one-by-one), but rather write about stuff I encounter everyday either in my company, or at the university (yes we also have to manage our research projects there). Hence, if I encouter an interesting issue - it is likely to be presented in an upcoming post (with some additional examples). &lt;br /&gt;&lt;br /&gt;Next time I will be talking about requirements engineering or "what customer wants and why he does not really need it":)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9443485-2538095579686787126?l=programmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmer.blogspot.com/feeds/2538095579686787126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programmer.blogspot.com/2011/08/why-software-fails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/2538095579686787126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/2538095579686787126'/><link rel='alternate' type='text/html' href='http://programmer.blogspot.com/2011/08/why-software-fails.html' title='Why software fails?'/><author><name>Michal</name><uri>http://www.blogger.com/profile/00977612876422593833</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9443485.post-5277284203933799541</id><published>2011-08-08T20:25:00.000+01:00</published><updated>2011-08-08T20:25:21.879+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='software failure'/><category scheme='http://www.blogger.com/atom/ns#' term='project management'/><category scheme='http://www.blogger.com/atom/ns#' term='software engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='coding'/><title type='text'>What the programming is really about?</title><content type='html'>The way we learn to program causes in my opinion a small misunderstanding of what programming really is. All tutorials, most of university courses (at least these called 'programming'), and the way we approach the process of learning put focus on &lt;i&gt;writing a code&lt;/i&gt; in a particular language. But the process of creating a piece of (usable) software is much more than just writing the code.&lt;br /&gt;&lt;br /&gt;Whatever approach, workflow, or strategy we employ there are always some steps and parts that cannot be ommited such as design and testing. In the beginig of our carrier as a programmer we often do not do explicit design or testing steps - the programs we write (e.g. to complete programming course) are often small enough to do the design on-the-fly in our head, and refine in process, while the testing is often done in "lets check if it works" fashion. As such these steps are not completely ommited, however neglecting them this way causes our software to be only good enough to serve the particular purpose of the moment (i.e. passing the course). Extending, maintaining or even proper debugging is a pain even though the code is usually less than a few thousands lines.&lt;br /&gt;&lt;br /&gt;But what with real software? Not toy programs of 1000 lines but real program that has let say 100 000 lines of the code, usees number of external libraries (additional 100 000 lines of code, not maintained by us directly), a number of resources like images, data files, devices (e.g. printers). A programs that are not single-threaded (often different parts do not even work on the same PC), and that compete for resources with other processes.&lt;br /&gt;&lt;br /&gt;Extending and maintaining such an application was one of the first tasks when I started to work as a professional progammer. Unfortunately the code was written without any design, with virtually no documentation and not even trace of user requirements. To make things harder the programmer who wrote it left the company shortly before I started... The effect? Complete mess... It took me half a year to really understand how it works and fix it to the degree it could be used by the customers. 5 years, 2 releases, &lt;i&gt;major&lt;/i&gt; rewrites, and a lot of cleanup later, the code was still simply bad, but there was hope to make it right!&lt;br /&gt;&lt;br /&gt;Why this happened? There are several reasons most important are lack of initial requirements, understanding customer needs, lack of any design and testign routines. Plus a few missed deadlines, and a complicating factor of the customers changing their mind every second day. The code I inherited form the previous developer was simply a stack of ad-hoc solutions to the unstructured set of ideas that customers had.&lt;br /&gt;&lt;br /&gt;To be honest I was part of the problem as well - being young and proud, I said "yes I can make it working". I was right I could - but today I know it could have been done at half of the cost and much faster if I started from scratch with the correct approach. Unfortunately, nobody prevented me from making this mistake back than as the company I was working at was not really a software development business. As such no project manager had any real experience in real-world software development.&lt;br /&gt;&lt;br /&gt;But hey! Saying I was part of the problem I didn't mean I had no knowledge about &lt;i&gt;software engineering&lt;/i&gt;. I had! I have taken the courses, I have read the books, and hell I even have written a few programs using the correct approach. The problem was that I had still belived that I can manage to do ad-hoc development on such a large program. Having experience only in writing programs that were 1/10 of its size, and experience in modifying large programs that were &lt;i&gt;nicely written, correctly designed and well documented&lt;/i&gt;, I had no idea it might be &lt;i&gt;that&lt;/i&gt; hard. &lt;br /&gt;&lt;br /&gt;But was that really my fault? I had come across 3 universities in 3 different countries, in each case the programming courses I had to take, taught me to &lt;i&gt;write&lt;/i&gt; a code. The engineering process was taught in separation and required me - a student - to write a small program using widely accepted approach (e.g. Rational Process). But the scale was not right, writing 1000-5000 lines of code to make a small database of customers and products makes no difference if I make some serious mistakes while building the program or not as I can recover quickly by deleting 100 lines of code and writing them again. Plus nobody told me how to estimate time and cost of the development. How are you going to earn money as a company if you have no idea what the cost will be and how much customer has to pay? Most of the graduates I interviewed over last few years for various positions in the companies I was working for were in the same position as I had been back then.&lt;br /&gt;&lt;br /&gt;Fortunately there is more emphasis on design and testing in the current way of teaching, but I would say even more is needed. In the couple of next articles I will try to develop a small programming 101 series. I will not make a tutorial though - rather I will try to focus why we should not consider programming to be code writing (which is &lt;i&gt;coding&lt;/i&gt;), how to avoid mistakes, and how to make ours (i.e. programmers) and our project managers life easier. I will not limit myself to write essays - instead I will be presenting various projects, techniques and examples I consider useful or because they are simply worth looking at.&lt;br /&gt;&lt;br /&gt;Before I finish I will give you a link to a small article titled "&lt;a href="http://www.mymanagementguide.com/top-5-project-failure-reasons-or-why-my-project-fails/"&gt;Top 5 Project Failure Reasons, or Why My Project Fails&lt;/a&gt;" published on &lt;a href="http://www.mymanagementguide.com/"&gt;My Management Guide&lt;/a&gt; site. Even though I do not think it is comprehensive - it is a good starting point to understand why the project I described above was such a pain, and why it actually is a miracle it was completed to the customer satisfaction.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9443485-5277284203933799541?l=programmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmer.blogspot.com/feeds/5277284203933799541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programmer.blogspot.com/2011/08/what-programming-is-really-about.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/5277284203933799541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/5277284203933799541'/><link rel='alternate' type='text/html' href='http://programmer.blogspot.com/2011/08/what-programming-is-really-about.html' title='What the programming is really about?'/><author><name>Michal</name><uri>http://www.blogger.com/profile/00977612876422593833</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9443485.post-5284449881634470230</id><published>2011-08-07T14:36:00.000+01:00</published><updated>2011-08-07T14:36:06.886+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='project management'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>There's a new sheriff in the town...</title><content type='html'>The blog will have its second life, after Alexander - the previous author agreed to transfer it to me. I will try to keep it alive, writing about various technical and non-technical issues related to programming and computer science as a field. The first batch of stuff will be published soon - I have some larger projects going on in my company, that we need to pay close attention to... software projects management is a b**ch.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9443485-5284449881634470230?l=programmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programmer.blogspot.com/feeds/5284449881634470230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programmer.blogspot.com/2011/08/theres-new-sheriff-in-town.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/5284449881634470230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9443485/posts/default/5284449881634470230'/><link rel='alternate' type='text/html' href='http://programmer.blogspot.com/2011/08/theres-new-sheriff-in-town.html' title='There&apos;s a new sheriff in the town...'/><author><name>Michal</name><uri>http://www.blogger.com/profile/00977612876422593833</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
