Subscribe by Email


Showing posts with label Compilation. Show all posts
Showing posts with label Compilation. Show all posts

Thursday, August 30, 2012

What is a Module? What is a Compiled Module? (In WinRunner)


Modules are the basic elements of any software system or application that make up the foundation of that software system or application. In winrunner usually the term “compiled module” is used. We shall see in this article that what are the compiled modules and how they can be created in winrunner. 

What are Compiled Modules?

- Compiled modules store the frequently used functions and so are considered to be a kind of libraries. 
- In compiled modules, the functions defined by users i.e., the user defined functions can be stored and later these stored user defined functions can be called from the test scripts. 
- Compiled modules are considered to be a library since they are actually a script containing all the user defined functions which are required to be called many times from other tests. 
- Whenever a compiled module is loaded, the functions that it contains are subjected to automatic compilation and reside in the memory itself. 
- After this, they can be called directly and from within any test. 
- With the compiled modules, the performances as well as the organization of the tests that you create are improved significantly.
- This happens so because the compiled modules are debugged before they are used and therefore the tests that we created require very less error- checking. - In addition to all this, the interpretation of a function in a test script is quite slower than the calling of a function that has already been compiled.

There are 2 ways available for compiling a module as mentioned below:
  1. Loading the module to be compiled from a test script with the help of the TSL load function.
  2. Running the script of the module to be compiled with the help of the winrunner run commands.
- The step commands can be used for performing the incremental compilation if in case you need to debug or modify an already existing module. 
- After this, the part of the compiled module that you made changes to needs to be run so that the entire compiled module will be updated. 
- It is necessary that the user defined functions present in your compiled modules are automatically compiled every time the winrunner starts up. 
- For this you need to add load statements top the start up tests. 
- However, you should know that for loading the recovery compiled module there is no need for adding the load statements to the start up tests or any other tests.
- This is so bacuse the recovery compiled module loads by itself when the winrunner is started. 
- Another point to be taken care of is that the compiled modules cannot load the GUI map files when you are working in the GUI map file per test mode.
- If the compiled module has to make references to any of the GUI objects present in the application software then it is required that the referred GUI objects must also be referred in the test which is responsible for loading that particular compiled module. 
- Like a regular TSL test the compiled module can be opened, edited or saved.  - However, there is a big difference in the contents of a compiled module or ordinary tests. 
- Like a regular test, a compiled module does not contain any analog input or check points. 
- This is so because a compiled module is designed to store user defined functions rather than just performing a test. 
- The purpose why it stores all the frequently user defined functions is to speed up the execution process by providing a quick and convenient access from the other tests. 
- Its contents are:
  1. Function definitions and declarations,
  2. External functions prototypes
  3. Load statements etc. 


Wednesday, February 29, 2012

What are different compatibility and intersystem defects?

WHAT IS MEANT BY SOFTWARE COMPATIBILITY?

- Software compatibility is usually described as the compatibility of a software system or application to run without any problems on any major platform.
- It means that the software system or application is compatible with the major platforms and CPU architectures such as Intel or mercury etc.
- It also refers to the compatibility of a software system with different operating systems.
- It is very difficult to develop software that is compatible with many CPU architectures since during the compilation of such a system it shows different errors for the different CPU architectures.
- But such compatible application software do exist.
- The applications are developed and compiled for the various CPU architectures and these are then made compatible to with the various different CPU architectures via the operating systems.

WHAT IS INTERPRETED SOFTWARE?
- In contrast to the compiled software, the interpreted software does not show the above drawback.
- They are very well capable of running on multiple CPU architectures.
- But here one condition has to be fulfilled i.e., the interpreter should be available for that particular type of the CPU architecture.

Software incompatibility is more frequent among the newer software versions developed for the new versions of the operating system which is found to be incompatible with the older version of that software system or application version due to a lack of some features and functionalities.

The newer versions of a software system or application that are able to work with the older versions of the operating systems are said to possess the capability of the backward compatibility.

