The Economies of Software Testing

Why software defects are costly to find and fix?

How early defect detection can save much cost in fixing defects?

There is a definite economic impact of software testing. One economic impact is from the cost of defects and the another is the way we perform testing. Cost of defect is a very real and very tangible cost. The second point the way we perform testing will not consider it now.

Where defects originate?


One of the most commonly understood facts about defects is that most defects originate in the requirements definition phase of a project. The next runner-up is the design phase.

Some problems in getting accurate, clear, and testable requirements are:

  • Many people do not have a solid requirements gathering process
  • Few people have been trained in or understand the dynamics of requirements
  • Projects, people, and the world around us change very quickly
  • The English language is ambiguous and even what we consider clear language can be interpreted differently by different people.

 Where testing resources are used?

In the previous section we saw that most defects originate in requirements and design, but most of the testing effort occurs in a traditional “testing” phase toward the end of the project. The problem with the big bang approach to testing is that defects are not found until toward the end of the project. This is the most costly and risky time to fix defects. Some complex defects may even be impossible to fix.

 Relative cost of fixing defects

One of the known facts about software defects is that the longer they go undetected, the more expensive they are to fix. Although research differs on the exact ratios, the general rule is 1:10:100. That is, if a defect costs one unit (hour, dollar, etc.) to fix in requirements and design, it costs 10 units to fix in testing (system/acceptance) and over 100 times to fix in production. The cosThis cost of defects doesn’t even take into account the impact cost of defects. These t of fixing in production may be even higher than 100 times. Costs could be attributed to lost revenue, reimbursements, fraud, lost customers, bad public relations, and litigation.



  • Most defects are created in the early stages of a project
  • Most defects are found in the later stages of a project
  • It costs 10 to 100 times as much to fix a defect in the later phases of a project.

So, what does all of this mean? The main conclusion is that most people perform testing too late in the process. These people wonder why testing is so expensive and why their projects are often over budget.

If you really want to make your testing more efficient and reduce the overall cost of testing and defects, test early in the project and continue testing throughout the project.

How To Make WiFi Tethering in Windows 8.1

Steps to Configure Wifi Tethering in Windows:

  1. Launch an elevated command prompt under Windows 8 (command prompt with administrator privileges).
    To do this Press Windows + x key in windows 8 and click Command Prompt (Admin).
  2. Execute the below command to verify that your network interface support virtualization:

netsh wlan show drivers

If the “Hosted network supported” says “Yes“, then you’re ready to share the internet via Wi-Fi. Otherwise, you need to upgrade your hardware, if the software update doesn’t fix it.

  1. Now set up the Ad-hoc wireless network (wifi tethering) using this command. Replace the parts in markup tags with your own choices

netsh wlan set hostednetwork mode=allow ssid= key=

ssid is nothing but your desired Wi-Fi name, you can give your own.

Key is nothing but your Wi-Fi password. It should be Minimum 8 characters long.

Eg : netsh wlan set hostednetwork mode=allow ssid=myhomenet key=012345678

  1. Your hosted network has been created. Now, you need to start it.
    Use the command below to start your Wi-Fi Network:

netsh wlan start hostednetwork


  1. Now type exit. Command Prompt will close.
  2. Open the connected network and right click on it and select “Connection Properties“. Now open Sharing Tab (Internet Connection Sharing) and check “Allow other network option”and from the dropdown select the “Local Area Connection”and Click “OK”.


  1. To Check the connection, open Control Panel-> Internet and Sharing and there you will see 2 connections one is your internet connection and the other one is Local Area Connection (Which is your WiFi Created)

Democracy Wins – Birth of new Style of Politics

The result 67/3 I had never expected. Thought of 37-45 for AAP.

Delhi election shows that Government is By the people, For the people and Of the people.

BJP was over confident with its Lok Sabha election win. But State politics is different from National. At national level there was no other option.  People voted for the best possible candidate. But in Delhi election people has the option to choose between honest people’s leader and Center’s representative.

There are few questions that have come up in media recently like

Why BJP projected CM candidate unlike in other states?

Why was the election delayed?

Why did they started using negative tactics?

Whatever may be the reason, everything went against them.

I am not here to analyze why APP won or why BJP lost.

I am just trying to focus that Government is By the people, For the people and Of the people. Jai Hind!

Security testing – revisited

This blog (security testing revisited) is intended to summarize  few of my post related to security testing :-

  1. Ethical Hacking – part 1 – 

    Before going into details of how to ethical hacking we should be clear of what it is. What is ethical hacking? ….

  2. Ethical Hacking – part 2

    In this part we will go a step further in to ethical hacking and discuss how to do Penetration testing. Warning: Proceed only after permission from network owner else it will be treated as hacking….

  3. What is Cross-Site Scripting?

    What is Cross-Site Scripting (XSS)? Cross-Site Scripting (XSS) attacks are a type of injection problem, in which malicious scripts are injected into the otherwise trusted web sites….

  4. SQL Injection

    SQL injection is a technique often used to attack data driven applications. This is done by including portions of SQL statements in an entry field in an attempt to get the website to pass a newly formed SQL command to the database. ….

  5. Security Testing tips

    What is Security testing? Security testing is a process to determine that an information system protects data and maintains functionality as intended. It is the process that determines that confidential data stays confidential and users can perform only those tasks that they are authorized to perform….


