Ramesh Prabhala's blog

  • Home
  • Contact Me
  • About Us

Retrieving documents and their attributes from Lotus Domino using the COM based API

3rd January, 2013 · prabhalar · Leave a comment

I didn’t know anything about IBM’s Domino – or is it Lotus? Or is it Notes? Or some combination of all three? I will attempt to clarify what is named what in a second here, for now let’s just call it Lotus Domino. Coming from a mainly Microsoft focused background, I didn’t know anything about Lotus Domino until a month back when as part of a project I had to extract some documents out of it. I am not talking about email attachments or anything to do with email here. Part of the problem when researching about Lotus Domino API is that the content that turns up usually refers to email as opposed to document management. Also, whatever content that you do come across on the web is not comprehensive nor is it all in one place, so I had to piece together bits of information to complete my task. As you will notice the code by itself is not complicated but understanding the Domino architecture, taxonomy and the API takes time. So I pieced together the fruits of my research in this article that will briefly explain how to extract documents from a Domino database. Following are a few helpful facts before we get to the code.

What is named what? As a result of acquisitions, merging products or to simply distinguish client from a server, IBM has managed to confuse people with the variable names. The Notes/Domino product suite is a client-server model where Lotus Notes is the client.Lotus Domino is the server. This is analogous to Microsoft’s email product where the client is called Outlook and the server is called Exchange. However, unlike Outlook, Lotus Notes is billed as an application platform so apart from email it can also be used as client to access document management capabilities within the Domino server.

What is Domino.Doc? Adding to the confusion is yet another product called Lotus Domino Document Manager or Domino.Doc. Thankfully, this is retired (although it is replaced by yet another product called Lotus Quickr). Domino.Doc had only document management capabilities. In this project I was asked to work with Lotus Domino 8.5.1 (Enterprise edition) so the code here should work for this and higher versions.

Ultimately where do documents reside and how to access them? Once we navigate through the maze of all these names, products, applications and add-ins that Lotus Domino/Notes suite offers, it will become apparent that core document management capabilities are provided by the Domino server. As mentioned earlier document management is just one of the features provided by Lotus Domino. It also provides other features like email, calendars, discussions and workflows. Documents are stored in non-relational document-centric file based databases which have extensions “.nsf”. Since these are not relational databases you will not be able to query then like you would a SQL Server database. There is an API that we can use to programmatically access the .nsf database for emails, calendars, documents etc.

Can we not just use the Lotus Notes/Domino web services? While researching I learnt that Lotus Domino provides web services. That would make life so easy if we could just call the out-of-the-box web services to access Domino like we can with SharePoint, TFS and Exchange. Unfortunately, Lotus Domino merely provides the infrastructure to write and configure web services. There are no out-of-the-box pre-written web services that we can simply call. Since we still have to provide the meat, we need to know the internals of the product and the API anyway. Now this fact is not apparent in what little documentation IBM has put out there.

Do I need a server with Domino installed to use the COM based API? Yes. I have read somewhere that you can get away with running your code on a box where either the Domino client or server is not installed as long as you register one dll. In my experience that is not true. This one dll in question has dependencies with other dlls so you may end up having to register a whole lot of them to get the API to work. It will be much easier to install at least the Domino client or seek out a box where it is already installed and run your code there else you will run into all sorts of COM errors.

So where is this API and how can I access it? The LotusScript/COM/OLE classes are documented here. General information on accessing Domino objects via COM is described here. The hardest part is getting the actual COM library itself. It’s nowhere to be found in the official documentation sites or the installation folders. I (as did others) found it as part of the source download in this CodeProject article. I have attached the dll to this blog post for convenience.

Calling the COM API from C# to extract documents

As the heading of this post notes the purpose here is to query the Lotus Domino database and extract documents that I save to a local folder. I also need to get the attributes of the document that I just extracted. In my project I copy these attributes to a local text file in XML format but you could just as easily copy them to a database or elsewhere if you would like. Make sure you have downloaded and copied the Interop.Domino.dll that I uploaded here. Here is a step by step description.

1. After creating the project in Visual Studio, add a reference to the Interop.Domino.dll by browsing to the location where you copied it. Note that there is no need to register this dll. This is simply an interface to the native API. This dll is dependent though on other dlls that would have already registered as part of the Domino installation.

2. Initialize a COM session. You can use the Initialize method of the NotesSessionClass and pass a password (it assumes the user from the context the code is running under) or you can call the InitializeUsingNotesUserName and explicitly pass a user name and password that has access to Domino.


var dominoSession = new Domino.NotesSessionClass();
// dominoSession.Initialize(Password);
dominoSession.InitializeUsingNotesUserName(UserName, Password);

3. Create a Domino database object and open the database (which is a .nsf file as mentioned earlier). To the GetDatabase function, you can pass empty string if the code is running on the same server as the database. To the database parameter pass the full path and file name of the .nsf file (e.g. “C:\Domino\Data\AdminDB.nsf”). The third parameter is optional and if set to true will create a database object even if opening the
database fails.


var dominoDatabase = dominoSession.GetDatabase(server name, full database file path, false);
if (dominoDatabase == null)
{
throw new Exception(“Unable to create Domino database object.”);
}

4. At this point a session has been created and a reference to the database obtained. Next we need to query the database for documents. We can call AllDocuments of the NotesDatabase class to get all documents in the database. However, here I need documents which were created or modified on or after a certain date so I will call the GetModifiedDocuments method and pass a date parameter.


