Social Icons

Sunday, March 24, 2013

NET Interview Questions & Answers For Freshers Paper-4



What is the difference between VB and VB.NET?
Now VB.NET is object-oriented language. The following are some of the differences:
Data Type Changes
The .NET platform provides Common Type System to all the supported languages. This means that all the languages must support the same data types as enforced by common language runtime. This eliminates data type incompatibilities between various languages. For example on the 32-bit Windows platform, the integer data type takes 4 bytes in languages like C++ whereas in VB it takes 2 bytes. 

Following are the main changes related to data types in VB.NET:
1. Under .NET the integer data type in VB.NET is also 4 bytes in size.
2 . VB.NET has no currency data type. Instead it provides decimal as a replacement.
3. VB.NET introduces a new data type called Char. The char data type takes 2 bytes and can store Unicode characters.
4. VB.NET do not have Variant data type. To achieve a result similar to variant type you can use Object data type. (Since every thing in .NET including primitive data types is an object, a variable of object type can point to any data type).
5. In VB.NET there is no concept of fixed length strings.
6. In VB6 we used the Type keyword to declare our user-defined structures. VB.NET introduces the structure keyword for the same purpose.

Declaring Variables
Consider this simple example in VB6:
Dim x,y as integer
In this example VB6 will consider x as variant and y as integer, which is somewhat odd behavior. VB.NET corrects this problem, creating both x and y as integers.
Furthermore, VB.NET allows you to assign initial values to the variables in the declaration statement itself:
br> Dim str1 as string = Hello
VB.NET also introduces Read-Only variables. Unlike constants Read-Only variables can be declared without initialization but once you assign a value to it, it cannot be changes.

Initialization here
Dim readonly x as integer
In later code
X=100
Now x can’t be changed
X=200 *********** Error **********

Property Syntax
In VB.NET, we anymore don't have separate declarations for Get and Set/Let. Now, everything is done in a single property declaration. This can be better explained by the following example.
Public [ReadOnly | WriteOnly] Property PropertyName as Datatype
Get
Return m_var
End Get
Set
M_var = value
End Set
End Property
Example:
Private _message as String
Public Property Message As String
Get
Return _message
End Get
Set
_message = Value
End Set
End Property

ByVal is the default - This is a crucial difference betwen VB 6.0 and VB.NET, where the default in VB 6.0 was by reference. But objects are still passed by reference.

Invoking Subroutines In previous versions of VB, only functions required the use of parentheses around the parameter list. But in VB.NET all function or subroutine calls require parentheses around the parameter list. This also applies, even though the parameter list is empty.

User-Defined Types - VB.NET does away with the keyword Type and replaces it with the keyword Structure
Public Structure Student
Dim strName as String
Dim strAge as Short
End Structure
Procedures and Functions

In VB6 all the procedure parameters are passed by reference (ByRef) by default. In VB.NET they are passed by value (ByVal) by default. Parantheses are required for calling procedures and functions whether they accept any parameters or not. In VB6 functions returned values using syntax like: FuntionName = return_value. In VB.NET you can use the Return keyword (Return return_value) to return values or you can continue to use the older syntax, which is still valid.

Scoping VB.NET now supports block-level scoping of variables. If your programs declare all of the variables at the beginning of the function or subroutine, this will not be a problem. However, the following VB 6.0 will cause an issue while upgrading to VB .NET

Do While objRs.Eof
Dim J as Integer
J=0
If objRs("flag")="Y" then
J=1
End If
objRs.MoveNext
Wend
If J Then
Msgbox "Flag is Y"
End If

In the above example the variable J will become out of scope just after the loop, since J was declared inside the While loop.

Exception Handling
The most wanted feature in earlier versions of VB was its error handling mechanism. The older versions relied on error handlers such as "On Error GoTo and On Error Resume Next. VB.NET provides us with a more stuructured approach. The new block structure allows us to track the exact error at the right time. The new error handling mechanism is refered to as Try...Throw...Catch...Finally. The following example will explain this new feature.

Sub myOpenFile()
Try
Open "myFile" For Output As #1
Write #1, myOutput
Catch
Kill "myFile"
Finally
Close #1
End try
End Sub

The keyword SET is gone - Since everything in VB.NET is an object. So the keyword SET is not at all used to differentiate between a simple variable assignment and an object assignment. So, if you have the following statement in VB 6.0

Set ObjConn = Nothing
Should be replaced as
ObjConn = Nothing.
Constructor and Destructor

The constructor procedure is one of the many new object-oriented features of VB.NET. The constructor in VB.NET replaces the Class_Initialize in VB 6.0. All occurance of Class_Initialize in previous versions of VB should now be placed in a class constructor. In VB.NET, a constructor is added to a class by adding a procedure called New. We can also create a class destructor, which is equivalent to Class_Terminate event in VB 6.0, by adding a sub-procedure called Finalize to our class. Usage of Return In VB.NET, we can use the keyword return to return a value from any function. In previous versions, we used to assign the value back with the help of the function name itself. The following example explains this:

Public Function Sum (intNum1 as Integer, intNum2 as Integer) as Integer
Dim intSum as Integer
intSum = intNum1 + intNum2
Return intSum
End Function
Static Methods

