Windows Server Administration Fundamentals

If you don’t want to watch the Microsoft Virtual Academy course on Windows Server Administration Fundamentals, here are some notes that can save you a lot of time


  1. sysprep is used to setup a windows machine
  2. Server Image Manager is used to generate answer file for sysprep
  3. Server Core only has a command line ( cmd.exe ). It’s a stripped down version of windows. Some services or roles do not work on server core so make sure the services you want work before choosing server core
  4. Windows installation ISO contains a ‘.wim’ file which is used to install Windows
  5. This ‘.wim’ file can be used to install windows using PXE ( this uses windows deployment services [WDS] )
  6. ‘.wim’ files can also be created from a reference computer using the Image Capture Wizard
  7. In enterprise environment you should ideally use Windows Software Update Services ( wsus ) to update Windows
  8. Run “oobe” in “Run” line to get the Initial Configuration Tasks

Managing Server

  1. UAC asks for permission if you are running as administrator. It asks for administrator username and password if running as normal user.
    This can be turned off by going to “Control Panel” -> “User Accounts” -> “Change User Account Control Settings”
  2. System settings is Right Click on “My Computer” and select “Properties”
  3. WORKGROUPS and used when you have smaller networks ( 10 -15 ) -> decentralized
  4. Active Directory is used when you have larger networks to manage -> centralized


  1. RAID0 stripes data across all drives. if any drives fail all the data is gone
  2. Host Bus Adapter is a network adapter that is used specifically to access storage network

Monitoring and Troubleshooting

  1. “System Information” gives you information about all the individual pieces of the system
  2. “Event Viewer” gives you details on all the interesting events in the system
  3. “Master Boot Record” is the first 512 bytes of a partitioned storage device such as hard disk
  4. Code written here passes control to Volume Boot Record
  5. Volume Boot Record ( VBR ) contains the code to load NTLDR and BOOTMGR
  6. It used to be boot.ini file that told Windows how to load
  7. Now you can use BCDEdit to modify it ( BCD = Boot Configuration Data )
  8. “System Configuration” ( msconfig ) is boot and trouble shooting tool which is service based
    1. Turn on safe boot, turn services off etc
    2. Once you figure out what the problem, set the settings back to “Normal Startup”
  9. Virtual memory settings are shown in “system properties”
    1. Usually page file is at : C:\pagefile.sys
  10. Control Panel” -> “Administrative Tools” -> “Windows Server Backup” to use builtin backup tool ( not enterprise ready )

Essential Services

  1. C\Windows\System32\Drivers\etc\hosts -> hosts file
  2. “DNS Manager”
    1. Create a forward lookup zone ->
    2. Add a new host ( leave parent domain name by leaving the Name field blank ) and add IP address say
    3. Add the IP address of this server to your DNS servers list
    4. Looking up gives you
  3. “DHCP”
    1. Add it using “Add Roles and features”
    2. Right click on “DHCP” -> “Server name” > “IPv4” and select “New Scope”
    3. Give a name and setup start, end, mask, excluded addresses etc
    4. Authorize by logging in as domain administrator
  4. Active directory
    1. Active directory is a hierarchical structure of all entities in the network you are managing
    2. Forests contain trees contain domains
    3. Communicate with each other through trusts
    4. Information regarding domains are stored in a domain controller
    5. Global catalog stores information about all entities in the network. Created on first domain controller. Other domain controllers only contain subset of the info
    6. When new applications are installed active directory attributes may get created on existing objects ( for example installing exchange may add email attribute to users )
    7. User accounts, computer accounts, groups
    8. “Active Directory Users and Computers” in “Administrative Tools”
    9. “Active Directory Administrative Center” in 2012
    10. “Group Policy Management” lets you restrict or set functionality across the network ( password policy, start menu disable etc )

Fortress of Reason

First of all, let me say that I am not an official spokesperson for the Roman Catholic Church. I tell this story because I feel it needs to be said, but it may contain inaccuracies.

