Showing posts with label Computers and Internet. Show all posts
Showing posts with label Computers and Internet. Show all posts

Watir - Open Source Web Testing tool

What do you mean by Watir?

Web Application Testing in Ruby (Watir) is an open source testing tool. It is one of the popular open source testing tools. Lets us now have a look at its features, advantages, disadvantages and its comparison with Selenium.

Features of Watir QA testing tool

  • The test scripts are written in Ruby language.
  • It supports multiple domains and has a test recorder.
  • It can find elements by its name, index, ID or value.
  • WatirWebDriver supports browsers like Chrome, Firefox and Safari with help of ChromeWatir, FirefoxWatir and SafariWatir respectively.

Watir’s advantages
  • It is very easy to learn.
  • It is very easy to debug
Watir’s disadvantages
  • To use Watir you need to learn Ruby language because it supports no other language.

Comparison of Watir and Selenium

Selenium
  • Selenium supports multiple languages.
  • It supports multiple browsers.
  • In order to install Selenium IDE, we need to first install Firefox because Selenium IDE is a Firefox plugin.

Watir
  • Watir supports only Ruby language.
  • WatirWebDriver supports multiple browsers like IE, Chrome, Safari, Firefox browser and Opera.

How to install Watir?

The installation process consists of two steps. First install Ruby and then Watir. Ruby installation on Windows
Before installing Ruby on your machine it’s always better to check whether you have already installed it. You can check this by running the given below command from your command prompt.
ruby– v
Note: If Ruby is installed on your machine, then its version will be displayed. If not then a message will be displayed stating that it is not a recognized command.

The steps for installing Ruby on Windows are as follows.
  • Install the latest version of Ruby using RubyInstaller. It is an easy way to install Ruby. Initially Ruby was installed by using one-click installer but now you can prefer RubyInstaller.
    http://rubyinstaller.org/
  • Open the above link and then click on “Downloads’.The downloads page will be opened http://rubyinstaller.org/downloads/
  • Click on the latest version of Ruby and run the installer. Follow the steps that are shown on the screen.
  • Click on your Start menu and check which entries have been created after installing Ruby.
  • You can also verify the installed Ruby version with the help of the command ruby –v
  • Once you have installed Ruby, you can download an open source editor to write programs in Ruby. There are many open source editors available. For example Notepad++. You can download the one you mostly prefer.
  • Link to download Notepad++ https://notepad-plus-plus.org/

Updating RubyGems
RubyGems are softwares written in Ruby. They are also called gems.It is very important to update RubyGems because the installation of Ruby may not contain the latest version of RubyGems.

Syntax to find version of gems (run this command from command prompt)
gem-v


Syntax to update RubyGems
gem update --system
Watir Installation
  • Open the Command Prompt
  • Run this command to install Watir
    gem install watir
  • Please note that if you are installing from behind a proxy, add this command at the end after any gem update or gem install.
    -p http://name_of_your_proxyserver:-port_of_your_proxyserver

How to create a Watir script?