VB.NET now allows you to create static methods in your classes. Static methods are methods that can be called without requiring the developer to create instance of the class. For example, if you had a class named Foo with the non-static method NonStatic() and the static method Static(), you could call the Static() method like so:
Foo.Static()

However, non-static methods require than an instance of the class be created, like so:
Create an instance of the Foo class
Dim objFoo as New Foo()
Execute the NonStatic() method
ObjFoo.NonStatic()
To create a static method in a VB.NET, simply prefix the method definition with the keyword Shared.


                                PREVIOUS                   NEXT                                                                                                       

NET Interview Questions & Answers For Freshers Paper-3



What is Machine.config?
Ans: Machine configuration file: The machine.config file contains settings that apply to the entire computer. This file is located in the %runtime install path%Config directory. There is only one machine.config file on a computer. The Machine.Config file found in the "CONFIG" subfolder of your .NET Framework install directory (c:WINNTMicrosoft.NETFramework{Version Number} CONFIG on Windows 2000 installations).

The machine.config, which can be found in the directory $WINDIR$Microsoft.NETFrameworkv1.0.3705CONFIG, is an XML-formatted configuration file that specifies configuration options for the machine. This file contains, among many other XML elements, a browser Caps element. Inside this element are a number of other elements that specify parse rules for the various User-Agents, and what properties each of these parsing supports.

For example, to determine what platform is used, a filter element is used that specifies how to set the platform property based on what platform name is found in the User-Agent string. Specifically, the machine.config file contains:
platform=Win95
platform=Win98
platform=WinNT

That is, if in the User-Agent string the string "Windows 95" or "Win95" is found, the platform property is set to Win95. There are a number of filter elements in the browserCaps element in the machine.config file that define the various properties for various User-Agent strings.

Hence, when using the Request.Browser property to determine a user's browser features, the user's agent string is matched up to particular properties in the machine.config file. The ability for being able to detect a user's browser's capabilities, then, is based upon the honesty in the browser's sent User-Agent string. For example, Opera can be easily configured to send a User-Agent string that makes it appear as if it's IE 5.5. In this case from the Web server's perspective (and, hence, from your ASP.NET Web page's perspective), the user is visiting using IE 5.5, even though, in actuality, he is using Opera.

What is Web.config?
Ans: In classic ASP all Web site related information was stored in the metadata of IIS. This had the disadvantage that remote Web developers couldn't easily make Web-site configuration changes. For example, if you want to add a custom 404 error page, a setting needs to be made through the IIS admin tool, and you're Web host will likely charge you a flat fee to do this for you. With ASP.NET, however, these settings are moved into an XML-formatted text file (Web.config) that resides in the Web site's root directory. Through Web.config you can specify settings like custom 404 error pages, authentication and authorization settings for the Web sitempilation options for the ASP.NET Web pages, if tracing should be enabled, etc.

The Web.config file is an XML-formatted file. At the root level is the tag. Inside this tag you can add a number of other tags, the most common and useful one being the system.web tag, where you will specify most of the Web site configuration parameters. However, to specify application-wide settings you use the tag.

For example, if we wanted to add a database connection string parameter we could have a Web.config file like so.