// var documentCollection = dominoDatabase.AllDocuments;
Domino.NotesDateTime lastCheckedDate = dominoSession.CreateDateTime(“3/5/2010 12:10:00 AM”);
var documentCollection = dominoDatabase.GetModifiedDocuments(lastCheckedDate);
if (documentCollection == null)
{
throw new Exception(“Unable to get documents.”);
}

5. Now comes the interesting part where we enumerate the documents to read their properties and get the content. But before we get into the code, I need to explain what a “document” means in Domino. In Lotus Domino a document is defined differently compared to the traditional Windows document. In Windows, a document or file that resides on the drive and accessed via say Explorer has properties and content associated with it. In Domino a document is a higher level entity (think of it as the root or parent object) that can contain one or more attachments. These attachments are objects that have content. A document can have attributes like id, create date, subject, author(s), http and Notes url’s etc. but not the content itself. Attachment(s) belonging to a document will have a name and content. A diagram may help explain the concept better. Below I show a document identified by its id and it contains two attachments – one is a MS Word document and the other is a pdf.

Domino

6. The following code iterates through the document collection and reads a few of its attributes. What I have realized is a document has two types of attributes. A main set of attributes that can be read directly via properties of the NotesDocument class as you will notice below. A second set which I call “extended attributes” can be read by accessing the Items property of the NotesDocument class. If the document contains attachments then one or more of the items will have its type set to “attachment”. If we encounter an attachment type, we can then get its name and its content as I show in the code. If the type is not an attachment it will most likely be an extended attribute. Dumping these extended attributes into a XML file, it got me attributes like document category, area and region in the taxonomy, its root name/title, approver names, publisher name, revision number, effective/expired dates etc.


var document = documentCollection.GetFirstDocument();
while (document != null)
{
if (document.IsValid
&& (!document.IsDeleted)
&& (document.HasEmbedded))
{
if (document.Created != null)
{
string createDate = document.Created.ToString();
}
if (document.LastModified != null)
{
string LastModifiedDate = document.LastModified.ToString();
}
if (document.UniversalID != null)
{
string universalId = document.UniversalID;
}
if (document.HttpURL != null)
{
string httpUrl = document.HttpURL;
}

if (document.Authors != null)
{
object[] authors = (object[])document.Authors;
if (authors != null)
{
string[] authorsList = (string[])authors;
}
}

object[] items = (object[])document.Items;
if (items != null)
{
foreach (var item in items)
{
Domino.NotesItem notesItem = (Domino.NotesItem)item;
if (notesItem != null
&& notesItem.Values != null
&& !(notesItem.Values is string))
{
object[] itemValues = (object[])notesItem.Values;
if (itemValues != null)
{
if (notesItem.type == Domino.IT_TYPE.ATTACHMENT)
{
if (itemValues[0] != null && notesItem.Name != null)
{
string fileName = itemValues[0].ToString;
ExtractFileToLocalFolder(document, fileName);
}
}
else
{
foreach (object value in itemValues)
{
if (value != null)
{
string itemName = notesItem.Name;
string value = value.ToString();
// log to xml file or database
}
}
}
}
}
}
}
}
document = documentCollection.GetNextDocument(document);
}

7. The code for the ExtractFileToLocalFolder method is below. This method is called every time an attachment type is encountered while iterating through the items.


private void ExtractFileToLocalFolder(Domino.NotesDocument docment, string fileName)
{
var attachment = docment.GetAttachment(fileName);
attachment.ExtractFile(FilePath + @”\” + fileName);
}

Conclusion

As you may have noted the code is fairly straightforward. Comprehending the concepts and the taxonomy of Lotus Domino that is the tricky part. Finally, do note that this is not production code and I purposely simplified it for this article. Also, you may want to save the attributes – both the main ones and the extended ones – to a file or database. Here I just copy them to meaningless variables to keep the code clean.

EDIT: Though I have left it out for the sake of brevity, do remember to clean up the COM objects – documentCollection, dominoDatabase and dominoSession after you are done by calling Marshal.ReleaseComObject() on them preferably in a finally block.

Download the NuGet package to get the interop.domino.dl

Posted in Uncategorized |

Challenges with offshore development and lessons learned

27th December, 2012 · prabhalar · Leave a comment

Having worked on offshore development teams and on onsite teams in America, I have experienced the dynamics and the obvious challenges on both sides of the fence. Many companies that are dealing with offshore development teams today are experiencing similar challenges, so it will help to understand specifically what those challenges are and how to at least try and alleviate them even if some are too daunting to be fixed outright. This article has a strong India tilt since I have lived there before immigrating to the USA. However, I have also worked with offshore teams in other Asian countries as well as Europe. A lot of the challenges that I have experiences dealing with India based teams are ones I have experienced with teams in other countries as well so the lessons here are pretty universal.

Starting my software engineering career in Bangalore back in 1997, I used to occasionally ride past the Texas Instruments aesthetic campus in my motorcycle. With contemporary buildings and lush green lawns the campus stood in stark contrast to the drab commercial structures housing mainly government offices sprinkled around the city. TI was the first global company to set up an offshore engineering center in India in the mid 1980’s. Faced with explosive growth in business and consequently its need to hire engineering talent, it ventured into India looking to address this need when no other global company recognized the country back then as a host for engineering talent. With more than 700 patents today and the footprint of the Bangalore team in a lot of its products, TI is entitled to feel vindicated for that decision. Once TI paved the way other multinational firms followed suite eager to benefit from the technical education combined with English language skills of a young workforce. At that point the low cost of hiring engineers was a pleasant secondary advantage but not the primary reason to offshore that it would later become.