Part I : French Revolution

In 1689, St. Margaret Mary Alacoque receives a vision of Jesus. Jesus reveals to St. Margaret that despite the love he has shown to men we only repay Him with ungratefulness and wickedness. He orders St. Margaret to ask the King of France to consecrate France to His sacred heart. The King Louis XIV ignores this order.

Painting of Jesus appearing to Saint Margaret Mary, Church of San Michele
Painting of Jesus appearing to Saint Margaret Mary, Church of San Michele by Giovanni Destefanis

Exactly a 100 years later the French Revolution breaks out. It is one of the deadliest revolutions in history. The aftermath of French Revolution was :

  1. Reign of Terror, murder and mayhem on the streets
  2. The Napoleonic wars severely depopulates France with a large number of people perishing in Napoleon’s thirst for power
  3. Catholic Church suffers major setbacks : it’s nuns and priests turned out, leaders killed or put in exile, it’s property seized and controlled by enemies
  4. There is an attempt to de-Christianize France

However, the effects were partially reversed in time. Some effects still remain to this day. Most important of these are “liberalism” and the  idea of replacing God with reason. See : The Cult of Reason.

It is believed that the King Louis XVI did consecrate France to the Sacred Heart of Jesus after he was arrested by revolutionaries, but it is wasn’t valid since he was no longer the King of France.

Part II: The events at La Salette

In 1846, in the French village of La Salette-Fallavaux, Mother Mary appears to two shepherd children : Mélanie Calvat and Maximin Giraud.

Our Lady at La Salette By Qfamily

Here is what She said :

France has corrupted the universe, one day it will be punished. The faith will die out in France: three quarters of France will not practice religion anymore, or almost no more, the other part will practice it without really practicing it. Then, after [that], nations will convert, the faith will be rekindled everywhere.

A great country in the north of Europe, now Protestant, will be converted; by the support of this country all the other nations of the world will be converted

I see that there are many versions of this text and some readings of these messages will lead you to consider the notion that there is nothing much to it. Be warned that interpreting these messages are difficult for the best of us, but at least we can see that half of this has already come true. If you look at religion in France today, only a quarter believe in God.

So now, the question is which is the great country to the north of Europe ?

Part III: Our Lady and Fátima

In 13 May 1917, three children ( among them Lúcia Santos ) in Fátima, Portugal reported a vision of Mother Mary.

Children of Fatima
Lúcia Santos (left) with her cousins Jacinta and Francisco Marto, 1917

The veracity of these visions have been declared worthy of belief by the Church. Here is a brief overview of the events that came out of this apparition :

  • The Lady revealed Three Secrets to St. Lúcia. Here is some text from the second secret :
  • The war is going to end: but if people do not cease offending God, a worse one will break out during the Pontificate of Pope Pius XI. When you see a night illumined by an unknown light, know that this is the great sign given you by God that he is about to punish the world for its crimes, by means of war, famine, and persecutions of the Church and of the Holy Father. To prevent this, I shall come to ask for the Consecration of Russia to my Immaculate Heart, and the Communion of reparation on the First Saturdays. If my requests are heeded, Russia will be converted, and there will be peace; if not, she will spread her errors throughout the world, causing wars and persecutions of the Church. The good will be martyred; the Holy Father will have much to suffer; various nations will be annihilated. In the end, my Immaculate Heart will triumph. The Holy Father will consecrate Russia to me, and she shall be converted, and a period of peace will be granted to the world.

    To me it looks like the ‘war that is going to end’ is World War I and the other one that ‘breaks out during the Pontificate of Pope Pius XI’ is World War II.


  • Our Lady fulfills her promise, asking “for the consecration of Russia to Her Immaculate Heart, promising its conversion through this means and the hindering of the propagation of its errors
  • At Rianjo, Spain in August 1931, Our Lord communicated to Sister Lucia His dissatisfaction. Here is what He said :