What is the difference between ADO and ADO.NET?
Ans: ADO uses Recordsets and cursors to access and modify data. Because of its inherent design, Recordset can impact performance on the server side by tying up valuable resources. In addition, COM marshalling - an expensive data conversion process - is needed to transmit a Recordset. ADO.NET addresses three important needs that ADO doesn't address:
1. Providing a comprehensive disconnected data-access model, which is crucial to the Web environment
2. Providing tight integration with XML, and
3. Providing seamless integration with the .NET Framework (e.g., compatibility with the base class library's type system). From an ADO.NET implementation perspective, the Recordset object in ADO is eliminated in the .NET architecture. In its place, ADO.NET has several dedicated objects led by the DataSet object and including the DataAdapter, and DataReader objects to perform specific tasks. In addition, ADO.NET DataSets operate in disconnected state whereas the ADO RecordSet objects operated in a fully connected state.

In ADO, the in-memory representation of data is the RecordSet. In ADO.NET, it is the dataset. A RecordSet looks like a single table. If a RecordSet is to contain data from multiple database tables, it must use a JOIN query, which assembles the data from the various database tables into a single result table. In contrast, a dataset is a collection of one or more tables. The tables within a dataset are called data tables; specifically, they are DataTable objects.

 If a dataset contains data from multiple database tables, it will typically contain multiple DataTable objects. That is, each DataTable object typically corresponds to a single database table or view. In this way, a dataset can mimic the structure of the underlying database.
In ADO you scan sequentially through the rows of the RecordSet using the ADO MoveNext method. In ADO.NET, rows are represented as collections, so you can loop through a table as you would through any collection, or access particular rows via ordinal or primary key index. 

A cursor is a database element that controls record navigation, the ability to update data, and the visibility of changes made to the database by other users. ADO.NET does not have an inherent cursor object, but instead includes data classes that provide the functionality of a traditional cursor. For example, the functionality of a forward-only, read-only cursor is available in the ADO.NET DataReader object.
There is one significant difference between disconnected processing in ADO and ADO.NET. In ADO you communicate with the database by making calls to an OLE DB provider. In ADO.NET you communicate with the database through a data adapter (an OleDbDataAdapter, SqlDataAdapter, OdbcDataAdapter, or OracleDataAdapter object), which makes calls to an OLE DB provider or the APIs provided by the underlying data source.

                                  PREVIOUS                           NEXT

.NET Interview Questions & Answers For Freshers Paper-2


Advantages of migrating to VB.NET ?
Ans: Visual Basic .NET has many new and improved language features — such as inheritance, interfaces, and overloading that make it a powerful object-oriented programming language. As a Visual Basic developer, you can now create multithreaded, scalable applications using explicit multithreading. Other new language features in Visual Basic .NET include structured exception handling, custom attributes, and common language specification (CLS) compliance.

The CLS is a set of rules that standardizes such things as data types and how objects are exposed and interoperate. Visual Basic .NET adds several features that take advantage of the CLS. Any CLS-compliant language can use the classes, objects, and components you create in Visual Basic .NET. And you, as a Visual Basic user, can access classes, components, and objects from other CLS-compliant programming languages without worrying about language-specific differences such as data types.

CLS features used by Visual Basic .NET programs include assemblies, namespaces, and attributes.
These are the new features to be stated briefly:

Inheritance:
Visual Basic .NET supports inheritance by allowing you to define classes that serve as the basis for derived classes. Derived classes inherit and can extend the properties and methods of the base class. They can also override inherited methods with new implementations.
 All classes created with Visual Basic .NET are inheritable by default. Because the forms you design are really classes, you can use inheritance to define new forms based on existing ones.

Exception Handling:
Visual Basic .NET supports structured exception handling, using an enhanced version of the Try...Catch...Finally syntax supported by other languages such as C++.
Structured exception handling combines a modern control structure (similar to Select Case or While) with exceptions, protected blocks of code, and filters. Structured exception handling makes it easy to create and maintain programs with robust, comprehensive error handlers.

Overloading:
Overloading is the ability to define properties, methods, or procedures that have the same name but use different data types. Overloaded procedures allow you to provide as many implementations as necessary to handle different kinds of data, while giving the appearance of a single, versatile procedure. 

Overriding Properties and Methods The Overrides keyword allows derived objects to override characteristics inherited from parent objects. Overridden members have the same arguments as the members inherited from the base class, but different implementations. A member's new implementation can call the original implementation in the parent class by preceding the member name with MyBase.

Constructors and Destructors:
Constructors are procedures that control initialization of new instances of a class. Conversely, destructors are methods that free system resources when a class leaves scope or is set to Nothing. Visual Basic .NET supports constructors and destructors using the Sub New and Sub Finalize procedures.

Data Types:
Visual Basic .NET introduces three new data types. The Char data type is an unsigned 16-bit quantity used to store Unicode characters. It is equivalent to the .NET Framework System. Char data type. The Short data type, a signed 16-bit integer, was named Integer in earlier versions of Visual Basic. The Decimal data type is a 96-bit signed integer scaled by a variable power of 10. In earlier versions of Visual Basic, it was available only within a Variant.

Interfaces:
Interfaces describe the properties and methods of classes, but unlike classes, do not provide implementations. The Interface statement allows you to declare interfaces, while the Implements statement lets you write code that puts the items described in the interface into practice.

Delegates:
Delegates objects that can call the methods of objects on your behalf are sometimes described as type-safe, object-oriented function pointers. You can use delegates to let procedures specify an event handler method that runs when an event occurs. You can also use delegates with multithreaded applications. For details, see Delegates and the AddressOf Operator.

Shared Members:
Shared members are properties, procedures, and fields that are shared by all instances of a class. Shared data members are useful when multiple objects need to use information that is common to all. Shared class methods can be used without first creating an object from a class.

References:
References allow you to use objects defined in other assemblies. In Visual Basic .NET, references point to assemblies instead of type libraries. For details, see References and the Imports Statement. Namespaces prevent naming conflicts by organizing classes, interfaces, and methods into hierarchies.

Assemblies:
Assemblies replace and extend the capabilities of type libraries by, describing all the required files for a particular component or application. An assembly can contain one or more namespaces.

Attributes:
Attributes enable you to provide additional information about program elements. For example, you can use an attribute to specify which methods in a class should be exposed when the class is used as a XML Web service.

Multithreading:
Visual Basic .NET allows you to write applications that can perform multiple tasks independently. A task that has the potential of holding up other tasks can execute on a separate thread, a process known as multithreading. By causing complicated tasks to run on threads that are separate from your user interface, multithreading makes your applications more responsive to user input.

Using ActiveX Control in .Net :
ActiveX control is a special type of COM component that supports a User Interface. Using ActiveX Control in your .Net Project is even easier than using COM component. They are bundled usually in .ocx files. Again a proxy assembly is made by .Net utility AxImp.exe (which we will see shortly) which your application (or client) uses as if it is a .Net control or assembly.

Making Proxy Assembly For ActiveX Control: First, a proxy assembly is made using AxImp.exe (acronym for ActiveX Import) by writing following command on Command Prompt:
C:> AxImp C:MyProjectsMyControl.ocx
This command will make two dlls, e.g., in case of above command
MyControl.dll
AxMyControl.dll
The first file MyControl.dll is a .Net assembly proxy, which allows you to reference the ActiveX as if it were non-graphical object.
The second file AxMyControl.dll is the Windows Control, which allows u to use the graphical aspects of activex control and use it in the Windows Form Project.
Adding Reference of ActiveX Proxy Assembly in your Project Settings: To add a reference of ActiveX Proxy Assembly in our Project, do this:

o Select Project A Add Reference (Select Add Reference from Project Menu).
o This will show you a dialog box, select .Net tab from the top of window.
o Click Browse button on the top right of window.
o Select the dll file for your ActiveX Proxy Assembly (which is MyControl.dll) and click OK o Your selected component is now shown in the ‘Selected Component’ List Box. Click OK again Some More On Using COM or ActiveX in .Net

.Net only provides wrapper class or proxy assembly (Runtime Callable Wrapper or RCW) for COM or activeX control. In the background, it is actually delegating the tasks to the original COM, so it does not convert your COM/activeX but just imports them.

A good thing about .Net is that when it imports a component, it also imports the components that are publically referenced by that component. So, if your component, say MyDataAcsess.dll references ADODB.dll then .Net will automatically import that COM component too!

The Visual Studio.NET does surprise you in a great deal when u see that it is applying its intellisense (showing methods, classes, interfaces, properties when placing dot) even on your imported COM components!!!! Isn’t it a magic or what?

When accessing thru RCW, .Net client has no knowledge that it is using COM component, it is presented just as another C# assembly.
U can also import COM component thru command prompt (for reference see Professional C# by Wrox)
U can also use your .Net components in COM, i.e., export your .net components (for reference see Professional C# by Wrox).

                                     PREVIOUS                     NEXT


.NET Interview Questions And Answers for Freshers Paper-1


1. What is .NET?
Ans: .NET is essentially a framework for software development.
It is similar in nature to any other software development framework (like J2EE etc) in that it provides a set of runtime containers/capabilities, and a rich set of pre-built functionality in the form of class libraries and APIs.

The .NET Framework is an environment for building, deploying, and running Web Services and other applications.
It consists of three main parts:
  • Common Language Runtime
  • Framework classes
  • ASP.NET
2. How many languages .NET is supporting now?
Ans: When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. Totally 44 languages are supported.

3. How is .NET able to support multiple languages?
Ans: A language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.

4. How ASP .NET different from ASP?
Ans: Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.

5. What is smart navigation?
Ans: The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

6. What is view state?
Ans: The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control

7. How do you validate the controls in an ASP .NET page?
Ans: Using special validation controls that are meant for this. We have Range Validator, Email Validator.

8. Can the validation be done in the server side? Or this can be done only in the Client side?
Ans: Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.

9. How to manage pagination in a page?
Ans: Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.

10. What is ADO .NET and what is difference between ADO and ADO.NET?
Ans: ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.

11. Observations between VB.NET and VC#.NET?
Ans: Choosing a programming language depends on your language experience and the scope of the application you are building. While small applications are often created using only one language, it is not uncommon to develop large applications using multiple languages.

For example, if you are extending an application with existing XML Web services, you might use a scripting language with little or no programming effort.

For client-server applications, you would probably choose the single language you are most comfortable with for the entire application. For new enterprise applications, where large teams of developers create components and services for deployment across multiple remote sites, the best choice might be to use several languages depending on developer skills and long-term maintenance expectations.

The .NET Platform programming languages - including Visual Basic .NET, Visual C#, and Visual C++ with managed extensions, and many other programming languages from various vendors - use .NET Framework services and features through a common set of unified classes. The .NET unified classes provide a consistent method of accessing the platform's functionality. If you learn to use the class library, you will find that all tasks follow the same uniform architecture. You no longer need to learn and master different API architectures to write your applications.

In most situations, you can effectively use all of the Microsoft programming languages. Nevertheless, each programming language has its relative strengths and you will want to understand the features unique to each language. The following sections will help you choose the right programming language for your application.

Visual Basic .NET :
Visual Basic .NET is the next generation of the Visual Basic language from Microsoft. With Visual Basic you can build .NET applications, including Web services and ASP.NET Web applications, quickly and easily. Applications made with Visual Basic are built on the services of the common language runtime and take advantage of the .NET Framework.

Visual Basic has many new and improved features such as inheritance, interfaces, and overloading that make it a powerful object-oriented programming language. Other new language features include free threading and structured exception handling. Visual Basic fully integrates the .NET Framework and the common language runtime, which together provide language interoperability, garbage collection, enhanced security, and improved versioning support. A Visual Basic support single inheritance and creates Microsoft intermediate language (MSIL) as input to native code compilers.

Visual Basic is comparatively easy to learn and use, and Visual Basic has become the programming language of choice for hundreds of thousands of developers over the past decade. An understanding of Visual Basic can be leveraged in a variety of ways, such as writing macros in Visual Studio and providing programmability in applications such as Microsoft Excel, Access, and Word.

Visual Basic provides prototypes of some common project types, including:
  • Windows Application.
  • Class Library.
  • Windows Control Library.
  • ASP.NET Web Application.
  • ASP.NET Web Service.
  • Web Control Library.
  • Console Application.
  • Windows Service.
  • Windows Service.

Visual C# .NET:
Visual C# (pronounced C sharp) is designed to be a fast and easy way to create .NET applications, including Web services and ASP.NET Web applications. Applications written in Visual C# are built on the services of the common language runtime and take full advantage of the .NET Framework.

C# is a simple, elegant, type-safe, object-oriented language recently developed by Microsoft for building a wide range of applications. Anyone familiar with C and similar languages will find few problems in adapting to C#. C# is designed to bring rapid development to the C++ programmer without sacrificing the power and control that are a hallmark of C and C++. Because of this heritage, C# has a high degree of fidelity with C and C++, and developers familiar with these languages can quickly become productive in C#.

C# provides intrinsic code trust mechanisms for a high level of security, garbage collection, and type safety. C# supports single inheritance and creates Microsoft intermediate language (MSIL) as input to native code compilers.

C# is fully integrated with the .NET Framework and the common language runtime, which together provide language interoperability, garbage collection, enhanced security, and improved versioning support. C# simplifies and modernizes some of the more complex aspects of C and C++, notably namespaces, classes, enumerations, overloading, and structured exception handling. C# also eliminates C and C++ features such as macros, multiple inheritance, and virtual base classes.

For current C++ developers, C# provides a powerful, high-productivity language alternative.

Visual C# provides prototypes of some common project types, including:
  • Windows Application.
  • Class Library.
  • Windows Control Library.
  • ASP.NET Web Application.
  • ASP.NET Web Service.
  • Web Control Library.
  • Console Application.
  • Windows Service.

Saturday, February 9, 2013

Software Life Cycle Models


Software Life Cycle Models:

Iterative model - This model iterates requirements, design,, build and test phases again and again for each requirement and builds up a system iteratively till the system is completely build.
Incremental model - It is non integrated development model. This model divides work in chunks and one team can work on many chunks. It is more flexible.
Spiral model - This model uses series of prototypes in stages, the development ends when  the prototypes are developed into functional system. It is flexible model and used for large and complicated projects.
Evolutionary model - It is more customer focused model. In this model the software is divided in small units which is delivered earlier to the customers.
V-Model - It is more focused on testing. For every phase some testing activity are done. the following are the list of activity performed side by side.

Iterative model :
In the first step of iterative enhancement model, a simple initial implementation is done for a subset of the overall problem. This subset is the one that contains some of the key aspects of the problem which are easy to understand and implement, and which forms a useful and usable system. 

A project control list is created which contains, in an order, all the tasks that must be performed to obtain the final implementation. This project control list gives an idea of how far the project is at any given step from the final system.

Each step consists of removing the next step from the list. Designing the implementation for the selected task, coding and testing the implementation, and performing an analysis of the partial system obtained after this step and updating the list as a result of the analysis.

These three phases are called the design phase, implementation phase and analysis phase. The process is iterated until the project control list is empty, at the time the final implementation of the system will be available. The process involved in iterative enhancement model is shown in the figure below.



                        

The Iterative Enhancement Model
The project control list guides the iteration steps and keeps track of all tasks that must be done. The tasks in the list can be include redesign of defective components found during analysis. Each entry in that list is a task that should be performed in one step of the iterative enhancement process, and should be simple enough to be completely understood. Selecting tasks in this manner will minimize the chances of errors and reduce the redesign work.
Explain the Iterative Model?
The iterative model approach is to iterate on steps as the project progresses with requirements. Iterative model iterates Requirements, Design, Build and test phases again and again for each requirement and builds up a system iteratively till the complete system is built. The advantage is that iterative model can accommodate changes in requirements which are very common in most of the projects. It also provides an opportunity to identify and build upon any major requirement or design flaws throughout the process because of its iterative nature.

Incremental model:

Incremental model  combines elements of the waterfall model applied in an iterative fashion.
Each linear sequence produces deliverable “increments” of the software.(Ex: a Notepad delivers basic file management, editing, in the first increment More refined editing, format and printing in the second increment Find and Replace in the third increment.)

With an increment model, the first increment is often a core product.  The core product is used by the customer and after the feedback from the customer, a plan is developed for the next increment. The plan deals with the modification of the core product to better meet the needs of the customer and the delivery of additional features and functionality.
The process is repeated until the complete product is produced.

When to use Incremental model?
If it is too risky to develop the whole system at once, then the incremental development should be considered.

Advantages of Incremental model:
As product is to be delivered in parts, total cost of project is distributed.
Limited number of persons can be put on project because work is to be delivered in parts.
As development activities for next release and use of early version of product is done simultaneously, if found errors can be corrected. Customers or end users get the chance to see the useful functionality early in the software development life cycle.

Disadvantages of Incremental model:
As product is delivered in parts, total development cost is higher.
Well defined interfaces are required to connect modules developed with each phase.
The model requires well defined project planning schedule to distribute the work


"V" Model is one of the SDLC Methodologies:

In this methodology Development and Testing takes place at the same time with the same kind of information in their hands.
Typical "V" shows Development Phases on the Left hand side and Testing Phases on the Right hand side.
Development Team follow "Do-Procedure" to achive the goals of the company
and
Testing Team follow "check-Procedure" to verify them.
SRS                                                                            User Acceptance
         Design                                                      System Testing
                     HLD                                       Integration Testing
    SDLC                   LLD                    Unit Testing       STLC
                                         Coding

  • Verification process is called as Do procss and validasation phase is check procedure.
  • Development starts with information gathering. After the requirements gathering  BRS/CRS/URS will be prepared. This is done by the Business Analyst.
  • During the requirements analysis all the requirements are analyzed. at the end of this phase S/wRS is prepared. It consists of the functional (customer requirements) + System Requirements (h/w + S/w) requirements. It is prepared by the system analyst.
  • During the design phase two types of designs are done. HLDD and LLDD. Tech Leads will be involved.
  • During the coding phase programs are developed by programmers.
  • During unit testing, they conduct program level testing with the help of WBT techniques.
  • During the Integration Testing, the testers and programmers or test programmers integrating the modules to test with respect to HLDD.
  • During the system and functional testing the actual testers are involved and conducts tests based on S/wRS.
  • During the UAT customer site people are also involved, and they perform tests based on the BRS.
  • From the above model the small scale and medium scale organizations are also conducts life cycle testing. But they maintain separate team for functional and system testing.


The Spiral Model:
The process begins at the center position. From there it moves clockwise in traversals. Each traversal of the spiral usually results in a deliverable. It is not clearly defined what this deliverable is. This changes from traversal to traversal. For example, the first traversals may result in a requirement specification. The second will result in a prototype, and the next one will result in another prototype or sample of a product, until the last traversal leads to a product which is suitable to be sold. Consequently the related activities and their documentation will also mature towards the outer traversals. E.g. a formal design and testing session would be placed into the last traversal.






There are different instances of this model so far I saw it with 3 to 6 task regions. The above picture shows 4 task regions.
These regions are:
•   The planning task - to define resources, responsibilities, milestones and schedules.
•   The goal determination task - to define the requirements and constraints for the product and define possible alternatives.
•   The risk analysis task - to assess both technical and management risks.
•   The engineering task - to design and implement one or more prototypes or samples of the application.

The most outstanding distinction between the spiral model and other software models is the explicit risk evaluation task. Although risk management is part of the other processes as well, it does not have an own representation in the process model. For other models the risk assessment is a sub-task e.g. of the overall planning and management. Further there are no fixed phases for requirements specification, design or testing in the spiral model. Prototyping may be used to find and define requirements. This may then be followed by "normal" phases as they can be found in other process models to handle design and testing.

The advantages of the spiral model are that it reflects the development approach in many industries much better than the other process models do. It uses a stepwise approach which e.g. goes hand in hand with the habit of maintaining a number of hardware sample phases in cases where the product to be produced is not only software for a given environment, but also contains the development of hardware. This way the developers and the customer can understand and react much better to risks in the evolutionary process. By having an iterative process which reduces formalisms and omittable activities in the earlier phases the use of resources is optimized. Further, any risks should be detected much earlier than in other process models and measures can be taken to handle them.

The disadvantages of the spiral model are that the risk assessment is rigidliy anchored in the process. First of all it demands risk-assessment expertise to perform this task and secondly in some cases the risk assessment may not be necessary in this detail. For completely new products the risk assessment makes sense. But I dare to say that the risks for programming yet another book keeping package are well known and do not need a big assessment phase. Also if you think of the multitude of carry over projects in many industries i.e. applying an already developed product to the needs of a new customer by small changes, the risks are not a subject generating big headaches. Generally speaking the spiral model is not much esteemed and not much used, although it has many advantaged and could have even more if the risk assessment phases would be tailored down to the necessary amount.

Prototype model:

1>Based on the initial requirements a prototype is developed.
2>Prototype is demonstrated to the client and based on the prototype more requirements are gathered from the clients.
3>After getting clear requirements based on those requirements software is developed.

The goal of prototyping based development is to counter the first two limitations of the waterfall model discussed earlier. The basic idea here is that instead of freezing the requirements before a design or coding can proceed, a throwaway prototype is built to understand the requirements. This prototype is developed based on the currently known requirements. Development of the prototype obviously undergoes design, coding and testing. But each of these phases is not done very formally or thoroughly. By using this prototype, the client can get an "actual feel" of the system, since the interactions with prototype can enable the client to better understand the requirements of the desired system.

Prototyping is an attractive idea for complicated and large systems for which there is no manual process or existing system to help determining the requirements. In such situations letting the client "plan" with the prototype provides invaluable and intangible inputs which helps in determining the requirements for the system. It is also an effective method to demonstrate the feasibility of a certain approach. This might be needed for novel systems where it is not clear that constraints can be met or that algorithms can be developed to implement the requirements. The process model of the prototyping approach is shown in the figure below.






Prototyping Model
The basic reason for little common use of prototyping is the cost involved in this built-it-twice approach. However, some argue that prototyping need not be very costly and can actually reduce the overall development cost. The prototype are usually not complete systems and many of the details are not built in the prototype. The goal is to provide a system with overall functionality. In addition, the cost of testing and writing detailed documents are reduced. These factors helps to reduce the cost of developing the prototype. On the other hand, the experience of developing the prototype will very useful for developers when developing the final system. This experience helps to reduce the cost of development of the final system and results in a more reliable and better designed system.

Advantages of Prototyping:

1. Users are actively involved in the development
2. It provides a better system to users, as users have natural tendency to change their mind in specifying requirements and this method of developing systems supports this user tendency.
3. Since in this methodology a working model of the system is provided, the users get a better understanding of the system being developed.
4. Errors can be detected much earlier as the system is mode side by side.
5. Quicker user feedback is available leading to better solutions.

Disadvantages:
1.Leads to implementing and then repairing way of building systems.
2.Practically, this methodology may increase the complexity of the system as scope of the system may expand beyond original plans.


                                          PREVIOUS                       NEXT

Tuesday, January 29, 2013

Manual Testing Introduction and its Overview


What is Manual Testing ?
Testing is process execution of application in controlled manner with the intent of finding the errors. It is nothing but “Detection”.
The Quality Assurance involves through out the software development process to monitor and improve the process, making sure that agreed upon standards and procedures are followed and ensuring that problems are found and dealt with it.

It is oriented for “Prevention”.Solving problems is a high-visibility process; preventing problems is low-visibility.This is illustrated by an old parable.

Software Testing Def:
Testing is a process used to help identify the correctness, completeness and qualityof developed computer software. With that in mind, testing can never completely establish the correctness of computer software.

Software Industry:
In India itself, Software industry growth has been phenomenal.
IT field has enormously grown in the past 50 years.
IT industry in India is expected to touch 10,000 crores of which software share is dramatically increasing.

Software Crisis:
Software cost/schedules are grossly inaccurate.
Cost overruns of several times, schedule slippage’s by months, or even years are common.

Productivity of people has not kept pace with demand
Added to it is the shortage of skilled people.

Quality of software is than desired
Error rates of released software leave customer dissatisfied…Threatening the very business.

Purpose of Testing:
1. The main course of testing is to check for the existence of defects or errors in a program  or project or product, based up on some  predefined instructions or conditions.
2. The Purpose of Testing is to Analyze that the Product is according to Requirements.
3. To improve the quality of the product.
4. To satisfy the customers need.
5. To provide a Bug free software.

What is Software Quality:
Quality software is reasonably bug-free, delivered on time and within budget, meets requirements and/or expectations, and is maintainable.However, quality is a subjective term. It will depend on who the ‘customer’ is and their overall influence in the scheme of things.

A wide-angle view of the ‘customers’ of a software development project might include end-users, customer acceptance testers, customer contract officers, customer management, the development organisation’s management/accountants/testers/salespeople, future software maintenance engineers, stockholders, magazine reviewers, etc. 

Each type of ‘customer’ will have their own view on ‘quality’ - the accounting department might define quality in terms of profits while an end-user might define quality as user-friendly and bug-free. 

Quality Assurance:
“Quality Assurance” measures the quality of processes used to create a quality product.
Software Quality Assurance (‘SQA’ or ‘QA’) is the process of monitoring and improving all activities associated with software development, from requirements gathering, design and reviews to coding, testing and implementation.

It involves the entire software development process - monitoring and improving the process, making sure that any agreed-upon standards and procedures are followed, and ensuring that problems are found and dealt with, at the earliest possible stage. 

Unlike testing, which is mainly a ‘detection’ process, QA is ‘preventative’ in that it aims to ensure quality in the methods & processes – and therefore reduce the prevalence of errors in the software.

What’s the difference between QA and testing?
TESTING means “Quality Control”; and
QUALITY CONTROL measures the quality of a product; while
QUALITY ASSURANCE measures the quality of processes used to create a quality product.

Difference between static and dynamic testing?
  • Static testing is about prevention dynamic testing is about cure.
  • The static tools offer greater marginal benefits.
  • Static testing is many times more cost-effective than dynamic testing.
  • Static testing beats dynamic testing by a wide margin.
  • Static testing is more effective!
  • Static testing gives you comprehensive diagnostics for your code.
  • Static testing achieves 100 statement coverage in a relatively short time while dynamic testing often often achieves less than 50 statement coverage because dynamic testing finds bugs only in parts of the code that are actually executed.
  • Dynamic testing usually takes longer than static testing. Dynamic testing may involve running several test cases each of which may take longer than compilation.
  • Dynamic testing finds fewer bugs than static testing.
  • Static testing can be done before compilation while dynamic testing can take place only after compilation and linking.
  • Static testing can find all of the followings that dynamic testing cannot find: syntax errors code that is hard to maintain code that is hard to test code that does not conform to coding standards and ANSI violations.
  • Ya Dynamic testing invoves functional testing also.

Software Engineering Process
  • Consists of Three generic Phases:

Definition, Development, and Maintenance.
1. Definition (What)
Customer Contact, Planning, Requirement Analysis.
2. Development Phase (How)
Design, Coding, Testing.
3. Maintenance Phase (Change)
Correction, Adaptation, Enhancement, Reengineering.
4. Support Activities
Quality Assurance, Configuration Management.

                                                        NEXT

Monday, January 28, 2013

Types of Testing For an Application


MANUAL TESTING TYPES

Quality:  It is defined as the conformance to the customer specification.

Testing:  A Tester should suppose to identify the defects.

White box testing: Based on knowledge of the internal logic of an application’s code. Tests are based on coverage of code statements, branches, paths, conditions.

Test case:  Test case is a description of what to be tested, what data to be given and what actions to be done to check the actual result against the expected result.

Black box testing:  Not based on any knowledge of internal design or code. Tests are based on requirements and functionality.

Functionality testing:  Testing whether the functionality of the application is working or not and whether all the requirements have covered are not.

System testing:  The entire application tested according to the requirements.

Sanity testing:  Initial testing conducted on the application to check the proper behavior on the application.

Smoke testing:  Initial testing is conducted on over all application to check whether all the functionalities available to conduct detail testing on them.

Regression testing:  Retesting the bug after fixing or any modifications or enhancement done to the application and testing whether the existing functionalities are effecting to the privies functionalities or not.

Integration testing:  All the modules are integrated together and testing how modules are couple together and communication between the modules.
Usability testing: - Checking whether it is user friendliness or not.
i.              To check for the look and feel of application.
ii.             Where the end user can understand and can easily use the application.

User acceptance testing:  After all the bugs are fixed we have to test once again to make shore that the application meets the user requirements.

Severity:  how much the bug is effecting the application.

Priority:  When the bug is to be fixed.

Unit testing:  After completion of their reviews, programmer concentration on coding, to physically construct a soft ware. In this level, their will test every program through white box testing.

Recovery testing:  It is also known as reliability testing during this test, testing engineers validates that whether our application build change from abnormal state to normal state or not.

Compatibility testing:  It is also known as portability testing. During this test, testing engineer validates that whether our application build run on customer expectation platform or not.

Configuration testing: It is also known as hardware compatibility testing. During this test testing engineer validates that whether our application support different technology hardware devises or not.

                                                PREVIOUS                      NEXT

Friday, January 11, 2013

JAVA JDBC Questions with Answers For Freshers Paper -1



1. What is JDBC?
Ans: JDBC technology is an API (included in both J2SE and J2EE releases) that provides cross-DBMS connectivity to a wide range of SQL databases and access to other tabular data sources, such as spreadsheets or flat files. With a JDBC technology-enabled driver, you can connect all corporate data even in a heterogeneous environment

2. What are stored procedures?
Ans: A stored procedure is a set of statements/commands which reside in the database. The stored procedure is precompiled. Each Database has it’s own stored procedure language,

3. What is JDBC Driver ?
Ans: The JDBC Driver provides vendor-specific implementations of the abstract classes provided by the JDBC API. This driver is used to connect to the database.

4. What are the steps required to execute a query in JDBC?
Ans: First we need to create an instance of a JDBC driver or load JDBC drivers, then we need to register this driver with DriverManager class. Then we can open a connection. By using this connection , we can create a statement object and this object will help us to execute the query.

5. What is DriverManager ?
Ans: DriverManager is a class in java.sql package. It is the basic service for managing a set of JDBC drivers.

6. What is a ResultSet ?
Ans: A table of data representing a database result set, which is usually generated by executing a statement that queries the database.
A ResultSet object maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The next method moves the cursor to the next row, and because it returns false when there are no more rows in the ResultSet object, it can be used in a while loop to iterate through the result set.

7. What is Connection?
Ans: Connection class represents a connection (session) with a specific database. SQL statements are executed and results are returned within the context of a connection.
A Connection object’s database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so on. This information is obtained with the getMetaData method.

8. What does Class.forName return?
Ans: A class as loaded by the classloader.

9. What is Connection pooling?
Ans: Connection pooling is a technique used for sharing server resources among requesting clients. Connection pooling increases the performance of Web applications by reusing active database connections instead of creating a new connection with every request. Connection pool manager maintains a pool of open database connections.

10. What are the different JDB drivers available?
Ans: There are mainly four type of JDBC drivers available. They are:
Type 1 :
 JDBC-ODBC Bridge Driver – 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.

Type 2:
 Native API Partly Java Driver- 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.

Type 3:
 Network protocol Driver- 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.

Type 4: 
JDBC Net pure Java Driver – 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.

11. What is the fastest type of JDBC driver?
Ans: Type 4 (JDBC Net pure Java Driver) is the fastest JDBC driver. Type 1 and Type 3 drivers will be slower than Type 2 drivers (the database calls are make at least three translations versus two), and Type 4 drivers are the fastest (only one translation).

12. Is the JDBC-ODBC Bridge multi-threaded?
Ans: No. The JDBC-ODBC Bridge does not support multi threading. The JDBC-ODBC Bridge uses synchronized methods to serialize all of the calls that it makes to ODBC. Multi-threaded Java programs may use the Bridge, but they won’t get the advantages of multi-threading.

13. What is cold backup, hot backup, warm backup recovery?
Ans: Cold backup means all these files must be backed up at the same time, before the database is restarted. Hot backup (official name is ‘online backup’ ) is a backup taken of each tablespace while the database is running and is being accessed by the users

14. What is the advantage of denormalization?
Ans: Data denormalization is reverse procedure, carried out purely for reasons of improving performance. It maybe efficient for a high-throughput system to replicate data for certain data.

15. How do you handle your own transaction ?
Ans: Connection Object has a method called setAutocommit ( boolean flag) . For handling our own transaction we can set the parameter to false and begin your transaction . Finally commit the transaction by calling the commit method.