Shift to a cost saving philosophy
Back in the day when IT offshoring started in India it was a manpower scaling model rather than a cost saving model. That is, companies that either sought out offshore partners or opened their own offshore development centers were mainly looking to fill the shortage of USA based engineers with Indian counterparts to design chips, write code for internet startups and enterprise software, maintain databases, perform medical transcriptions etc. In the 1980’s and 1990’s the cost and ease of setting up an offshore development center in say Bangalore wasn’t as cheap as today. Yes the salaries were much cheaper compared to an engineer in the US but there were offsetting factors. For example office space was limited and therefore expensive, telecom infrastructure was just beginning to get spruced up and in one interview Bill Gates even said he may need to get an airstrip built before establishing an offshore development center in Hyderabad because the air transportation infrastructure was inadequate. But over time air transportation (and connectivity) and telecommunication infrastructure improved and office space increased thus significantly lowering the cost and ease of incubating a development center. As costs lowered in India, US went into an economic recession during the internet bubble era. That’s when American and to a lesser extent European companies increased offshoring with cost as the primary motive. That was the point at which in my opinion quality issues experienced an increase. A number of issues and challenges that I outline below in my view are due to this change in incentive to offshore to lower IT expenses.

High employee attrition and turnover
When I say attrition, I am referring to employees voluntarily and frequently changing jobs after short stints. A lot of managers I talk to here in US refer to high turnover as the number one cause for concern. It’s obviously an issue for the company that offshored if employees get trained on a product and leave before making any meaningful contribution and new employees have to be retrained all over again. But it is a major handicap for an offshore employee too in terms of advancing their skills. When so much focus and time is spent on looking for a new job even before settling down in the current one, it leaves little time and motivation to hone existing skills and learn new ones.

Causes of voluntary employee attrition are partly cultural. In Asian society there is a trend of keeping up with – or even surpassing – the Joneses. Employees freely exchange personal compensation details among themselves and if a coworker or a buddy gets a higher compensation even if it’s only by a handful of dollars, there is instant compulsion to match or exceed usually by seeking a change of employers. While deep rooted cultural habits are difficult to overcome, the primary reason for attrition is really something else. In my view the main reason people change jobs is that they are not emotionally invested in the company or project they are working for. In other words they feel detached.

Feeling of detachment
It is much easier to break ties when those ties are weak in the first place. Offshore teams residing in a different continent usually share a loose bond with the parent company due to the geographical distance and the lack of face time and physical interaction. Video conferencing tools can go only so far. Additionally, the different time zones further complicate matters. If the parent company is in USA and the offshore team is in Europe there is a time difference of around six hours. If the offshore team is in China or India it is around twelve hours. Time differences and physical separation will instill a feeling of detachment in offshore teams and obviously not much can be done about it but there is another more important reason for an offshore worker feeling detached that is a result of the cost model I referred to earlier.

When I worked in Bangalore on offshore projects early in my career, at the commencement of any new project I was provided with the name of the customer, description of the task and some existing code and documents (if applicable depending on project state). Never was I ever briefed on the business need of the product/application I was working on or its importance to the customer. Often times it was a struggle to even acquire the functional specifications. When you are simply an hourly worker provided with piecemeal requirements and expected to deliver some working code every once in a while, it offers no incentive to develop a feeling of ownership. Offshore employees (for that matter onsite workers too) must be made to feel like they are part owners of the product/application and be invested in its success. If managers leading offshore employees are unable to create a sense of ownership among their cross-continent workers, it will lead to those workers cherishing compensation and benefits over technical challenges and accomplishments. In reality, creating a feeling of ownership in offshore teams is easier than solving the cultural or the geographic separation issues I discussed earlier, so it is surprising so many managers with offshore responsibilities fail to see this point. Even if it is less, offshore workers still do cost money and it’s in a manager’s best interest to make offshore workers feel part of a bigger goal. Something as simple a message as telling these engineers how critical the success of the project is to the parent company or organizations bottom-line may help. Quarterly or half-yearly visits by high ranking managers from the parent company and having one-one conversations with offshore employees (especially the stars) will go a long way in diluting any feelings of detachment.

Lack of mentoring
Whether it is software engineers in India or factory workers in China, salaries are gradually increasing thus chipping away at the cost advantage that companies enjoyed so far. To compensate, companies are resorting to hiring younger and less experienced engineers. It’s a universally known fact that lesser the experience, the more mentoring is needed for a worker to obtain adequate competency over time. Universally that is except in India, China, Malaysia or other Asian offshore teams that I have worked with. Traditionally, mentoring is an unknown concept in those parts.

If you are an offshore manager, insist on establishing a mentoring program especially for junior employees and ensure they are paired with more senior skilled developers. Reality is – some hand-holding is necessary for junior engineers regardless of their college education and aptitude.

Failure to employ competent architects on both ends
The Golden Gate Bridge in San Francisco (as any suspension bridge for that matter) has two massive towers on both ends of the bridge. Suspended cables that hold the road deck are secured to the towers and continue to run to the ground where they are attached. The cables transfer the weight to the towers which in turn transfer it to the ground. The towers are extremely important to the integrity of the bridge. If the towers have integral weakness, the entire bridge will cave in. There is no redundancy when it comes to the towers.