The steps are as follows
  • Open an editor. Write the below code in it.
    require watir # load the watir library
    browser = Watir::Browser.new
    browser = Watir::Browser.start(“http://ianswer4u.com”)
  • Note - # is a comment. The text followed after this symbol is ignored.
  • Save it as samplefile.rb (Here rb is the extension used for Ruby files)
How to run the script?
  • Open the command prompt window and run the Watir test script.
    ruby C:\samplefile.rb
  • After you execute the above command an IE browser will be opened with the specified URL.

Watir Syntax

The syntax used in Watir is as follows.
  • To load library
    requirewatir
  • To open a browser and a specified URL
    browser=Watir::Browser.new
    browser=Watir::Browser.start(“http://ianswer4u.com”)
  • With help of goto syntax we can open a specified URL
    . browser.goto(“http://ianswer4u.com”)
  • To close the browser browser.close
  • To access elements
    • Buttons
      p=browser.button(:value, “Submit Form”)
    • Text area or text box
      b=browser.text_field(:name, “customer_firstname”)
    • Checkbox
      cb=browser.checkbox(:name, “enabled”)
    • Radio button
      rb=browser.radio(:name, “select activity type”)

Read More:
Windmill - Free Web Testing software and Windmill V/s Selenium
Difference between method Overloading and Overriding in OOPs
Difference between Abstraction and Encapsulation
Testing and Debugging : What, Who does it, Differences

Copyright © ianswer4u.com

Windmill – Open Source Web Testing Tool

What is Web Application testing?

The technique which tests web applications is called as Web Application testing. Web Application testing consists of different techniques like Compatibility testing, Functionality testing, Security testing, Interface testing, Performance testing and Usability testing.

Introduction to Windmill

Nowadays various tools are used to test web applications. For example Selenium,Waitr,Sahi etc. Today we will have a look at one of the best Open Source Web Testing Tool called Windmill. Windmill provides a cross-browser recorder and an interactive shell to automate web browsers.It provides various useful features which are given below.

Features of Windmill web-testing tool

  • Windmill has a record and play feature.
  • Supports multiple browsers like Chrome, Firefox, IE, Opera, Safari
  • It is OS independent.
  • Supports languages like Python, JavaScriptand Ruby.
  • It supports Web and RubyOnRails technologies.
  • Debugging tools like Firebug and Firebug Lite.

Advantages of Windmill
  • We can save the test suite in multiple formats. For example in python, json and javascript.

Disadvantages of Windmill
  • You need to add wait commands like “waitforElement”.
  • File uploads are not supported in Windmill.

Windmill vs Selenium

Selenium
  • Selenium supports many languages and browsers.
  • Selenium does not have any integrated debugging tools.
  • In order to install Selenium IDE, we need to first install Firefox because Selenium IDE is a Firefox plugin.
Windmill
  • Windmill supports multiple browsers but supports only Python, JavaScript and Ruby languages.
  • Windmill has integrated debugging tools like Firebug and Firebug Lite.
  • Test recorder for all browser platforms.
  • Visual Studio or Eclipse is not required since the tests can be directly written in the Windmill IDE.

How to run Windmill?

There are different ways to run Windmill. Today let’s have a look at Command line Utility.
Command Line
  • Mozilla browser
    • There are two ways you can run windmill.
    • windmill firefox http://www.yoursitelink.com
      windmill –m http://www.yoursitelink.com
  • Chrome browser
    • windmill chrome http://www.yoursitelink.com
  • Safari browser
    • windmill safari http://www.yoursitelink.com
    • windmill –shttp://www.yoursitelink.com
  • Internet browser
    • windmill ie http://yourwebsitelink.com
    • windmill –x http://www.yoursitelink.com

How to create Tests in Windmill Testing Suite?


  • Start IDE - windmill firefoxhttp://www.yoursitelink.com
  • Two windows will be opened. One will contain the application you want to test (http://yourwebsitelink.com) and the other will contain Windmill IDE.
  • Record Tests – Click on record button to start recording.
  • Play Tests – Click on play button to run the test.
  • Save Tests – Click on save button to save the test.

Windmill Settings
We can change the Windmill Settings from the Settings tab. For example:
  • Format of saving the Test suite.
  • Auto Scroll action.
  • To suppress JavaScript alerts.
  • Break on Failure.
  • Full debug
  • To use XPath only for recorder or explorer.
  • Click sensitivity while recording.
  • Play action

How to run Windmill Test script? (Command line)
  • windmill firefox test=./path_to_your_scripts_folder/ http://www.yoursitelink.com

Read More:
Load Testing vs Stress Testing
Difference between Test Case and Test Scenario in Software Testing
Black-box vs White-box Testing
The Benefits of Unit Testing

Copyright © ianswer4u.com

Structural Design Patterns in Software Engineering

Today's article on Structural design patterns is the fourth and the last article on design patterns in Software Engineering, read the earlier articles here:

What to you mean by Structural Patterns in Software Engineering?

Structural design pattern are way to describe how classes and objects are composed in application to form larger structure. Structural design pattern simplifies the structure of the application by identifying the relationships. It basically focuses on how classes are related to each other via inheritance and how one class is composed from the other.

Advantages of Structural design pattern

  • The efficiency of the application increases when we use design pattern.
  • Reusability of the application also increases through the use of structural design pattern.
  • Through the use of design pattern in the application, the structure of the application becomes cleaner and simpler- interfaces become easier to understand.

Different types of structural design pattern

1. Adapter Pattern

The adapter pattern is a type of structural pattern which connects two related interface. It is the device adapter which connects the two devices together. Let us take real world example. Electric sockets in our houses are of different sizes and shapes. Let’s take the example of a socket of 20 Ampere. A 10 Amp socket cannot fit a 20 Amp plug. This is why we use an adapter to connect the two. The adapter can be called a connector here.

2. Bridge Pattern

Bridge pattern is basically used for separating the interface from its implementation. Doing this gives flexibility.
The best example of this is the use of switch board.The switch board is a bridge in which there is ON/OFF buttons for fans and tube light. The functionality can be used to switch On the fan with help of ON button on switch board and Switch Off the fan using OFF button on the switch board. We have two more device tubelight and AC whose functionality is also managed through switch button.
Lets understand this with the help of example:
Public interface SwitchBridge
 {
   void switchOn();
   void switchOFF();
 }
Public class Fan implements SwitchBridge
 {
    void switchOn()
  {
     System.out.println(“FAN IS SWITCHED OFF USING SWITCH BOARD”);
   }
  void switchOFF()
 {
    System.out.println(“FAN IS SWITCHED ON USING SWITCH BOARD”);
  }
  } Public class Fan implements SwitchBridge
  {
     void switchOn()
   {
      System.out.println(“TUBELIGHT IS SWITCHED OFF USING SWITCH BOARD”);
   }
  void switchOFF()
 {
     System.out.println(“TUBELIGHT IS SWITCHED ON USING SWITCH BOARD”);
  }
}
 Public class AC implements SwitchBridge
 {
    void switchOn()
    {
      System.out.println(“AC IS SWITCHED OFF USING SWITCH BOARD”);
     }
   void switchOFF()
  {
     System.out.println(“AC IS SWITCHED ON USING SWITCH BOARD”);
   }
}

3. Composite Pattern

Composite pattern is a kind of Structural design pattern and is used when we have to represent a part-whole hierarchy. The collection of the object is stored in the class.

4. Facade Pattern

Façade Design pattern hides the complexities of the system. A separate interface is used for hiding the complexities of the system and delegate the call to the system classes.
Façade patterns are allowed in following scenarios
  • When we want a simple system from a complex system. Subsystem becomes complex as we start developing it. The subsystems can be reused and are easier to use. A façade pattern provides simple view to the subsystem.
  • There are many dependencies between clients and implementation class of an abstraction.
  • We can easily layer our system with the help of façade. The view and complex logic gets separated from each other.

5. Flyweight Pattern

Flyweight pattern is basically used to reduce the number of objects created and used in the application. It is generally useful to minimize the usage of memory and increase performance. When no matching object is found, an existing similar kind of objects can be reused by flyweight pattern.

6. Proxy Pattern

A class represent the functionality of another class is basically proxy pattern.
Proxy patterns are applicable in below references:
  • Remote proxy – It basically provides a local representation for an object in a different address space.
  • A virtual proxy – It basically helps in creating expensive objects
  • Protection proxy- It is helpful when the objects have different access rights.

Read More:
Abstraction vs Encapsulation in OOPs with example
Advantages And Features Of Object Oriented Programming

Copyright © ianswer4u.com

Creational Design Patterns

Creational design pattern abstracts the instantiation process. It helps in making the system independent of how its objects are created, composed and represented. Object creation is a complex task. To resolve this problem we have design patterns. You can read more about

Hard coding of the program is not always a good approach for programming. We create the instance using a new keyword. The nature of objects usually changes with respect to the nature of the program. Thus design pattern is essential for instantiation of the object in the application.

Let us see the various different creational design patterns are and how to use these design patterns:

Factory Method Pattern

In factory method design pattern, we define an interface and abstract classes for creating object and we let the subclasses to decide which class to instantiate. In short subclasses are responsible for instantiating the subclasses.
The major advantage of using such a pattern is that subclasses have an option to choose the interface or abstract class for creating object.
Secondly the codes are loosely-coupled, as the class which needs the object creation code will only implement or extend the interface or class.
Let us understand it with help of example

class PGStudent extends Student
{
  long numberOfLectures;
  PGStudent(String name ,String PRN, String specialization,long numberOfLectures)
 {
  super(name,PRN,specialization);
  this.numberOfLectures = numberOfLectures;
 }
  void display()
 {
   super.display();
   System.out.println("No of lectures for PG student : "+numberOfLectures);
  }
 }
  class UGStudent extends Student
  {
    long numberOfLectures;
    UGStudent(String name ,String PRN, String specialization,long numberOfLectures)
    {
         super(name,PRN,specialization);
         this.numberOfLectures = numberOfLectures;
     }
  void display()
   {
      super.display();
      System.out.println("No of lectures for PG student: "+numberOfLectures);
    }
 }
  class GetStudentFactory{
   Public Student getPlan(String studentType)
 {
    if(studentType==null)
    return NULL;
    if(studentType.equalIgnoreCase(“PGStudent”)
    {return new PGStudent;}
   }
  else if(studenttype.equalIgnoreCase(“UGStudent”)
{
   Return new UGStudent;
  }
}

Abstract Factory Pattern

Abstract Factory class is that which defines an interface or abstract class for creating families of related dependent or independent objects. It is similar to Factory method but it produces a collection of the classes or objects.
It is very useful when families of related objects need to be created.System requirement of multiple objects can be fulfilled with the help of abstract factory pattern for creation of family of objects.

Singleton Pattern

Singleton design pattern in Java is used to define a class that has only one instance .The instance can be created at the run time or compile time.
There are two possible ways through which the objects can be created:
  • Early instantiation : Instantiation at the load time.
  • Lazy instantiation: Instantiation whenever required.

Singleton saves memory as the objects are not created at every request. Same object is used every time.
Example of the singleton pattern using JAVA language

class A{ //definition of class A
 private static A obj=new A();
 private A(){}
 public static A get A(){
 return obj;
   }
 public void doSomething(){

   }
}

Builder Pattern

Builder pattern is the pattern through which complex objects are created from simple objects using step by step process.
Basically it provides clear separation between construction and representation of objects. Construction of the code can be done easily with help of Builders pattern. It will support if there is any change in the representation of objects.

Object Pool Pattern

Creation of objects is costly affair. So the basic principle behind the object pool pattern is that an object container has been created and whenever any of the objects are required, we can take object from that container and once there is no object in the container then we put more objects in the container.
A pool is basically used because it manages objects properly.
Some of the advantages of the object pool patterns are as follow:
  • It helps in good performance of the application which has used the object pool pattern.
  • It is the most effective when a bulk of the object’s initialization is required in the application.
  • With the help of Object pool design pattern, we can easily reuse the objects.
  • Object pool design pattern restricts the developer’s use objects.

Read More:
Method Overloading V/s Method Overriding In OOPs
Pros and Cons of Inheritance in OOPS
Advantages & Disadvantages of Polymorphism in Object Oriented Programming

Copyright © ianswer4u.com

Behavioral Design Patterns in Software Design

In the previous article we discussed about in brief about various Software design patterns, their types and why they are helpful in developing a robust software architecture which can be reused. Today we will discuss about behavioral design patterns in OOPs and different types of the behavioral design patterns.

What are behavioral design pattern?

Behavioral pattern concerned with interaction between different objects. Behavioral pattern not only describes the pattern of objects or classes but also the pattern of communication between different objects. Behavioral pattern basically describes the flow of processes. It is a step by step flow of object interaction. It maintains how different objects and classes interact with each other to carry out all processes.

Behavioral pattern uses object compositions rather than inheritance.We use behavioral pattern where a single object could not handle the process but which can be handled by group of objects.

Creational pattern helps in the instantiation of object. Structural pattern helps in the creation of structure of the application and the behavior of the application will be controlled by behavioral pattern.

Different types of the behavioral design patterns

  1. Chain of Responsibility

    The chain of responsibility is a design pattern in which there are multiple handlers which handle the process request. It is typically not possible for one object to process the object sent by other objects. The problem can be resolved with help of Chain of responsibility design pattern. There are multiple processing objects which will handle the process once it is successfully passed from one object to another and it gets passed to the end. Chain of responsibility pattern is applicable where there are multiple objects to handle the processes.There should be more than one object to handle the request. The set of objects which will handle the request should be specified dynamically.
  2. Advantages of Chain of responsibility design pattern

    • Each of the objects is independent of the other. Hence chain of responsibility supports reduced coupling amongst different objects.
    • The codes are more flexible as there are different objects handling different process.
    • As there is no recipient at the end of the process so it is not sure that process will be successfully handled at the end of the process completion.

    Let’s understand this with the help of a real world example.
    Suppose we have a vending machine which accepts coins of any shape and size.In order to do processing of each type of coin we should have specific handlers. The coin of $1 will be handled by one handler and that of 50 Cents will handled by some other handlers. In this way different handlers are used to handle different coins of different weight and size.

  3. Command Pattern

    The command pattern is a design pattern which enables all the information for the request to be stored in a single object.
    Command pattern is a behavioral design pattern in which all information needed to execute a method could be used immediately or held for later use. This object doesn’t execute anything,it only includes information.

    Advantages of the Command design pattern

    • Command pattern supports decoupling as the object implementing the operation and object invoking the functions are unaware of each other.
    • Objects can be easily manipulated and changed.
    • We can easily assemble commands into composite commands
    • It is an easy process to add new commands because we don’t need to change the existing class.

    Suppose we have an oven in which have different functionalities like heating the food, start button, end button, buzzer button. All the functionalities of the oven will be handled by the oven.
  4. Interpreter Pattern

    The interpreter pattern is a design pattern which is used when developing domain-specific languages. This pattern allows the grammar for such domain specific language to be represented in an object-oriented programming.
    Interpreter pattern are applicable where the grammars are simple.
    It basically evaluates the sentence in the languages. The patter is described in term of formal grammar.

    Advantages of interpreter design patterns

    • As the interpreter pattern uses classes to represent language. We can easily use inheritance to change or extend the grammar.
    • Implementation of grammar is easy.
    • Through interpreter pattern we can easily evaluate an expression as per the new requirement.
    • Interpreter can easily handle easy grammar but it is difficult to handle complex grammar.

Read More:
Difference between method Overloading and Overriding in OOPs
How does inheritance work in Java?
Ad-hoc Testing, Monkey Testing & Exploratory Testing
Difference in Drivers and Stubs | Software Testing

Copyright © ianswer4u.com

Software Design Pattern: Why to use & its types

What is design pattern in software architecture?

A pattern basically describes a problem which occurs over and over again in the environment. It describes the core solution to the problem in such a way that you can use this solution a million times without doing it twice. Design patterns play an important role in Software Engineering Architecture as we try to simply the solutions and reusing the old solutions go a long way in cutting down the costs. A software design pattern acts as a template for future software development projects.

How to use software design pattern in software engineering?

  • Read the pattern once through an overview. Pay special attention to the applicability and consequences of using the design pattern in the application. 
  • Before using the design pattern in the application, it is necessary to understand the classes and objects used in the pattern. 
  • Look at the sample code section to make correct use of the design pattern. 
  • Define the class which uses the design pattern. Interfaces, inheritance relationships and instance variable have to be defined properly.

Types of software design patterns in software architecture

  1. Creational design pattern
    Creational design pattern abstract the instantiation process. They help in making the system independent of how its objects are created, composed and represented. Object creation is a complex task. Design pattern resolves this problem.
    Different types of creational design pattern:
    • Factory Method Pattern
      In factory method design pattern, we define an interface and abstract class for creating the object and we let the sub-classes decide which class to instantiate. In short, sub-classes are responsible for instantiating the sub-classes.
    • Abstract Factory Pattern
      Abstract Factory class is that which defines an interface or abstract class for creating families of related of dependent or independent objects. It is similar to Factory method but it produces a collection of classes or objects.
    • Singleton Pattern
      Singleton design pattern in Java is used to define a class that has only one instance .The instance can be created at run time or compile time.
    • Builder Pattern
      Builder pattern is the pattern through which a complex object is created from simple objects through a step by step process. Basically it provides a clear distinction between construction and representation of objects. Construction of the code can be done easily with help of Builders pattern. It will support if there is any change in the representation of objects.
    • Object Pool Pattern
      Creation of an object is a costly affair. So the basic principle behind the object pool pattern is that an object container has been created and whenever any of the objects is required then we can take object from that container and once there is no object in the container then we put more objects in the container.
  2.  Structural design pattern
    Structural design patterns are ways through which we can describe how classes and objects are composed in an application to form a larger structure. Structural design pattern simplifies the structure of the application by identifying the relationships. It basically focuses on how classes are related to each other via inheritance and how one class is created from other.

    Advantages of Structural design pattern
    • The efficiency of the application increases when we use design pattern
    • Re-usability of the application also increases through the use of structural design pattern
    • Through the use of design pattern in the application, the structure of the application becomes cleaner, simpler interfaces which are easier to understand.

    Below are the different types of structural design pattern
    1. Adapter Pattern
      Adapter pattern is the structural pattern with help of which we can connect two related interfaces together. The interface which joins the two interfaces is known as Adapter.
    2. Bridge Pattern
      Bridge pattern is basically used for separating out the interface from its implementation .Doing this will give flexibility.
    3. Composite Pattern
      Composite pattern is one of the Structural design patterns and is used when we have to represent a part-whole hierarchy. When we need to create a structure, in a way, that the objects are identified correctly. The collection of the object is stored in the class.
    4. Facade Pattern
      Façade Design pattern hides the complexities of the system. A separate interface is used for hiding the complexities of the system and delegate the call to the system classes.
    5. Proxy Pattern
      A class that represents the functionality of another class is a proxy pattern. 

  3.  Behavioral design pattern
    Behavioral patterns are concerned with interaction between different objects. Behavioral pattern not only describes the pattern of objects or classes but also the pattern of communication between different objects. Behavioral pattern basically describes the flow of the process. It is the step by step flow of objects interaction. It maintains how different objects and classes interact with each other to carry out all process.
    Behavioral pattern uses object compositions rather than inheritance .We use behavioral pattern where a single object could not handle the process but which can be handled by group of objects.
    Creational pattern helps in the instantiation of objects. Structural pattern helps in the creation of structure of the application and the behavior of the application will be controlled by behavioral pattern.
    There is different type of the behavioral design pattern:
    • Chain of Responsibility Pattern
    • Command Pattern
    • Interpreter Pattern
    • Mediator Pattern
    • Memento Pattern
    • Observer Pattern
    • State Pattern
    • Strategy Pattern
    • Template Pattern
    • Visitor Pattern
    • Null Object

Advantages of design pattern in software engineering

  • Design pattern allows users to reuse the Software. 
  • Design pattern helps in improving developer communication. 
  • Design pattern captures expert knowledge and widely uses it.

Disadvantages of design pattern in software engineering

  • It is impossible to reuse code of design pattern as it will be complex. 
  • They are validated by experience and discussion. 
  • Memory consumption is more because of generalised format or code without design pattern. 

 Read More:
 Overriding vs. Overloading in OOPs
Types of Polymorphism and advantages
What is a Defect Life Cycle or a Bug life cycle in software testing?
What is software unit testing and why is it important?

Copyright © ianswer4u.com

Java Virtual Machine : Its features & internal structure

Java virtual machine is a machine within a machine which enables java byte code to be executed as action or operating system calls any other process regardless of the operating system being used. JVM basically translates the programming code so that two machines that may be on different platforms are able connect.

Other way to define virtual machine is that it is a layer of abstraction that gives a program one simplified interface for interacting with a variety of physical computers and its operating system.
Java virtual machine is software which resides in the computer. JVM has flexibility to execute the program’s byte code into executable code and execute it in any platform. It is not real hardware machine but a software layer which resembles an hardware platform.

JAVA COMPILER converts the source code into byte code .Suppose a program consist of class, function and variable then it will convert the program into byte code and JVM will execute the byte code on any operating system. So the input the JVM will be BYTE code and the output will be executable code.

Some important features of JVM

  • Platform Independence
    Java codes are written once and can be executed and can be run on any platform. Java source codes are converted into byte code and that byte can be executed on any of the system irrespective of the operating system used. JVM converts the source code to byte code and once the program is executed it will get converted into machine code.
  • Security
    Java Virtual machines have high built in security features which allow programmers to write highly secure java programs which will not harm any of the operating system on which the byte code will be executed.
  • Performance
    The performance of the java program is high as the codes are converted into system neutral language which byte code. The executable codes are converted into byte code which can run on any system and the execution of byte code to machine code takes very less time.
  • Correctness
    A program which executed through Java virtual Machines are error free and operate correctly .The java virtual machines are reliable and are not prone to any error. The Java virtual Machine is produced with high standard and therefore the chances to find the error is very few.
  • Java virtual Machine uses Java IN TIME (JIT) to convert Java code into low level machine code that runs quickly.
  • If nobody has installed Java Runtime Environment on your computer then we cannot use the Java program. This is one of the disadvantages of Java Virtual machine.

The structure of JVM

JVM consist of several components. The list of components is as follow:
  1. Local Variable
    They are all the local variables being used by the current method invocation while executing the program. It is pointed to by the vars register in the memory.
  2. Execution environment
    The execution environment is used to maintain the operations of the stack itself. Each of the operation is maintained in the stack and execution environment keep track of it. It is pointed to by the frame register in the memory.
  3. Operand Stack
    The operand stack is used as a work space by byte code instructions. It is used for holding parameters for byte code instructions and results of byte code instructions are also kept in operand stack. The top of the operand stack is pointed to by the optop register in the memory.
  4. Method Area
    This is the area where the byte code actually resides and the program counter points to some byte in the method area. It always keeps track of the current instruction which is being executed. After execution of an instruction, the JVM sets the PC to next instruction. Method area is shared among all the threads of a process.
  5. Garbage collected stack
    The garbage collected stack is where the objects of the java program are saved. Whenever any of the objects are created with the help of new operator then heaps are created and memory is allocated for each of the object being created.

Read More:
Difference between method Overloading and Overriding in OOPs
Advantages and Disadvantages of Inheritance in OOPS
How does inheritance work in Java?
Different features of OOPs

Copyright © ianswer4u.com

Difference between method Overloading and Overriding in OOPs

Earlier we discussed about the basics of OOPs and its features. Also we saw the concepts like Abstraction, Encapsulation, Inheritance and Polymorphism. Today we will discuss about a very common interview question and an often misunderstood concept of difference between method overloading and overriding in Object Oriented Programming and polymorphism which can be achieved by it.

Method Overloading

  • To call an overloaded method in Java, it is must have the same name as that of the function.
  • Overloaded methods may have different return types and same or different the return type which will uniquely identify the function.
  • When Java encounters a call to an overloaded method, it simply executes the version of the method whose parameters match the arguments used in the call. That depends on the type and number of arguments.
  • It allows the user to achieve compile time polymorphism.
  • An overloaded method can throw different exceptions.
  • It can have different access modifiers (It can be public, private or protected).

Rules for Method Overloading

  1. Overloading can be applied in the same class or in the sub-class.
  2. Constructor in Java can also be overloaded.
  3. Overloaded methods must have a different argument list.
  4. The parameters may differ in their type or number, or in both.
  5. They may have the same or different return types.
  6. It is also known as compile-time polymorphism.
Example of Method Overloading
Class Shape
 {
   void area (double radius)
   {
      System.out.println(“Area of circle”);
    }
   void area( double length, double breadth)
   {
       System.out.println(“Area of Rectangle”);
   }
  void area ( double side)
   {
      System.out.println(“Area of Square”);
    }
 }

Method Overriding

Child class and the base class have the same function. In this case the child class overrides the parent class method without changing the functionality of the base class.

Rules for Method Overriding:

  1. Function overloading is applied to inherited methods.
  2. The decisions of which overridden method will take place at the runtime not compile time.
  3. Overriding method can have different return type.
  4. Overriding method must not have more restrictive access modifier(the overridden method should have higher access modifier than overriding method)
  5. Abstract methods must be overridden
  6. Static and final methods cannot be overridden
  7. Constructors cannot be overridden. Because for a particular class its constructors are unique.
  8. It is also known as Runtime polymorphism.
Example of Method Overriding

class House {
    String Street, City, OwnerName;
    long HouseNo;
    House()
     {
      }
    House(String Street, String City, String OwnerName,long HouseNo)
     {
        this.Street = Street;
        this.City = City;
        this.OwnerName = OwnerName;
        this.HouseNo = HouseNo;
      }
    void displayHouseDetails()
      {
          System.out.println("House No :" +HouseNo);
          System.out.println("OwnerName :" +OwnerName);
          System.out.println("Street Name :" +Street);
          System.out.println("City Name :" +City);
       }
 }
 class RentedHouse extends House
  {
     double rent;
      RentedHouse(String Street, String City, String OwnerName,long HouseNo,double rent)
    {
       super(Street, City,OwnerName,HouseNo);
       this.rent = rent;
     }
//method overriding from super class to sub class
 void displayHouseDetails()
      {
         super.displayHouseDetails();
         System.out.println("Rent: " +rent);
     }
 }
In this we have base class as House which hold properties like House detail (Size of the house, location of the house, House No, owner of the house).These features can be used by RentedHouse subclass which will inherit these features and also add some other functionalities which will be specific to rentedHouse.

Copyright © ianswer4u.com

Advantages & Disadvantages of Polymorphism in OOPs

WHAT IS POLYMORPHISM?

Poly means many forms. So it is basically means different types of the object. Polymorphism is a way of defining multiple functionalities under the same name. In other words we can say that we have the same code or operation but it will behave differently in different contexts.

IMPORTANT POINTS ABOUT POLYMORPHISM

  •  A functionality can behave differently for different instances
  • The behavior depends on the type of data used in the operation
  • Polymorphism is used for implementing inheritance.

ADVANTAGES OF POLYMORPHISM

  • It helps programmers reuse the code and classes once written, tested and implemented. They can be reused in many ways.
  • Single variable name can be used to store variables of multiple data types(Float, double, Long, Int etc).
  • Polymorphism helps in reducing the coupling between different functionalities.

DISADVANTAGES OF POLYMORPHISM

  • One of the disadvantages of polymorphism is that developers find it difficult to implement polymorphism in codes.
  • Run time polymorphism can lead to the performance issue as machine needs to decide which method or variable to invoke so it basically degrades the performances as decisions are taken at run time.
  • Polymorphism reduces the readability of the program. One needs to identify the runtime behavior of the program to identify actual execution time.

Read More:
Pros and Cons of Inheritance in OOPS
What Is Inheritance in Java?
Load Testing vs Stress Testing

Copyright © ianswer4u.com

Pros and Cons of Inheritance in OOPS

In the previous post we discussed we discussed How does inheritance work in OOPs and various types of inheritance with an example. Today we will look into various benefits and drawbacks of using inheritance while coding using object oriented programming languages.

Advantages of Inheritance in OOPS

  1. The main advantage of the inheritance is that it helps in reusability of the code. The codes are defined only once and can be used multiple times. In java we define the super class or base class in which we define the functionalities and any number of child classes can use the functionalities at any time.
  2. Through inheritance a lot of time and efforts are being saved.
  3. It improves the program structure which can be readable.
  4. The program structure is short and concise which is more reliable.
  5. The codes are easy to debug. Inheritance allows the program to capture the bugs easily
  6. Inheritance makes the application code more flexible to change.
  7. Inheritance results in better organisation of codes into smaller, simpler and simpler compilation units.

Disadvantages of Inheritance in OOPS

  1. The main disadvantage of the inheritance is that the two classes(base class and super class) are tightly coupled that is the classes are dependent on each other.
  2. If the functionality of the base class is changed then the changes have to be done on the child classes also.
  3. If the methods in the super class are deleted then it is very difficult to maintain the functionality of the child class which has implemented the super class’s method.
  4. It increases the time and efforts take to jump through different levels of the inheritance.

Read More:
Advantages and Disadvantages of Software Testing Outsourcing
EDI - Advantages and Disadvantages
What is system integration testing in software testing?

Copyright © ianswer4u.com

How does inheritance work in Java?

What is inheritance in Java/OOPs

Inheritance is the main feature of object oriented programming language. Inheritance allows the class to use the properties and methods of other classes. In other words we can say that the sub classes derive the properties and functionalities from the base class. Sub classes are also known as derived class and base class is known as super class.
Super class and sub class have a “IS-A” relationship between them.

Types of Inheritance

There are five types of inheritance
  1. Single Inheritance
    In this there is only single level of inheritance in which one child class inherits the property of the base class. It is the simplest form of the inheritance.
  2. Multiple Inheritance
    In this type of inheritance there is two or more super class and the child class inherits the property from it. Multiple inheritance is not possible in java programming language. In order to implement multiple inheritance we have the concept of Interfaces.
  3. Hierarchical Inheritance
    In hierarchical inheritance, multiple derived classes inherits the features from single base class.
  4. Multilevel Inheritance
    In multilevel inheritance the derived class inherits from a class which in turn inherits from some other class. Or we can say that there is a super class for one and subclass for others.
  5. Hybrid Inheritance
    Hybrid inheritance is the combination of hierarchical and multilevel inheritance.
The important points about inheritance
  • Inheritance allows the developers to reuse the codes so that efforts and time can be saved.
  • A subclass can be treated as if it is a super class.
  • Inheritance can be implemented as the objects of both super class and subclass can be created in the applications.
  • A class can be extended in which the additional and exclusive functionality can be placed without altering the super class functionalities and properties.
  • Through inheritance the relationships among objects(of sub class and super class) can easily be established.

An example of Inheritance in Java

class Student
 {
   String name,PRN;
   String specialization;
   Student(String name ,String PRN, String specialization)
    {
      this.name = name;
      this.PRN = PRN;
      this.specialization = specialization;
    }
  void display()
  {
    System.out.println("Name of Student: " +name);
    System.out.println("PRN of Student: " +PRN);
    System.out.println("Specialization of Student: " +specialization);
  }
 }
classPGStudent extends Student
 {
    long numberOfLectures;
    PGStudent(String name ,String PRN, String specialization,long numberOfLectures)
    {
      super(name,PRN,specialization);
      this.numberOfLectures = numberOfLectures;
     }
//overriding table
   void display()
   {
      super.display();
      System.out.println("No of lectures for PG student : "+numberOfLectures);
    }
  }
classUGStudent extends Student
  {
    long numberOfLectures;
    UGStudent(String name ,String PRN, String specialization,long numberOfLectures)
    {
      super(name,PRN,specialization);
      this.numberOfLectures = numberOfLectures;
    }
    void display()
    {
      super.display();
      System.out.println("No of lectures for PG student: "+numberOfLectures);
     }
}

In this example, there is Student base class and two sub classesPGStudent and UGStudent. There some common functionalities which child classes PGStudent and UGStudent can use from base class.

Read More:
Abstraction Vs Encapsulation
What are the advantages of using object oriented programming?
Manual Testing: Advantages and Disadvantages
Pros and Cons of White Box Testing

Copyright © ianswer4u.com

Difference between Abstraction and Encapsulation

Earlier we discussed about basics of Object oriented programming , what abstraction in OOPs is and what encapsulation means . Today let us see what differentiates abstraction from encapsulation.

  1. Abstraction is implemented through Interface and abstract classes in Java. While encapsulation is implemented by using access modifiers like private, public and protected.
  2. Encapsulation is also called data hiding. That is hiding the details from outside the world.
  3. Abstraction is based on design principal of “programming for interface than implementation” and basis of encapsulation is “encapsulate whatever changes”.
  4. Abstraction resolves the problem at the design level but the encapsulation resolves the problem at the implementation level.
  5. Abstraction hides the irrelevant details and gives relevant information. Encapsulation is encapsulating data and functions into single unit so that it can be protected from outside the world.
  6. Abstraction focuses on what the object does rather than how it does. Encapsulation hides the internal features which implement the functionality of the class.
  7. Example of abstraction is “Outer look of the mobile like the display screen on which the numbers are displays and keypads on which the digits and other character are displayed”. Example of encapsulation is inner layout of the mobile phone like how the how the keypad and its different buttons are connected with the screen.
Difference between encapsulation and abstraction wiki java oops
Difference between Abstraction and Encapsulation
Copyright © ianswer4u.com

Abstraction : OOPs concept and its example

What is abstraction in object oriented programming?

Abstraction is the process of implementing the essential features and removing the unnecessary information. Abstraction is an important characteristic of abstraction in which the programmers hide the background details and show important one. This will help in reducing the size of the code and the complexity of the code.

Abstraction is implemented through Interface and abstract classes in Java. You may like to read more Encapsulation in OOPs and benefits of using OOPs.

Real world example of abstraction

1) Mobile phones
We use mobile phone and we are unaware of the internal functionality of the mobile phones. Feature of calling is like we dial a number which will concatenate the sequence of the digits and form ten digit numbers. And finally it gets displayed on the screen. And when we press the green button then call gets connected to the person. We are using mobile phone features but we are not aware of internal functionalities behind it. This is possible only through abstraction.

2) GMAIL 
When we enter our user Id and password on Gmail login page it automatically calls the home page through which we can compose mails, view and send mails etc. Here also users do not know the internal functionality of features of Gmail which are unnecessary for them and are hidden. Users know only about the features which are necessary information for them.

Abstraction example through programming language (JAVA)


Interface MobilePhones
{
Public void calling();
Public void sendSMS();
}
Class MOTOG implements MobilePhones
{
void calling()
{
System.out.println(“MOTOG PHONE HAS BEEN CALLED”);
}
Void sendSMS()
{
System.out.println(“MESSAGE HAS BEEN SEND TO MOTOG”);
}
}
Class NOKIA implements MobilePhones
{
void calling()
{
System.out.println(“NOKIA PHONE HAS BEEN CALLED”);
}
Void sendSMS()
{
System.out.println(“MESSAGE HAS BEEN SEND TO NOKIA”);
}
}
Class MOTOX implements MobilePhones
{
void calling()
{
System.out.println (“MOTOX PHONE HAS BEEN CALLED”);
}
Void sendSMS()
{
System.out.println (“MESSAGE HAS BEEN SEND TO MOTOX”);
}
}

Here we have created mobilePhones interface and other classes call it and implement it according to their own features. Three classes MOTOG, MOTOX and NOKIA implement the interface according their own features.

Advantage of abstraction

  • Abstraction makes code readable and simpler to understand. The codes are simple to understand as the complexity of the code is hidden from the user.
  • The size of the code is reduced as through abstraction we do not show unnecessary codes.
  • If we don’t apply abstraction to codes then it is difficult to maintain the codes.
  • Through abstraction, we simplify the representation of Domain Model.
  • Abstraction grouped the data of same type together and separate different type.

Read More:
Difference between portability and compatibility testing
What is the difference between test cases and test scenarios?

Copyright © ianswer4u.com

Encapsulation in Object Oriented Programming

Encapsulation is a concept in object oriented programming which focuses on protecting the variable and function from outside the world in order to manage the piece of code in better way and produce least impact on other parts of the code. Read More about OOPS concepts, features of object oriented languages and their benefits.

Encapsulation supports the mechanism of binding of parameter and functions together. The binding of parameter and functions can be done in a class.

Important points about encapsulation

  • Through encapsulation it is possible to hide the internal details of how an object does something in a class. Encapsulation helps in resolving the problem at the implementation level.
  • With defining a class or structure it is possible to define the accessibility of the members (methods, properties, variables) to the code outside it. Encapsulation can thus help us control the interaction between objects
  • The data of an object can be used by another object without knowing the entire data. For example, an Employee object may have name, address, company, and department as its properties. If a third party object wants to use the Employee object, it can request the name and address for the employee without needing to know the company and department details of the object.

Thus a great benefit of encapsulation is that it can change the internal implementation of a class without altering the overall system.

Let us understand encapsulation with the help of example

Class College
{
//creation of private members
private String collegeId;
private String collegeName;
private String collegeLocation;
private Long collegeContact;

//creation of private constructor
private college( String collegeid, String collegeName, String collegeLocation,collegeContact)
this.collegeid=collegeid;
this.collegeName=collegeName;
this.collegeLocation=collegeLocation;
this.collegeContact =collegeContact;

//create college can encapsulate inside loan creation module
Public College createCollege()
{
return College;
}
}

In the above code, we have made all the member type as private so that they are encapsulated and we can update and access these variables only inside the class and nowhere else.

Design pattern used based on encapsulation

1) Singleton design pattern
Singleton design pattern is used to create an object with help of method get instance (). Since the object is created inside one class and not from any other place in code you can easily change how you create object without affecting the other part of code.

2) Factory design pattern
Factory design pattern is used for creation of the design pattern which is used to create objects other than creating object through new operator.

Benefits of Encapsulation

  1. Encapsulated codes in object oriented programming are better and more flexible to use.
  2. Encapsulated codes in object oriented programming can be easily adaptable to new changes.
  3. Encapsulated codes can restrict the user access.
  4. Encapsulated code in object oriented programming reduces coupling of the modules and increases cohesion because all the codes are encapsulated together.
  5. If we change anything in the encapsulated code then rest part of code remains unaffected.
  6. Through encapsulation, we can change the implementation code without breaking the code of others
  7. In encapsulation we hide the implementation details behind a public programming interface.
  8. Encapsulation makes unit testing easy.

Read More :
Advantages And Disadvantages Of Peer To Peer Network
What are Proxy Servers and their uses ?
Benefits of Beta Testing


Copyright © ianswer4u.com

OOPS : Advantages and Features Of Object Oriented Programming

What is object oriented programming?

Object oriented programming language (OOPL) is a high level programming language based on objected oriented programming model (OOPM). Object oriented programming comprises of logical classes, objects, methods and relationships.
Object oriented programming is a programming language that focuses on objects (i.e. data) rather than logic (i.e. procedures). If we talk about structured programming language then it focuses on procedures and not on the data. So in object oriented programming we focus on how we can manipulate the object rather than logic which are used to manipulate data of the object. Each object is independent of each other and executed independently. It can execute by itself and can be interchanged with other objects. Object interacts by interchanging information with each other.

Advantages of Object Oriented Programming

  1. Objects are created on real world entities. 
  2. Through object oriented programming language, complex systems of real world can be converted into software solutions. 
  3. Large programs are difficult to develop. Objected oriented programs focuses the developer to do extensive planning which will reduces programming flaws and better design. 
  4. Software maintenance of the object oriented programming is easier than as compared with structured oriented programming as much time has been invested while doing the planning of the code so minimum flaws are found. 
  5. Object oriented programming can be easily reused in other programs due to its re-usability feature. 
  6. Objected oriented programming is easy to implement. 
  7. Object oriented programming can easily extensible. New features or changes in operating environment can be easily done.
 Let us discuss some of the basic characteristics of OOPS in brief, subsequently I will discuss them in detail.

Basic features of object oriented programming language:

 Encapsulation
Encapsulation is a concept in object oriented programming which focuses on protecting the variable and function from outside the world in order to manage the piece of code in better way and produce least impact on other part of the code.

Important points about encapsulation
  • The internal details about what the object does can be hidden by using encapsulation. The problem can be solved at the implementation level itself.
  • With defining a class or structure it is possible to define the accessibility of the members (methods, properties, variables) to the code outside it. Encapsulation can thus help us control the interaction between objects.
  • The data of an object can be used by another object without knowing the entire data. For example, an Employee object may have name, address, company, and department as its properties. If a third party object wants to use the Employee object, it can request the name and address for the employee without needing to know the company and department details of the object.
Thus a great benefit of encapsulation is that it can change the internal implementation of a class without altering the overall system.

 Abstraction
Abstraction is the process of implementing the essential features and removing unnecessary information. Abstraction is an important characteristic in which the programmer hides the irrelevant details which will in turn reduces the size of the code and the complexity of the code. Abstraction makes things more general, simpler and abstract.

Important points about Abstraction
  • Abstraction makes code readable and simpler to understand. The codes are simple to understand as the complexity of the code is hidden from the user.
  • The size of the code is reduced as through abstraction we do not show unnecessary codes.
  • If we don’t apply abstraction to codes then it is difficult to maintain the codes.
  • Through abstraction, we simplify the representation of Domain Model.
  • Abstraction grouped the data of same type together and separate different type. 

 Inheritance
Inheritance is another main feature of object oriented programming language. Inheritance allows the class to use the property and method of other class. In other words, we can say that the sub classes derive the property and functionality from the base class. Subclass is also known as derived class and base class is known as super class.

The important points about inheritance
  • Inheritance allows the developers to reuse the codes so that time and effort can be saved.
  • A subclass can be treated as if it is a super class.
  • It is possible to create a class of extended and exclusive functionality without having to change the functionalities and properties of the super class.
  • Through inheritance the relationships among objects(of sub class and super class) can easily be established 

 Polymorphism
Polymorphism is way by which we are defining multiple functionalities under the same names. In other words we can say that we have the same code or operation but it will behave differently in different contexts.

Some points to remember about polymorphism
  • A functionality can behave differently for different instances
  • The behaviour depends on the type of data used in the operation
  • Polymorphism is used for implementing inheritance. 

Read  More
Difference between Automated Testing and Manual Testing
Drivers and Stubs in Software testing
Benefits and drawbacks of whitebox testing

  Copyright © ianswer4u.com

What is the difference between interoperability and compatibility testing?

Interoperability Testing

Interoperability testing is used to check the functionality of the system when it interacts with other systems. Interoperability testing is concerned with whether the application can successfully interact with the other systems or not. It has nothing to do with whether the communication between the two systems is logical or not.

For example:
Let us understand this with the help of an example, suppose we have an internet banking system and internet banking system interacts with different host like CORE BANKING SYSTEM (CBS), CIS(Customer information system), Mortgage System , Loan System , FDI (Credit card system).Now their interaction is governed through XML .Through interoperability testing will check whether the application(internet banking) can successfully interact with the other host like CBS, OCIS, Mortgage, Loan system etc.

Compatibility Testing

Compatibility testing is basically concerned with how two or more systems or components perform the functions while sharing the same environment. The interaction could occur between two programs which are on the same computers or between two programs which are on different computers connected through internet.
Compatibility testing is nonfunctional testing in which environment application on which the application can be run successfully is tested.It is also checks whether your application can run successfully on different platforms or environments.
Tester should have enough knowledge of the platform, hardware and software to understand the expected behavior of the application

Type of compatibility testing
  1. Hardware
    It checks the software compatible with hardware configuration.
  2. Operating System
    It checks your software compatibility with different operating like Windows, UNIX,MAC.
  3. Software
    It checks whether the software developed is compatible with other software or not.
  4. Browser
    It checks the compatibility of the website with different browsers.
  5. Device
    It checks the compatibility of the software with the devices like USB, port devices, printer, scanner etc.
  6. Mobile
    It checks the compatibility of the software with mobile platform like Android, IOS.
Type of compatibility checking
  1. Forward checking
    It is done by checking the behavior of hardware/software with the newer version of the hardware/software.
  2. Backward checking
    It is done by checking the behavior of hardware/software with the older version of the hardware/software
Tools used for compatibility testing
  1. Adobe Browser Lab
  2. Secure Platform
  3. Virtual Desktop.

Difference between Interoperability Testing & Compatibility Testing

Interoperability Testing helps in verifying whether the application under test interacts and functions as expected with other software and hardware components. Therefore, this test plays an important role in case any application/web site is required to run on different platforms with different software and hardware components. Basically we check the compatibility of the software or hardware component with other software or hardware component.

Compatibility testing verifies that the product functions are as expected on a wide variety of hardware, software, and network configurations which are planned on an identified set of compatibility combinations. Compatibility testing is conducted on the application to evaluate its compatibility with the environment on which it is working.

Suppose in case of interoperability testing, if version A writes data into a database that version B can operate on the data correctly is INTEROPERABILITY or INTEGRATION testing. Because they operate on shared data the different versions of the components are in reality different components of the system. They have an interaction through shared data.

While in case of compatibility testing, if version A is introduced then version B can still access the database across the network is a COMPATIBILITY issue. The two could be working on totally separate data, possibly even totally separate database instance. There is no intentional interaction between them in this mode.

Hence we can say that Interoperability testing checks that interactions that it is intended to support work correctly while compatibility testing checks for un-intended interactions that changes normal operation.

Read More
Benefits and drawbacks of Manual Testing
Pros and Cons of Whitebox Testing
Software Bug and Defect Life Cycle
Pros and Cons of EDI

Copyright © ianswer4u.com

Load Testing vs Stress Testing

Load Testing

Load testing is basically evaluates the performance of the AUT(application under testing with predefined loads.We need to check the performance of the application by constantly increasing the load on the application. With the help of this, we will examine how the system will perform under different loads. It is interesting to see the behavior of the application under zero load. It is basically used to check the response time of the application.

For example:
Suppose if we are testing the email functionality of an application, we will check how many users can use the application at once. We will vary the number of users and allow them use the different functionalities of the email at once. We will examine the behavior of application under such conditions.

Why load testing is done:

  1. The goal of the load testing is to check the upper limit of the database used, hardware and network.
  2. Load testing can check memory leak and management of the memory.
  3. Load testing will check the load balancing problem, bandwidth issue and capacity of the application.

Stress Testing

The purpose of the stress testing is to check the performance of AUT (application under testing) when excess load of the resource has been given on the application. It is basically used to check the performance of the application under adverse conditions. It shows how the system recovers from the adverse conditions and how gracefully it will come to its normal state.

For example:
Suppose an application has been built which takes only 40 user attempts. So stress testing is done by giving load of the users to the application by allowing 43 users to use the application. The main objective of the testing is to see how gracefully the system will recover back from the adverse condition to normal condition.

Why is stress testing done:

  1. Examine the behavior of the application after crash.
  2. Examine whether the application accept the adverse condition gracefully or not.
  3. Examine whether the application comes back to its normal condition and the sensitive data is still preserved or not.

Difference between load and stress testing

Load Testing
  1. Load testing helps in determining the reliability of the application.
  2. It helps in examining the behavior of the application under different loads.
  3. The main focus of load testing is to check the response time of the application.
  4. Load testing is a subset of stress testing.
Stress Testing
  1. The main focus of stress testing is to check the reliability of the application.
  2. Stress testing is used to check the behavior of the application under extreme load.
  3. The main focus is to check the throughput.
  4. Stress Testing is the superset of the load testing.
Read More
The Advantages and Disadvantages of Black Box Insurance
Automated Testing vs Manual Testing

Copyright © ianswer4u.com

Performance Testing In Software Testing

Performance Testing

Performance testing is form of testing nonfunctional elements of the application.Performance Testing is crucial to check how the application performs under different conditions.

Performance testing covers the following points
  1. Verifying the behaviour of the application under different adverse conditions.
  2. Several users are involved in performing different operations
  3. Performance testing can be executed very well if it is automated.
  4. Performance testing involves different members like Developers, Testers, Customers, DBA (database administrator) and network managers.
  5. It can be implemented in the production environment.Hardware is required to populate the load requirement.

Different parameters are checked are as follows:

  1.  System response time
    System response time is the time taken by the application to respond to particular query or request by the user. Through performance testing we check the response time of the application for any request. Then we increase the load on the application and determine the application performance.
  2. External interface response time
    We identify how the application responds to the external interface request. We check the efficiency of the application while interacting with the external interface.
  3. Central processor unit utilisation
    We identify the CPU utilisation by the usage of the application. We increase the load and identify the CPU usage and check whether the application will work properly in adverse conditions or not.
  4. Memory utilisation
    Memory utilisation by the application is checked in the performance testing by increasing the load on the application.
Read More
Manual Testing and its Advantages, Disadvantages
What is White Box Software Testing: Advantages and Disadvantages


Copyright © ianswer4u.com

Difference between Test Case vs Test Scenario in Software Testing

Testing terminologies can sometimes confuse even the most experienced of IT professionals. Today we will discuss about test cases, test scripts and test scenarios which may seem similar to any layman but there is a subtle difference between these terms which make a world of difference for a software tester.
You may also read about Test Plan and Test Strategy | What are they and difference between them.

Test Case

Test cases are a set of valid and invalid procedures for testing of a particular module in an application.
Test cases with a valid procedure are called valid test case and the test case with an invalid procedure is called as invalid test case. In order to do complete testing, both valid and invalid procedures have to be kept so that testing can be done in different conditions.
While designing test cases below terms have to be defined:
  • Test Id: Test Id is unique Id for defining test case
  • Test Case name: Test case name is given to a particular test case.
  • Test case description: It is detailed description of what the test case is going to test.
  • Precondition: These are the steps that have to be implemented before executing the test case.
  • Expected result: Expected result is the outcome which is expected after running the test case.
  • Actual result: Here we record the actual outcome or result obtained after execution of test case.
  • Status: Fail or pass status is decided after the execution of the test case, to identify whether or not actual result matched with the expected outcome.

Test Script

Test Script is the term used in the case of automation testing which is the same as test cases in manual testing.
It is a set of instructions that will be performed on the system under test to test the functionalities of the application. These instructions are in the form of code or a script which can be executed automatically using any automation testing tools.

Test Scenario

Test Scenarios means we are talking about the requirements in detail. Here unlike test cases we are not talking about a particular condition while testing a module. Test scenarios are detailed test procedures which can be consist of multiple test cases associated with it.
In scenario testing, the preparation of scenarios is the most important part, to prepare test scenarios testers need to take help from the developer, business analyst and project manager. A scenario consists of series of activities, each compromising of different inter-related test cases, which a user of the system may execute when system goes live. Here we recreate the user activities to understand how a particular functionality will “play out”.

For example:
  • Validate whether student can add his course or not after logging in.
  • Validate whether the student can edit his course or not.
  • Validate whether the student can delete his course or not.

Read More :
Automated vs. Manual Testing: The Pros and Cons of Each
White-Box Testing: Pros and Cons

Copyright © ianswer4u.com

Test Plan and Test Strategy | Difference and What are they

Software testing is the most important activity which determines the success of software project and the success of testing activity is determined by robustness of software test strategy.

What is Software Test Strategy?

Testing Strategies are the high level activities which define the approach for testing phase in the software testing life cycle. This approach is usually planned by project manager based on Business Requirements Specifications, design document and architectural design document which are prepared during requirement analysis phase. Test Strategy Documents states the objectives of the testing process, what all standards will be followed along with the timelines. Resource requirements, estimated costs and list of deliverables are also stated in this document.

This document is not changed often during the course of project and is used for guidelines by project members while creating test plans and cases. Big expensive projects should have a comprehensively defined software test strategy document.
Let us look at the various activities which are involved in the test strategy formation:
  • Preparation of test strategies document for various type of testing. The testing can be unit level, integration, system or user acceptance testing.
  • Testing tools are selected. Testing techniques are decided depending upon the functionality being tested. If repetitive testing is required in the module then automation testing is preferred while if usability of the software is being tested then manual testing is preferred.
  • Total test efforts are being estimated
  • Allocation of resources is done and their roles and respective responsibilities are decided.
  • If any training is required then training is imparted to the testers.
  • Environment requirements are being discussed in this phase which can be hardware, software, OS or network.
  • Capturing of all the approvers of the document, their titles and sign-off date.

What is Test Plan?

Unlike Test Strategy document, test plan is a low level document which is derived from SRS, UC documents and strategy document itself. Some small projects may not require project manager to prepare strategy documents but a test plan should be developed no matter what the scale of project be. It is prepared by test manager or lead.
Test Plan document is more granular and changes as the project moves forward depending on changes in approach or suggestions by team members. While test strategy document is client focused, test plan is project focused.

Read More:
Pros and Cons of Manual Testing
Benefits of Unit Testing
Difference in Test drivers and Test Stubs


Copyright © ianswer4u.com