Sunday 30 December 2012

15. Networking skills up to Architect level


In this post, I am going to explain what are the network diagnostic commands need for in order to troubleshoot the website or networking issues for developers and architects. I am not going to explain all the commands which Network Engineers use.

Now, I am think of the following commands, tools…etc.

NetworkingCommnds

Before going into the details of each command, I would like to mention

How Internet Works?
  1. In high level, when we type www.microsoft.com on browser, browser sends the request to DNS (Domain Name Server) to ask for the IP address of the website.  This browser request goes via many DNS including root DNS and finally to get the IP address of the website which we are requested.
  2. Once browser get the IP address of the website, browser sends request to the IP address to get the content of the website.
Commands Explanation:
Please click start->and type command on the windows search box and open the command prompt to verify the following commands. Please note that some of the commands are may not work for you due to path issue or utility for that command is not installed on your machine. Please check with your Network Engineer if it’s not working. The command prompt window should be similar like the below picture.
Command
  1. Ipconfig:  To display the network settings currently assigned to any or all network adapters in the machine. This command is used to verify/find an IP address, network connection as well as to verify your network settings. Please type ipcong/? If you need to know more about the command and other options.
For example, the result of ipconfig for my machine
ipconfig

2. nslookup:  To look up an IP address of a domain or host on a network. Please type nslookup/?  To know more about how to use them.
For example, nslookup results for www.microsoft.com from my machine

nkslookup

3. Tracert: Used to visually see a network packet being sent and received and the amount of hops required for that packet to get to its destination. It will also show you that your request going to via which networks and firewalls with details from source to destination.
For example, type tracert google.com. This is the tracert for google.com from my machine.
tracert

4.       Ping: Used to check for network errors.  Generally, if unable to connect webs site or any host then you can use ping command to verify and it’s also give you he IP address of the site.
For example, When I type, ping www.facebook.com and I am seeing the below result.
ping
5. netstat: Allow you to view the statistics of the network such as active TCP connections, ports on which the computer is listening…etc.
For example, netstat results for my machine is given below.
netstat

6.       pathping: Its similar to the tracert command, pathping command provides information about network latency and network loss at intermediate hops between a source and destination. Pathping sends multiple echo request messages to each router between a source and destination over a period of time and then computes results based on the packets returned from each router.
For example, pathping results for www.amazon.com from my machine.

pathping

7. telnet: Telnet is software utility that allows users to remotely access another computer such as a server, network device, or other computer.  We can verify that if we cannot connect to any machine with particular port and this will help us to troubleshoot the problem and connectivity issue.

8. ftp: Short name for File Transfer Protocol. Used to receive and send the files from FTP server

Tools:

1.       Fiddler: Fiddler is the web debugging tool and its downloaded from http://www.fiddler2.com. Please download and play around it to know more about the fiddler. Fiddler will show lot of information such HTTP headesr, requests…etc. & also used for verifying the performance of the web site.
 For example, traffic information for www.yahoo.com from my machine.
fiddler

WireShark: WireSharek is a network packet analyser tool and it’s downloaded from wireshark.org. Please download and try it. Please share your experience about this tool if you like it.
Others:

Hosts file:  Hosts file is used to map hostname to IP address. The location of the host file is C:\Windows\System32\drivers\etc. The contents of the host files similar like below.

127.0.0.1       localhost
x.y.z.z1          mysite.com
Usability:  
  1. Used to test for the DNS IP address changes when diverting traffic to specific IP address.
  2. Divert any website traffic to specific IP address on your machine.
If you would to know more about the networking commands please refer the following sites

Note: There are many numbers of tools/info available for debug/trace the website/network traffic. If your find the good one and useful for others please share with us and also share with me at Jayachandran.NET@hotmail.com.

16. Troubleshooting the problems


This post describes how to you troubleshoot the any problems.

As mention on the post 4. UML that simple diagrams will save you lot of time for the explanation. So I am going to draw diagram here to show how we can troubleshoot the problems if website or application is not working and the same troubleshooting funda can applicable for other problems too.

Diagram:

TroubleShooting The Problems

As of now, I can think of that the following other ways to help to troubleshoot the problem.

Notes:
  1. Use Fiddler to inspect your HTTP traffic.
  2. Check Event Viewer and exception logging database if you have for that website or application.
  3. If your website hosted on Web Farm(same website hosted on multiple web servers), then very hard to find the request coming from which web server, So in order to trouble shoot the problems easily I would suggest to define the customer http headers on IIS using “HTTP Response Headers”  for each web servers. For example, please refer the below picture and you will understand that.
TroubleShootingTheProblems1

4. If your website or application build up with many layers (say UI, BAL, Web Service, Data, caching …etc.) then I would suggest to write the simple script to make sure everything is working on individual layers including connectivity and calling simple methods…etc. Because this will save us lot of time. For example, if there is a problem on DB then if we execute the script and script will tell us straightaway where is the problem instead of looking from web servers and narrow down the issue to other layers.
5.  Setup instant notifications via email or SMS for your production environments if any critical problems are happened or any health check issues.
6. Prepare the support manual documentation and use it for when the problems are happened and this document also very useful for future support/developers.
7. To work our applications on all of the modern browsers, sometimes, we need to write separate working block for the some of the functionalities for specific browsers. For example, our testers say it’s not working on Chrome or IE…etc. then we need fine the alternative working solution of that.
8. Please use networking commands to troubleshoot the problems for network related issues.

