Tuesday, October 5, 2010

Waterfall Model

As I was in the university, I used to learn lot about Waterfall model of software development life cycle. It was such as uncomplicated process to learn. But after been in the software development industry for more than four year, I'm been convinced that Waterfall model software development process is not going to valid for more projects popping up these dates.

Summery if the phases of Waterfall model

  1. Requirements – Gathering, analyzing, documenting and etc.
  2. Design – design system for functional and non functional requirements
  3. Development – It's all about coding and developer testing
  4. Testing And Verification – the testing conducted by the dedicated testing team in the organization after a particular release of the system is delivered. There can be number of releases is been delivered in this phase and testing team is reporting for the bugs system is consist of and developer team is fixing them to deliver the well behaved features with the very next release.
  5. Finally, it deployment and maintenance.


Success Stories of Waterfall model

If I'm talking about my experience, there were projects which were developing smoothly at least for more than six months without interruptions to change the requirement in the mean time development in progress.

The first large scale project which I was working on is a migration. It was to already implemented Time Management system (But it was large number of feature that just not a time management, had more than 8 modules each averagely estimated to 2000 hours) and it was implemented using C++ and VB. Customer was facing barrier of providing more and more feature with the existing one.

The requirement was cleared, well identified already, and what all we need to start doing things from Use cases to Deployment, Client was not so annoyed to change the requirements and he got what he was looking for at the end of the project.

This is an example of one of the success story of the Waterfall model, but it was also not a 100% success story.

But more than 95% of projects currently in progress of development would be failed with Waterfall Model.

Why Waterfall model is not success in most cases.

  1. Difficult to responds for the requirements changes are raised to by the customer after starting development and designs.
  2. Difficult to respond new requirements are requested by customer after starting of the development and designs.
  3. Cycle is draw out for long period of time which customer has to wait to see check whether that developer has delivered the system what they were looking for.
  4. Business rules are changing rapidly in today businesses, waterfall model is not good enough to address it.
  5. etc.

Regards

Lakmal

Software Development Processes

I used to write things to the blog, especially to arrange things I'm absorbing when I'm working. Last weekend I took some time to browse about software development processes and this blog post is about summarizing them into a note for later references.

Waterfall model, CCMI, Agile, Extreme Programming, SCRUM, Lean, FDD, are they just words?? , those are not just words when it's come to the software development processes. It's not all about software development; they can be applied for other industries as well.

As I can remember, when we were having discussion about implementing a process in our company, people were talking about why don't try SCRUM instead of Agile?, Why don't we try agile instead of XP. Truly I had no clues to popping up any ideas about the processes, because I knew I had to talk if I had good idea about them only. I was exposed to such good software development processes in my life but I was not worried to learn more about them till to this point.

What's software development process?

Found a definition for "Software Development Process" from Wikipedia

"A software development process is a structure imposed on the development of a software product. Synonyms include software life cycle and software process. There are several models for such processes, each describing approaches to a variety of tasks or activities that take place during the process."

What's the meaning of Software Development Process Framework?

Framework, the word itself insisting us that, you have something implemented for you and all you have to do is extend it to support you environment. Core, Concept, Idea, Initiative, Guidelines, Suggestions are already there, we just extend it to adapt into custom environments.

Each and every organization is supposed to have their own process to manage their projects (Or their day today works). But defining a process from the scratch is not going to be a simple task. All we need is to extend already well defined, proved process framework in our environment.

Waterfall model, Spiral model, agile, SCRUM, XP, Lean, DFDM, FDD, Crystal they all are process frameworks.

Regards

Lakmal

Tuesday, September 14, 2010

10 Suggestions for Architect of an Agile Team

Nice speech given by Tom Hollander from Microsoft Australia and he is making 10 suggesion for agile team architect to be sticked to. According to the tom, Agile team is employing number roles itself...
  • PjM – is the Project Manager, similar to a Scrum Master, making sure the team is following the process.
  • PdM – is the Product Manager, also known as the Customer or the Product Owner, determining what the product is supposed to be
  • Architect – a solution/application architect
  • Dev – the development team
  • Test – the test team
  • UX – the User Experience team
  • Release – the Build and Release role taking care of the building process ( In our environment we used to called this role as Build Manager)
