Black Box Testing part two

Cause and Effect Graphs

Cause-effect graphing attempts to provide a concise representation of logical combinations and corresponding actions. A Cause-and-Effect Diagram is a tool that helps identify, sort, and display possible causes of a specific problem or quality characteristic . It graphically illustrates the relationship between a given outcome and all the factors that influence the outcome.Causes (input conditions) and effects (actions) are listed for a module and an identifier is assigned to each.

A cause-effect graph developed.

Graph converted to a decision table.

Decision table rules are converted to test cases.

The C&E diagram is also known as the Fishbone/Ishikawa diagram because it was drawn to
resemble the skeleton of a fish, with the main causal categories drawn as "bones" attached to the spine of the fish.

Advantages

Helps determine root causes

Encourages group participation

Indicates possible causes of variation

Increases process knowledge

Identifies areas for collecting data

Comparison Testing

In some applications, the reliability is critical.

Redundant hardware and software may be used.

For redundant s/w, use separate teams to develop independent versions of the software.

Test each version with same test data to ensure all provide identical output.

Run all versions in parallel with a real-time comparison of results.

Even if will on run one version in final system, for some critical applications can develop

independent versions and use comparison testing or back-to-back testing.

When outputs of versions differ, each is investigated to determine if there is a defect.

Method does not catch errors in the specification.


TESTING PROCESS PART THREE

WHAT TEST PLAN SHALL HAVE ?

SOFTWARE RELIABILITY

TEST DESIGN

DEFECT CLASSIFICATION

DEFECT TRACKING

TEST METRICS

TEST REPORTS

CHANGE REQUEST MANAGEMENT

UNIT TEST SPECIFICATIONS

UNIT TEST SPECIFICATIONS PART TWO

FUNCTIONAL FLOW MATRIX PART ONE

FUNCTIONAL FLOW MATRIX PART TWO

PROGRAM INSPECTION AND REVIEWS

CODE INSPECTION IN SOFTWARE TESTING

Black Box Testing part one

Testing based on an analysis of the specification of a piece of software without reference to its internal workings. The goal is to test how well the component conforms to the published requirements for the component

It attempts to find:

Incorrect or missing functions
Interface errors
Errors in data structures or external database access
Performance errors
Initialization and termination errors

Black-box test design treats the system as a "black-box", so it does not explicitly use knowledge
of the internal structure. Black box testing is based solely on the knowledge of the system requirements. Black-box test design is usually described as focusing on testing functional requirements.

In comparison, White-box testing allows one to peek inside the "box", and it focuses specifically on using internal knowledge of the software to guide the selection of test data .

Black box testing focuses on testing the function of the program or application against its specifications. Specifically, this technique determines whether combinations of inputs and
operations produce expected results.

Test Case design Techniques under Black Box Testing:

Equivalence class partitioning
Boundary value analysis
Comparison testing
Orthogonal array testing
Decision Table based testing
Cause Effect Graph

Determination of equivalence classes

Examine the input data.
Few general guidelines for determining the equivalence classes can be given
If the input data to the program is specified by a range of values:

e.g. numbers between 1 to 5000.
One valid and two invalid equivalence classes are defined.
If input is an enumerated set of values:

e.g. {a,b,c}

one equivalence class for valid input values
Another equivalence class for invalid input values should be defined.

Example

A program reads an input value in the range of 1 and 5000:

computes the square root of the input number

There are three equivalence classes:

the set of negative integers,

set of integers in the range of 1 and 5000,

Integers larger than 5000.

The test suite must include:

representatives from each of the three equivalence classes:

A possible test suite can be: {-5, 500, 6000}.


ERROR CHECK LIST FOR INSPECTIONS

WALK THROUGHS IN TESTING

TESTING FOR SPECIALIZED ENVIRONMENTS PART ONE

TESTING FOR SPECIALIZED ENVIRONMENTS PART TWO

VALIDATION TESTING

SYSTEM TESTING


DEBUGGING AND TESTING

DEFECT AMPLIFICATION AND REMOVAL

ITERATIVE SPIRAL MODEL

STANDARD WATER MODEL

CONFIGURATION MANAGEMENT


CONTROLLED TESTING ENVIRONMENT

RISK ANALYSIS PART ONE


RISK ANALYSIS PART TWO

BACK GROUND ISSUES

SOFTWARE REVIEWS PART ONE

SOFTWARE REVIEWS PART TWO

SOFTWARE RELIABILITY

SAFETY ASPECTS

MISTAKE PROOFING

SCRIPT ENVIRONMENT

V MODEL IN TESTING

Cross Page Posting in dot net

...............................................................................................
By default, button controls in ASP.NET pages post back to the same page that contains the button, where you can write an event handler for the post. In most cases this is the desired behavior, but occasionaly you will also want to be able to post to another page in your application. The Server.

Transfer method can be used to move between pages, however the URL doesn't change. Instead, the cross page posting feature in ASP.NET 2.0 allows you to fire a normal post back to a different page in the application. In the target page, you can then access the values of server controls in the source page that initiated the post back.

To use cross page posting, you can set the PostBackUrl property of a Button, LinkButton or ImageButton control, which specifies the target page. In the target page, you can then access the PreviousPage property to retrieve values from the source page.