Selenium Ruby Binding – how ?

Good part of selenium is that the selenium tests can be written in multiple programming languages like c#, Java, Perl, PHP, Ruby etc. I normally hear saying that “This Java project, so we can write tests in Java as well”.  The only advantage I see with this is that you can get help from development team incase you are stuck somewhere. But if you are good at c# or any other language it should not be an hindrance. Test framework will be different that coding framework unless you want to integrate it.

I covered Java and C# in most of my previous posts. Here I will be using Ruby to write the Selenium tests.

 A simple Ruby Test

require "selenium-webdriver"
driver = Selenium::WebDriver.for :firefox ""
element = driver.find_element(:name, 'q')
element.send_keys "Hello Selenium WebDriver!"

require “selenium-webdriver”  – This is similar to import in Java and using in c#

The above example is without using any Test framework. In Ruby you can use Test Framework as you do with C# ( NUNIT test framework) and Java( JUNIT or TestNG framework).

In Ruby you can use minitest or BDD framework  RSpec or Cucumber

Structure of RSpec test

load File.dirname(__FILE__) + '/test_helper.rb' 
#'describe' marks the a test group
describe "Selenium Ruby Tests" do 
include TestHelper
 # 'it' marks the start of a test case, ends with the matching 'end'
it "Start Chrome" do
 browser = Selenium::WebDriver.for(:chrome)
 sleep 1
it "Start FireFox" do
browser = Selenium::WebDriver.for(:firefox)
 sleep 1
it "Start IE" do
 browser = Selenium::WebDriver.for(:ie)
 sleep 1

For more information on RSPec click here .

War has begun

I am not talking of war with guns and rockets but price war.
With the  Flipkart’s big billion day sale, it has started a price war among other e-retailers. Snapdeal and Amazon has also started the same.  Others might follow the path.

Its a win-win situation for consumers.

Future group and others are complaining that it is ill-legal. They have not done anything new, same was done by Big bazzar 12 years ago with Independence day offer. At that time other small retailers were complaining the same. But ultimately consumers benefitted. Now they are at the receiving end.
According to me it is a healthy sign and price war means benefit to consumers.

This is my personal opinion.
What do you think?

Test Pattern – Pair Testing

Pair Testing

Pair testing is another example of test pattern.


  1. Pair testing is a way of approaching a test design process by having two people test the same time and place continuously.
  2. The dynamics of pairing enables the generation of more and different ideas than either tester is likely to produce on his own.
  3. It is an effective complement to individual testing.


  1. Composer/ lyricist pair
  2. Pilot and Co-pilot in a aeroplane


Two tester working together produce tests, over a period of time continuously exchanging ideas. Assuming that the conditions exists that enables test design, successful pair testing requires three specific conditions

  1. At least one tester is available who can be trusted to test without supervision
  2. Another tester is available who can join the first tester for a session of test design.
  3. The two testers are otherwise capable of working together


  1. Idea Exchange – The process of explaining and questioning helps pollinate new ideas. This is true even when one of the testers is much less knowledgeable than the other one.
  2. Attention flow – The core dynamic of pair testing is the flow of attention. Pair testing requires that the testers synchronize their pace of work. They continuously share ideas and direct themselves to various problems.
  3. Test strategy – If each tester specializes in a different sub-systems, then as a pair they may be especially effective at system testing that examines the interaction among those sub-systems.

Test Patterns – Scenario Testing

Scenario Testing

Scenario testing is one of the example of Test Patterns


  • The objective of scenario testing is to prove that the program will fail when asked to do real work ( significant tasks) by an experienced user. A failure at this level is a validation failure ( a failure to meet the stated or implicit program requirements.)
  •  “All” of the features have been tested in isolation. More precisely, all of the features that will be called within this scenario have been tested on their own and as fas we can tell, none of them has an error that will block  this scenario test.)
  • The tester must have sufficient knowledge of the domain( eg: accounting, if this is an accounting application) and many of the ways in which skilled users will use the program.


  • Time trade off
  • There is often much time pressure to develop “realistic” tests quickly.
  • Because complex tests are expensive. You can not develop many of them. What level of coverage will you get from these tets? What level should you expect.


Ideally scenario test has four attributes

  1. The test is realistic
  2. It is complex
  3. It is easy to tell whether the program passed of failed the test
  4. Serious failure if the program will not pass a given scenario

The key message of this pattern is that you should keep this four attributes in mind when you design a scenario test and try hard to achieve them.

Next we will cover another example of test pattern.





How to convert xml to json format?

To Convert XML to JSON format

Consider a situation where in you have data in xml file and want to use it as a input to some other system where in it takes data in the form of JSON. You would require to convert XML to json format.

Below is an example of converting XML file into json file format.

#! /usr/bin/env ruby -rubygems

require 'rubygems'
require 'active_support/all'
require 'json'
json_str = Hash.from_xml([0]).read).to_json[1], 'w+').write json_str

To run the command,

xml-to-json.rb .file1.xml .file_out.json