Monday, December 11, 2017

What and How of Requirement Gathering - Part 2

In continuation to my previous post, I’ll add some more techniques which are popularly used for information gathering.

Interviewing: While on one hand shadowing provides an effective means to discover what is currently being done in the business, but on the other hand it does not provide all the necessary information. Another flaw of shadowing would be, it is not suitable for getting information about long-term activities that extent weeks or months along with the processes that requires very less or no human intervention. Hence, we can look for other techniques like interviewing.

Interviewing someone is the one-on-one meeting between project team and the user.
Here quality of information totally depends upon interviewee and the interviewer. The interviewer can ask a wide range of questions as compared to shadowing mechanism. These questions can be from basic information to difficulties to limitations of the system. During the interview process, the interviewee can give some ideas to improvise the solution, but one should avoid assuming that those ideas are the correct solution.

The success of this technique totally depends on how the questions are structured or framed? The interviewer should be in a position to get more and more questions out of the answers given by the interviewee. One should always avoid asking misleading questions.
Few of the standard questions that can be asked during this process can be:
  • Is there any documentation available to help you in performing your job?
  • Is there any third party, that affect your work – i.e. support specialists, external suppliers/system, etc.?
  • Does any business policy hinder you in performing your job?
  • Do you need any assistance or help when you work remotely? If yes, then what?

