Subscribe by Email


Showing posts with label Function. Show all posts
Showing posts with label Function. Show all posts

Wednesday, May 15, 2013

Define a system call? List the different types of the system calls?


- A program can request for services from the kernel of the operating system through a system call. 
- These services include all the following:
  1. Hardware related services such as data access from the HDD.
  2. Creation and execution of processes
  3. Communication with integral services of the kernel such as scheduling.
- An essential interface is provided by the system call that lies between the operating system and the process. 
- The modern microprocessor architecture consists of a security model specifying multiple levels of privileges for the execution of the software. 
- For example, a program has limitations of its own address space so even by accident it does not modify or access the programs that are executing or the OS. 
- This way the direct manipulation of the hardware devices (such as the network devices and frame buffer etc.) by the program will also be avoided. 
However, this is not the only case.
- There are situations where the programs really need access to these devices. - This is why the system calls are made available to the programs. 
- System calls ensure that such operations are safely implemented and are well defined. 
- The level at which the operating system executes is the highest privilege level.
- Therefore, the applications requests for the devices to the operating system through the system calls. 
- The execution of the system calls is carried out through the interrupts that would automatically put the CPU at the required level of the privilege. 
- After this, the control is passed on to the kernel. 
- From here the kernel determines whether or not the requested service should be granted to the calling program. 
- If the program is granted the service it requested, a specific instruction set is executed by the kernel which cannot be directly controlled by the calling program.
- These instructions return the privilege level down to that of the program that invoked the call. 
- Finally, the control is returned to the calling program.
- Generally, an API or a library is provided between the operating system and the normal programs. 
- The purpose of this library is to provide wrapper functions for the calls. 
- The names of these functions are same as that of the system calls. 
- The purpose of these functions is to expose a subroutine through which the system call can be used.
- These functions also provide modularity to the system call. 
- But above all, the primary function of the wrapper is placing the arguments in their proper processor registers that are to be passed on to the system call.
- A unique system call number is set that will be called by the kernel. 
- In this way, the portability is increased by the help of this library.
- Making direct system calls in the code of the application is very difficult and so requires embedded assembly code.
- In systems based up on ex-kernel, library is as important as the intermediary as they provide resource management, abstractions and shields the application from a low level kernel. 
- A control transfer involving features specific to the architecture is required for the implementation of the system call. 
- A way of implementing this is by using a software trap. 
- RISC processors can only use the implementation technique via interrupts. 
But there are some other additional techniques for processors with CISC architectures. 
- One example is of the following two sets developed independently by Intel and AMD respectively for serving the same purpose:
SYSRET/ SYSEXIT
SYSCALL/ SYSENTER
- These were actually control transfer instructions and very fast indeed. 


Monday, January 7, 2013

What are benefits of LabVIEW(Laboratory virtual instrumentation engineering workbench)?


Laboratory virtual instrumentation engineering workbench (or labview as it is commonly known) is a platform developed for designing systems and presents a development environment.

Benefits of LabView


1. Interfacing
- The extensive support that labview provides for access to instrumentation hardware is one of the key benefits of it. 
- In addition to the drivers, a number of abstraction layers are available for inclusion for a variety of buses as well as instruments. 
- These drivers and abstraction layers are presented as the graphical nodes. 
- A standard interface is provided by the abstraction layers so that communication with the other hardware devices could be established. 
- A lot of program development time is saved by the driver interfaces that are provided. 
That is why people having limited coding experience of writing the programs can even develop programs and easily deploy the test solutions in a time less than what it might take with the conventional programming systems. 
- DAQmxBase is a brand new driver topology.
- It comprises mostly of the G – coded components having a few register calls via national instrument measurement hardware driver development kit (DDR) functions.
- It is known to provide hardware access that is independent of the platform. 
- This access is to instrumentation devices and a number of other data acquisition devices. 
- This new driver is available for the following platforms:
a)    Windows
b)    Mac os x
c)    Linux
- An interface for .net frame work applications is also provided by the labview using    which one can use XML files and data bases in one’s automation projects.

2. Code Compilation
- When it comes to performance, labview is at its best as it provides you even a compiler that can produce a native code for platform level of CPU. 
- Firstly, the graphical code is converted in to machine executable code by passing it through an interpreter and compiler.
- The syntax of the labview is to enforced during the code editing process only and then it is compiled in to machine level code whenever execution command is given. 
- The executable code is executed by the run time engine of labview which already has some pre-compiled code that can be used to perform usual tasks that have been already defined by the G – language. 
- Also, the compile time is reduced by the run time engine. 
- In addition to this it also offers you a consistent interface that can be used for a number of following:
a)    Operating systems
b)    Graphic systems
c)    Hardware components and so on.
- The code is made portable across the platform because of the run – time environment. 
- Labview code compiles slower than the equivalent code in C and this difference gets larger with the program optimization.