And the Suggestions are..
  1. "Just Enough" Up front design
  2. Start with a Vertical Slice - Mean start the development with a small module which cuts all the architectural and designs decisions made.
  3. Just in time design each Iteration
  4. trust your team.. be there for them
  5. Write code
  6. Be involved in everything related to the project
  7. Drive a culture quality
  8. Know when changes are required
  9. Shield the team from external randomization
  10. Write docs... but only is some to read them

Have a watch all video from MSTechEd or you can read speech summery from InfoQ

Regards

Lakmal

Path way to better coding...

I’m a big fan of Joel Spolsky’s writings and last weekend I checked his article archive for some useful to read. One interesting article I found there, which is about how we can steer our development process to achieve better coding. Even though he has written this in year of 2000, it's almost valid yet.

He was discussing about 12 steps we can follow up for better coding and he named it as Joels Test

The Joel Test

  1. Do you use source control?
  2. Can you make a build in one step?
  3. Do you make daily builds?
  4. Do you have a bug database?
  5. Do you fix bugs before writing new code?
  6. Do you have an up-to-date schedule?
  7. Do you have a spec?
  8. Do programmers have quiet working conditions?
  9. Do you use the best tools money can buy?
  10. Do you have testers?
  11. Do new candidates write code during their interview?
  12. Do you do hallway usability testing?

Questions are about two options you take as answer; Yes or No.

Have a read all the article…

Monday, September 13, 2010

Software Usability...

Usability is a big thing to be bothered about in the current industry. Even though we have delivered all the functionalities well worked, how we are going to assure that customer is reaching all the functionalities and features we developed over nights to make them happy.

Found nice definitions for usability from the few articles I read…

Put User at the center of the Process
The term usability in the context of creating software represents an approach that puts the user , rather than the system, at the center of the process.

Usability And Likability
Usability is a measure of how easy it is to use a product to perform prescribed tasks. This is distinct from the related concepts of utility and Likability.

Regards

Lakmal Kankanamge

Wednesday, August 4, 2010

Path 'SVNURL' is not canonicalized; there is a problem with the client.

Few months back, we were migrating our SVN server into new machine and after the migration we all needed to Re-Locate our sources.
In that case, what we were assisted to replace old server URL with new Server URL.

As Expected Re-Locating went successfully and after that we were trying to get update the Projects Sources with the new server. But it was started throwing following error message.

Path 'https://svnservername.CompanyName.local:8443/svn/projectname' is not canonicalized; there is a problem with the client.

Error itself doesn’t tell much on issue details and was surfing internet to find the solution.

Finally found someone mentioning make all the characters in the URL into simple and try. So made the URL like this

https://svnservername.companyname.local:8443/svn/projectname.

Tried to update the source again and everything went successfully.

Regards

Lakmal Kankanamge


Wednesday, July 28, 2010

Generate .NET Code Dynamically

As I can remember, when I was starting learn to programming, writing a simple Hello World program was a big challenge, even though we had enough capable IDEs to do the programming. It’s very interesting to even imagine generate programs dynamically at run time by another program.

With Microsoft .NET CodeDom, it’s possible to generate programs, compile and run them at run time. With this framework code library, it’s possible to have virtual DLLs, Namespaces, classes, Variables, Methods and etc.

Just Imagine this is the class you need to generate dynamically,

namespace ArticlesCodeArchive

{

public class SampleClass

{

private string _property1;

private bool _property2;

public SampleClass(string tech)

{

this._property1 = tech;

this._property2 = false;

}

public string Property1

{

get { return _property1; }

set { _property1 = value; }

}

public bool Property2

{

get { return _property2; }

set { _property2 = value; }

}

}

}

Create a Namespace

public static CodeNamespace CreateNameSpace(string nameSpaceName)

{

CodeNamespace returnValue =

new CodeNamespace(nameSpaceName);

returnValue.Imports.Add

(new CodeNamespaceImport("System"));

returnValue.Imports.Add

(new CodeNamespaceImport("System.Text"));

return returnValue;

}

Method is returning a reference to a CodeNamespace object, which is representing a Namespace with provided name.

Create Class Declaration

public static CodeTypeDeclaration CreateType(string name)