So why is this lesson on a suspension bridge relevant here? Because just like a suspension bridge needs strong towers on both ends, any project with an offshore team also needs strong architects on both sides of the continental divide. This is not easy to achieve but it is integral to a project’s success. The onsite architect will need to know the strengths and weaknesses of the onsite as well as the offshore team. He also needs to be aware of the cultural differences. Further the onsite architect needs to interpret requirements from the business/program managers and articulate in a language that the offshore architect clearly understands. Conversely, the offshore architect needs to be on the same page as the onsite architect, be able to translate requirements to rest of his offshore team and technically be responsible for the quality of delivery. In terms of skills both architects need to have relevant technical skills and experience, have good functional knowledge of the product/application, have excellent communication and leadership skills. It is touch to get all these competencies in one person but good architects have the ability to compensate for inherent weaknesses of a team so paying top dollar to recruit such an architect is entirely justifiable. Unfortunately, too many teams ignore this very important fact that really could be the difference between a projects success and failure.

Lack of proactive participation from onsite stakeholders
I need to begin this section with another personal story. Back when I was working in Bangalore in late 90’s, there was a project that was well into six months of execution but wasn’t going well. It was revealed that the customer basically punted the project to my employer and proceeded to take a hands-off approach. Six months into the project, after encountering missed deliverables and quality issues, a very exasperated customer flew down to Bangalore, fired the entire team of ten or so developers from the project and personally interviewed and installed a team of just four developers including a rock star architect. From that point on it was a phenomenal turnaround of fortune. The product that this new team churned was a spectacular success and won a few US patents (this was a web product back when web was in its infancy) and industry awards along the way.

Lesson learnt. If you go to a car dealership to buy a car, you pay the money or finance it and drive the car home. You don’t participate in its design or manufacturing process. Unfortunately, this approach of selecting an offshore vendor, paying the money and taking a backseat rarely works in IT. The dynamics of software development combined with cultural idiosyncrasies of offshore teams places the onus on the stakeholders to take more than a passing interest in their offshore development.

Undefined or poor processes and methodologies
Offshore companies especially those based out of India have traditionally been high on unproductive methodologies like ISO and SEI-CMM which are documentation and process heavy. Time and again it has been proved that simply possessing a SEI-CMM certification does not guaranty a quality deliverable. Even if it did, ISO and SEI-CMM are difficult to implement across physical boundaries and distributed teams. What is needed is a process that binds both the onsite and offshore teams and that which can overcome the time difference and physical separation. Also needed is a process that encourages partitioning requirements into small digestible tasks and which encourages code reviews and testability between both teams. Adopting a methodology like Agile with suitable tweaks to suit both teams may help. Using a robust tool like TFS that supports a distributed architecture which will help with the implementation of the selected methodology/process may also be a smart decision. Time differences and geographical distance are issues that cannot be solved completely but can be managed via a good process.

Conclusion
Offshoring and outsourcing of software development is here to stay for a while so these lessons that I compiled from personal experiences and talking to other developers, architects and managers should help improve the quality of your offshore teams. A lot of these lessons should come handy regardless of the country that your offshore teams reside. Actually, some of these lessons should apply even to near-shored/outsourced teams that reside in the same country or even in the same office.

Posted in Management |

Sir, now can I meet your tester? (The obvious but often overlooked problem with IT organizations staffing model)

28th November, 2012 · prabhalar · Leave a comment

Q. Does your team have test plans and test cases?
A. Yes? Nice!

Q. Does your team do TDD or write unit tests?
A. Yes? Good!

Q. Does your team perform scale, load and performance testing?
A. You do? Great!

Q. Does your team have a dedicated tester?
A. What… No?

Over my years working in the software field, I consistently come across this singular flaw in a project teams test strategy – the absence of a dedicated test/QA team. The role simply does not exist. That we have created and regularly update test plans and cases, that we may be doing TDD, that we may be refusing to approve a release to production unless our developers have run scale and performance tests are all laudable but futile efforts if we do not have dedicated testers. In my experience the worst offenders of “we don’t need testers” psychology are IT organizations of businesses since they produce applications for internal consumption and therefore carry the notion that users will tolerate quality issues. They also believe that quality issues should they crop up post-release can be addressed before they start causing financial implications. Having said that product companies that I have worked for or consulted for too skimp on employing testers. They usually do have test teams but the developer to tester ratio is so skewed in favor of the developers that testers are spread too thin to thoroughly test product features in a timely fashion.

Business doubling up as QA

Not that managers are unaware of this very obvious need to employ testers. Every manager knows developers are not good testers of their own code. They are aware that even those developers who are good testers can only unit test their own code and there must be someone else to perform integration testing. Unfortunately, the team that they entrust to accomplish integration testing in many cases is the business team. Generally the business owners themselves or the project/development managers are thrust with this additional responsibility. Again the worst offenders here are IT departments.

Let me clarify what I mean by “business team” here. I am referring to the business stakeholders also known as business users or business owners. They are basically the ones that come up with requirements from a business perspective and pony up the money to implement the requirements in a software solution or product. I am not referring to business analysts who are essentially a bridge between the business owners and the development team although business analysts if ever there was one would also not make good integration testers in my opinion (Not that I was able to validate this assertion. Most teams I have worked with rarely have a business analyst role and someone else usually the project manager or the technical architect take on this additional responsibility).

Acceptance is not integration testing

So back to our topic. It is well documented that developers are not good testers. It is not so well documented that business users are equally bad testers. Yes, they are responsible for acceptance testing and final signoff. But they are responsible for their own features just like a developer is. For large projects and organizations there are many business users and no single user has responsibility for the complete solution. Even if they did they still would not be good testers. It’s too much to ask a business user to test boundary conditions, test for regression, test for scale and performance, test for security etc. Business users should only do acceptance testing and acceptance testing is feeble at best. Consider the two examples below.

