Pages

Showing posts with label java training in chennai. Show all posts
Showing posts with label java training in chennai. Show all posts

Saturday, 7 March 2015

JAVA QUESTIONS

What is use of This keyword and Super Keyword?
THIS:
Here is given the 6 usage of java this keyword.
·        this keyword can be used to refer current class instance variable.
·        this() can be used to invoke current class constructor.
·        this keyword can be used to invoke current class method (implicitly)
·        this can be passed as an argument in the method call.
·        this can be passed as argument in the constructor call.
·        this keyword can also be used to return the current class instance.
SUPER
·        super is used to refer immediate parent class instance variable.
·        super() is used to invoke immediate parent class constructor.
·        super is used to invoke immediate parent class method.


What is Annotation in Servlet?
Annotation represents the metadata. If you use annotation, deployment descriptor (web.xml file) is not required. But you should have tomcat7 as it will not run in the previous versions of tomcat. @WebServlet annotation is used to map the servlet with the specified name.

Friday, 6 March 2015

JAVA QUESTIONS

Differencre between ArrayList and Vector List?
·         ArrayList and Vector both having same data structure internally, which is Array
·         Vector is by default synchronized, means at a time only one thread can access its methods from out side, where as ArrayList is non-synchronized means N number of threads can access at a time
·         But we can make ArrayList as synchronized by using Collections class, see it bellow
·         Both Vector and ArrayList  have capability to re-size dynamically, means Vector will Doubles the size of its array when its size increased, but ArrayList increased by Half only
How to Sort a Array List in Java?
import java.util.ArrayList;
import java.util.Collections;

public class SortingArrayList {
     public static void main(String args[]){
        ArrayList<String> al = new ArrayList<String> ();
             al.add("sai");
            al.add("sri");
            al.add("arun");
            al.add("john");
            al.add("babu");
            al.add("athish");
             System.out.println("Printing List before sorting......");
             for(String value: al){
                 System.out.println(value);
             }   Collections.sort(al);
              System.out.println("Printing List after sorting......");
             for(String value: al){
                System.out.println(value);
             }
}

}

Thursday, 5 March 2015

JAVA QUESTIONS

Difference between Extends and Implements?
·         When a subclass extends a class, it allows the subclass to inherit (reuse) and override code defined in the supertype.
  • When a class implements an interface, it allows an object created from the class to be used in any context that expects a value of the interface.
Aggregation in Java?
If a class have an entity reference, it is known as Aggregation. Aggregation represents HAS-A relationship.
Consider a situation, Employee object contains many informations such as id, name, emailId etc. It contains one more object named address, which contains its own informations such as city, state, country, zipcode etc.
What is singleton design pattern?
A singleton is a class that is instantiated only once. This is typically accomplished by creating a static field in the class representing the class. A static method exists on the class to obtain the instance of the class and is typically named something such as getInstance(). The creation of the object referenced by the static field can be done either when the class is initialized or the first time that getInstance() is called. The singleton class typically has a private constructor to prevent the singleton class from being instantiated via a constructor. Rather, the instance of the singleton is obtained via the static getInstance() method
Visit:www.sssedu.inhttp://sssedu.in/java-training-in-chennai.html

Wednesday, 4 March 2015

JAVA QUESTIONS

DAY:12
What is ServletConfig?
·         ServletConfig available in javax.servlet.*; package
·         ServletConfig object is one per servlet class
·         Object of ServletConfig will be created during initialization process of the servlet
·         This Config object is public to a particular servlet only
·         Scope: As long as a servlet is executing, ServletConfig object will be available, it will be destroyed once the servlet execution is completed.
·         We should give request explicitly, in order to create ServletConfig object for the first time
·         In web.xml – <init-param> tag will be appear under <servlet-class> tag
What is ServletContext?
·         ServletContext available in javax.servlet.*; package
·         ServletContext object is global to entire web application
·         Object of ServletContext will be created at the time of web application deployment
·         Scope: As long as web application is executing, ServletContext object will be available, and it will be destroyed once the application is removed from the server.
·         ServletContext object will be available even before giving the first request
·         In web.xml – <context-param> tag will be appear under <web-app> tag