{

CodeTypeDeclaration returnValue = new CodeTypeDeclaration(name);

returnValue.IsClass = true;

returnValue.BaseTypes.Add(new CodeTypeReference(typeof(Object)));

return returnValue;

}

The Class name you have to pass into the method and it will return a reference of object type CodeTypeDeclaration class, which is representing a particular .NET Class with given name.

Create a Property

public static CodeMemberProperty CreateProperty(string Name, Type propertyType)

{

CodeMemberProperty returnValue = new CodeMemberProperty();

returnValue.Attributes = MemberAttributes.Public;

returnValue.Name = Name;

returnValue.Type = new CodeTypeReference(propertyType);

returnValue.GetStatements.Add(

new CodeMethodReturnStatement(new

CodeVariableReferenceExpression("_" + Name)));

returnValue.SetStatements.Add(new CodeAssignStatement(

new CodeVariableReferenceExpression("_" + Name),

new CodeVariableReferenceExpression("value")));

return returnValue;

}

As Same as Class declaration, we have to pass Property Name and the type of the property here and method will return an object reference of type CodeMemberProperty Class, which is representing the .NET Class Property virtually.

Generate a Class

Let’s generate the class we need with all together,

public static CodeNamespace GenerateSkeleton()

{

CodeNamespace returnvalue = CreateNameSpace("ArticlesCodeArchive");

CodeTypeDeclaration generatedType = CreateType("SampleClass");

returnvalue.Types.Add(generatedType);

generatedType.Members.Add(CreateProperty("property1", typeof(string)));

generatedType.Members.Add(

new CodeMemberField(typeof(string), "_property1"));

generatedType.Members.Add(CreateProperty("property2", typeof(string)));

generatedType.Members.Add(

new CodeMemberField(typeof(string), "_property2"));

return returnvalue;

}

public void GenerateCode()

{

CodeNamespace cns = GenerateSkeleton();

return cns.ToString();

}

Now we have generated the class we need and to make sure everything is ok, you just write the text coming from GenerateCode() method to a file. And it will exactly match with the class we mentioned at the start of this article.

Compile the Generated Class

Now it’s time to working on compiling the class generated at runtime. As same as class generation, compilation is also going to be done at runtime.

public Assembly CompileCode()

{

CodeNamespace ns = GenerateSkeleton();

string lcCode = GenerateCode("C#", ns);

ICodeCompiler loCompiler = new CSharpCodeProvider().CreateCompiler();

CompilerResults loCompiled = GetCompiler(lcCode, loCompiler);

if (loCompiled.Errors.HasErrors)

{

string lcErrorMsg = "";

lcErrorMsg = loCompiled.Errors.Count.ToString() + " Errors:";

for (int x = 0; x <>

lcErrorMsg = lcErrorMsg + "\r\nLine: " +

loCompiled.Errors[x].Line.ToString() + " - " +

loCompiled.Errors[x].ErrorText;

//MessageBox.Show(lcErrorMsg + "\r\n\r\n" + lcCode,

// "Compiler Demo");

return null;

}

Assembly loAssembly = loCompiled.CompiledAssembly;

Return loAssembly;

}

At the end of the compilation, you can have compiled assembly and this is not an assembly physically exists.

How to use a virtual assembly

After generating the Assembly for the virtual class implementation, it’s time to use it at runtime. This class won’t be alive to use later or after a particular session of the application, because all these things are happening here, is virtual. Anything you need to keep for the later use, you will have to save them purposely in the code.

public void UseVirtualClass()

{

Assembly loAssembly = CompileCode();

object loObject = loAssembly.CreateInstance("ArticlesCodeArchive.SampleClass");

object loResult = null;

loResult = loObject.GetType().InvokeMember("property1", BindingFlags.DeclaredOnly |

BindingFlags.Public | BindingFlags.NonPublic |

BindingFlags.Instance | BindingFlags.SetProperty, null, loObject, new Object[] { "This is the value for propert1" });

loResult = loObject.GetType().InvokeMember("property2", BindingFlags.DeclaredOnly |

BindingFlags.Public | BindingFlags.NonPublic |

BindingFlags.Instance | BindingFlags.SetProperty, null, loObject, new Object[] { "This is the value for propert2" });

}

That’s all, now we have assigned values for an object of the class that what we generated dynamically and all these things are happening at runtime.

Lakmal Kankanamge