Make it known to My ministers, given that they follow the example of the King of France in delaying the execution of My requests, they will follow him into misfortune. 

They did not wish to heed My request! Like the King of France they will repent of it, and they will do it, but it will be late. Russia will have already spread its errors in the world, provoking wars and persecutions against the Church. The Holy Father will have much to suffer.

  • Many consecrations of Russia are attempted  ( in 1942, 1952, 1964, 1982 ). St. Lúcia informs that none has fulfilled the conditions ( the conditions are that all bishops in union with the Pope and Russia must be specially mentioned )
  • In March 25, 1984, Pope John Paul II, “united with all the pastors of the Church in a particular bond whereby we constitute a body and a college,” consecrates “the whole world, especially the peoples for which by reason of their situation you have particular love and solicitude.” Both the Pope and Sr. Lucia initially seemed uncertain that the consecration has been fulfilled, but shortly thereafter Sr. Lucia tells the papal nuncio to Portugal that the Consecration is fulfilled.
  • May 13, 1984, An explosion at the Soviets’ Severomorsk Naval Base destroys two-thirds of all the missiles stockpiled for the Soviets’ Northern Fleet
  • 1991, Dissolution of Soviet Union

Technically Russia is to the north of Europe and technically the country is Protestant, in the sense that Orthodox Christians do not accept the authority of the Pope. Since the fall of Communism religion is returning to Russia.

Part IV: Why did I tell this story ?

Regardless of what you think about the interpretation of these events, what you have to accept that there are currently two major threats to our faith :

  • Replacing God with the State

This is mostly a Communist idea. We can see echoes of this idea in modern left wing and liberal movements. Since I went to a government college and grew up in a Communist influenced state, I know this is a bad idea already. I do not think governments are very good at their jobs. There may be good people in the government, but mostly it is an instrument used by people with power to take advantage of people without power. Incentive structures within the government are setup so that people get paid well even if they mistreat the people who have to deal with these bureaucrats.

  • Replacing God with Reason

This is the modern vision put forward by New Atheists. We are required by our professions to maintain and upgrade our capacity to reason, and for a long time, we have done so. We have built our minds into a Fortress of Reason, and this benefits us. Unfortunately, to maintain our relationship with God, it is upon this Fortress of Reason that we must commence our siege.

10 reasons why commercial companies should do open source software

  1. Positive PR
  2. External targeted contributions. For example, most people submitting patches to open source software are facing some issue as a user. If they are experiencing an issue, others may also be experiencing similar problems. This is a much better way of driving development, compared to doing it post expensive market research.
  3. Marketing
  4. Recruiting vehicle
  5. Increasing the size of markets. For example Google is trying to bring more people online with Android to increase the size of search market.
  6. Commoditizing complements :
  7. Reducing the cost of training new employees
  8. Influencing the direction of an industry. For example setting standards for server hardware with Open Compute Project.
  9. Free testers
  10. Improving employee morale

Agile software development process explained in simple terms

Agile is a combination of two processes that are designed to develop software. The two methodologies that form Agile are : Scrum and Kanban.
Key to understanding agile is understanding the objective tree. Here is an example objective tree for a company like which aims to build an e-commerce website.

Organization Objective Tree

There are many people who argue about the number of levels in the tree and how they should be called. But the key insight here is that :
a) Objectives form a tree
b) When child objectives are done, the parent objective is automatically done

There are two methodologies within Agile : scrum and kanban.



Objectives are broken into user stories. A prioritized list of user stories is called a backlog. Product management owns the backlog.

Objectives are achieved by working on them in 2 weeks sprints. Team pulls the maximum number of stories that can be completed into the sprint backlog and starts working on them when the sprint starts. Sprint backlog is owned by the team.

Every day of the sprint there is a 15 minute standup meeting where team members describe 3 things :

  1. What they worked on yesterday
  2. What they are planning to work on today
  3. Blockers ( if any )