1. A business user that wants a reports of all orders placed within a date range will test for valid and reasonable date ranges only. She is not expected to test invalid date ranges to ensure that wrong data is not displayed and that a friendly error is displayed to the user to inform that the date input was not valid.

2. A business user that wants an email to be sent to her team when new orders are placed in the system may be unaware that the developer in making this change inadvertently caused the workflow in the payments feature to stop working.

These are instances business users is expected to overlook (and developers too for that matter). Too many times, development managers view acceptance testing as a benchmark for the quality of their product. It is simply abdicating responsibility of ensuring product quality to the stakeholder (well at least until that 1 AM phone call from the business user). In reality a cover for the lack of a dedicated tester or QA team.

Cost is as always the excuse

So why not have a dedicated test team? Why not have at least a small test team per application or one tester per handful of developers/features even though testers are less expensive relative to other roles? A manager once told me if he had the budget to hire a tester he would have invested that money to hire another developer. He was implying that by having the additional developer he could deliver more features in a project span even at the expense of hurting quality. BTW, those of us that have read The Mythical Man-Month will realize that it is no guarantee that additional developer(s) will simply spit out features faster or reduce the time it takes to develop a feature. Sorry, but cost is not a valid excuse. The cost saving of not having a test team or having an overworked tester spread too thin is hypothetical. In reality whatever savings squeezed are short term which quickly dissipate and cost actually begins to multiply as time passes by and quality of a system continues to deteriorate and more resources are required later to address the quality issues.

Conclusion

I am seeing less and less of test/QA resources as line items in IT budgets or in statements of work (SOW’s). This is a costly omission that only presents an illusion of cost savings for the short term. A quality product demands dedicated testing. No other role can multiplex this function. Not developers, not project managers and certainly not business stakeholders and although all these people too need to test, it is never adequate unless a committed test team with the sole responsibility to perform testing is present. Apart from integration testing, we also need testers for performance/scale testing, regression testing, security testing etc. all of which many not be feasible to expect other roles to perform due to time constraints. Although developers and architects should certainly keep all these things in mind when designing and coding, they are however only a first line of defense. Dedicated testers act as a solid second line of defense that is so overwhelmingly necessary to keep bugs at bay.

P.S.:
Consulting companies usually operate on a “time and material model” are thus notorious for not having their own test teams. After all you are writing code for someone else so is it not the customers responsibility to bring their own test team (thus falling into the same trap I described in this post – customers are usually represented by their business stakeholders so all they will do is acceptance testing). Thus, I was pleasantly surprised to know that my current employer Neudesic has a test/QA organization and we make it a point to include a QA resource in our SOW’s (yes many times we do need to convenience customers to justify the additional cost). Usually, we employ some excellent QA talent from our sister company Amerishore where many engineers are groomed for a career in QA.

Posted in Management, Testing |

My experiences with software methodologies, processes and standards over the years

9th November, 2012 · prabhalar · Leave a comment

Agile development is the rage these days and I have been involved with its variants over the past few years. With so much talk about it lately I was reminiscing about my first interactions with software development methodologies a decade and a half ago and decided I would share the experiences and lessons learned.

Disclaimer: this is not a PhD thesis (thought the article got longer than I wanted it to) and I don’t compare and contrast the methodologies here. It is simply a post on my personal experiences, opinions and lessons all the way from 15 years ago to now across a couple of geographic locations. Also, like all blog posts, views here are my own and do not reflect nor represent the views of my current or earlier employers.

The ISO 9001 conundrum

Around 1998 when I was new to the software industry and was working in Bangalore, the ISO fever was catching on especially with offshore based companies out of India. ISO is a standard originally written for the manufacturing industry and focuses on production rather than design and development – the latter two phases which are so important in creating software. It is a standard to promote quality for sure but is ill suited to the software industry. Attempts have been made to redefine and morph it to fit the software paradigm but it still is trying to fit a square peg into a round hole. More for gaining a sales and marketing edge over competitors than to really improve quality of deliverables, offshore companies in those days were falling all over themselves to get that coveted ISO 9001 certification. So it wasn’t long before I got the dreaded email that the project I was leading had to implement the ISO mandated processes. I was given three months to get my house in order before the internal ISO auditor paid the customary visit. I took an ISO crash course, had my team attend it as well, shored up the documentation, got my team to document whatever necessary (or unnecessary) and still promptly failed the internal audit. The auditor did not read the content of the documents nor did he care. His concern wasn’t the quality of the content; it was the length and the formatting. My documents weren’t long enough and pretty enough (a few months later the external auditors followed the same approach with the projects that were showcased to them). The lack of aesthetics meant that my project would be axed from being considered for external audit. Whew… we breathed a sigh of relief. Now we could focus on code delivery without the ISO monkey on the back!

Then there was SEI-CMM