Compatibility testing is usually carried out to test the operational environment of a software application or program. The software system or application is checked for its suitability i.e., whether or not the application will be able to perform in that environment or not.

DIFFERENT COMPATIBILITY & INTER-SYSTEM DEFECTS
Defects affecting the compatibility of a software system or application are commonly called as compatibility and inter-system defects. These are:

DEFECT #1:
After completing the installation of the application software, the user executes that application and observes that he/she is not able to access some features and functionalities and also not able to view any pictures images, icons or data.

DEFECT #2:
Some browsers may show java script errors with applications developed in java language.

DEFECT #3:
Inconsistency is observed in some elements of a web application or a web site when viewed through different browsers.

DEFECT #4:
The software program is observed to behave differently on different browsers.

DEFECT #5:
Inter-system defects like corruption of data in an NFS mounted file. Usually data is not corrupted in an NFS system.

DEFECT #6:
- In some cases, an unauthorized user is very well able to access the control to a system which uses the LDAP methodology for the authentication purpose.
- This inter-system defect is common in ensemble, UNIX clients and VMS employing LDAP authentication system, windows clients and cache file versions.

DEFECT #7:
- Encryption of data base in VMS clusters.
- In such a defect the system usually becomes inactive and does not respond.
- Like the above mentioned defect, this defect also exists in ensemble versions. - This defect usually occurs when the data base is forced to shut down without the cache being closed.

DEFECT #8:
Failure of cluster mounted data bases.

DEFECT #9:
- Defect making the application server unresponsive.
- This defect is usually encountered when there is too much ECP traffic on the application or web site.
- This defect can affect all platforms.

DEFECT #10:
- Memory defects like core dumps which are generated during the start up of the cache.
- Because of this defect in some cases the start up can fail completely.

DEFECT #11:
Speed reduction in cache making it unresponsive. This defect occurs mainly when the amount of shared memory exceeds a specified limit.


Thursday, September 15, 2011

Some details about Pointers and Structures in C...

A pointer can be defined as a variable pointing to another variable or a variable storing the location or address of another variable.Pointers can be used to point to any data type.There are object pointers, function pointers, structure pointers and so on. Like any other pointers, structure pointers are also a very useful tool in C programming.Pointer structures are easy to declare and declared similarly like any other kind of pointer by putting a “*” sign before the name of the structure. See the example below:

Struct address *a1, *a2;
a1 = &b2;
a2 = &b3;

where b2 and b3 are the actual structure address variables. Using the below given assignment statement you can copy the details of structure pointed by a2 to a1:

*a1 = *a2;

Any member of a structure can be accessed using a pointer in the following way:
A->b

Here A is a pointer pointing to a structure and b is a data member or a member function of the structure being pointed. And there’s another way to access a member of a structure which has been given below:

(*A).b;

Both the statements are equivalent. Use of structure pointers is very common and useful.Be careful while dealing with structure pointers like any other normal pointer.The precedence of operators matters a lot. Be careful with the precedence of operators while programming in C.If we enclose *A is parentheses, an error will be generated and the code will not be compiled since the “.” Operator has got a high precedence than the”*” operator.Using so many parentheses can be quite a tedious job so, C allows us to use a shorthand notation to reduce the bombastic jargon. ” (*A).” can also be written as given below:

A ->

This is equivalent to (*A). but takes less characters. We can create pointers to structure arrays. A lot of space can be saved if we declare an array of pointers instead of an array to structures. In this only one structure is created and subsequently values are entered and disposed. Even structures can contain pointers as shown below:

Typedef struct
{
Char a[10];
Char *b;
} c;
c d;
char e[10];
gets(d.a,10);
d.b = (char *) malloc (sizeof (char[strlen(e)+ 1]));
strcpy(d.b, e);