This is an opportunity for micro-course-correction. If a story was done, team members can move to help with another story. If there is something that blocks a team member, management can move to unblock them. If a story might spillover, it can be called out.

At the end of the sprint there is a sprint retrospective to re-evaluate and course correct at a higher level.

Every N sprints ( for a finite value of N ) there is 1 refactor sprint. No new features are delivered in this sprint. Architectural runway is prepared for incoming stories and code is made more maintainable.

Why is the process like this ?

Reason for product management owning the backlog is to communicate clearly what the current priority is. This can be challenging in a changing environment. For example, management may ask the team to support an application on Windows 2012 platform and mark it high priority since largest customer base is on that platform. Afterwards it could turn out that highest paying customers are on RHEL 7.1. Management can communicate this information to engineering by adding a new story to support RHEL 7.1 and deprioritizing the story for Windows 2012 support.

Team owns the backlog because the team is responsible to ensure that the features ( stories ) committed at the beginning of sprint is done by end of sprint. This is why it’s the team that need to pull the stories into the sprint ( and not the manager ) so they feel a sense of ownership.

Standups give an idea about the pulse of the sprint : whether the team is on track, if it needs adjustment etc. Since software development is a collaborative process, it can get blocked on other people. For example : UI team can get blocked on UX mockups, developers can get blocked on APIs that were promised by other team members, one team member may be blocked for code review from another etc. Daily meetings help with dealing with these problems as they arise. It also enables the team to help others, for example, if someone airs a database problem, someone else on the team may have encountered and solved the problem before. Standup meetings should be short and sweet. If they are too long, since they occur everyday, they become a productivity drag.

The sprint retros are an opportunity to improve things at a higher level. For example, developers may notice that the CI system could run a larger portion of automated tests, reducing QA burden. Developers may point out that the code is getting too complex in one area and request refactor stories.


1. If a story is in the backlog, it may get done. If a story is not in the backlog, it will never get done.

Why is this expectation there ? Sometimes product management may request a feature. Engineering does not know if that feature was important, whether it was a priority etc. Moreover, there could be multiple managers requesting different priorities for stories fuelling confusion. This expectation sets up management to close out the relative priority of objectives before people set out to achieve them.

There is no such thing as an implicit requirement. Management owns the product backlog.

2. Target spillover for any sprint is zero

Why is this expectation there ? For hard software engineering problems it is required that the team is a highly committed one. An uncommitted team member will usually bring down the whole team since the job is collaborative in nature. Target spillover of zero ensures that the team remains focussed on the problem at hand.

3. No activities are planned mid-sprint

Why is this expectation there ? This is to help the team remain focussed so that the cost of context switching is lowered. It is called a “Sprint”, not a “Trot” or “Gentle Walk”. Management is expected to defend the team from external influences. Course corrections are possible at the end of sprint. Therefore, it is important to keep the sprints as short as possible to get a meaningful amount of work done. The length of your sprint should be the minimum amount of time it takes you to respond to external influences. Usually, it is 2 weeks.

4. QA should raise a ticket if there is a problem.

Why is this expectation there ? It is possible that QA notices a problem and communicates it verbally or through email. Now people may go on vacation etc cutting the team’s ability to deliver.

There is no such thing as an implicit ticket. Raise it in issue management software.

5. No story is done until :
a) All code is reviewed
b) There are no open tickets
c) Documentation is complete

Why is this expectation there ? Code reviews are important because it lets someone else get familiar with that code base allowing them to take over in the event of the author’s absence. It is important to close all open tickets before calling a story done since otherwise your development process simply turns feature requests to bugs. Documentation should be developed lock step with code since that is when it is easiest to write it.

6. Do not test from feature branches

Why is this expectation there ? Someone could merge something else into the development branch making the feature tested in feature branches to be unviable in development branch. Development branch is what ultimately gets shipped to users so that is where things should be tested.