Having wasted some precious cycles to ISO with nothing to show for it in return, I had to move companies when the earlier one went bankrupt (look ISO never claimed it will make money for you). That’s when I met SEI-CMM a new buddy in my next job. Now, if you are interested its full form is Software Engineering Institute’s (SEI) Capability Maturity Model (CMM). I will not go into details of what this model is but suffice to say it has what it calls five “maturity” levels with each level after the first defined by a set of “key practices”. The idea here being the higher an organization is on the maturity ladder, the better processes it will have for developing software (and hence by implication it will deliver better quality software). So far so good. All a company needs to do is somehow reach that heavenly level-5 and attain the equivalent of digital Nirvana. Having just recovered from the ISO turbulence, I was hesitant when I heard my new employer was aiming to get SEI-CMM certified (if I hear that word one more time…). Soon, I was reduced to a nervous wreck when I came to know we were only at maturity level-1 with still four more rungs to climb. BTW, according to CMM every company is initially at level-1 (it doesn’t start at zero unlike array indexes) so there is no solace in knowing you are at level-1. In fact, level-1 is defined as Initial and explained away as “chaotic, ad hoc, individual heroics – the starting point for use of a new or undocumented repeat process”. So there you go.

With each new seemingly insurmountable level we were attaining, I was put through more CMM training sessions and had to devote more and more time to excruciatingly elaborate documentation. With each level, not just the managers and the leads but key developers and testers got sucked into devoting time for CMM documentation. Here is a sampling of the documents we were required to produce and update continuously – project plan, technical/functional solution, configuration management plan, QA/test plan, organization layout, training plan, risk management plan, requirements document, change record, timesheets and so on. Often times multiple documents needed to be updated to record a certain event or change. I will attest that some of these documents should be created and updated in any project but just not to the rigor that CMM demands. The criticism we often hear is CMM is ill-suited for product companies like Microsoft, Apple and Google (none of which by–the-way implement CMM and yet manage to create great software). However, whether it is generic shrink-wrap software or a custom application, the dynamics of producing software are not all that different between the two. CMM thus poses the same issues of being process heavy to not only product but also to consulting/services organizations.

I cannot close out this section without mentioning the internal CMM auditor. A full time, omnipresent role the CMM auditor was a messiah of the management (he who will guide the company to the promised land of maturity level 5). With an authority fit for a dictator, he would call audit review sessions seemingly at will. With the disdainful look of a prison warden he would ask for documentation on the most minuscule of details – where is the email thread when the developer asked for a sick day and where in the project plan is it documented? When the customer requested a darker shade of gray for a label, why does the requirement document and the change request document not link to her original email? – well you get the drift. That you and your team were skilled software engineers or that you were delivering and exceeding customer expectations while maintaining adequate documentation did not matter to him (and obviously to CMM). That you failed to document sufficiently your one sick day was an indication of the poor quality of your deliverables and thus you deserved the adult equivalent of corporal punishment. And therein lays the problem with the fundamental assumption of CMM – that quality is directly proportional to the process applied. The greater the process the better the likely outcome in terms of quality. But when so much time and energy is sucked by process alone something has to give. Yes, its creativity that tanks. Ironically, CMM (and its newer avatar CMMI) leave little time to research, to train, to spend time on code quality and test that they fail to achieve the very quality they so espouse.

And finally some gratification with Agile

Bless those seventeen souls including names like Martin Fowler and Robert Martin who convened at some resort somewhere in Utah in 2001 because that’s when they came up with the Agile manifesto (no word on how fruitful their skiing plans were but all must have gone well since no injuries were reported either). Reading the manifesto will be like manna for anyone who’s ever been subjected to the rigors of ISO/CMM. Individuals and interactions over processes and tools? Working software over comprehensive documentation? Customer collaboration and responding to change? Surely, you got to be kidding. You are actually telling me I don’t need to document every teeny-weeny change request at three different places but instead focus on delivery? I get to spend more time with the customer and discuss requirements instead of the weekly public flogging and humiliation from the auditor? You really mean that? Really?

Look, Agile methodology in itself cannot promise a quality product just like TDD in itself cannot. Software development is a lot more complex than just throwing a methodology at it and expecting magic will happen. It takes smart passionate people, right processes/methodologies and lot of other things to come together to deliver successful software. But a good methodology is a good start. Agile was designed by creative software engineers who did not work as mechanical or production engineers in a manufacturing industry nor were they mainframe’ers working on on never ending marginally changing projects. They understood that two fundamental tenets of software development that many predecessors missed – that software is a creative process where human intelligence/knowledge plays a key role and time needs to be devoted to hone those aspects without being bogged down with heavy process. Secondly, software is fluid and change needs to be accommodated without kicking off a tsunami of process.

Conclusion (and a word of caution)

Creating software is managed chaos since it’s an iterative thing. For good software to be produced it has to undergo iterations and transformations all the way from requirements gathering, design and coding phases with each phase iterative in itself (how many times did you not change the design after coding has commenced). Change needs to be accommodated without the burden of a huge process and documentation. It involves creativity so time needs to be allocated to thinking, researching, training and learning, prototyping apart from designing, coding, testing, requirements gathering etc. midst of all this there needs to be some process to ensure the train is chugging along. There also needs to be documentation to ensure that the purpose and function of a project are well recorded and so are the technical artifacts like architecture. However, ISO/CMM takes this to the extreme – they advocate governance through so much process and documentation to the point that it stifles creativity thus greatly dampening the passion and progress of many promising software engineers. CMM in particular demands so much attention to process, it leaves a project team little time to devote to the core functions of creating quality software. By intention, faulty implementation or otherwise, ISO/CMM try to fit software creation into a factory/production mold that by its very nature it is ill suited for.

Now a word of caution. There is currently a lot of hype associated with Agile and we must be careful in not creating another bubble out if it. It may not suit all situations and especially in consulting projects it depends on customer willingness to cooperate (key is to educate customers and that takes time). We must also be careful in not complicating Agile and adding bloat to it thus falling into the same trap that ISO/CMM did. Agile is intended to be a simple process, that’s how the Agile manifesto envisions it and that’s how we need to keep it.