By default, the PreviousPage property is of type Page, so you must access controls using the FindControl method. You can also enable strongly-typed access to the source page by setting the @PreviousPageType directive in the target page to the virtual path or Type name of the source page.

Here is a step-by-step guide for implementing the cross-page post back using controls that implement the IButtonControl interface.

Create a Web Form and insert a Button control on it using the VS .NET designer.

Set the button's PostBackUrl property to the Web Form you want to post back. For instance in this case it is "nextpage.aspx"



When the PostBackUrl property of the IButtonControl is set, the ASP.NET framework binds the corresponding HTML element to new JavaScript function named WebForm_DoPostBackWithOptions.

RELATED POST

VISUAL STUDIO INTRODUCTION

C SHARP INTRODUCTION

C SHARP OUT LOOK

DOT NET AND C SHARP

C SHARP APPLICATION STRICTURE

OOPS INTRODUCTION

OOPS AND C SHARP

IDE AND C SHARP

INSTANTIATING OBJECTS IN C SHARP

CLASSES AND OBJECTS IN C SHARP

OPERATORS IN C SHARP

SWITCH AND ITERATION IN C SHARP

BRANCHING IN C SHARP

CONSTANTS AND STRING

ASP.NET authentication process


ASP.NET does not run by itself, it runs inside the process of IIS. So there are two authentication layers which exist in ASP.NET system. First authentication happens at the IIS level and then at the ASP.NET level depending on the WEB.CONFIG file.

Below is how the whole process works:

IIS first checks to make sure the incoming request comes from an IP address that is allowed access to the domain. If not it denies the request.

Next IIS performs its own user authentication if it is configured to do so. By default IIS allows anonymous access, so requests are automatically authenticated, but you can change this default on a per – application basis with in IIS.

If the request is passed to ASP.net with an authenticated user, ASP.net checks to see whether impersonation is enabled. If impersonation is enabled, ASP.net acts as though it were the authenticated user. If not ASP.net acts with its own configured account.

Finally the identity from step 3 is used to request resources from the operating system. If ASP.net authentication can obtain all the necessary resources it grants the users request otherwise it is denied. Resources can include much more than just the ASP.net page itself you can also use .Net’s code accesssecurity features to extend this authorization step to disk files, Registry keys and other resources.

Authentication and authorization:

This can be a tricky question. These two concepts seem altogether similar but there is wide range of difference. Authentication is verifying the identity of a user and authorization is process where we check does this identity have access rights to the system. In short we can say the following authentication is the process of obtaining some sort of credentialsfrom the users and using those credentials to verify the user’s identity. Authorization is the process of allowing an authenticated user access to resources. Authentication always proceed to Authorization; even if your application lets anonymous users connect and use the application, it still authenticates them as being anonymous.

RELATED POST

VISUAL STUDIO INTRODUCTION

C SHARP INTRODUCTION

C SHARP OUT LOOK

DOT NET AND C SHARP

C SHARP APPLICATION STRICTURE

OOPS INTRODUCTION

OOPS AND C SHARP

IDE AND C SHARP

INSTANTIATING OBJECTS IN C SHARP

CLASSES AND OBJECTS IN C SHARP

OPERATORS IN C SHARP

SWITCH AND ITERATION IN C SHARP

BRANCHING IN C SHARP

CONSTANTS AND STRING

Software-Testing-V-model

V model is model in which testing is done parallel with development. Left side of v model, reflect development input for the corresponding testing activities.

V model is the classic . It encapsulates the steps in Verification and Validation phases for each step in the SDLC. For each phase, the subsequent phase becomes the verification (QA) phase and the corresponding testing phase in the other arm of the V becomes the validating (Testing) phase.


In the Software , both the Development activity and the testing activities start almost at the same time with the same information in their hands. The development team will apply "do-procedures" to achieve the goals and the testing team will apply "Check- Procedures" to verify that. Its a parallel process and finally arrives to the product with almost no bugs or errors .

V-model is one of the SDLC STLC; it includes testing from the unit level to business level.

That is after completing the coding tester starts testing the code by keeping the design phase documents that all the modules had been integrated or not, after that he will verify for system is according to the requirements or not, and at last he will go for business scenarios where he can validate by the customer and he can do the alpha testing and beta testing. And at last he decides to have the complete.
The V model shows the Development Cycle Stages and Maps it to Testing Cycles, but it fails to address how to start for all these test levels in parallel to development. It is a parallel activity which would give the tester the domain knowledge and perform more value added, high quality testing with greater efficiency. Also it reduce time since the test plans, test cases, test strategy are prepared during the development stage itself.

The figure shows the brief description of the V-Model kind of testing. Every phase of the STLC in this model corresponds to some activity in the SDLC. The design has Integration
Testing (IT) and the System Integration Testing (SIT) and so on.

23
RELATED POST


ERROR CHECK LIST FOR INSPECTIONS

WALK THROUGHS IN TESTING

TESTING FOR SPECIALIZED ENVIRONMENTS PART ONE

TESTING FOR SPECIALIZED ENVIRONMENTS PART TWO

VALIDATION TESTING

SYSTEM TESTING


DEBUGGING AND TESTING

DEFECT AMPLIFICATION AND REMOVAL

ITERATIVE SPIRAL MODEL

STANDARD WATER MODEL

CONFIGURATION MANAGEMENT


CONTROLLED TESTING ENVIRONMENT