Tuesday, 3 March 2015

JAVA QUESTIONS

What are available drivers in JDBC?
JDBC technology drivers fit into one of four categories:
1.     A JDBC-ODBC bridge provides JDBC API access via one or more ODBC drivers. Note that some ODBC native code and in many cases native database client code must be loaded on each client machine that uses this type of driver. Hence, this kind of driver is generally most appropriate when automatic installation and downloading of a Java technology application is not important. For information on the JDBC-ODBC bridge driver provided by Sun, see JDBC-ODBC Bridge Driver.

2.     A native-API partly Java technology-enabled driver converts JDBC calls into calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS. Note that, like the bridge driver, this style of driver requires that some binary code be loaded on each client machine.

3.     A net-protocol fully Java technology-enabled driver translates JDBC API calls into a DBMS-independent net protocol which is then translated to a DBMS protocol by a server. This net server middleware is able to connect all of its Java technology-based clients to many different databases. The specific protocol used depends on the vendor. In general, this is the most flexible JDBC API alternative. It is likely that all vendors of this solution will provide products suitable for Intranet use. In order for these products to also support Internet access they must handle the additional requirements for security, access through firewalls, etc., that the Web imposes. Several vendors are adding JDBC technology-based drivers to their existing database middleware products.

4.     A native-protocol fully Java technology-enabled driver converts JDBC technology calls into the network protocol used by DBMSs directly. This allows a direct call from the client machine to the DBMS server and is a practical solution for Intranet access. Since many of these protocols are proprietary the database vendors themselves will be the primary source for this style of driver. Several database vendors have these in progress.

What is the Difference between Externalizable and Serializable Interfaces?

Serializable is a marker interface therefore you are not forced to implement any methods, however Externalizable contains two methods readExternal() and writeExternal() which must be implemented. Serializable interface provides a inbuilt serialization mechanism to you which can be in-efficient at times. However Externilizable interface is designed to give you greater control over the serialization mechanism. The two methods provide you immense opportunity to enhance the performance of specific object serialization based on application needs. Serializable interface provides a default serialization mechanism, on the other hand, Externalizable interface instead of relying on default Java Serialization provides flexibility to control this mechanism. 

Monday, 2 March 2015

JAVA QUESTIONS

What is the difference between sleep(), suspend() and wait() ?
Thread.sleep() takes the current thread to a "Not Runnable" state for specified amount of time. The thread holds the monitors it has acquired. For example, if a thread is running a synchronized block or method and sleep method is called then no other thread will be able to enter this block or method. The sleeping thread can wake up when some other thread calls t.interrupt on it. Note that sleep is a static method, that means it always affects the current thread (the one executing sleep method). A common mistake is trying to call t2.sleep() where t2 is a different thread; even then, it is the current thread that will sleep, not the t2 thread. thread.suspend() is deprecated method. Its possible to send other threads into suspended state by making a suspend method call. In suspended state a thread keeps all its monitors and can not be interrupted. This may cause deadlocks therefore it has been deprecated. object.wait() call also takes the current thread into a "Not Runnable" state, just like sleep(), but with a slight change. Wait method is invoked on a lock object, not thread.

What are the alternatives to Serialization? If Serialization is not used, is it possible to persist or transfer an object using any other approach?
In case, Serialization is not used, Java objects can be serialized by many ways, some of the popular methods are listed below:

·        Saving object state to database, this is most common technique used by most applications. You can use ORM tools (e.g. hibernate) to save the objects in a database and read them from the database.
·        Xml based data transfer is another popular mechanism, and a lot of XML based web services use this mechanism to transfer data over network. Also a lot of tools save XML files to persist data/configurations.
·        JSON Data Transfer - is recently popular data transfer format. A lot of web services are being developed in JSON due to its small footprint and inherent integration with web browser due to JavaScript format.   


Sunday, 1 March 2015

JAVA QUESTIONS