This method is implemented when only a few records are required to be stored. When the size of the structure is large, it becomes difficult to pass and return the structures to the functions. To overcome this problem we can pass structure pointers to the functions. These structures can be accessed indirectly via pointers. Given below is a small code to illustrate the passing of structure pointers to the function and accessing them:

struct product
{
Int pno;
Float price;
};
Void inputpno (struct product *pnoptr);
Void outputpno (struct product *pnoptr);
Void main()
{
Struct product item;
Printf(“product details\n\n”);
Inputpno (&item);
Outputpno (&item);
}
Void outputpno (struct product *pnoptr)
{
Printf( “product no. = %d, price = %5.2f \n”, ( *pnoptr). Pno, (*pnoptr).price);
}
Void inputpno (struct product *pnoptr)
{
Int x;
Float y;
Struct product pno;
Printf( “product number: “);
Scanf( “%d”, &x);
( *pnoptr).pno = x;
Printf ( “price of the product: “);
Scanf( “%f”, &y);
( *pnoptr). Price = y;
}


In this program code, the prototypes, function calls and definitions have been changed in order to work with structure pointers. Dereferencing of a structure pointer is very common in programs. “->” (arrow) is an operator that is provided by C for accessing the member function of a structure. The 2 statements given below are equivalent:

Pnoptr -> pno;
(*pnoptr).pno;


Friday, September 9, 2011

Understanding the Structure of a C Program

The best way to get started with any programming language is to study a program, so in order to make you understand C program structure, we will take into consideration an example program whose code is:

1. /* this is a simple c program
2. Written to explain basic program structure */ -------------------------multiple line comment
3. #include //header file. ---------------------- single line comment
4. int main()
5. {
6. return 0;
7. }

This is the simplest C program and this program unfortunately doesn’t do anything. “#include” is called a preprocessor command. It tells the compiler to do processing before the compilation. This command tells the compiler to include the header file “stdio.h” in the program.

Functions are the basic building blocks of any program. The function “main()” is the most important function in any C program. You can say that this is the point of execution of a program. This function should exist as an entry point. Following the main is a pair of parentheses. These two parentheses indicate that the main is a function. Now coming to the opening and closing pair of braces in lines 5 and 7, are used to define the limits of a function or the program. Usually these braces contain executable statements of a function. The main() is preceded by word int. it means that this function returns an integer value. This value is returned using the “return” statement.

Now let’s take a program “abc.C” that does something. It’s same as the previous except that it has an executable statement between the braces in addition to the obligatory return statement. The executable statement calls a function which is already included in the header files as a part of the C library. The function is namely “printf()” and in order to make it print text the desired text is written with quotation marks within the parentheses of the function. The text will be displayed on the monitor when program is run. Notice the semicolon at the end of the executable statements. A semi colon in C is used as a statement terminator.

Consider the following statement:
printf("Hello World!\n");

Notice the “\n” character. The back slash is used to indicate to the compiler that a special character is being inserted. Here “n” indicates a new line. This is used whenever you want to print something in a new line. The function “printf()” prints the text and returns the carriage. Consider the following statements:

int index;

the key word int stands for integer and is used to declare a variable of type integer called index. Always keep in mind that the number of field descriptors and the number of variable definitions must be the same or else the runtime system will generate something we are not expecting. Another common and important part of C program structure is “comments”.Comments are optional but it’s good to include because they make the program more readable although they don’t mean anything to the compiler. Comments are of two types: single line comments and multiple line comments. Single line comments are used to give only one line description of a function or any other statement. A multiple line comment spans through several lines and is used to give a detailed description of a program or function.Look at the above program code for an example of comments. Another important part of a program are statements and expressions which combine variables and constants and can be assignments, function calls etc.Coming to the line breaks they are necessary to for good style formatting of your programs. This makes it easy for you to understand how your program flows when you want to maintain or modify it.You can also use “blank lines” after pre compiler declarations and declaration of new variables.Indentation should also be used in order to make your program more readable and to define the body of functions.


Facebook activity