Friday, September 28, 2007

Agile & Scrum

Flashback: I always used to wonder the difference between a software project development and a software product development? Is there any difference? I had experience with software project development. But I could not differentiate a software product and a project. [Till 2006]

Finally I got a chance to work with a software product, and my objective of this blog is to share some of the major points which I have come across in the product development. [2007]

Its “Agile” and “scrum”!!!

It may not make sense to some of you, because agile can be used in project development also, but according to me, agile is more suitable for product development.

What is Agile and why Agile?
It is a software development methodology. And agile is perfectly suitable for product development. Changes in the requirements are so frequent in the product development. ie, Product should satisfy all the changing market needs, there is nothing called as a frozen requirement. So it is very difficult to maintain software if you are using traditional software development methodologies like waterfall model or Iterative method. So the best option is agile!!

And another important factor in the product development is the timeframe. Duration of product development is very short. Waterfall model takes months together or may be takes years for building the software. Drawback of this methodology is Customer has to wait for a long time for the software. Even it takes time in case of iterative development. But agile push down the development time and thus it’s the obvious choice!!

Agile quotes and terms:

-There is no concept of INDIVIDUAL in agile, instead it’s TEAM. Agile says that,



“If one person fails to deliver on time, then the complete team is
failed. People should help each other to complete tasks”

-Chickens and Pigs

ScrumScrum is one of the agile methodologies for software development.The word scrum came from the rugby formation. :-)



(ie, it represents the importance of teamwork)







Product backlogs: Complete list of tasks for the product.

Sprint: Development is divided into sprints. Duration of sprint will be 4-6 weeks.

Sprint backlogs: Picks some backlogs from the product backlogs for the sprint. And these tasks have to be completed within the sprint duration.

Scrum meeting: Daily meeting of sprint team members. Meeting should not exceed beyond 15 minutes. Each team member gets a minute for talk about

1. What I did yesterday?
2. What Am I planning to do today?
3. Any issues?

Team members should not discuss issues in detail during scrum meeting, instead it should take offline.

Scum master: A team member from the Sprint team.

Scrum of Scrum: Multiple sprints may be running parallel, and it is important that each sprint team should go in tandem. It is not practical to meet all the sprint members. So the alternative is the meeting of scrum masters from each sprint and is called as scrum of scrum.

Scrumworks: A tool helps to manage sprint. Tool helps to list down all the backlog items and tasks with respect to each sprint. And it really helps in estimation.

http://www.scrumworks.com/


Reference:

A book by name "Agile Software Development with Scrum" - Ken Schwaber, Mike Beedle
(ISBN 0-13-067634-9)




And

There are lot many details to be addressed while discussing about agile and scrum. But I hope that I have discussed some of the major terms and did justice to my blog :-)

‘Either you win as a team or you loose as a team”.

Thursday, September 6, 2007

UML - Part 1

UML Distilled : A book review
I know that I am deviating from my objective of the technical blog. I have created this blog for discussing about hardcore technical topics, not for just discussing about a book. But I could not stop myself from writing few lines about this fantastic book by Martin Fowler!!

You cannot call yourself a software designer or an architect
if you have not read this book.
~ nidhish ;)
I was a 9th standard student when this book got published for the first time and believe me, I have never seen a computer at that time!! Ten years from then,here I am, doing the review of that best seller :) Software industry is changing so drastically and ten years in a long period, but UML Distilled is still hot!! That made me to write about this special book.

How do you represent the design of a software system?

Well,we all know the answer, its UML (Unified Modelling Langauage). Have you ever thought about how UML emerged?

History:
People were using different methods for representing their design in late 80's and early 90's. There were no standard way to represent design. Different people were using different ways of representing their design, But basically all these methods were similar. Sadly there was no standardization on these methods and which was leading to confusion.

By 1997, Grady,Jim and Ivar worked together and combined all their works under one name : the Unified Modeling Langauge(UML). Now they are known as "three amigos".

Grady Booch - Rational software
Jim Rumbaugh - GE (OMT : Object modeling technique)
Ivar Jacobson - Ericsson (Use Cases)

UML is a modeling language, It is not a method(method contains both modeling language as well as a process). Modeling language uses notations to express design. ie, it helps you to discuss your design with someone.

We will discuss more about the UML Diagrams on the next part of the Blog.
(contd..)

And
There are thousands of UML books available in the market, and its really hard to find the best one out of it. Thanks to Aslam for suggesting me to go for this fantastic book. The beauty of the book is Martin Fowler worked very close with the "three amigos" for writing this book.

Tuesday, September 4, 2007

.NET on Linux