RISK ANALYSIS PART ONE


RISK ANALYSIS PART TWO

BACK GROUND ISSUES

SOFTWARE REVIEWS PART ONE

SOFTWARE REVIEWS PART TWO

SOFTWARE RELIABILITY

SAFETY ASPECTS

MISTAKE PROOFING

SCRIPT ENVIRONMENT

V MODEL IN TESTING

Interview Questions on dot net cache part two

What is Cache Callback in Cache ?

Cache object is dependent on its dependencies example file based, time based etc...Cache items remove the object when cache dependencies change.ASP.NET provides capability to execute a callback method when that item is removed from cache.

What is scavenging ?

When server running your ASP.NET application runs low on memory resources, items are removed from cache depending on cache item priority. Cache item priority is set when you add item to cache. By setting the cache item priority controls the items scavenging are removed first.

What are different types of caching using cache object of ASP.NET?

You can use two types of output caching to cache information that is to be transmitted to and displayed in a Web browser:

Page Output Caching

Page output caching adds the response of page to cache object. Later when page is requested page is displayed from cache rather than creating the page object and displaying it. Page output caching is good if the site is fairly static.

Page Fragment Caching

If parts of the page are changing, you can wrap the static sections as user controls and cache the user controls using page fragment caching.

How will implement Page Fragment Caching ?

Page fragment caching involves the caching of a fragment of the page, rather than the entire page. When portions of the page are need to be dynamically created for each user request this is best method as compared to page caching. You can wrap Web Forms user control and cache the control so that these portions of the page don’t need to be recreated each time.

Can you compare ASP.NET sessions with classic ASP?

ASP.NET session caches per user session state. It basically uses “HttpSessionState” class.

Following are the limitations in classic ASP sessions :

ASP session state is dependent on IIS process very heavily. So if IIS restarts ASP session variables are also recycled.ASP.NET session can be independent of the hosting environment thus ASP.NET session can maintained even if IIS reboots.

ASP session state has no inherent solution to work with Web Farms.ASP.NET session can be stored in state server and SQL SERVER which can support multiple server.

ASP session only functions when browser supports cookies.ASP.NET session can be used with browser side cookies or independent of it.

152
RELATED POST


ERROR CHECK LIST FOR INSPECTIONS

WALK THROUGHS IN TESTING

TESTING FOR SPECIALIZED ENVIRONMENTS PART ONE

TESTING FOR SPECIALIZED ENVIRONMENTS PART TWO

VALIDATION TESTING

SYSTEM TESTING


DEBUGGING AND TESTING

DEFECT AMPLIFICATION AND REMOVAL

ITERATIVE SPIRAL MODEL

STANDARD WATER MODEL

CONFIGURATION MANAGEMENT


CONTROLLED TESTING ENVIRONMENT

RISK ANALYSIS PART ONE


RISK ANALYSIS PART TWO

BACK GROUND ISSUES

SOFTWARE REVIEWS PART ONE

SOFTWARE REVIEWS PART TWO

SOFTWARE RELIABILITY

SAFETY ASPECTS

MISTAKE PROOFING

SCRIPT ENVIRONMENT

V MODEL IN TESTING

Interview Questions on dot net cache

What is an application object ?

Application object can be used in situation where we want data to be shared across users globally.

What’s the difference between Cache object and application object ?

The main difference between the Cache and Application objects is that the Cache object provides cache-specific features, such as dependencies and expiration policies.

How can get access to cache object ?

The Cache object is defined in the System.Web.Caching namespace. You can get a reference to the Cache object by using the Cache property of the HttpContext class in the System.Web namespace or by using the Cache property of the Page object.

What are dependencies in cache and types of dependencies ?

When you add an item to the cache, you can define dependency relationships that can force that item to be removed from the cache under specific activities of dependencies.Example if the cache object is dependent on file and when the file data changes you want the cache object to be update. Following are the supported dependency :

File dependency : Allows you to invalidate a specific cache item when a disk based file or files change.

Time-based expiration : Allows you to invalidate a specific cache item depending on predefined time.

Key dependency :Allows you to invalidate a specific cache item depending when another cached item changes.


SAMPLE CODE

Public Sub displayAnnouncement()

Dim announcement As String

If Cache(“announcement”) Is Nothing Then

Dim file As New _
System.IO.StreamReader _
(Server.MapPath(“announcement.txt”))
announcement = file.ReadToEnd
file.Close()
Dim depends As New _
System.Web.Caching.CacheDependency _
(Server.MapPath(“announcement.txt”))
Cache.Insert(“announcement”, announcement, depends)

End If
Response.Write(CType(Cache(“announcement”), String))
End Sub