3. Large Libraries
- A large number of libraries with a large number of functions such as those mentioned below are provided with the labview package:
a)    Functions for data acquisition
b)    Signal generation
c)    Mathematics
d)    Statistics
e)    Signal analysis
f)     Signal conditioning and so on.
- The package also has a number of graphical interface elements. 
- The package has numerous advanced mathematics blocks which can carry out functions such as filters, integration and so on.
- Many other specialized capabilities that are associated with the data that has been captured with the help of hardware sensors. 
- In addition to all this, labview comes with mathscript which is nothing but a text based programming component having some additional functionality such as for mathematics, analysis, signal processing and so on. 
- This component and graphical programming can be integrated together via the script nodes and using a syntax compatible enough with MATLAB.

4. Code re use
5. Parallel programming
6. Ecosystem
7. User community


Friday, January 4, 2013

Explain LabVIEW (Laboratory virtual instrumentation engineering workbench)?


Laboratory virtual instrumentation engineering workbench (or labview as it is commonly known) is a platform developed for designing systems and presents a development environment. 
- The environment it provides is for the development of visual programming language from what are known as the national instruments. 
- The graphical language that is usually used is commonly known as “G”. 
- Make sure that you do not yourselves with G code.
- This graphical language had its release for the Apple Macintosh in the year of 1986. 

Labview is used for a number of purposes few of which are:
  1. Data acquisition
  2. Instrument control
  3. Industrial automation and so on.
All these functions can be carried out on a number of platforms including:
a)    Unix
b)    Linux
c)    Mac OS X and
d)    Microsoft windows

- Labview 2012 which is the latest version of labview has been released recently in year 2012 in the month of August. 
- 'G' is actually a data flow programming language. 
- The structure of the graphical block diagram helps in determining the execution. 
- This graphical block diagram is actually composed of the LV source code using which the different function nodes can be connected via wires. 
- Variables are propagated by these wires. 
- Any node for which all the input data is available can be put in to execution immediately. 
- It involves a number of modes simultaneously, parallel execution is very much possible in G.
- Built-in scheduler is automatically exploited through multi–threading and multi– processing hardware.
- Multiple OS threads are multiplexed by the built – in scheduler over the nodes that are ready to be executed. 
- User interfaces called front panels are created by the labview and incorporated in to the development cycle. 
- The programs or subroutines of the labview are termed as virtual instruments or VIs. 

There are 3 main components of each VI namely:
  1. A block diagram
  2. A front panel and
  3. A connector panel
- The third component i.e., the connector panel is used for the representation of the virtual instrument in the other virtual instruments which call this one. 
- Front panel comprises of the indicators and controls, thus allowing the operator to input or extract data from an active virtual instrument. 
- Another feature of the front panel is that it also serves as a programmatic interface. 

Thus, a virtual instrument can be run in either of the two ways:
  1. As a program: The front panel serves as a user interface.
  2. As a node on to the block diagram: The inputs and outputs for a particular node are defined by the front panel through the connector panel.
- Any of the virtual instruments can be tested very easily before it is embedded in to the main program as a subroutine. 
- Even non-programmers can take the benefit of the graphical approach since using it, they can build programs by just dragging and dropping the lab equipment’s’ virtual representation with which they have some familiarity. 
- Advantage is that the labview programming environment comes with documentation and some included examples which can be used to work out small applications very easily. 
- There is one disadvantage also which is that one might underestimate the expertise required from implementing high quality G – programming.
- Also, as far as complex programming or large scale programming is concerned it is a must for the programmer to have an extensive knowledge regarding the labview syntax and the topology it uses for the management of memory. 
- The advanced development system of the labview lets you create stand –a lone applications also.


Thursday, August 23, 2012

What are different types of functions available in WinRunner?


Functions form a very important aspect of the winrunnner. When you work with the winrunner you are provided with functions from all the categories. 

Some of the functions are there which are suppose to work only when the applications have been developed in specific environments like those mentioned below:
  1. Visual basic
  2. Power builder and so on.
What is a Function?
- The availability of a specific function can be checked by clicking up on the availability button available at the top of the help screen for that particular function. 
- The loadrunner GUI vusers types make use of the winrunner for the creation of the system load.
- This makes it possible to make use of any of the categories. 
- The standard functions can be used apart from the loadrunner functions in loadrunner scenario scripts on UNIX platform only.
- There are certain TSL functions that have the support for both the Xrunner and winrunner. 
- The winrunner provides 4 major types of TSL functions as stated below and a different and unique requirement is addressed by each of them:
1. Context sensitive functions: These functions hold the responsibility for performing the operations on GUI objects.
2. Analog functions: These functions hold the responsibility for carrying out some user like events like mouse and key board input.
3. Customization functions: These functions hold the responsibility for configuring the settings of the testing tool according to one’s requirement. 
4. Standard functions: These functions hold the responsibility for performing the basic programming language operations.