Surveys: Surveys are the other means of gathering information. It consists of a collection of questions. A very good example of surveys is the customer feedback form.
One of the best parts of surveys is that, they keep the identity of the user hidden as they can be given anonymously, which in turn promoted confidentiality.  Such kind of information gathering technique is useful when one is more concerned about the responses rather than which individual has responded.
The most difficult part of surveys is its preparation. Everyone cannot come up with surveys as is requires a trained professional for choosing questions and then analyzing the responses.
Note: Surveys can be affected by user attitude or mood :(
Few are the common examples of information that can be collected via surveys:
  • Organizational structure
  • Policies
  • Training material and instructor feedback
  • Customer satisfaction surveys, etc.
Hope you got an idea about interviewing and surveying technique and when to use what. In my next blog post, I’ll continue to write about few more techniques.
Till then keep reading.

ReferencesMSDNCDEBH Project Management

Saturday, December 9, 2017

What and How of Requirement Gathering - Part 1

This time rather than writing on some technology or solution, I thought to write on one of the important phases of SDLC which is nothing but requirement gathering. To be more specific, this article will be more about collecting information about business requirement. What are the various sources to get and understand most of the portions of any business requirement.

It’ very important to understand that, information can be gathered from many standpoints. It can be from Business front, Application front, Operations front, Technology front, and may be many more. So, while gathering information, one should have a clear vision on what kind of information they are looking for. Let’s have a look at few of the well-known categories:

  • Business – Goal of business, Service offerings, Products, Financial Structure, etc.
  • Application – Productivity tools, interaction with business application system, Code Modules, etc.
  • Operations – Identify the information’s origin, information’s consumption, information’s ownership, Data warehousing, Data models, Data Management policies, etc.
  • Technology-Technical Services, i.e. Development Environment, Topologies, Network Services, Security, DBMS, Technical Specifications, Hardware, Software etc.

The next biggest question would be how to gather all this information?
If you will search on the internet about how to gather information, you will get lot many ways. But most of these tactics, more or less fall into 1 of the below categories:

Shadowing: In this technique one will observe a user performing the tasks in an actual world environment and ask the user any questions related to the task. It is basically like following the user as he or she performs daily tasks. In other words, more the questions, more the information.
Note: This technique is effective only for frequently performed activities or tasks because if the task is performed occasionally, then it would be difficult to shadow someone.
Some common questions which can be asked during shadowing can be:-
  • What decisions do users make when starting or completing a task?
  • What modifications must be made over time to make it easier to complete the task?
  • Which related tasks may affect the design of the solution?
  • Are there any performance criteria?
  • How many people does a user interact during a given task?
  • Are there any variations in the steps to complete the task?
  • How often does system or management interfere with their job?
  • What do users like/dislike about the system?
  • Characteristics and preferences of user.
  • Concepts and terminology used by users?
  • What trainings do users need?
  • How can training and support costs can be reduced?
  • Have users been through the training or they are self-taught?
  • What information about the user is not documented?
In essence, one has to observe and question both the management and the users. If there are any external stakeholders involved with the task then they should also be part of this observation.
Hope you got an overview of shadowing. There are a few more techniques, which can be considered in order to get the required information for starting any project. But being a completely theoretical write-up, I would like to end this blog here itself and will write about more techniques in my next blog.
Till then keep reading.

ReferencesMSDNCDEBH Project Management

Friday, December 1, 2017

Generating XML Root Node having colon - via Serialization

Recently I got a requirement to generate an XML on the fly with some defined schema. I know this requirement looks very simple in first sight, but actually it was not.

The XML which was to be generated was having a very specific format as it was supposed to be the input for some 3rd party tool. So, it means, it should be fully compliant with the prescribed XML node structure. Just have a look at the below schema:

<sl:RandomWindow xmlns:xsi="" xmlns:sl="" xsi:schemaLocation=" wwRandomWindow.xsd">
  <Title>First Window</Title>

Below are the classes I created for serialization purpose:

By using the XmlElement and XmlAttribute classes I was able to generate most of the required parts of the XML as shown below:

But the only thing which didn’t come up correctly was the root node which is expected to be in the form <sl:RandomWindow>.

So, in order to achieve root node with prefix and colon, I updated the code to:

    public class RandomWindow {…}

But alas! It gave me some strange results. It converted the prefix to hexadecimal as shown below:

Then I thought, instead of providing concrete prefix, let’s add namespace itself as shown below:
[XmlRoot("RandomWindow", Namespace = "")]
     public class RandomWindow { ... }

And my result was:

Which was bit closer to what I need, but not the exact one. Now the issue remaining was the extra prefix in front of each element :(.

In order to resolve this issue, I tried various options provided over various blogs, but no luck.

But after spending hours, I was able to crack it by hit and try. To hide namespaces at element node level, I provided the namespace value as empty as shown below:

And that did the trick for me. Finally, I was able to achieve the required format.

Although this issue was pretending to be very small, it ate up my so much time. So, thought to share it here. Hope it would be helpful for you too.

Happy troubleshooting !!!

Saturday, August 19, 2017

The SDK ‘Microsoft.NET.Sdk.Web’ specified could not be found

If you are working on Visual Studio 2017 with update 3, then you might have come across the error 'The SDK ‘Microsoft.NET.Sdk.Web’ specified could not be found' in netcoreapp1.1 for both web and console.

Unfortunately, I also landed up into this situation. So, one straight forward and temporary solution could be to edit the project file manually from Project Sdk = ”Microsoft.NET.Sdk.Web” to Project Sdk = ”Microsoft.NET.Sdk” and re-open the solution. Everything will work fine as expected. So, what are the reasons behind this error?

I explored many articles on MSDN forums as well as looked at github link and the primary reasons which are causing this error are:
  • Workstation is still holding an old preview version of CLI 1.0
  • Installed CLI version is correct but its path is incorrect.

  • Uninstall all the older versions of CLI with 1.x as SDKs with version 1.x can break things
  • Verify the value of PATH- Open the developer command prompt and verify the value of the PATH variable and make sure that 'C:\\Program Files\\dotnet' appears on the path before any other entries that point to subdirectories of the dotnet folder.

If you are working with the web project, then you can also verify the SDK versions in global.json file and edit it manually if required.

Hope above post was useful for the newbies who just took Update 3 and are struggling to build their solution templates.

Friday, August 11, 2017

Is your client request missing from IIS log?

One can enable IIS logging by going to IIS Manager and checking the Enable logging checkbox. So, it means if IIS logging is enabled, then each and every request made by the client should be showing up in the IIS log. Isn’t it? But by any chance, if the request is not present in IIS log then the most probable reason would be either IIS was not running or may be request was not made.

But this statement is not 100% correct. Because whenever any request is made to the server, first it routes through HTTP.SYS then it comes to IIS. So, if anything is not visible under IIS logs, then one can see the logging for HTTP.SYS which is HTTPERR. The most common errors logged here are related to timeout or service unavailability.

The next question would be, where these logs are exactly saved?
You can find HTTPERR under C:\Windows\System32\LogFiles\HTTPERR

Interested in knowing more about HTTP.SYS, here you go.

Sunday, August 6, 2017

Unable to launch IIS Express from Visual Studio

Recently, while working on one of the web project, I came across a situation which ate up my almost an hour. Concern was, my IIS express was not launching automatically on running my web application from Visual Studio 2015. I tried various solutions like,
  • ran the Visual studio as an Administrator,
  • changed the port,
  • disabled the firewall,
  • reset the IISExpress folder.
But no luck :(
Then I thought, let's give a try by deleting the temporary folders which were created by Visual Studio and guess what? That worked for me. 

The culprit was the .vs folder which was the hidden folder in the project's root directory. One of my colleague checked-in that folder by mistake and as I was fetching the code for the first time, it came on my machine. Actual felon was the .suo file which was inside .vs folder. This .suo file contains user specific settings. Hence same user settings didn’t work for me. 

Solution - Deleting .vs folder did the trick :)

Happy troubleshooting !!!

Wednesday, May 24, 2017

Possible Multiple Enumeration of IEnumerable

If you have worked with IEnumerable and using ReSharper, then you may land up into this warning, "Possible Multiple Enumeration of IEnumerable". So, what this warning is all about?
Well, before proceeding further, let’s see how we can store something into IEnumerable object .
IEnumerable items = GetAllItems()
So, above code itself speaks that items is a variable of type IEnumerable which will hold some values/objects we can iterate through.
Now here lies the performance hit, which is also indicated in the form of ReSharper warning. This performance hit may not be significant for a small number of items. But this can be noticed while dealing with a huge number of items.
Reason behind this is, whenever you are iterating through items collection, GetAllItems method will be called for the same number of times.
Solution: It is always good to materialized the result in a list or array like below:
IEnumerable items = GetAllItems().ToList()

Once you are done with mentioned code changes, you will notice that above warning doesn't exist any more.
Hope you like this small post.

Tuesday, May 16, 2017

.Net Architecture Guidance announced

Few days back, Microsoft announced the draft version of the .NET architecture guidance. This guidance is the combined effort of the Visual Studio team and the Microsoft Developer Division. As of today, it covers only 4 areas:
  • ASP.NET Web applications
  • Azure Cloud Deployment
  • Xamarin Mobile Applications
  • MicroServices and Docker
You can find more about this guidance on Microsoft’s official page.

Saturday, March 25, 2017

Why normal .NET exception handling doesn't work in WCF?

Errors and exceptions are part of our programming life and WCF is no different. So, when we get errors in WCF, we would like to propagate those errors to our WCF client so that they can accordingly take actions. In order to demonstrate this, let’s go through the code of a simple service:
       public int Add(int number1, int number2)
            return number1 + number2;

        public double Divide(int number1, int number2)
            return number1 / number2;
Both the above methods will perform some calculation and return the result to the client. Let’s say, now for some reason someone sent 2nd parameter of Divide method as 0. 

What will happen? Definitely code will throw an error or say DivideByZero exception. Isn’t it?

Know how to handle this error? Most of the developers will simply decorate Divide method with Try-catch block and throw the exception, similar to our normal .NET exception handling mechanism as shown in below code:
public double Divide(int number1, int number2)
                return number1 / number2;
            catch (DivideByZeroException exception)
                throw exception;
This normal exception handling mechanism will not work in WCF world. Now before discussing on WHY, let’s quickly see what is passed from the client:
MathClient math = new MathClient();
                math.Divide(10, 0);
            catch (Exception exception)

Now if we will run this client application, we will land upon such error message:

Now by looking at the error message, we cannot figure out what went wrong as it only mentions it is an internal error :(

Now coming back to the same question, why is this happening like this?

Well, reason behind this is the message format being used by WCF. WCF uses, XML or XML SOAP to communicate with clients. So, even if any exception is raised, it has to be in XML format. Hence normal .NET exception handling mechanism doesn’t work here because the error is not sent to clients in the form of XML.

So, the solution here is Fault Exceptions and rather than throwing a normal .NET exception, we have to throw a fault exception as shown below:
public double Divide(int number1, int number2)
                return number1 / number2;
            catch (DivideByZeroException exception)
                throw new FaultException(exception.Message);

Now re-run our application and we will be able to see proper error message.

On a summary note, we cannot use normal .NET exceptions to propagate exceptions to the client but same can be used within WCF service.

Hope you like this small but very useful tip. Happy learning!

Friday, February 17, 2017

Which WCF template to be used?

Recently, one of my colleague asked me, which WCF template should I use to create a service? For experienced people, it may be a silly question, but it is one of the common question among beginners, who just entered into the world of services. That’s the motivation who made me write this small post.

Well, let’s first have a look at what all templates are available in Visual Studio 2015 for WCF: 

The developer can choose any of the above templates as per project need. Let’s go through them one-by-one.

WCF Service Library: This template is nothing but a simple service library which uses App.config as its configuration file.

WCF Service Application: This template will create a web site which in turn will be hosting a service in it. Here Web.Config will be used to serve configuration settings.

WCF Workflow Service Application: This template is useful when you want your workflow to be accessed as a web service.

Syndication service Library: This template is useful when you want to expose RSS as a web service.

Hope now you are comfortable on which template to be chosen.Happy learning!