7. Stories are of the form “As a [user] I want to do [task] so that I can [accomplish goal]”. If they are not in that form, it can be safely deleted.

Why is this expectation there ? Often stories may be created with no clarity on what the next step is. Often developers may misunderstand the requirement and deliver a different feature requiring multiple unnecessary round trips and feedback loops to complete the feature. If the story is not in the prescribed form, it can be deleted and considered non-existent since it motivates people to state the objectives of the story explicitly.

A few points

  1. In Scrum the keywords are focus and course correction.
  2. Manager – employee relationship is co-operative. The team does everything to make the manager look good ( by delivering high quality features that delights users ) and managers does everything to setup the team and employees for success : removing impediments, giving them tools and access they need to meet the objectives.
  3. Dev – QA relationship is quasi-adversarial. QA tries to defend the customer demanding issues be fixed within reason. Dev team appreciates QA for finding the bugs they have missed that could have caused them to deliver an inferior product.
  4. Agile requires self motivated team. An under-motivated team may over inflate estimates or under commit into a sprint.
  5. There is no such thing as half-agile. Agile gives management a certain amount of power and engineers certain amount of power. This is to improve efficiency by reducing friction and miscommunication. If management says : ‘I will accept these parts of the process that gives me power and ignore these parts that require me to relinquish power’ this process will fail. It requires humility on the part of management and engineering.


This is usually for support. After product is developed, support is trained on resolving bugs that get into production. Support can’t wait 2 weeks to resolve issues. When tickets come into the queue people take them on and try to get through them as fast as possible.

Scrum is more proactive and Kanban is more reactive. Kanban is for situations where a 2 week turnaround time is unacceptable.


Agile came about as a response to the Waterfall model of software development. It helps solve the most important problems with waterfall such as quicker course correction, improving focus and reducing miscommunication.

In waterfall, the software developed in following phases ( one after other ) :

  1. Gathering requirements
  2. Designing solution
  3. Implementing solution
  4. Testing solution


  1. A mistake in early phase cannot be detected until last phase.
  2. There is little focus as work drags on for years.
  3. People working on each step only communicates with people in previous step increasing communication errors.

Should Indian Railways be privatized ?

Should Indian Railways be privatized ? Looking up the answer to this question on the Internet would lead one to conclude that no, it should not be privatized. I am not convinced, I think it should be privatized.

Lets look at the arguments against privatization, one by one.

  • It is not clear how it will improve situation

The argument is that privatization and increased competition will improve the quality of service, drive down prices and spur innovation. It should reduce corruption and force employees to do their best. For a government owned company the employees have no reason to work hard, treat its customers well and figure out how to make everything better. They get paid regardless. This causes them to mistreat their customers and generally be lazy about their work.

The Indian Railways lost ₹30,000 crore (US$5 billion) in 2015. This is despite the fact that it is a high demand business with a government sanctioned monopoly. Booking a train ticket is so painfully difficult that it a subject of so many degrading memes on the Internet. The compartments are noisy and sleeper classes are filled with bed bugs. The toilets are dirty. The staff is unpleasant to deal with. The train stations are riotous and unclean. It smells of shit and urine.

I wonder how many levels of incompetence it takes to suck so badly at a job.

Privatization has helped the Indian telecommunication sector and aviation sector. It is possible for it to work in the rail industry as well. Even if it doesn’t help, it is at least worth a try.

  • Look at the state of American and British Railways

They are significantly better, aren’t they ? But even if it isn’t, there are a thousand reasons it could work better in India. Yes, I know there are a thousand reasons why it couldn’t work also. But why not give it a try ?

Concerning America, their landmass is 3 times that of India and they are a very affluent and urbanized country. This means that most of the travel is very long and hence very inconvenient to be conducted by train. So rail is used mostly for goods and human beings pay a little more to travel by planes.

  • It is a natural monopoly due to high cost of entry and exit