Context Sensitive Functions
- The actions taking place on the software system or application which is under test can be depicted by these functions in terms of the GUI objects like buttons, lists and windows and so on. 
- These functions are available for the following platforms:
      a)   Winrunner
      b)   Load runner GUI vusers
   - Parameters that make a reference to the logical name of some object are involved in most of the context sensitive functions. 
   - However, it should be checked that the logical name of an object has been given a place with the physical description. 
    - What happens during recording is that the logical name is automatically put to use by the system. 
   - In some cases the function is expected to work with the physical description of the object as well.

    Analog Functions
   - Operations are recorded and executed at the screen coordinates of the screen as specified in the test script. 
   - When the winrunner recording is done in this mode, these functions come in to play for depicting the following:
a)     Mouse clicks
b)     Key board input
c)     Exact coordinates travelled by the mouse
- The purpose of these functions is to run and retrace the mouse tracks and submit the exact input that was recorded by the user. 
- There are some other particular operations that are supported by analog functions:
a)   Synchronization
b)   Verification
c)   Text manipulation etc.
- The analog functions are available for the same platforms as for the context sensitive functions.

Customization Functions
- With these functions, the testing tools you are using can be enhanced further to suit better with your testing style and other specific needs. 
- One particular example for this function is the function using which functions can be added to the function generator and custom GUI check points can be created. 
- These are only available for winrunner.

Standard Functions
- These functions are for general elements of the programming language like:
a)   Basic input and out put
b)   Control flow
c)   Mathematical functions
d)   Array functions and so on.
- Unlike other function the standard functions are available for all the products of mercury interactive.  


Tuesday, August 21, 2012

When do you use Break Points? What is Toggle Break Points? How it differ from Break points?


What you got to do when you are in need of pausing a test run in between its execution? 
- Break points are used to mark such points in the test script where you want the test to be paused. 
- Break points have proved to be a very useful tool in the discovery of the flaws that might be present in a test script. 
- A break point marker marks the break point present in the test script. 
- This break point marker resides in the left margin of the test scripts.
- The test run is paused by the winrunner whenever it encounters a break point. 
- On a particular break point following tasks can be carried out:
  1. The effects of the test run can be examined.
  2. The current value of the variables can be viewed.
  3. Any necessary changes can be made.
  4. Test can be continued to further execution.

How to use Break Points?

- To continue the execution of the test after completing the task to be carried out on the break point the “run from arrow” command can be given and the test will restart from the break point. 
- Once, it gets in to the execution process again it will continue to execute until and unless it encounters another break point or till the test is complete. 
- One thing that should always be taken care of is to make sure that the winrunner is out of batch mode otherwise it won’t pause. 
- For winrunner to pause on break points, it is mandatory that it comes out of the batch mode. 
- If it is not, it is sure to ignore the break points. 
- There are 3 main uses of the break points:
  1. They are used to suspend the test run at a particular point so that the state of your software system or application can be inspected.
  2. They are used for monitoring the entries that are there in the watch list.
  3. They are used to mark certain points throughout the test script for the stepping purpose by using the step commands.

Types of Break Points

We have two types of break points as mentioned below:
  1. Break at location point: This break point makes the test to stop at some line number specified by the user in a test script and
  2. Break in function point: This break point makes the test to stop whenever a functioned specified by the user is called in a loaded compiled module.
The break points that you define in a session remain active for that particular winrunner session only. Once you terminate that particular winrunner then you must redefine the break points to continue the debugging of the test script in the successive session.

Toggle Break Point and how they differ from normal break point

- Toggle break point command is used whenever you have to set a break at the location break point. 
- For doing this, you just need to move the point of insertion to that line of the test script where according to your desire the test must stop executing. 
- Now go to the debug menu and click on the option “toggle break point” or you can simply go for the button entitled toggle break point. 
- Once you have clicked on this you can observe a symbol of break point towards the left margin of the current window of the winrunner. 
- This break like other break points is also listed in the break points list.
- There is just one simple difference which is that the toggle break points automatically make use of the pass count of 0 and if some other pass count is required these break points can be easily modified. 


Tuesday, July 10, 2012

What is meant by code coverage? What are different types of code coverage?


Code coverage is one of the important measures that comes across while carrying out the software testing. 

What is Code Coverage?