What are the types of statements in JDBC?
The JDBC API has 3 Interfaces,
·        Statement,
·        PreparedStatement,
·        CallableStatement
 The key features of these are as follows:
Statement
This interface is used for executing a static SQL statement and returning the results it produces.
The object of Statement class can be created using Connection.createStatement() method.
PreparedStatement
A SQL statement is pre-compiled and stored in a PreparedStatement object.
This object can then be used to efficiently execute this statement multiple times.
The object of PreparedStatement class can be created using Connection.prepareStatement() method. This extends Statement interface.
CallableStatement
This interface is used to execute SQL stored procedures.
This extends PreparedStatement interface.
The object of CallableStatement class can be created using Connection.prepareCall() method.

What is Connection pooling? What are the advantages of using a connection pool?
Connection Pooling is a technique used for sharing the server resources among requested clients. It was pioneered by database vendors to allow multiple clients to share a cached set of connection objects that provides access to a database.
Getting connection and disconnecting are costly operation, which affects the application performance, so we should avoid creating multiple connection during multiple database interactions. A pool contains set of Database connections which are already connected, and any client who wants to use it can take it from pool and when done with using it can be returned back to the pool.

Apart from performance this also saves you resources as there may be limited database connections available for your application.

Saturday, 28 February 2015

Java Questions

What is the Difference between Enumeration and Iterator interface?
Enumeration and Iterator are the interface available in java.util package. The functionality of Enumeration interface is duplicated by the Iterator interface. New implementations should consider using Iterator in preference to Enumeration.
Iterators differ from enumerations in following ways:
Enumeration contains 2 methods namely
·        hasMoreElements()
·        nextElement()
whereas Iterator contains three methods namely
·        hasNext(),
·        next(),
·        remove().
Iterator adds an optional remove operation, and has shorter method names. Using remove() we can delete the objects but Enumeration interface does not support this feature.
Enumeration interface is used by legacy classes. Vector.elements() & Hashtable.elements() method returns Enumeration. Iterator is returned by all Java Collections Framework classes. java.util.Collection.iterator() method returns an instance of Iterator.

What are transient variables? What role do they play in Serialization process?
The transient keyword in Java is used to indicate that a field should not be serialized. Once the process of de-serialization is carried out, the transient variables do not undergo a change and retain their default value. Marking unwanted fields as transient can help you boost the serialization performance.

Friday, 27 February 2015

JAVA QUESTIONS

What is the difference between java.util.Iterator and java.util.ListIterator?
Iterator : Enables you to traverse through a collection in the forward direction only, for obtaining or removing elements
ListIterator : extends Iterator, and allows bidirectional traversal of list and also allows the modification of elements.
What is Metadata and why should I use it?
JDBC API has 2 Metadata interfaces
·        DatabaseMetaData
·        ResultSetMetaData.
 The DatabaseMetaData provides Comprehensive information about the database as a whole. This interface is implemented by driver vendors to let users know the capabilities of a Database Management System (DBMS) in combination with the driver based on JDBC technology ("JDBC driver") that is used with it. Below is a sample code which demonstrates how we can use the DatabaseMetaData

DatabaseMetaData md = conn.getMetaData();
 System.out.println("Database Name: " + md.getDatabaseProductName());
 System.out.println("Database Version: " + md.getDatabaseProductVersion());
 System.out.println("Driver Name: " + md.getDriverName());
 System.out.println("Driver Version: " + md.getDriverVersion());
The ResultSetMetaData is an object that can be used to get information about the types and properties of the columns in a ResultSet object. Use DatabaseMetaData to find information about your database, such as its capabilities and structure. Use ResultSetMetaData to find information about the results of an SQL query, such as size and types of columns. Below a sample code which demonstrates how we can use the ResultSetMetaData
ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
     ResultSetMetaData rsmd = rs.getMetaData();
     int numberOfColumns = rsmd.getColumnCount();

     boolean b = rsmd.isSearchable(1);

Thursday, 26 February 2015

JAVA QUESTIONS

