Showing posts with label Tools. Show all posts
Showing posts with label Tools. Show all posts

Tuesday, July 15, 2008

Overview on VMWare Workstation and Player

In one of my previous blogs, I wrote on Virtualization and its role in productivity and resource optimization. It also plays crucial part in having power savings by reducing the number of servers. Virtualization, as a solution, is considered very seriously by many organizations. In this blog, the review of one such Virtualization product, VMware Workstation is presented. Before starting, let me clarify. Neither I am an investor nor a paid reviewer. I try to present my personal views based on more than four years of experience with VMware workstation and one year experience with VMWare player.

Running Multiple VMs
VMWare workstation had a modest start and three years back, you cannot have more than one virtual machine running on your system. Meaning that you can create as many virtual machine as you need but you can have only one VM live and running. Over a period of time, this restriction was overcome and now one can run any number of virtual machines. When you start a virtual machine, you need to understand that you are running an operating system inside an application which runs on a physical operating system (or hardware). In order to explain clearly, each virtual machines (called as Guest OS), runs inside VMWare which is an application that runs on Linux/Windows (physical system). Often people forget this and expect that their virtual machines to be rocket fast. Really speaking, for every virtual machine you need to have at least 1GB RAM to run smoothly. Here the key is running so many virtual machines in parallel.

Modes of Networking
The next feature is that one can have so many network configurations like NATed environment, Host only networking, No networking and bridged networking. VMWare comes with virtualized DHCP server which takes care of IP address allocation to your virtual machines. The user has liberty to modify the IP addresses provided by VMWare through reasonably good user interface. Apart from this network configuration, one can form virtual team. The virtual team is the network of virtual machines. The virtual team is similar to that of real network and interestingly VMWare provides ways to configure network packets loss percentage.

Virtual Devices
Since all the devices are virtualized, one can add hardware to the virtual machine. VMWare workstation allows you to create 25 ethernet cards. One can increase the size of virtual hard disk or add new hard disk.


Snapshot Manager
VMWare also has Snapshot manager. A snapshot is nothing but a frozen state. At any instant of time, the user can freeze the state of virtual machine and the snapshot can be restored. VMWare comes with a nice and interactive Snapshot manager which makes archiving the states easier for you. This is the one of the cool feature that I like in VMWare. If you do not have time to analyze an issue, you can archive it and revisit later. The other features like record and playback and suspend are notable features.

Using VMWare workstation one can create virtual machines and run them. Typically, we will not be creating VM all times. We will create VMs once in while and put them in production by running the VMs. So, in order to run a VM, VMWare player is enough. In VMWare player, it just runs only one Virtual machine. You do not have the luxury of running a team or many VMs. By the way, Workstation is commercial product but Player is a free software.

Hope this write up will help you to understand VMWare better. More information can be found here.

Sunday, July 13, 2008

Virtualization - A new wave

It was three years back, it was an accident that I was hooked up with Virtualization without knowing that one day it would become a hot area. Today (at least from end of 2006), there has been so much advancements in Virtualization. It clearly remember that VMWare workstation was my first virtualization software and Linux was my first virtual machine.

During end of 2004, I wanted to learn Linux and experiment with it but did not have a desktop where I can install a farm of variety of Linux distributions. Once I thought, installing many distributions would make me Linux geek. Soon I realized that it wouldn't and got rid of so many distributions but I retained VMWare workstation simply because it was (is) a cool tool. My first assignment with Linux was to learn POSIX threads and compare the threading behavior with Solaris. As I was doing the first assignment, since I am a monkey, I wanted to jump to writing system calls. Taking a snapshot in my virtual machine (which will save the current state), I moved to a fresh state and started the experimentation of Linux system call. (Actually I completed both the work and published two articles in Linux for You - Confession to say that I m trying not be a monkey).

Two years later, I got a chance to install the new version of VMware workstation and to my surprise it had hell a lot of features like running multiple VMs, networking them, wide range of virtual hardware configuration, record and play back. After exploring the entire VMWare workstation, I realized that it is killer tool which could actually be used for maximizing resource utilization and also to improve productivity. If you are impressed and want to read more, I would recommend you to read some white papers on Virtualizaton from VMWare

These days, many of the organizations are trying to use virtual machine to reduce the cost of hardware and more importantly I feel Virtualization has key role to play in making this world green. Since you virtualize so may PCs, you end to using lesser power and your system dissipate less heat which is good for our planet. If you are a software developer or a decision maker and an environmentalist, you got to seriously consider in using virtualization.

Apart from commercial virtualization software, you can also find few open source or free virtualization software. Shortly, I will be writing on more blog on virtualization products. both commercial and open source.

Wednesday, September 5, 2007

Improving Test Coverage using Code Coverage

For the past few years, the industry is undergoing a lot of advancements. Particularly, new software development model have been followed. The industry moved from waterfall model towards Agile and Iternation (incremental) model. Also, a lot of progress have been made in improving productivity by employing tools to aid development. One of the most important activity is Unit testing. Unit testing is essential to ensure that the developed code works as expected and without the unit testing the development is not complete. Unit testing has to be carried on the entire code not leaving a single line of code. It is during this phase, the developers make sure that the code will work properly as expected. There are few questions that we need to ask ourselves during unit testing
  1. Are we doing it like a black box testing without looking at the source code?
  2. Do we look at the source code during unit testing?
  3. How do we make sure that the unit testing cover maximum source code?
Let us straight away get into the answers to the above questions. To answer the first question, the unit testing is not a black box testing. Doing it like a black box testing is not effective way of testing the software at unit level. For example, in the actual source code there could be lots of conditional and branching statements and loop statements. The black box testing does not test these language specific constructs properly but it focuses only on functionality of the software.