I hope you enjoy reading this post. Please contact me if you have any questions.

Architect Graph


Architect Topics Graph
Architect Topics Graph
Please click the below links which do you wish to know more details to become an Architect.
2. OOAD
4. UML

Contact

If you have any questions regarding about design/architect the software systems or any other technical help, please contact Jayachandran(Jay) at Jayachandran.NET@hotmail.com. He will  reply your queries as soon as he can.

Architect Help

If you have any questions regarding about design/architect the software systems or any other technical help, please contact Jayachandran(Jay) at Jayachandran.NET@hotmail.com. He will  reply your queries as soon as he can.

Technical Bricks For Building Websites


What are the technical key considerations needed for building websites?

In overall, we need the following technical bricks to build the websites
  1. Software Design(including choosing the software technologies which comply with modern technologies)
  2. Development Environment Setup (including source version control, coding standards…etc.)
  3. Authentication and Authorization(for frontend and backend layers depends upon the type of websites)
  4. Security (including for preventing XSS, CSRF…etc.)
  5. Exception Handling and Logging (including custom error messages, page not found error page…etc.)
  6. Database Design (including normalization, store procedures, triggers, views…etc.)
  7. Caching (for improving the performance of the web site)
  8. Testing (including unit test, performance, Data Driven Testing (DDT)...etc.)
  9. Hosting Environment Plan
  10. Documentation (including deployment, support…etc. documentations)
Next, do we need necessarily all the above bricks for building websites?  
Yes. But no. It's depends upon the type of websites.

Saturday 29 December 2012

9. Testing framework


Here, Testing Framework means various types of testing methodologies enforce for whatever the code written & each and every piece of code should be testable.

Testing is partially NFR (Non- Functional Requirements).

What is the NFR?
NFR is also called “ilities”. Because of the use of suffix “ility” with many non-functional requirements. For example, some of the NFR are Documentation, Availability, Maintainability, Interoperability, Recoverability, Supportability and testability…etc.

Why NFR is so important and how they are identified?
  1. In our SDLC, we are always focusing and working on functional requirements (FR). In most of the projects, Project Owners mainly focus on FR (Functional Requirements) only. It’s important to give same level of preference for NFR after development finish. NFR are identifies during whole project life cycle and it’s very important to spend some time to put on the place. NFR helps lot of our development time and money for future projects.
  2. Identifies  and Prioritize NFR  items like “Must”, ‘High Want” “Want” during project life cycle and implement NFR items depends upon the time availability.
  3. NFR also includes Lesson learned such as what is necessary to document and put the methodologies needed for the future projects.
  4. NFR items are not visible to business owners and they are not interested on this. However, project development team responsible to notify to business owner about the benefits of NFR.
Software testing types:

Please refer the below diagram.
Software Testing

Do we need to focus on all the above testings?
Yes but no. It is depends upon your project & project type.

I am not going to describes all the testing here. I do describe the necessary testing performed by development team.

Most of the testings are performed by test team. However, Development team should have testing frameworks for testing below tests.

Unit Testing: 
Developers are writing and running unit tests while they write their code to produce the high quality code. As we know, it takes times to write unit test. However we should be writing unit testing for each and every method we write.

There is a unit testing project comes with recent Microsoft Visual Studio release got many features. Please watch the below video for more information.

We need to use different kinds of testing frameworks depend upon our projects. For example, Rhino Mock-up framework is good for if your project need to authenticate with user name and password to test. 

Please refer the below URL
for more information about testing frameworks.

And also refer the below URL’s for more information about unit testing.

Integration Testing:
Each individual’s software modules are combined and tested a group. It does occur after unit testing. 
Please refer the below URL’s for more about integration testing.

Performance Testing:
It’s very important & necessary test to perform for each and every application. There are different types of performance testing measures the application performance.

Please note that all the Microsoft Visual Studio editions does not support for performance testing. Please refer the below URL for more information and buy relevant product which is suitable for your project to perform the performance test.

It’s good to have performance testing performed for each layer. Let’s say, if your project has UI, BAL, web Service, Data layers then please try to develop the performance test for individual layer to test the performance test.

Please refer the below URL’s

Performance test objectives include the following:
Response time or latency
Throughput
Resource utilization

Please refer the below URL’s and you will get to know more about the objectives and measurements for the performance testing.
Please refer the http://msdn.microsoft.com/en-us/library/bb924357.aspx to know more about the types of performance testing.

Performance vs. Scalability:
Performance refers to the capability of a system to provide a certain response time.
Scalability refers to the characteristic of a system to increase performance by adding additional resources such as processor, memory, and web server in web farms.
Please visit the following URL’s
https://developers.google.com/speed/pagespeed/ to expert in performance testing.

Compatibility Testing:
Now days, each and every application which we develop should be compatible for mobile devices as most of the traffic coming from mobile devices. To verify our application how works on mobile devices, we can use browsers extensions (such as Firefox user agent switcher) which are available on the market. However, some situations/scenarios these testing tools does not simulate 100% correctly. For testing on real mobile devices on remotely please use
And other useful links

Finally, I would suggest that to prepare testing check list for your team and use if for your project development.

I hope you enjoy reading this post.