Even though being a Microsoft professional, I’ve started my career in a Java project in 2003. I know how strange it was… :) !! But it gave me a chance to know more about a robust technology- JAVA. And I’ve started comparing Java and “brand new” .NET. But I could see that .NET was lagging in interoperability. It was not platform independent.

Beauty of JAVA is, “write code, compile once and run it anywhere”. I felt that .NET had a huge limitation on this, until I come across MONO. Thanks to NOVELL for providing the open source software that helps to run .NET code on Linux platform. Now I can proudly tell to any Java developer that my C# code which I have written on windows platform can be run on the Linux environment. :)



What is Mono?

Mono is open source software provided by NOVELL, which helps to run .NET code on Linux platform.

Current production version of mono is 1.2.4 (as of today)

MonoDevelop is the IDE (Integrated Development Environment) which can be used for writing C# code in Linux.

Mono Migration Analyzer is a tool which helps to identify the portability issues while porting .NET code written in windows platform to Linux. The tool lists down all the portability issues in the form of a report.

SLED (SUSE Linux Enterprise Desktop 10.2) is the Linux operating system on which mono can be installed. This Linux flavour is also provided by NOVELL.

BOO is a language available with Mono :)

Gtk# project can be created using MonoDevelop. It is similar to WinForms.

MonkeyGuide is the name of help file for Mono :)



p.s: What does the name "Mono" mean? Mono is the word for 'monkey' in Spanish. NOVELL says that they like monkeys ;)

Challenges while porting :
I really do not have any clue on “how to port ASP.NET applications into Linux”. Because there is no IIS present on Linux. So the real question is “where do I host my web application or webservice on Linux platform?”

Currently Mono does not support .NET framework 3.0. So just don’t plan for using WCF or WPF.

Not all the .NET framework 2.0 features are ready in Mono, open source team of NOVELL is adding those features. But majority of the framework 2.0 features are available.

There are many more portability issues which you may come across while working with Mono. And good thing is NOVELL is having support team for Mono. But I fear that it’s a paid service. After all I don’t think anyone in this word will be ready to provide free support. :)


References:
www.mono-project.com


And

Special thanks to Radhika (who is working with NOVELL and my super-super-super senior :) at +2) for introducing me to the people who’ve developed Mono. That was a very different experience talking to those folks who were behind mono project!!!

Thursday, August 30, 2007

Unit testing in .NET

NUnit: Unit testing framework for .NET

I had only theoretical knowledge about the unit testing until I came across NUnit. Later I've realized that NUnit can make a huge impact in the quality of the code as well as the project and how helpful it is for a .NET developer. Its very hard to maintain huge chunks of code and it will become real difficult to keep track of changes in a huge project. NUnit will come into picture here.
TDD (Test driven development) and extreme programming:
According to Aslam : "you have a requirement, you will start writing test code for the requirement before writing the actual code, obviously test fails when trying to run the test because the actual code is missing , then you will start writing the actual code.This method is called as TDD."
isn't TDD crazy!!? :)
Let me conclude, Test driven development involves 3 stages,
1.write a test 2.write code to pass the test 3.refactor the code to make it simpler and flexible

When TDD is getting used? Suppose the changes in requirement is so frequent and thus it results an overhead for the developer to keep track of the changes in code. TDD is a solution for the above mentioned problem.
And the only way to understand TDD is to do it.
TDD(test driven development) is an extreme programming technique. There will be a corresponding test code for every functionality in the actual code. Now comes the question, how will you write the unit test code in .NET? And the answer is NUnit.
Here is a scenario on how to use NUnit.
1. Account.cs :
using System;
using System.Collections.Generic;
using System.Text;

namespace bank
{
public class Account
{
private float balance;
public void Deposit(float amount)
{
balance += amount;
}

public void Withdraw(float amount)
{
balance -= amount;
}

public void TransferFunds(Account destination, float amount)
{
}

public float Balance
{
get { return balance; }
}
}
}
2. AccountTest.cs : unit test for Account.cs
using System;
using System.Collections.Generic;
using System.Text;

namespace bank
{
using NUnit.Framework;

[TestFixture]
public class AccountTest
{
[Test]
public void TransferFunds()
{
Console.Out.WriteLine("start testing...");
Console.Out.WriteLine("creating source object...");
Account source = new Account();
source.Deposit(200.00F);
Console.Out.WriteLine("creating destination object...");
Account destination = new Account();
destination.Deposit(150.00F);
Console.Out.WriteLine("transfer funds...");
source.TransferFunds(destination, 100.00F);
Assert.AreEqual(150.00F, destination.Balance);
Assert.AreEqual(200.00F, source.Balance);
Console.Out.WriteLine("end testing...");
}
}
}