The answer to the second question is that every developer has to look at the source code while writing a unit test plan. This is very crucial and the test cases has to be based on the source code. The developer of the source code is the best person to know about the source code and hence it is advisable and desirable that the author of the software carry out the unit testing.

Before answering the third question, let us discuss on testing effectiveness. The effectiveness of testing is the covering the entire source code with minimal test cases. When the effectiveness is high, the quality and productivity of the software will also be high. As human are prove to make mistakes, it is often essential to use tools to improve effectiveness. Code coverage is one such technique to do unit testing effectively. Code coverage pin points the area of the source code that is not tested. Most of the code coverage tools work from package level to source line number level. Once the unit testing session is over, the developer can immediately see the results and improve the test plan to make it more effective.

For example, during iteration #1, the developer will execute the test cases and run code coverage in parallel. During the unit testing or after the unit testing, the developer can take a look at the code coverage reports. Since the code coverage tool reports the coverage at line level, it is easier for the developer to add test cases then and there. Most of the tools have features to generate a comprehensive reports at desired level (application, package, class, method and line level).

There are few code coverage tools (open source and commercial) available for Java. Emma and Cobertura are the most popular code coverage tools in open source arena. Both of them are much matured and used by many developers across globe. There are lot of tutorials available for both the tools. Kindly refer respective websites for more information.

Saturday, September 1, 2007

Profiling Tools for Java Applications

“An apprentice carpenter may want only a hammer and saw, but a master craftsman employs many precision tools”

Tools are primarily used for two reasons – Quality and Productivity. It helps us to drill down the problem. When it comes to Java, one has a lot of tools both open source and commercial. There are lots of development tools available for Java and you can find consolidated information at http://java-source.net/. This blog discusses profiling Java applications and gives guidelines on when and where to profile.

Believe me, profiling has to be considered as last resort. It is just like debugging a bug in your application. While coding, the developers should concentrate on addressing the requirements rather than concentration on the performance. The development team chooses the technology, protocols and algorithms that perform the job effectively. Profiling should be done selectively and on need basis. Never profile the application to improve the overall performance of the application. If you want to improve the performance of the whole application, start with design document. Evaluate the algorithms, data structures and infrastructure.

Profiling has to be done only on critical paths. Only 20% of the code is used by the users 80% of the time and the rest of 80% of code is used only 20% of time. It is enough to profile that 20% of code that is used 80% of time. Once you have decided to profile the application (even for fun), you need to have a tool that gives you reliable data. Though you can always settle for printing the time in each method entry and exit, most of the times you will have access the source code and you might be able to add print statements because of various reasons. Profiling tools become handy and once again for Java, you have many open source profiling tools. Netbeans profiler is a great tool to profile the application for fastness, memory consumption. It can profile entire application or part of the application. You can even profile a single statement and get to know their performance cost. You can find the Netbeans IDE and Profiler at http://www.netbeans.org

I have been using Netbeans and Netbeans profiler for the past one year and I am quite satisfied with its feature and results. It integrates nicely will any application and that is the crux. Before using Netbeans, I tried to use few open source profilers but I spent a lot time to find how to use the tool. But with Netbeans, I bet, you will take off within 10 minutes. After installing Netbeans profiler, it is enough to spend few minutes in going through the “Profiler” menus and you can happily explore its functionality in your free time.

Monday, July 2, 2007

Experiences With Netbeans

I have been using Netbeans IDE (5.0 and 5.5) for the past one year and my experiences great. Prior to using Netbeans, I was using Eclipse in my high-end desktop. Yes, I had 2 GB RAM and 2.x GHZ processor. When I start my applications and Eclipse, I faced a lot of difficulties in running both of them. I do not find fault with Eclipse, but it is sheer nature of my application that caused the problem.

For experimental sake, I installed Netbeans and download Netbeans happened quite quickly and within 30 minutes, I was able to install Netbeans and set up the project. Since I needed to set a debugging session, my task was simple. Just compile the sources and start the Tomcat in debug mode. I was happy to connect to remote tomcat (in the same host) and completed the debugging. Since I used to debug applications using Eclipse, the debugging with Netbeans became easy. I would give full marks to Netbeans for giving a small but efficient IDE.

Over the next few days, I was using Netbeans almost daily and that made to investigate more on the tool. Suddenly, I needed to work on a project which is a web application running on Tomcat and powered by Struts. Netbeans, The Crusader, came to my rescue. Netbeans has built-in Tomcat and feature that supports Struts. Soon, I have all configuration files ready and without any source, I built and ran the project. My test web application was launched in my default browser, Firefox. Once again, I am pushed to give full marks for integrated Tomcat. Two more stars for the feature to configure integrated Tomcat. It was a "WoW" feeling.

I don’t find any differences between Netbeans and Eclipse in other features like Refactoring, help, Views/Perspective etc. Both are equally good and I don’t have any points to support one in the basics aspects of IDE. I believe Netbeans developers are very much careful in people's need rather than features and this reflected in the integrated servers (like Tomcat, Web server) but in the case of Eclipse we need to download additional megabytes to install plug-in and that the plug-ins are version dependent.

As of now, the main disadvantage with Netbeans is that there are only few plug-ins but for Eclipse already hundreds of plug-ins are available. Netbeans community should improve a lot and fast to make life easier for the developers. Unless this is addressed, the developers will be in dilemma whether to migrate to Netbeans completely. At least, the software development tools like Code Coverage, Metrics Calculation should be the first priority.

Hope the Netbeans Community will address this soon.

Have a Great Day