This is partially true. The high cost of entry and exit is largely due to high cost of building and operating railways, so we may need to have some government assistance with regard to this.

One solution to this problem is to let the rails themselves be owned by one company and combine this with multiple companies owning the individual trains. The train companies lease the rails from the rail company to provide their service.

Sure, some government assistance will be needed to acquire more land, ensure that there is stiff competition etc but these are all problems that have well known solutions. It can definitely not be a fire and forget endeavor.

Also I don’t understand how it becomes harder for individual investors to exit the rail business as most companies are traded on the public stock market. If you want to enter the rail business buy a few shares of the company at the Mumbai Stock Exchange. Want to exit ? Sell them at the stock exchange.

  • Some routes may be under serviced because they may be unprofitable

Form a government company to service only these routes using tax payer money. There is no need to keep the entire business in the public sector and cause incalculable misery to everyone in India to benefit a few.

  • The railway employs a lot of people these jobs may be lost in privatization

Privatization does not automatically cause loss of jobs. If a private railway business can operate with fewer number of people and automate away a lot of these jobs it would benefit the customer with lower fares. This money saved by customers can be used to buy new things which creates new jobs. See the parable of broken windows. Another possibility is to tax the rail companies and pay unemployment benefits to these people directly. At least the public will be spared from their laziness and callousness.

  • Defense concern. Countries like China could buy up all Indian Rail businesses and in the event of a war, discontinue them all

We can repossess these businesses in the event of a war. The other problem is if they sabotage it silently while they are holding it. This problem can be solved by stronger policing.

  • National pride and unity

A lot of arguments center around how Indian Railways is a matter of pride for Indians. Sorry, I would rather travel comfortably than with pride. Also, I don’t think it is a matter of pride given how absurdly mismanaged it is.

So anyway, I think most of these arguments are bogus or ill-informed. I have similar thoughts about the power industry ( power cuts are uncommon in Western countries ) since there is no innovation in solar, wind, nuclear power in India despite us having no serious oil reserves. I think India is a poor country on account of power. But more on that later.

What do you think ? Let me know in the comments section.

How to write good software

Here is my theory on an algorithm to build great software :

  1. Figure out how the software ought to work.

    This is the most important part in the software design process. It is important that the user experience be nailed down before we begin all other processes. If we don’t do this first, people will find the easiest way to make the software work. Such an approach may not deliver the best quality experience to the user. It is important to note that it is essential, to involve the users in this step. We need to clearly understand the problems they are facing. How should the optimal solution to their problem work ? Is it even possible with the available resources and at the current state of the art ?

  2. Make it work

    This is the part where you build the software according to the expectations set by the user. At this point you do not have to worry about code quality, performance etc.

  3. Make it better

    In this step you have to make sure that the code is extendable, has high quality tests and is secure

  4. Make it pretty

    In this step, make the software beautiful. Make the text conversational and friendly. Introduce fancy graphics and other visual elements if possible.

  5. Make it fast

    Finally it is time to seek out the worst performing parts of the software and make it fast.

If you follow these steps, and in that order, you should have a high quality piece of software in your hands.

What is polymorphism ?

Polymorphism is touted as one of the awesomest features of Object Oriented Programming. But what exactly is the point of polymorphism ?

Lets take the problem of trying to automate Google search. Lets say your test case is :

  1. Open the browser
  2. Navigate to “”
  3. Type “facebook” to the search text box
  4. Click on “Google Search” button
  5. Wait for the page to load
  6. Check if the results page contain a link to “”

Clearly we need to find some way to drive the browser to do these actions. But how will the automation software know where the ‘search text box’ is ? How will it know where the ‘Google Search button’ is ? So, there is a technology called Xpath that lets you identify a particular element in a web page.

So here is the procedural code that solves the problem ( Language : C ):