3. Run the test (using GUI-Runner ie, nunit-gui.exe)



Here test is successful and thus indicating in green color.


Reference: http://www.nunit.org/


And
NUnit was my first work in IBM, and Thanks to Aslam(TPM) for
giving me the opportunity to dig into NUnit. And later my learnings are
recognized and added as an IBM asset in code library!! :)

Friday, August 24, 2007

SAP.NET Connectivity

In the initial days of my career I always used to wonder how the integration takes place between two technologies, but never got a chance to work with one. Later i realized that "Opportunities are vast and it will come to you even if it is late". And I got a chance to work with .NET and SAP integration.

My objective of this blog is to explain the SAP.NET connectivity. ie, connecting to SAP from a .NET web Service. Prerequisites for achieving the connectivity are:

  1. Microsoft visual studio 2003
  2. SAP.NET connector 2.0
  3. Java runtime environment
  4. SAP client (Optional)
Perform the following steps:

  1. Install SAP.NET Connector 2.0 (Ensure that Microsoft Visual Studio .NET 2003 is already installed on the PC before installing SAP.NET Connector)
  2. Install Java runtime environment (j2sdk-1_4_2_05-windows-i586-p.exe)
    Note: Java Runtime Environment require for generating SAP proxy.

  3. Open .NET solution (Here I’m explaining with respect to Web service)
  4. Open Server explorer from the .NET Solution and you can see SAP addin appearing on the Server explorer. Note: SAP addin will appear on server explorer only after the installation of SAP.NET Connector 2.0




  5. Expand SAP addin in the server explorer and Select Application Server and Right click - “Add an application server”.





  6. Configure application server :

    Destination type : Custom logon settings
    AppServerHost : 10.222.21.35
    SystemNumber : 0
    UserName : mmdemo
    password : ******
    client : 200
    Language : EN





  7. Expand application server – Functions – “Add Function Filter…” – and add the following filters

    GroupFilter : *
    NameFilter : *






  8. Expand Functions after setting function filters and you will get the list of BAPIs (Business APIs) on the server explorer





  9. Add a new SAP connector proxy class to the solution from the solution explorer.




  10. drag and drop particular BAPI on to the design view of Proxy class.






  11. Build the solution after retrieving data
  12. Go to the design view of design view of ASMX file. And select Toolbox - SAP Proxy





  13. Drag and drop the proxy from the toolbox to the design view of ASMX file.




  14. Create web method that makes use of the proxy.


    //SAP Connectionstring
    public string _CONNECTIONSTRING="ashost=10.222.21.35 sysnr=0 client=200 passwd=newuser type=3 user=mmdemo";
    //SAP proxy
    private wsSAPdotnet.MySAPProxy mySAPProxy1;

    [WebMethod]
    public DataSet GetData()
    {
    DataSet dsData=new DataSet();

    //Initialize SAP proxy
    mySAPProxy1=new MySAPProxy(_CONNECTIONSTRING);
    //Open proxy connection
    mySAPProxy1.Connection.Open();

    //Parameters for the BAPI
    ZBAPIMATGRPTable Matgrp_List=new ZBAPIMATGRPTable();
    ZBAPIPLANTTable Plant_List=new ZBAPIPLANTTable();
    ZBAPIPURGRPTable Purgrp_List=new ZBAPIPURGRPTable();
    BAPIRETURNTable Return0=new BAPIRETURNTable();

    //Invoke BAPI and the result will be present in
    //the 4 parameters
    mySAPProxy1.Bapi_Plant_Mat_Pur_Grp(
    ref Matgrp_List,
    ref Plant_List,
    ref Purgrp_List,
    ref Return0);

    //Close proxy connection
    mySAPProxy1.Connection.Close();

    //Convert SAPTable to DataTable and add it to dataset
    dsData.Tables.Add(Matgrp_List.ToADODataTable());
    dsData.Tables.Add(Plant_List.ToADODataTable());
    dsData.Tables.Add(Purgrp_List.ToADODataTable());

    return dsData;
    }


  15. Compile the solution and execute it
  16. p.s : Here is your webservice !! And you can access SAP just by
    invoking the webmethod which we'd creaded just now!!


  17. Invoke web method GetData and which returns the data from SAP.




These 16 steps will allow a typical microsoft developer like me to access and do transactions in a SAP server :)
And
Thanks to SAP for providing the SAP.NET Connector and special
thanks to Ram(PM,L&T) for giving me the wonderful opportunity to make my hand dirty by doing the integration between Microsoft.NET and SAP!!