- Code coverage is the measure that gives the degree up to which the source of a software system or application has been tested. 
- Code coverage earlier was recognized as one of the methods that were developed for carrying out a systematic software testing. 
- The term code coverage was first referenced under the “communications of the ACM” in the year of 1963 by Maloney and miller.
- Code coverage is measured using a specialized tool called code coverage analyzer for instrumenting the binaries in order to add all the tracing calls and run all the automated test cases against the software system or application under question. 
- A good code coverage analyzer will not only give you the degree of the coverage but will also allow you to dig deeper in to the data and check out for the lines of the code that are executed during a particular test. 
- Today we have a large number of code coverage criteria that amount to the total code coverage. 

Types of Code Coverage


- The software system or application that is under testing is adorned with certain options that run under a particular environment. 
- Each and every function of the program that is executed is traced back to the function calls in the source code which allows the easy checking of the rarely accessed, never accessed parts of the program under normal conditions. 
- This gives the software testers an assurance that the most important conditions of the source code have been tested. 
- The outcome is then subjected to analyzation for sorting out of the code that has been analyzed. 
- The process is a combination of several code coverage methods that aim to provide a manageable and rigorous set of regression tests. 
- The output of the code coverage analyzation can be used by the engineers for devising the test cases and configuration sets that in turn will increase the code coverage relating to the vital functions. 
- Mostly two common forms of the code coverage are used by the software testers namely:

1. Line coverage or statement coverage: 
- This type of the code coverage reports regarding the execution foot print of the software testing in terms of the lines of code which are executed for the completion of the test.
The statement coverage provides you with the benefit of the identification of the bugs that arise in the constructs of the control flow of the source code like consecutive switch labels and compound conditions. 
- The major setback of this code coverage type is that even though it seems like you have achieved 100 percent of the code coverage, there might be 100s of wicked and uncaught bugs.
- This disadvantage of the statement or line coverage is over-comed by a more advance form of code coverage called the branch coverage.

2. Edge or branch coverage: 
This type of code coverage reports regarding the branches or the code decisions that like statements are executed for the completion of the tests.

- Both of the above mentioned types of the code coverage provide the result in the form of code coverage metric in terms of percentages. 
- Out of the two, the branch code coverage is considered to be quite comprehensive that the equivalent percentage of the statement code coverage.
- It is also very easy to determine the number of branches that have to be tested since the Boolean decisions have only two outcomes i.e., either true or false. 


Wednesday, May 9, 2012

How is test driven development and documentation linked?


As we all know that the test driven development or TDD is another process in the list of the most of the popular software development processes. The topic of the test driven development is in the league of this article. 

About Test Driven Development


- The test driven development took its root from the idea of the repetition of a very short development cycles. 
- The first of all a failing automated test case is written or created by the software developer or tester which is meant to serve the purpose of defining a new function or a desired improvement. 
- Secondly a code to pass the above created test is also written by the developer. 
- This newly written code is then subjected to refactoring in order to make it meet the acceptable standards. 
- The test driven development has always been looked up as an encouragement for the simple designs and also as an inspiration for boosting up the confidence levels.
- The test driven development has always been known to be related to the concepts of the extreme programming or XP. 
- But, eventually it came to be known as a standalone process having its own ways and rights.
- The concepts of the test driven development are used by the programmers and developers as a measure for debugging the legacy code and improving it further. 
- The test driven development is usually driven by a series of automated unit tests that are written by the developer to provide definition for the requirements of the code and then the code is automatically produced. 
- These tests are constituted of the assertions of their own.
- If a test is successfully passed, the developer is confirmed of the correctness of the code and that it can be further evolved and refactored. 

The documentation forms a very important part of any development or testing and so does of the test driven development. This article has taken up the question: “how is test driven development and documentation linked?”. 

About Importance of Documentation In TDD


Now coming to the importance of documentation in the test driven development, it includes the following documents:
  1. Feasibility report
  2. Technical documentation
  3. Operational documentation
  4. Log book and so on.
- The documentation in test driven development is another source of support to the developers as well as the users.
- It provides all the crucial information required to set up a uniform environment in which the software system or application is to be operated. 
- In case of a break down when the person in charge is not available, the users experience down time and most of their resources are wasted. In such situations, there is only one thing that can save one’s precious time and efforts and that thing is nothing but the documentation. 
- It provides all the information and guidelines that are required to fix an issue. 
- The format of the documentation does not matter much as much as it content matters.
- Documentation is vital to any software development process and not particularly to the test driven development.
- Documentation is an effective mean for streamlining the test driven development process
- Apart from all this, documentation has got an important role to play in the business.
- Document is needed in the test driven development since it helps in codifying the procedure for the development of the software system or application. 
- The documentation provides effective protection during the audits to the test driven development.
- It is important that the documentation is developed alongside the development of software system or application. 
- Documentation will be effective if it is considered to be a part of the work and not a hindrance to it. 


Facebook activity