int search_google_facebook()
    int test_passed = 1;
    char *search_box_xpath = "//searchbox";
    char *search_button_xpath = "//searchbutton";

    firefox_navigate( "" );
    firefox_type( search_box_xpath, "facebook" );
    firefox_click( search_button_xpath );
    test_passed &&= firefox_search_page_link( "" ):

    chrome_navigate( "" );
    chrome_type( search_box_xpath, "facebook" );
    chrome_click( search_button_xpath );
    test_passed &&= chrome_search_page_link( "" ):

    return test_passed;

Now lets look at the object oriented solution to the problem. Please keep in mind the Liskov Subsitution Principle : base class pointers can point to derived class objects. The code is in Java, so if you are unfamiliar with Java, just keep in mind that classes that implement an interface can be thought of as a derived class of said interface :

public interface BrowserDriver {
    public void navigate( String URL );
    public void type ( String textBoxXpath, String textToType );
    public void click ( String buttonXpath );
    public void waitForPageLoad();
    public boolean searchForLink();

public class FirefoxBrowserDriver implements BrowserDriver {
	public void navigate( String URL ) {
	// Code to navigate Firefox browser to the URL

	public void type ( String textBoxXpath, String textToType ) {
	// Code to type "textToType" into text box identified by textBoxXpath in Firefox

	// etc

public class ChromeBrowserDriver implements BrowserDriver {
	public void navigate( String URL ) {
	// Code to navigate Chrome browser to the URL

	public void type ( String textBoxXpath, String textToType ) {
	// Code to type "textToType" into text box identified by textBoxXpath in Chrome

	// etc

public class GoogleSearchFaceBookTest {

	public static boolean testGoogleSearchFacebook( BrowserDriver driver ) {
		driver.navigate( "" );
		driver.type( "//searchbox", "facebook" ); "//searchbutton" );
		return driver.searchForLink("");



public class TestMain {

	public static void main( String [] args ) {
		BrowserDriver browserDrivers[] = { new ChromeBrowserDriver(), new FirefoxBrowserDriver() };
		for( browserDriver : browserDrivers ) {
			if(!GoogleSearchFaceBookTest.testGoogleSearchFacebook( browserDriver )) {
				System.out.println( "GoogleSearchFaceBookTest has failed!" );



If you have a very large test suites, there are a couple of advantages to this approach :

  1. This code is a lot less copy paste and hence less error prone.
  2. Code is easily extensible : Want to add a new test ? Just add it to the main for loop. New test runs with all supported browsers. Want to add a new browser to the test suite ? Just add the driver object to the browserDrivers array. Your entire test suite now runs against the new browser.

How does this magic happen ? If you look at these lines of code :

driver.navigate( "" );
driver.type( "//searchbox", "facebook" ); "//searchbutton" );
return driver.searchForLink();

you can see that the code behaves differently ( polymorphism ) based on the type of the driver object. If the driver object is of type ChromeBrowserDriver, calls get dispatched to ChromeBrowserDriver methods. If driver is of type FirefoxBrowserDriver, calls get dispatched to FirefoxBrowserDriver methods. This is the power of polymorphism and it allows us to write modular code.

One important question that could come up at this point is : ‘My favorite language is C. Do I need to switch to Java to write object oriented code ?’. And my answer is : No, it is not the language that is important, but the technique. You can find object oriented code in C. Look at the write() system call in Linux :

ssize_t write(int fd, const void *buf, size_t count);

This is an object method operating on the file object pointed to by the “fd” parameter.

Since C is a simpler language compared to Java, if modularity problems are not common in the problems that you solve, use C. I believe we must use the simplest tool that gets the job done. This reduces chances for bugs and creates more performant software.

On the other hand, if modularity problems are common in the problem you are attempting to solve, it maybe helpful to use a language with support for object orientation. For example, if you say that ‘class A implements interface B’ and while implementing class A, if you forgot to implement a method specified in interface B, you get a nice compile time error in Java. In fact, if you use a good IDE, it will report the problem immediately, before you even decide to compile the program.