What is the difference between creating String as new() and literal?
When we create string with new() Operator, it’s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap.
String s = new String("Test");
does not  put the object in String pool , we need to call String.intern() method which is used to put  them into String pool explicitly. its only when you create String object as String literal e.g. String s = "Test" Java automatically put that into String pool.
What does Class.forName() method do?
Method forName() is a static method of java.lang.Class. This can be used to dynamically load a class at run-time. Class.forName() loads the class if its not already loaded. It also executes the static block of loaded class. Then this method returns an instance of the loaded class. So a call to Class.forName('MyClass') is going to do following
·        Load the class MyClass.
·        Execute any static block code of MyClass.
·        Return an instance of MyClass.

JDBC Driver loading using Class.forName is a good example of best use of this method. The driver loading is done like this
Class.forName("org.mysql.Driver");
All JDBC Drivers have a static block that registers itself with DriverManager and DriverManager has static initializer method registerDriver() which can be called in a static blocks of Driver class. A MySQL JDBC Driver has a static initializer which looks like this:
static {
    try {
        java.sql.DriverManager.registerDriver(new Driver());
    } catch (SQLException E) {
        throw new RuntimeException("Can't register driver!");
    }
}
Class.forName() loads driver class and executes the static block and the Driver registers itself with the DriverManager.


Wednesday, 25 February 2015

JAVA QUESTIONS