Private Sub Page_Init(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Init
displayAnnouncement()

End Sub
End Class

Above given method displayAnnouncement() displays banner text from Announcement.txt
file which is lying in application path of the web directory. Above method first checks whether the Cache object is nothing, if the cache object is nothing then it moves further to load the cache data from the file. Whenever the file data changes the cache object is removed and set to nothing.
117
RELATED POST


ERROR CHECK LIST FOR INSPECTIONS

WALK THROUGHS IN TESTING

TESTING FOR SPECIALIZED ENVIRONMENTS PART ONE

TESTING FOR SPECIALIZED ENVIRONMENTS PART TWO

VALIDATION TESTING

SYSTEM TESTING


DEBUGGING AND TESTING

DEFECT AMPLIFICATION AND REMOVAL

ITERATIVE SPIRAL MODEL

STANDARD WATER MODEL

CONFIGURATION MANAGEMENT


CONTROLLED TESTING ENVIRONMENT

RISK ANALYSIS PART ONE


RISK ANALYSIS PART TWO

BACK GROUND ISSUES

SOFTWARE REVIEWS PART ONE

SOFTWARE REVIEWS PART TWO

SOFTWARE RELIABILITY

SAFETY ASPECTS

MISTAKE PROOFING

SCRIPT ENVIRONMENT

V MODEL IN TESTING

Threads in Java

Threads and Concurrent Execution:

In which expressions are evaluated and statements are executed one after the other: that is onsidered only a single thread of execution, where a thread is an independent sequential activity. A Java program may execute several threads concurrently, that is, potentially overlapping in time. For instance, one part of a program may continue computing while another part is blocked waiting for input.

Multiple Threads:

The main program creates a new thread, binds it to u, and starts it. Now two threads are executing concurrently: one executes main, and another executes run. While the main method is blocked waiting for keyboard input, the new thread keeps incrementing i. The new thread executes yield() to make sure that the other thread is allowed to run (when not blocked).

class Incrementer extends Thread {
public int i;

public void run() {

for (;;) { // Forever
i++; // increment i
yield();
}
}
}
class ThreadDemo {
public static void main(String[] args) throws IOException {

Incrementer u = new Incrementer();
u.start();
System.out.println("Repeatedly press Enter to get the current value of i:");
for (;;) {
System.in.read(); // Wait for keyboard input
System.out.println(u.i);
}
}
}

A thread is created and controlled using an object of the Thread class found in the package java.lang. A thread executes the method public void run () in an object of a class implementing the Runnable interface, also found in package java.lang. To every thread (independent sequential activity) there is a unique controlling Thread object, so the two are often thought of as being
identical.

One way to create and run a thread is to declare a class U as a subclass of Thread, overwriting its (trivial) run method. Then create an object u of class U and call u.start(). This will enable the thread to execute u.run() concurrently with other threads .

Alternatively, declare a class C that implements Runnable, create an object o of that class, create a thread object u = new Thread(o), and execute u.start (). This will enable the thread to
execute o.run() concurrently with other threads. Threads can communicate with each other via shared state, namely, by using and assigning static fields, non static fields, array elements, and pipes . By the design of Java, threads cannot use local variables and method parameters for communication.

RELATED POST:

EXCEPTIONS IN JAVA

Exceptions in Java

Overview of an Exception:

An exception is an object of an exception type: a subclass of class Throwable. It is used to signal and describe an abnormal situation during program execution. The evaluation of an expression or the execution of a statement may terminate abruptly by throwing an exception, either by executing a throw statement or by executing a primitive operation, such as assignment to an array element, that may throw an exception.

A thrown exception may be caught in a dynamically enclosing try-catch statement.If the exception is not caught, then the entire program execution will be aborted, and information from the exception will be printed on the console. What is printed is determined by the exception's toString method.

There are two kinds of exception types: checked (those that must be declared in the throws-clause of a method or constructor;and unchecked (those that need not be). If the execution of a method or constructor body can throw a checked exception of class E, then class E or a super type of E must be declared in the throws-clause of the method or constructor.

The following table shows part of the exception class hierarchy.

Declaring a Checked Exception Class

This is the class of exceptions thrown by method wdayno4. Passing a string to the constructor of the super class (that is, class Exception) causes method toString to append that string to the name of the exception.

class CheckedExceptionDemo extends Exception {

public CheckedExceptionDemo(String wday) {
super("Illegal weekday: " + wday)
}
}































RELATED POST:

INTERFACES IN JAVA

LEASE AND RENUAL CALL TIME

........................................................................................
In normal .NET environment objects lifetime is managed by garbage collector. But in remoting environment remote clients can access objects which are out of control of garbage collector. Garbage collector boundary is limited to a single PC on which framework is running; any remote client across physical PC is out of control of GC (Garbage Collector).

This constraint of garbage collector leads to a new way of handling lifetime for remoting objects, by using concept called as “LeaseTime”. Every server side object is assigned by default a “LeaseTime” of five minutes. This leasetime is decreased at certain intervals.

Again for every method call a default of two minutes is assigned. When i say method call means every call made from client. This is called as “RenewalOnCallTime”.

Let’s put the whole thing in equation to make the concept more clear.

Total Remoting object life time = LeaseTime + (Number of method calls) X (RenewalTime).

If we take NumberOfMethodCalls as one.

Then default Remote Object Life Time = 5 + (1) X 2 = 10 minutes (Everything is in
minutes)

When total object lifetime is reduced to zero, it queries the sponsor that should the object be destroyed. Sponsor is an object which decides should object Lifetime be renewed. So it queries any registered sponsors with the object, if does not find any then the object is marked for garbage collection. After this garbage collection has whole control on the object lifetime. If we do not foresee how long a object will be needed specify the “SponsorShipTimeOut” value.

SponsorShipTimeOut is time unit a call to a sponsor is timed out.

“LeaseManagerPollTime” defines the time the sponsor has to return a lease time extension.

Marshalling

Marshaling is used when an object is converted so that it can be sent across the network or across application domains. Unmarshaling creates an object from the marshaled data. here are two ways to do marshalling :-

Marshal-by-value (MBV) :- In this the object is serialized into the channel, and a copy of the object is created on the other side of the network. The object to marshal is stored into a stream, and the stream is used to build a copy of the object on the other side with the unmarshalling sequence.

Marshaling-by-reference (MBR):- Here it creates a proxy on the client that is used to communicate with the remote object. The marshaling sequence of a remote object creates an ObjRef instance that itself can be serialized across the network.

Objects that are derived from “MarshalByRefObject” are always marshaled by reference. All our previous samples have classes inherited from “MarshalByRefObject”

To marshal a remote object the static method RemotingServices.Marshal() is sed.RemotingServices.Marshal() has following overloaded versions:-

public static ObjRef Marshal(MarshalByRefObject obj)
public static ObjRef Marshal(MarshalByRefObject obj, string objUri)
public static ObjRef Marshal(MarshalByRefObject obj, string objUri,Type
requestedType)

The first argument obj specifies the object to marshal. The objUri is the path that is stored within the marshaled object reference; it can be used to access the remote object. The requestedType can be used to pass a different type of the object to the object reference.

This is useful if the client using the remote object shouldn't use the object class but an interface that the remote object class implements instead. In this scenario the interface is the requestedType that should be used for marshaling.
102

RELATED POST


ERROR CHECK LIST FOR INSPECTIONS

WALK THROUGHS IN TESTING

TESTING FOR SPECIALIZED ENVIRONMENTS PART ONE

TESTING FOR SPECIALIZED ENVIRONMENTS PART TWO

VALIDATION TESTING

SYSTEM TESTING


DEBUGGING AND TESTING

DEFECT AMPLIFICATION AND REMOVAL

ITERATIVE SPIRAL MODEL

STANDARD WATER MODEL

CONFIGURATION MANAGEMENT


CONTROLLED TESTING ENVIRONMENT

RISK ANALYSIS PART ONE


RISK ANALYSIS PART TWO

BACK GROUND ISSUES

SOFTWARE REVIEWS PART ONE

SOFTWARE REVIEWS PART TWO

SOFTWARE RELIABILITY

SAFETY ASPECTS

MISTAKE PROOFING

SCRIPT ENVIRONMENT

V MODEL IN TESTING

SILK TEST Features

Platform Independent

Silk test doesn’t care about how the application is created, in which software the application is written, what kind of design is used, which browser it is being worked, in which operating system the application is running.


Browser Independent

There are various kinds of browsers used by various people for running their applications. The user may use any browser of his choice to test the standard application. Each and every browser acts differently with different applications. They show the same page differently. The web objects they display can also be aligned or displayed in different manner.

it just looks at these browser contents as objects and hence they cannot avoid any images, texts,… that they are not identifiable. Also we can write a test in one browser and run it in any other browser (to some extend).
With minor modifications, your tests are robust enough to support different browsers and different versions of these browsers.

Technology Independent

it does not care how the application was built. It seamlessly works with the different web technologies commonly used today.
21.2
RELATED POST


ERROR CHECK LIST FOR INSPECTIONS

WALK THROUGHS IN TESTING

TESTING FOR SPECIALIZED ENVIRONMENTS PART ONE

TESTING FOR SPECIALIZED ENVIRONMENTS PART TWO

VALIDATION TESTING

SYSTEM TESTING


DEBUGGING AND TESTING

DEFECT AMPLIFICATION AND REMOVAL

ITERATIVE SPIRAL MODEL

STANDARD WATER MODEL

CONFIGURATION MANAGEMENT


CONTROLLED TESTING ENVIRONMENT

RISK ANALYSIS PART ONE


RISK ANALYSIS PART TWO

BACK GROUND ISSUES

SOFTWARE REVIEWS PART ONE

SOFTWARE REVIEWS PART TWO

SOFTWARE RELIABILITY

SAFETY ASPECTS

MISTAKE PROOFING

SCRIPT ENVIRONMENT

V MODEL IN TESTING

FAQ'S ON WEB SERVICING PART ONE

Application domain

Previously “PROCESS” where used as security boundaries. One process has its own virtual memory and does not over lap the other process virtual memory; due to this one process can not crash the other process. So any problem or error in one process does not affect the other Process. In .NET they went one step ahead introducing application domains.

In application domains multiple applications can run in same process with out Influencing each other. If one of the application domains throws error it does not affect the other application domains. To invoke method in a object running in different application domain .NET remoting is used.


.NET Remoting

.NET remoting is replacement of DCOM. Using .NET remoting you can make remote object calls which lie in different Application Domains. As the remote objects run in different process client calling the remote object can not call it directly. So the client uses a proxy which looks like a real object.

When client wants to make method call on the remote object it uses proxy for it. These method calls are called as “Messages”. Messages are serialized using “formatter” class and sent to client “channel”. Client Channel communicates with Server Channel. Server Channel uses as formatter to deserialize the message and sends to the remote object.



RELATED POST


ERROR CHECK LIST FOR INSPECTIONS

WALK THROUGHS IN TESTING

TESTING FOR SPECIALIZED ENVIRONMENTS PART ONE

TESTING FOR SPECIALIZED ENVIRONMENTS PART TWO

VALIDATION TESTING

SYSTEM TESTING


DEBUGGING AND TESTING

DEFECT AMPLIFICATION AND REMOVAL

ITERATIVE SPIRAL MODEL

STANDARD WATER MODEL

CONFIGURATION MANAGEMENT


CONTROLLED TESTING ENVIRONMENT

RISK ANALYSIS PART ONE


RISK ANALYSIS PART TWO

BACK GROUND ISSUES

SOFTWARE REVIEWS PART ONE

SOFTWARE REVIEWS PART TWO

SOFTWARE RELIABILITY

SAFETY ASPECTS

MISTAKE PROOFING

SCRIPT ENVIRONMENT

V MODEL IN TESTING

Running Test Cases in Silk Test

Procedure To use the wizard :

  1. Involve the wizard by selecting File /New and clicking the Quick Start Wizard icon. Now you will name a new test plan, which will organize and manage your tests.

  2. Click Next.

  3. Name the file edit.pln and Next. The next step is to record the test frame, which defines all the windows, dialogs, menus, and so on that you want to test.

  4. To create a new test frame, leave New Test Frame selected and click Next. At this point, the wizard lists all the open (running and not minimized) applications. After you open the Text Editor, click on the Quick Start Wizard title bar to see Text Editor added to the list of applications.

  5. Select Text Editor and click next.

  6. The capture Windows panel displays, describing the procedure.

  7. Click Next.

  8. Now you simply open a document window an open all the dialogs hat you want to test in the Text Editor. When you place the mouse pointer on a window or dialog, the wizard records all the declarations .

  9. When you have finished capturing the windows and dialogs in Text Editor, click Return to Wizard in the Capturing New Windows dialog. Now that you have created you test frame, you are ready to create a test case.

  10. Click Next twice.

  11. Name the test Find Box and enter the description “Verify controls in Find dialog.” Click Next. You test is now being recorded, as indicated by the Record Status window on your screen.

  12. Now go to Text Editor, select Search / Find to open the Find dialog, place your mouse pointer over the dialog’s title bar, and press Ctrl + Alt to verify its state. The verify windows dialog displays. Click OK to verify all properties for the dialog. Close the Find dialog (to return to your base state), then click Done in the Record Status window. You return to the Wizard and are asked to confirm that the test is what you want.

  13. Click Next.

  14. Run the test by clicking the Run Test Button.

  15. The wizard reports the results. You an move the wizard to the side and look at the results file that is created whenever you run a test.

  16. In the wizard, click Next to save your testcase. The testcase is saved in a script (.t) file with the same name.

  17. Click Close to close the wizard. You see a window containing the results file from the test you just ran. In another window is the test plan.

Interfaces in Java

Interface Declarations in Java:
An interface describes fields and methods but does not implement them. An interface-
declaration may contain field descriptions, method descriptions, class declarations, and interface declarations, in any order.

interface-modifiers interface I extends-clause {
field-descriptions
method-descriptions
class-declarations
interface-declarations
}

An interface may be declared at top level or inside a class or interface but not inside a method or
constructor or initializer. At top level, the interface-modifiers may be public or absent. A public
interface is accessible also outside its package. Inside a class or interface, the interface-modifiers may be static (always implicitly understood) and at most one of public, protected, or private.

The extends-clause may be absent or have the form

extends I1, I2, ...

where I1, I2, ... is a nonempty list of interface names. If the extends-clause is present, then interface I describes all those members described by I1, I2,.., and interface I is a sub interface (and hence subtype) of I1, I2,.... Interface I can describe additional fields and methods but cannot override inherited members.

A field-description in an interface declares a named constant and must have the form
field-desc-modifiers type f = initializer;

where field-desc-modifiers is a list o f static, final, and public, none of which needs to be given
explicitly, as all are implicitly understood. The field initializer must be an expression involving only literals and operators, and static members of classes and interfaces.

A method-description for method m must have the form
method-desc-modifiers return-type m (formal-list) throws-clause;

where method-desc-modifiers is a list of abstract and public, both of which are understood and
need not be given explicitly.A class-declaration inside an interface is always implicitly static and public.

Classes Implementing Interfaces:
A class C may be declared to implement one or more interfaces by an implements-clause:

class C implements I1, I2, ...
class-body

In this case, C is a subtype I1, I2, and so on, and C must declare all the methods described by I1, I2,... with exactly the prescribed signatures and return types. A class may implement any number of interfaces. Fields, classes, and interfaces declared in I1, I2,... can be used in class C.

Three Interface Declarations:
The Colored interface describes method getColor, interface Drawable describes method draw, and Colored-Drawable describes both. The methods are implicitly public.

import java.awt.*;

interface Colored1 { Color getColor(); }

interface Drawable1 { void draw(Graphics g); }

interface ColoredDrawable extends Colored, Drawable {}


Classes Implementing Interfaces:
The methods getColor and draw must be public as in the interface declarations .

Ex1: class ColoredPaint extends Point implements Colored {
Color c;
ColoredPaint(int x, int y, Color c) {
super(x, y); this.c = c;
}

public Color getColor() {
return c;
}
}


Ex2: class ColoredDrawablePaint extends ColoredPaint implements ColoredDrawable {
Color c;

ColoredDrawablePaint(int x, int y, Color c) {
super(x, y, c);
}

public void draw(Graphics g) {
g.fillRect(x, y, 1, 1);
}
}


Ex3: class ColoredRectangle implements ColoredDrawable {

int x1, x2, y1, y2; // (x1, y1) upper left, (x2, y2) lower right corner
Color c;

ColoredRectangle(int x1, int y1, int x2, int y2, Color c){
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.c = c; }

public Color getColor() {
return c;
}

public void draw(Graphics g) {
g.drawRect(x1, y1, x2-x1, y2-y1;
}
}

RELATED POST:

STATEMENTS IN JAVA

Exception Statements in Java

The throw Statement:
A throw statement has the form
throw expression;

where the type of the expression must be a subtype of class Throwable . The throw statement is executed as follows: The expression is evaluated to obtain an exception object v. If it is null, then a NullPointerException is thrown; otherwise the exception object v is thrown. Thus a thrown
exception is never null. In any case, the enclosing block statement terminates abruptly .

The thrown exception may be caught in a dynamically enclosing try-catch statement . If the exception is not caught, then the entire program execution will be aborted, and information from the exception will be printed on the console (for example, at the command prompt, or in the Java Console inside a Web browser.

The try-catch-finally Statement:
A try-catch statement is used to catch (particular) exceptions thrown by the execution of a block of code. It has the following form:
try
body
catch (El x1) catchbody1
catch (E2 x2) catchbody2
...
finally finallybody

whereE1, E2 ,.. are names of exception types, x1, x2,.. are variable names,and body,catchbodyi, and finallybody are block-statements . There can be zero or more catch clauses, and the finally clause may be absent, but at least one catch or finally clause must be present.We say that Ei matches exception type E if E is a subtype of Ei (possibly equal to Ei).

The try-catch-finally statement is executed by executing the body. If the execution of the body
terminates normally, or exits by return or break or continue (when inside a method or constructor or switch or loop), then the catch clauses are ignored. If the body terminates abruptly by throwing exception e of class E, then the first matching Ei (if any) is located, variable xi is bound to e, and the corresponding catchbodyi is executed. The catchbodyi may terminate normally, or loop, or exit by executing return or break or continue, or throw an exception (possibly xi); if there is no finally clause, this determines how the entire try-catch statement terminates. A thrown exception e is never null , so xi is guaranteed not to be null either. If there is no matching Ei, then the entire try-catch statement terminates abruptly with exception e.


If there is a finally clause,then finallybody will be executed regardless of whether the execution of body terminated normally, regardless of whether body exited by executing return or break or
continue (when inside a method or constructor or switch or loop), regardless of whether any
exception thrown by body was caught by a catch clause, and regardless of whether the catch clause exited by executing return or break or continue or by throwing an exception. If execution of finallybody terminates normally, then the entire try-catch-finally terminates as determined by body (or catchbodyi, if one was executed and terminated abruptly or exited). If execution of finallybody terminates abruptly, then that determines how the entire try-catch-finally terminates .

The assert Statement:
The assert statement has one of the following forms:

assert boolean-expression ;
assert boolean-expression : expression ;

The boolean-expression must have type boolean. The expression must have type boolean, char,
double, float, int, long, or Object.

Under ordinary execution of a program, an assert statement has no effect at all. However, assertions may be enabled at run-time by specifying the option -ea or -enableassertions when executing a program C :

java -enableassertions C

When assertions are enabled at run-time, every execution of the assert statement will evaluate the boolean-expression. If the result is true, program execution continues normally. If the result is false, the assertion fails and an Assertion Error will be thrown; moreover, in the second form of the assert statement, the expression will be evaluated and its value will be passed to the appropriate Assertion Error constructor. Thus the value of the expression will be reported along with the exception in case of assertion failure. This simplifies troubleshooting in a malfunctioning program.


An Assertion Error signals the failure of a fundamental assumption in the program and should not be caught by a try-catch statement in the program; it should be allowed to propagate to the top level. An assert statement can serve two purposes: to document the programmer's assumption about the state at a certain point in the program, and to check (at run-time) that that assumption holds (provided the program is executed using the enableassertions option).

One may put an assert statement after a particularly complicated piece of code, to check that it has achieved what it was supposed to

Using assert to Specify and Check the Result of an Algorithm:

The integer square root of x ≥ 0 is an integer y such that y2 ≤ x and (y + 1)2 > x. The precondition x ≥ 0 is always checked, using an if statement. The postcondition on y is specified by an assert statement, and checked if assertions are enabled at run-time — which is reassuring, given that the correctness is none too obvious. The assertion uses casts to long to avoid arithmetic overflow.


static int sqrt(int x) { // Algorithm by Borgerding, Hsieh, Ulery

if (x < y =" 0," b =" 0x8000," bshft =" 15," v =" x;;">= (temp = (y<<1)+b>>= 1) > 0);
assert (long)y * y <= x && (long)(y+1)*(y+1) > x;
return y;
}

In a class that has a data representation invariant, one may assert the invariant at the end of every method in the class .

Using assert to Specify and Check Invariants:
A word list is a sequence of words to be formatted a line of text. Its length is the minimum number of characters needed to format the words and the interword spaces, that is, the lengths of the words plus the number of words minus 1. Those methods that change the word list use assert statements to specify the invariant on length and check it if assertions are enabled at run-time.


class WordList {
private LinkedList strings = new LinkedList();

private int length = -1; // Invariant: equals word lengths plus interword spaces
public int length() { return length; }
public void addLast(String s) {
strings.addLast(s);
length += 1 + s.length();
assert length == computeLength() + strings.size() - 1;
}
public String removeFirst() {
String res = (String)strings.removeFirst();
length -= 1 + res.length();
assert length == computeLength() + strings.size() - 1;
return res;
}
private int computeLength() { ... } // For checking the invariant only
}

One should not use assert statements to check the validity of user input or the arguments of public methods or constructors, because the check would be performed only if assertions are enabled at runtime.Instead, use ordinary if statements and throw an exception in case of error.
The assert statement was introduced in Java 2, version 1.4, and cannot be used in Java compilers prior to that. A program using the assert statement must be compiled with option -
source 1.4, as follows:


javac -source 1.4 myprog.java

An algorithm for formatting a sequence of words into a text with a straight right-hand margin should produce lines res of a specified length lineWidth, unless there is only one word on the line or the line is the last one. This requirement can be expressed and checked using an assert statement :


assert res.length()==lineWidth || wordCount==1 || !wordIter.hasNext();

RELATED POST:

JAVA STATEMENTS PART TWO

Statements in Java Part-2

Loop Statements in Java:

The for Statement:

A for statement has the form for (initialization; condition; step) body:

where initialization is a variable-declaration an expression, condition is an expression of type boolean, step is an expression, and body is a statement. More generally, the initialization and step may also be comma-separated lists of expressions; the expressions in such a list are evaluated from left to right when the list is evaluated. The initialization, condition, and step may be empty. An empty condition is equivalent to true. Thus for (;;) body means "forever execute body." The for statement is executed as follows:


1. The initialization is executed.
2. The condition is evaluated. If it is false, the loop terminates.
3. If it is true, then
a. The body is executed.
b. The step is executed.
c. Execution continues at (2).

The whi1e Statement:

A while statement has the form while (condition) body where condition is an expression of type boolean, and body is a statement. It is executed as follows:

1. The condition is evaluated. If it is false, the loop terminates.
2. If it is true, then
a. The body is executed.
b. Execution continues at (1).

The do-while Statement:

A do-while statement has the form do body while (condition);

where condition is an expression of type boolean, and body is a statement. The body is executed at least once, because the do-while statement is executed as follows:

1. The body is executed.
2. The condition is evaluated. If it is false, the loop terminates.
3. If it is true, then execution continues at (1).

Nested for Loops:

This program prints a four-line triangle of asterisks (*):

for (int i=1; i<=4; i++) {
for (int j=1; j<=i; j++)
System.out.print("*");
System.out.println();
}

Infinite Loop Because of Misplaced Semicolon:

Here a misplaced semicolon (;) creates an empty loop body statement, where the increment i++ is not part of the loop. Hence it will not terminate but will loop forever.

int i=0;
while (i<10); style="font-weight: bold;">Using do-while:

Roll a die and compute sum until 5 or 6 comes up. Here we can use do-while but while is usually safer because it tests the loop condition before executing the loop body.

static int waitsum() {
int sum = 0, eyes;
do {
eyes = (int) (1 + 6 * Math.random());
sum += eyes;
} while (eyes < style="font-weight: bold; color: rgb(204, 0, 0);">Returns, Labeled Statements, Exits, and Exceptions:

The return Statement:

The simplest form of a return statement, without an expression argument, is return;

That form of return statement must occur inside the body of a method whose return type is void, or inside the body of a constructor. Execution of the return statement exits the method or constructor and continues execution at the place from which the method or constructor was called. Alternatively, a return statement may have an expression argument:


return expression;

That form of return statement must occur inside the body of a method (not constructor) whose return type is a super type of the type of the expression. The return statement is executed as follows: First the expression is evaluated to some value v. Then it exits the method and continues execution at the method call expression that called the method; the value of that expression will be v.


static int wdayno3(String wday) {
for (int i=0; i <>

Labeled Statements:

A labeled statement has the form label : statement

where label is a name. The scope of label is statement, where it can be used in break and continue . The label cannot be reused inside statement, except inside a local class.

Using break to Exit a Labeled Statement Block:

for(int i=0;i<5;i++){ j="0;j<5;j++){" i="=">Using continue to continue Labeled statement Block:

l1:
for(int i=0;i<5;i++){ j="0;j<5;j++){" i="=" style="font-weight: bold; color: rgb(204, 0, 0);"> The break Statement:

Executing break exits the innermost enclosing switch or loop and continues execution after that switch or loop. Executing break label exits the enclosing statement that has label label, and continues execution after that statement. Such a statement must exist in the innermost enclosing method, constructor, or initializer block.


For Example

int i=0;
for(i=0;i<10;i++){ i="=" style="color: rgb(204, 0, 0); font-weight: bold;">The continue Statement:

A continue statement is legal only inside a loop and has one of the forms

continue;
continue label;

Executing continue terminates the current iteration of the innermost enclosing loop and continues the execution at the step in for loops the condition in while and do-while loops. Executing continue label terminates the current iteration of the enclosing loop that has label label, and continues the execution at the step or the condition. There must be such a loop in the innermost enclosing method or constructor or initializer block.

RELATED POST

STATEMENTS IN JAVA PART ONE