Posted in Management, Processes |

Resolving the “A problem has been encountered while loading the setup components” error message when repairing Visual Studio 2008 on a system that already has SQL Server 2008

4th October, 2008 · prabhalar · 2 Comments

Now that I work for Microsoft, I have free access to many of the latest product releases that only helps whet my appetite for trying new stuff. So, I installed Visual Studio 2008 (Team System version) from my MSDN DVD and the installation was smooth. Next, I installed SQL Server 2008 and here it detected the VS2008 installation on my system and asked me to install the VS2008 SP1 before progressing further. After I hunted down the service pack online and installed it, the rest of the SQL Server 2008 installation went through fine.


Here it got a tad interesting and thus the motive for this post. When I opened VS2008 -> New Project, many of the installed templates were missing. I swore I had seen the templates before installing SQL Server 2008. Something in the SQL Server 2008 installation messed up the VS2008 components. There is a chance of this happening since SQL Server 2008 client tools (Integration Services, BI studio and management tools) have shared components with Visual Studio and the reason the SQL Server installation was looking for VS2008 SP1 in the first place since the client tools require the SP1. Further information on this specific topic can be found in this MSDN blog post. Anyway, I figured I needed to repair the VS2008 installation to get back my pre-installed templates (plus there could be other problems I did not yet encounter). I ran the VS2008 setup again and this time it immediately failed with this error “A problem has been encountered while loading the setup components. Canceling setup”. A little research led me to this blog post by one of our developers in the Windows Installer team. See, the workaround is simple; kick off the VS2008 setup repair from the Add/Remove Programs of the Control Panel instead of directly from the media. The installation of VS2008 SP1 during the SQL Server 2008 setup was responsible for this problem as explained in the above article. Agreed that though the fix is simple, it is still a hassle nevertheless and I wish the whole installation process gets better in future releases.


To summarize, if you install VS2008 and do not apply the SP1 and then try to install SQL Server 2008 with client tools, you will be required to install VS2008 SP1 before proceeding with the SQL Server installation. The SQL Server 2008 setup however causes problems with VS2008 that is already installed on your machine. You can fix the VS2008 problems by repairing the VS2008 setup from the Control Panel instead of directly running setup from the VS2008 media.

Posted in Uncategorized |

Microsoft, ahoy!

28th May, 2008 · prabhalar · Leave a comment

So, I am into my third month of joining Microsoft. I joined the Microsoft Consulting Services division as a consultant. I will write another post on what the typical Microsoft consultant role defines but a short answer is consultants take customers business requirements and architect and implement solutions usually around Microsoft products and technologies. Of course customers have a wide variety of needs, so consultants are expected to perform a wide and diverse array of tasks like customization, infrastructure implementation and life cycle management. In my short time here I have also seen instances where consultants have led teams onsite or were tasked with implementing best practices across the organization. As you can see this role is not for the faint of heart. Having said that it has been both an exhilarating and fun ride for me so far.


I have been busy since joining with orientations, trainings, client engagement and travelling but end of the day the hectic lifestyle is well worth it for at least one thing – the caliber of the people we have here. The hiring practices are tough so I knew coming in that the talent level is top notch but equally impressive is the passion for technology and the leadership skills of every consultant and architect I have met so far. I am also amazed by how friendly and helpful everyone is despite their busy schedules. I will write a more detailed post on what it takes to be a consultant and my own interview process but if you are interested in learning about these things immediately just drop me a comment or an email from my contact page.

Posted in Uncategorized |

Performance from a software life cycle perspective (draft 1.0)

28th November, 2007 · prabhalar · Leave a comment

As much as performance is widely acknowledged as critical to the success of a software product, it still remains a much overlooked aspect of system development by even experienced architects, designers and programmers. Improving performance is often an afterthought, caused by users complaining of slow response or unavailability of a system rather than a proactive approach by the system developers. Even companies and projects teams that are aware of the significance of performance struggle to imbibe it into their culture. Part of the problem is the personnel themselves since they are not sure whose task it is to define performance requirements and benchmarks. So this begs the question – who should really care about performance? Is it the architect’s or the programmer’s or the tester’s responsibility? Also at what stage of a software life cycle should we seriously considered performance? The answers to these questions are not unexpected. Everyone – analysts, architects, designers, developers and testers – are responsible for performance. Additionally, performance can play a part in most phases of the software life cycle.

In the first draft of the article Performance from a software life cycle perspective I discuss how performance can play a significant role from the early stages of the software life cycle. I have offered tips on what to look for to improve performance in each of these phases. Finally I top off the article with what I call the “the snowball effect” in which performance degradation that starts early in a system life cycle degrades further probably linearly as the life cycle itself progresses. Readers are welcome to comment, suggest or co-author the final draft. You can drop a comment here with your contact information or you can use the contact page.

Posted in Uncategorized |

What about those “fringe” tools

1st May, 2007 · prabhalar · Leave a comment

I am a tools guy. I love to code tools every now and then whenever I deem I need one. I use tools for different purposes but mainly I create tools to supplement the project or product I am working on. Tool in computer parlance is a fuzzy term since their scope can range from a utility comprising of a few tens of lines of code snippets to huge commercial products. According to Wikipedia a tool is a “program or application that software developers use to create, debug, or maintain other programs and applications. The term usually refers to relatively simple programs that can be combined together to accomplish a task”.