What is Anonymous Inner Classes?
As the name suggests ,  word anonymous means not identified with name. So, there is no name of the anonymous inner classes , and their type must be either a subclass of the named type or an implementer of the named interface.
Example of Anonymous class below  :
class Apple {
    public void iphone() {
        System.out.println("iphone");
    }
}
class Mobile {
    Apple apple = new Apple() {
        public void iphone() {
            System.out.println("anonymous iphone");
        }
    };
An anonymous inner class is always treated like a statement in the class code , and remember to close the statement after the class definition with a curly brace. It is rare to found the curly braced followed by semi colon in java .
When finally block is NOT called?
Finally is the block of code that executes always. The code in finally block will execute even if an exception is occurred. Finally block is NOT called in following conditions
If the JVM exits while the try or catch code is being executed, then the finally block may not execute. This may happen due to System.exit() call.
if the thread executing the try or catch code is interrupted or killed, the finally block may not execute even though the application as a whole continues.
If a exception is thrown in finally block and not handled then remaining code in finally block may not be executed.

Tuesday, 24 February 2015

What is Marker interface? How is it used in Java?
The marker interface is a design pattern, used with languages that provide run-time type information about objects. It provides a way to associate metadata with a class where the language does not have explicit support for such metadata. To use this pattern, a class implements a marker interface, and code that interact with instances of that class test for the existence of the interface. Whereas a typical interface specifies methods that an implementing class must support, a marker interface does not do so. The mere presence of such an interface indicates specific behavior on the part of the implementing class. There can be some hybrid interfaces, which both act as markers and specify required methods, are possible but may prove confusing if improperly used.
 Java utilizes this pattern very well and the example interfaces are:
·        java.io.Serializable
·        java.rmi.
·        java.lang.
·        javax.servlet.SingleThreadModel
·        java.util.EvenListener
The "instanceof" keyword in java can be used to test if an object is of a specified type. So this keyword in combination with Marker interface can be used to take different actions based on type of interface an object implements.

What is the difference between final, finally and finalize?
 “final” is the keyword to declare a constant AND prevents a class from inherting subclasses. And overriding  super class methods.
“finally” is a block of code that always executes when the try block is finished, unless System.exit() was called.
“finalize()” is an method that is invoked before an object is discarded by the garbage collector.

Monday, 23 February 2015

JAVA QUESTIONS

What is difference between Executor.submit() and Executer.execute() method ?

There is a difference when looking at exception handling. If your tasks throws an exception and if it was submitted with execute this exception will go to the uncaught exception handler (when you don't have provided one explicitly, the default one will just print the stack trace to System.err). If you submitted the task with submit any thrown exception, 
checked exception or not, is then part of the task's return status. For a task that was submitted with submit and that terminates with an exception, the Future.get() will re-throw this exception, wrapped in an ExecutionException.


Define Serialization? What do you mean by Serialization in Java?

Serialization is a mechanism by which you can save or transfer the state of an object by converting it to a byte stream. This can be done in java by implementing Serialiazable interface. Serializable is defined as a marker interface which needs to be implemented for transferring an object over a network or persistence of its state to a file. Since its a marker interface, it does not contain any methods. Implementation of this interface enables the conversion of object into byte stream and thus can be transferred. The object conversion is done by the JVM using its default serialization mechanism.

DAY:4
What is Marker interface? How is it used in Java?
The marker interface is a design pattern, used with languages that provide run-time type information about objects. It provides a way to associate metadata with a class where the language does not have explicit support for such metadata. To use this pattern, a class implements a marker interface, and code that interact with instances of that class test for the existence of the interface. Whereas a typical interface specifies methods that an implementing class must support, a marker interface does not do so. The mere presence of such an interface indicates specific behavior on the part of the implementing class. There can be some hybrid interfaces, which both act as markers and specify required methods, are possible but may prove confusing if improperly used.
 Java utilizes this pattern very well and the example interfaces are:
·        java.io.Serializable
·        java.rmi.
·        java.lang.
·        javax.servlet.SingleThreadModel
·        java.util.EvenListener
The "instanceof" keyword in java can be used to test if an object is of a specified type. So this keyword in combination with Marker interface can be used to take different actions based on type of interface an object implements.

What is the difference between final, finally and finalize?
 “final” is the keyword to declare a constant AND prevents a class from inherting subclasses. And overriding  super class methods.
“finally” is a block of code that always executes when the try block is finished, unless System.exit() was called.
“finalize()” is an method that is invoked before an object is discarded by the garbage collector.


Sunday, 22 February 2015

JAVA QUESTIONS

What is Immutable Object? Can you write Immutable Class?

Immutable classes are Java classes whose objects can not be modified once created. Any modification in Immutable object result in new object. For example String is immutable in Java. Mostly Immutable classes are also final in Java, in order to prevent sub classes from overriding methods, which can compromise Immutability. You can achieve same functionality by making member as non final but private and not modifying them except in constructor. Apart form obvious, you also need to make sure that, you should not expose internals of Immutable object, especially if it contains a mutable member. Similarly, when you accept value for mutable member from client e.g.java.util.Date, use clone() method keep separate copy for yourself, to prevent risk of malicious client modifying mutable reference after setting it. Same precaution needs to be taken while returning value for a mutable member, return another separate copy to client, never return original reference held by Immutable class

What is the difference between creating String as new() and literal?

When we create string with new() Operator, it’s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap. For example, String str = new String("Test")does not put the object str in String pool , we need to call String.intern() method which is used to put them into String pool explicitly. its only when you create String object as String literal e.g. String s = "Test" Java automatically put that into String pool. By the way there is a catch here, Since we are passing arguments as "Test", which is a String literal, it will also create another object as "Test" on string pool.


Saturday, 21 February 2015

JAVA QUESTIONS

What will happen if we put a key object in a HashMap which is already there?

If you put the same key again than it will replace the old mapping because HashMap doesn't allow duplicate keys. Same key will result in same hashcode and will end up at same position in bucket. Each bucket contains a linked list of Map.Entry object, which contains both Key and Value. Now Java will take Key object form each entry and compare with this new key using equals() method, if that return true then value object in that entry will be replaced by new value.


What is difference between StringBuffer and StringBuilder in Java ?

StringBuffer:

StringBuffer is mutable means one can change the value of the object . The object created through StringBuffer is stored in the heap .  StringBuffer  has the same methods as the StringBuilder , but each method in StringBuffer is synchronized that is StringBuffer is thread safe . Due to this it does not allow  two threads to simultaneously access the same method . Each method can be accessed by one thread at a time . But being thread safe has disadvantages too as the performance of the StringBuffer hits due to thread safe property . Thus  StringBuilder is faster than the StringBuffer when calling the same methods of each class.

String Buffer can be converted to the string by using  toString() method.

StringBuffer demo1 = new StringBuffer("Hello") ;

demo1=new StringBuffer("Bye");

StringBuilder:

StringBuilder  is same as the StringBuffer , that is it stores the object in heap and it can also be modified . The main difference between the StringBuffer and StringBuilder is that StringBuilder is also not thread safe.

StringBuilder is fast as it is not thread safe . 

StringBuilder demo2= new StringBuilder("Hello");


demo2=new StringBuilder("Bye"); 

Tuesday, 10 February 2015

Types of Testing in Software Testing

Types of Testing in Software Testing

1.     Describe cyclomatic complexity with example.
Cyclomatic complexity is a software metric that measure the logical strength of the program. It was developed by Thomas J. McCabe. Cyclomatic complexity is calculated by using the control flow graph of the program. In the flow graph, nodes are represented by circle. Areas bounded by edges and nodes are called regions. When counting regions, we also include the area outside the graph as a region.
Complexity is computed in one of three ways:
The total number of regions of the flow graph.
By using the formula defined as:
V(G) = E - N + 2
Cyclomatic complexity, V(G), for a flow graph, G, is also defined as
V(G) = P + 1 ,where P is the number of predicate nodes contained in the flow graph G.
Note: Nodes that contain a condition is called a predicate node and is characterized by two or more edges originating from it.

Find out the Cyclomatic complexity V(G) of the given below flow graph.

Description: http://www.careerride.com/images/testing-interview-1.png
In the above flow graph there are total 9 nodes, 11 edges, and 4 regions.
1. The flow graph has four regions. 
2. V (G) = 11 edges- 9 nodes + 2 = 4.
 
3. V (G) = 3 predicate nodes + 1 = 4.

Control flow graph
Control flow graph enables developers to determine the independent execution paths and design the tests to validate these paths . Using this , the testers can assure that all the paths have been tested at least once in the white box testing .
Example :
 int check_age(int age)
   {
    if (age < 50)
       printf(“you are pretty young \n”);
Else
     {
      if (age <80 )
           printf( “you are old \n”);
      else
          printf(“you are really old \n”);
    }
Return 0;
  }
Here e=7, n=6 hence independent execution paths are 3.


2.     Describe Condition testing in brief.
Condition testing works on logical conditions contained in a program module. A simple condition is a Boolean variable or a relational expression. A relational expression takes the form
E1 <relational-operator>E2
For Example Where E1 and E2 are arithmetic expressions and <relational-operator> is one of the following: <, ≤, =, ≠ (not equal to), >, or ≥. A compound condition is created by using two or more simple conditions, Boolean operators, and parentheses. Conditional error is generated if Boolean variable, relational operator or Boolean operator is incorrectly used.
The purpose of condition testing is to detect errors in the conditions of a program.
3.     What are white-box, black-box and gray-box testing?
Whit-box Testing: It refers to the testing a system with full knowledge and access to all source code and other architecture documents. This testing enables to reveal bugs and vulnerabilities quickly in comparison with trial and error method. More complete testing coverage is ensured by exactly knowing what to test.
Ø  Statement Coverage.
Ø  Try to cover 100% of statement coverage of the code.
Ø  Testing the every possible statement in the code is executed atleast once.
Ø  Cantata++ tool is used to test this coverage.
Ø  Decision Coverage.
Ø  Try to cover 100% of statement coverage of the code.
Ø  Testing the every possible decision conditions like for loop and other conditional loops in the code is executed at least once.       
Ø  TCAT-PATH is used to test this coverage.
Ø  Condition Coverage.
Ø  Try to cover 100% Condition coverage of the code.
Ø  Testing the every possible conditions in the code is executed at least once.
Black-box Testing: It refers to testing a system without knowledge of specification to the internal workings of the system, access to the source code, and knowledge of the architecture. Essentially this approach mimics in a close approach, how an attacker typically follows approach to the application. However, the uncovering of issues or vulnerabilities could be further longer, because of lacking internal application knowledge.
Gray-box Testing: It refers to a testing system by knowing limited information about the internals of the system. The knowledge is always limited for detailed design documents and architecture diagrams. In concise, it is a good blend of black and white box testing, which leverage the strengths of each.
4.     What is Big-bang testing?
Big bang waterfall model delivers the complete solution once and in one go. That’s why it’s termed Big Bang.
Following is the approach:
  • Customer provides complete overall requirements.
  • Design follows
  • The design is built / developed.
  • The development work is tested.
  • The system is implemented.
One should go with Big bang waterfall model if:
  • Contract of work is completely defined and accurate.
  • Requirement and acceptance criteria is completely defined and accurate
  • It is feasible to finish the work within given constraints.
  • No change in requirements is expected.
  • Problem and proposed solution both are clearly understood by all stakeholders.
  • No mistakes can occur in requirements, design phases.
5.     Difference between Verification and Validation?
Verification - is to determine the right thing, which involves the testing the implementation of right process. Ex: Are we building the product right?
Validation - is to perform the things in right direction, like checking the developed software adheres the requirements of the client. Ex: right product was built
6.     Difference between Pilot and Beta Testing.
Pilot testing involves having a group of end users try the system prior to its full deployment in order to give feedback on its performance.
Beta testing is testing of the product in the user environment.
From the definitions, it is evident that beta testing comes at last in development cycle; whereas pilot testing takes place before deployment of the system. Also, beta testing takes place in real time user environment and pilot testing in development environment. A selected group of users do pilot testing whereas beta testing is carried by all users.

 

 

7.     What is Equivalence Partitioning?
Equivalence Partitioning (EP) is the process of methodically reducing the huge set of possible test cases into a much smaller but still equally effective set. The goal of EP is to reduce the set of possible test cases into a smaller, manageable set that still adequately tests the software. Since we are choosing not to test everything, we are taking on risk. So we need to be careful how to choose classes. Also note that EP is a set of test cases that test the same thing or reveal the same bug.
Example: If a student’s Mark Sheet s/w takes numbers only from 0 to 100, we need to check that the system takes all the numbers between 0 and 100 (including both) and it does not take any other number. Now if we have to verify this, ideally we need to make sure system accepts all numbers from 0 to 100 and it does not accept any number <0 and > 100. Testing all these numbers is practically impossible because we can’t test for all number from 0 to -8 and from 101 to +8. So we could partition the i/p data into 2 classes: Valid and Invalid. Where valid class would include all the numbers between 0 to 100 (including both) and invalid class would include numbers <0 and > 100. Thus, we can test for few entries from both the classes and safely say that the s/w works for all the numbers.
8.     Explain Structure-based testing techniques
- Structure-based testing techniques are also termed as white-box testing techniques.
- These are dynamic techniques. 
- They use the internal structure of the software to derive test cases. 
- They are usually termed as 'white-box' or 'glass-box' techniques 
- They need you to have knowledge of how the software is implemented and how it works.
9.     Explain component testing.
- Component testing is also termed as unit, module or program testing. 
- It looks for defects in the software and verifies its functioning. 
- It can be done in isolation from rest of the system depending on the context of the development life cycle and the system. 
- Mostly stubs and drivers are used to replace the missing software and simulate the interface between the software components in a simple manner.
- The stub is called from the software component to be tested while a driver calls a component to be tested.




    10. Explain exploratory testing.

- In exploratory testing approach testers are involved in minimum planning and maximum test execution.
- The planning includes creation of a test charter, a short declaration of the scope of a short time-boxed test effort, the objectives and possible approaches to be used. 
- The test design and test execution are performed parallelly without any formal documentation of test conditions, test cases or test scripts. However, this does not imply that other more formal testing techniques will not be used.

   11. Differentiate between re-testing and regression testing

Regressions testing: 
- It means testing new bug fixes to ensure that they don’t cause problems to occur involving problems fixed earlier. 
- The process here involves running a suite of tests. 
Re-testing: 
- It means testing a single defect that was just fixed. Only one test is performed here. 
- The target is to ensure that the defect that was just fixed was actually fixed properly.