Debuggers, source control applications like Visual Source Safe and ClearCase and development environments like Visual Studio are all examples of tools. So are parsers, editors like vi, search programs and memory detection software like BoundsChecker. These are all popular commercial tools. However, despite all the tools available in the market place there are always times when you or your team may need to create one either because there is no commercially available tool that fits your need or they are too expensive for your budget. These types of tools are what I mean by “fringe” tools. Usually, fringe tools are the result of a quick development effort by one or two programmers to perform a very specific and precise task or sub-task within a larger project. These tools are usually used internally by a project team or group and may not morph into commercial products. Having said that however, there are exceptions. There are numerous instances where internal tools have gone on to become widely used commercial applications.


But when would one exactly need these fringe tools? Actually, its not at all uncommon to find occasions when you may need them. To quote my own experience, I wrote many tools in my 10 years as a programmer including monitoring tools in a couple of my web based projects. There are of course many such tools already available in the marketplace but they didn’t suite my purpose. I needed a customized solution for my monitoring requirements. Additionally, the cost of the tools exceeded budget. I also developed various types of parsers – usually find and replace types that use advanced regular expressions. Whatever the need may be its always worthwhile to take the time and effort to create tools if you don’t already find one that suits your need. However, before you go off and start coding up your tool at the expense of jeopardizing your project schedules, I advise a little due diligence.


First, make sure there isn’t one already available that does the exact same thing you need. Maybe the guy next door (or cube) has one already. If you work for a large organization or group, a simple scan through the source control databases is a good idea. Maybe there is one on the web for free or cheap. Or – and this is not as uncommon as one may think – there is probably a language or product feature already in-built that supports your requirement. I once worked on a PERL application where a coworker took great pains to code up a word sorting algorithm. He did a good job at it too but to his utter disappointment he later found out that PERL already has built-in library functions to accomplish this. This might usually happen with inexperienced programmers.


Secondly, not all tools however peripheral can be coded by one person in 30 minutes and 50 lines of code. Sometimes tools even if intended to be used internally by the team may require extensive design, time and multiple programmers committed to them – sometimes as much as the actual project or product itself. In such cases it’s impossible to develop a tool when a production release is scheduled the next day. An intranet web site monitoring tool may be such an example. You may want to push it to the next release if you can’t get it out in the current one.


The line between a tool and “fringe” tool is thin. As I said earlier, there are times when a “quick and dirty” job progressively expands in scope and ends up being the main stay of a company or group or may even be sold commercially. To summarize, tools make the lives of programmers easier and exciting. Almost any project worth its salt will have the need for fringe tools. Its also a great idea to conceive and build them during those so called “bench” periods. Whenever you build them though, do remember to publish them as best as possible so your team mates and people in your organization can find them.

Posted in Uncategorized |

Resolve Sql Server 2005 “Agent XPs disabled” error

19th June, 2006 · prabhalar · 10 Comments

You may have had your Sql Server 2005 agent disabled and a baffling “Agent XPs disabled” error message displayed alongside. This may happen when you have been playing around with its properties and entered some invalid parameters. The most frustrating thing is this will not let you re-edit the properties to fix or remove the offending entries.


Here’s how you may fix this:


1.      Check Log file usually located at “C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG”. If you see the “Invalid object name ‘sys.configurations‘. [SQLSTATE 42S02] (DisableAgentXPs)” message go to the next step.


2.      Query the sys.configurations view:


Select * From sys.configurations


Where Name = ‘Agent XPs‘           


         You will see the “value” column set to 0.


3.      To set the value to 1 above to 1 execute the following statements:


sp_configure ‘show advanced options’, 1;


GO


RECONFIGURE;


GO


sp_configure ‘Agent XPs‘, 1;


GO


RECONFIGURE


GO

Posted in Uncategorized |

Introduction

19th March, 2006 · prabhalar · Leave a comment

This is my first blog entry and I am excited to join some 30 million or so blogs that already exist. I am a programmer living in Houston, Texas with my wife who has a Master’s in Information Systems from the University of Houston.


I am a programmer not just because I make my living out of it but because I have a passion for programming, software and technology in general (OK! I know you have heard that “passion” thing so many times you could live without hearing it again). This blog will give me an opportunity to share my work with other programmers, network with people in the software field and to analyze and discuss ideas with interested people.


I also occasionally dabble in philosophy. Mostly, I keep my thoughts to myself but only because it’s hard to find an attentive audience. Sometimes a friend or two will lend an obliging ear but only for a couple of minutes, before I start noticing their waning interest. I will blog my philosophical thoughts too for anyone interested.


Finally, I wish to thank dasBlog for this excellent blogging tool.
Edit: Now moved to WordPress.

Ramesh Prabhala
Houston, TX

Posted in Uncategorized |

Pages

  • Contact Me
  • About Us

Archives

  • January 2013
  • December 2012
  • November 2012
  • October 2008
  • May 2008
  • November 2007
  • May 2007
  • June 2006
  • March 2006

Categories

  • Management (3)
  • Processes (1)
  • Testing (1)
  • Uncategorized (7)

WordPress

  • Log in
  • WordPress

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Pages

  • Contact Me
  • About Us

Archives

  • January 2013
  • December 2012
  • November 2012
  • October 2008
  • May 2008
  • November 2007
  • May 2007
  • June 2006
  • March 2006

Categories

  • Management (3)
  • Processes (1)
  • Testing (1)
  • Uncategorized (7)

WordPress

  • Log in
  • WordPress
© My Website
  • Contact Me
  • About Us