Subscribe by Email


Showing posts with label Behavior. Show all posts
Showing posts with label Behavior. Show all posts

Sunday, July 7, 2013

Differentiate between persistent and non-persistent CSMA?

- CSMA or Carrier Sense Multiple Access makes use of LBT or listen before technique before making any transmission. 
- It senses the channel for its status and if found free or idle, the data frames are transmitted otherwise the transmission is deferred till the channel becomes idle again. 
- In simple words, we can say that CSMA is an analogy to human behavior of not interrupting others when busy. 
- There are number of protocols out which the persistent and the non – persistent are the major ones. 
- CSMA is based on the idea that if the state of the channel can be listened or sensed prior to transmitting a packet, better throughput can be achieved.
- Also, using this methodology a number of collisions can be avoided. 
- However, it is necessary to make the following assumptions in CSMA technology:
  1. The length of the packets is constant.
  2. The errors can only be caused by collisions except which there are no errors.
  3. Capture effect is absent.
  4. The transmissions made by all the other hosts can be sensed by each of the hosts.
  5. The transmission time is always greater than the propagation delay.
About Persistent CSMA
- This protocol first senses the transmission channel and acts accordingly. 
- If the channel is found to be occupied by some other transmission, it keeps listening or sensing the channel and as soon as the channel becomes free or idle, starts its transmission. 
- On the other hand, if the channel is found empty, then it does not wait and starts transmitting immediately. 
- There are possibilities of collisions. 
- If one occurs, the transmitter must wait for random time duration and start again with the transmission. 
- It has a type called 1 – persistent protocol which makes transmission of probability 1 whenever the channel is idle. 
- In persistent CSMA there are possibilities of occurrence of collisions even if the propagation delay is 0. 
- However, collisions can only be avoided if the stations do not act so greedy. 
We can say that this CSMA protocol is aggressive and selfish. 
- There is another type of this protocol called the P – persistent CSMA. 
This is the most optimal strategy. 
- Here the channels are assumed to be slotted where one slot equals the period of contention i.e., 1 RTT delay. 
- The protocol has been named so because it transmits the packet with probability p if the channel is idle otherwise it waits for one slot and then transmits.

About Non–Persistent CSMA
- It is deferential and less aggressive when compared to its persistent counterpart. 
- It senses the channel and if it is busy it just waits and then again after sometime senses the channel unlike persistent CSMA which keeps on sensing the channel continuously. 
- As and when the channel is found free, the data packet is transmitted immediately. 
- If there occurs a collision it waits and starts again.
- In this protocol, even if the two stations become greedy in midst of transmission of some other station they do not collide probably whereas, in persistent CSMA they collide.
- Also, if only one of the stations become greedy in midst of some other transmission in progress, it has no choice but to wait. 
- In persistent CSMA this greedy stations takes over the channel up on completion of the current transmission.
Using non – persistent CSMA can reduce the number of collisions whereas persistent CSMA only increases the risk. 
- But the non – persistent CSMA is less efficient when compared to the persistent CSMA.
- Efficiency lies in the ability of the protocols of detecting the collisions before starting the transmission. 


Thursday, May 9, 2013

What is a thread? What is meant by multi-threading?


About Thread

- A thread is a smaller instance of a process i.e., a sequence of instructions and an operating system scheduler can manage it independently. 
- A thread is sometimes also called as the light weight process. 
- The way these threads and processes are implemented is different for different operating systems. 
- But in majority of the cases threads are contained within a process. 
- The same process can have more than one thread. 
- These threads have to share the resources including memory while different processes may not share these. 
- In simple words, we can say that the instructions or code and the context or the values of the process are shared by its constituting threads. 

In this article we focus on threads and multi-threading.

- Multi-threading is a task of multiprocessor systems.
- But even single processor systems can do it by time division multiplexing just like the multitasking. 
- In TDM context switch occurs between the many threads. 
- This happens many times and so it seems to the user that a number of processors are being executed concurrently.
- However, in multiprocessor systems concurrency can be truly achieved since every processor processes one thread and so many threads are executed simultaneously. 
- Both multiprocessor and time threading is supported by most of the modern operating systems with help from the process scheduler. 
- The threads can only be manipulated through a system and this all is facilitated by the kernel of the operating system. 
- This is why some implementations have been named as the kernel thread. 
- An example of kernel thread is the LWP or the lightweight process and it shares same state as well as info. 
- Some programs even use user space threads when threading with the help of signals and timers etc. 
- These programs perform a kind of ad hoc time slicing. 
- Some may take threads and processes to be the same but there is a considerable difference between the two:
  1. Processes are independent whereas the threads are a subset of the processes.
  2. More state information is contained in threads whereas the same process state, resources and memory are shared by all the threads contained in that process.
  3. Address spaces of different processes are different whereas the same address space is also shared by the threads.
  4. IPC or the inter–process communication is the only medium for the processes to communicate with each other.
  5. The threads within the same process are switched with context switch which is faster than that of the processes.

Features of Multi-threading

- Multi-threading is now among the widespread programming models. 
- The major characteristic feature of this model is that multiple threads can execute within the same process context. 
- Even though the resources of the process are shared by the threads, they execute independently. 
- The most widespread application of this model is in parallel computing.
- Full advantage of this technology can be taken only when it is applied to a multiprocessor system or a distributed system. 
- This is so because the program threads have a natural tendency to heed to the true concurrent execution. 
- But in these cases, necessary precautions must be taken for avoiding the race conditions and other undesirable behavior. 
- For the correct manipulation of data thread synchronization is also important. - Mutually exclusive operations are another requirement of the threads for preventing the simultaneous modification of the common data. 
- If these primitives are used carelessly, then it can lead the system to a deadlock. 
- Another feature of multi-threading is that it is always responsive to I/P. 
- This can be contrasted with the single threaded applications where if one block occurs, the whole program freezes.


Monday, April 8, 2013

What are features of Hyper-Threading technology?


The HT technology or the hyper–threading technology is a proprietary SMT (simultaneous multi–threading) implementation developed by Intel in order to make improvements in the pluralization of the computations that are carried out by the microprocessors in PC. It was first included in the Xeon server processes and then in Pentium 4 processors, atom, Itanium, core I series etc. Two logical or virtual cores are addressed by the operating system for each physical processor core present. The workload is shared among these two whenever required and possible.

Features of Hyper Threading Technology

  1. Hyper–threading technology reduces the number of instructions in the pipeline that are dependent in nature. This is also its main purpose.
  2. Architecture: The hyper – threading technology is based on the super scalar architecture. This kind of architecture is capable of operate multiple instructions in parallel with separate data. It appears as if there are two processors, thus letting the OS operate with two processes simultaneously.
  3. Resource sharing: The same resources can be shared by the two or more processors available. Re–allocation of the resources can be done up on the failure of one of the processes.
  4. Support for SMT: Hyper–threading implies the support for SMT through an OS that is SMT supportable. The OS needs to be specially optimized for this technology. It is recommended by Intel to disable the HTT if the OS have not been optimized for HTT.
  5. Two processors: Certain processor sections are duplicated by the HTT. These are the sections in which the architectural states are stored. The main execution resources are not duplicated. Because of this, the HT processor appears as two processors to the OS namely, the physical and the logical processor. So the OS is able to process two threads at the same time without messing up. When a current task is not using the execution resources and the HTT and when the processor is stalled (because of data dependency, cache miss or branch mis-prediction), those resources can be used by the HT processor in execution of some other task scheduled earlier.
  6. Support for SMP: SMP stands for symmetric multiprocessing which is mandatory for taking full advantage of the hyper – threading processing.
  7. Transparency: There is a lot of transparency between the OS, its programs and this technology.
  8. Easy optimization: HTT allows easy optimization of the behavior of the OS on HTT capable systems running on multiprocessors.
  9. Provides support for multi–threaded code thus improving both the response time and reaction.
  10. Application – dependent performance: It works well in improving the performance of most of the MPI applications. The improvement in the performance depends largely on the nature of the running application and its cluster configuration. The performance gain can also be negative. Using performance tools would be beneficial for understanding the factors contributing to performance gain and degradation.
  11. Security: A timing attack can be used by some malicious thread for monitoring the other thread’s memory access patterns. This is nothing but the stealing of the cryptographic info. This can be avoided by changing the cache eviction strategy of the processor. 
The hyper – threading technology has been criticized heavily for being energy inefficient. It has been stated by ARM that power consumption in SMT is more than in the dual – core designs by a margin of 46%. It was also claimed that cash thrashing is also increased by a margin of 42% in SMT when compared to a 37% decrease in the case of dual core processors. However, on the other side, Intel has claimed the HTT to be highly efficient since it puts the ideal resources to use. 


Friday, March 22, 2013

What is an Artificial Neural Network (ANN)?


- The artificial neural network or ANN (sometimes also called as just neural network) is a mathematical model that has got its inspiration from the biological neural networks. 
- This network is supposed to consist of several artificial neurons that are interconnected. 
- This model works with a connectionist approach for computing and thus processes information based up on this only. 
- In a number of cases, the neural network can act as an adaptive system that has the ability of making changes in its structure while it is in some learning phase. 
- These networks are particularly used in searching patterns in data and for modeling the complex relationships that exist between the outputs and inputs. 
An analogy to artificial neural network is the neuron network of the human brain. 
- In an ANN, the artificial nodes are termed as the neurons or sometimes as neurodes or units or the ‘processing elements’. 
They are interconnected in such a way that they resemble a biological neural network. 
- Till now, no formal definition has been given for the artificial neural networks. - These processing elements or the neurons show a complex global behavior. 
The connections between the neurons and their parameters is what that determines this behavior.
- There are certain algorithms that are designed for altering the strength of these connections in order to produce the desired flow of the signal. 
- The ANN operates up on these algorithms. 
- As in biological neural networks, in ANN also functions are performed in parallel and collectively by the processing units.
- Here, there is no delineation of the tasks that might be assigned to different units. 
- These neural networks are employed in various fields such as:
  1. Statistics
  2. Cognitive psychology
  3. Artificial intelligence
- There are other neural network models that emulate biological CNS and are part of the following:
  1. Computational neuroscience
  2. Theoretical neuroscience
- The modern software implementation of the ANNs prefers a more practical approach than biologically inspired approach. 
- This practical approach is based up on the signal processing and statistics. The former approach has been largely abandoned. 
- Many times parts of these neural networks serve as components for the other larger systems that are a combination of non – adaptive and adaptive elements.
- Even though a more practical approach for solving the real world problems is the latter one, the former has more to do with the connectionist models of the traditional artificial intelligence. 
- Well the common thing between them is the principle of distributed, non – linear, local and parallel processing and adaptation. 
- A paradigm shift was marked by the use of neural networks during the late eighties. 
- This shift was from the high level artificial intelligence (expert systems) to low level machine learning (dynamical system). 
- These models are very simple and define functions such as:
f: X à Y
- Three types of parameters are used for defining an artificial neural network:
a)   The interconnection pattern between neuron layers
b)   The learning process
c)   The activation function
- The second parameter updates the weights of the connections and the third one converts the weighted input in to output. 
- Learning is the thing that has attracted many towards it. 
- There are 3 major learning paradigms that are offered by ANN:
  1. Supervised learning
  2. Un – supervised learning
  3. Reinforcement learning
- Training a network requires selecting from a set of models that would best minimize the cost.
- A number of algorithms are available for training purpose where gradient descent is employed by most of the algorithms.
- Other methods available are simulated annealing, evolutionary methods and so on.


Saturday, January 19, 2013

What is meant by Statistical Usage Testing?


Statistical usage testing is the testing process that is aimed at the fitness of the software system or application.
The test cases chosen for carrying out statistical usage testing mostly consist of the usage scenarios and so the testing has been named as statistical usage testing. Software quality is ensured by the extensive testing but that has to be quite efficient. Testing expenditures covers about 20 – 25 percent of the overall cost of the software project. In order to reduce the testing efforts, deploy the available testing tools since they can create automated tests. But usually what happens is that the important tests require manual intervention with the tester requiring thinking about the usage as well behavior of the software. This is just the repetition of the tasks that were done during the requirements analysis phase.

About Statistical Usage Testing

- A usage model forms the basis for the creation of tests in statistical usage testing.
- Usage model is actually a directed usage graph more like a state machine and it consists of various states and transitions. 
- Every transition state has a probability associated with it regarding the traversal of the transition when the system would be in a state that marks the beginning of the transition arc. 
- Therefore, the sum of the probabilities of outgoing transitions sum up to unity for every state.
- Every transition can be associated with an event and more with parameters that are known to trigger the particular transition. 
- Such event associated transitions can be further related to certain conditions called the guard conditions. 
- These conditions imply that the transition occurs only if the value of the event parameter satisfies the condition.
- For assigning probabilities to the transitions, 3 approaches have been defined as follows:
  1. Uninformed approach: In this approach, same probability is assigned to the exit arcs of a state.
  2. Informed approach: In this approach, a sample of user event sequences for calculating suitable properties. The sample is captured from either an earlier version of the software or its prototype.
  3. Intended approach: This approach is used for shifting the focus of the test to certain state transitions and for modeling the hypothetical users.
- According to a property termed as the marcov property, the actual state is what on which the transition probabilities are dependent. 
- However, they are independent of the history again by the property. 
- This implies that the probabilities must be fixed numbers. 
- A system based up on this property is termed as a marcov chain and it requires conclusion of some analytical descriptions. 
- Usage distribution is one among such descriptions. 
- It gives for every state its steady–state probability i.e., appearance rate that is expected.
- All the states are associated to one or the other part of the software system or application and the part of the software that attracts more attention from the tests is shown by the usage distribution. 
- Some other important descriptions are:
  1. Expected test case length
  2. Number of test cases required for the verification of the desired reliability of the software system or application.
- The idea of the usage model generation can be extended by handling guard conditions and enabling the non–deterministic behavior of the system depending on the state of the system’s data. 
- All this helps towards the application of the statistical usage testing to systems over a wide range. 
- The use cases are defined by the top–level structure of the unified modeling language (UML). 


Friday, August 17, 2012

How does Winrunner identify GUI Objects?


We all are familiar with the functional testing tool that has been developed by the mercury interactive known by the name of winrunner. In this article we are going to discuss one of the important aspects of the winrunner i.e., how the GUI objects are identified by the winrunner. 

How does WinRunner identify GUI objects?

- The software testing conducted by the winrunner is based up on the identification of the graphical user interfaces objects present in the software system or application under testing.
- The identification of the GUI objects takes place in the context sensitive recording mode. 
- In such recording, the application can be tested by the point of view of the user i.e., in the terms of the graphical user interface objects like buttons, windows, menus, lists and so on. 
- Each of these GUI objects have their own individual properties that are known to define their appearance as well as behavior.
- These properties are learnt by the GUI and are used in identification and location of the GUI objects while a test is in execution. 
- In this mode there is no need for the winrunner to know the physical location of a GUI object for its identification. 
- There is a tool called GUI spy which you can install on your system and properties of any of the GUI objects present in your software system or application that is to be tested can be known very quickly and easily. 
- All the information recorded by the winrunner regarding the behavior of the GUI objects is stored in the GUI map.
- While a test is in execution, this GUI map provides a lot of help in locating a particular object. 
- Actually, the information or the object description is read by the winrunner from the GUI map and then it searches for an object with same properties in the software system or application that is being tested.
- The tester can even have a view of the GUI map in order to know the scenario of the GUI objects that are present in their software system or application.
- The GUI map is actually many small GUI map files added together. 
Two modes have defined for the organization of the GUI map files:
  1. Default mode: A GUI map file is created for the whole application software or separately for each window in the application software. A common GUI map file can be referred by multiple tests. This mode holds good for the users who are quite experienced with the winrunner.
  2. Global GUI map file mode: In this mode the GUI map files are automatically created by the winrunner for every test that is created by the user. This mode holds good for the users who are new to the winrunner since it is quite simple.
- In many cases what happens is that the interface of the software system or application under testing changes  but this is not a reason to worry since the winrunner provides solution for this also. 
- The tests that you created for the previous interface can be used for the next interface also. 
- You just need to delete, add or edit the object descriptions in the GUI map so that the same can be located by the winrunner in the modified software system or application. 
- The tests are created by the scripts that have been either recorded or programmed. 
- These test scripts are constituted of the TSL (test script language by mercury) statements. 
- A logical name is given by the winrunner for every object to help in the identification process which is actually a nick name or an alias for the description of the GUI object. 


Wednesday, August 8, 2012

How will you synchronize tests using WinRunner? When should you synchronize? What are Synchronize settings?


Whenever a data driven test is created the fixed values of the test script language or TSL statements are parameterized. Contrary to all this there are no fixed values in the synchronization points.
Instead they consist of the following:
  1. A bit map check point statement/ bit map synchronization point statement: It contains a reference to the stored bitmap.
  2. A GUI check point statement: It contains a reference to a stored check list and expected results.
You should always remember this point that it is always better to create a single property check rather than creating a GUI check point while checking the properties of the GUI objects during a data driven test. This is recommended since a single property check does not consist of a check list and hence it is quite easy to parameterize. 
In this article we answer the following three important questions regarding synchronization in winrunner:
  1. How will you synchronize the tests using the winrunner?
  2. When should you synchronize?
  3. Synchronization settings

How to synchronize?

- First step in the synchronization of the tests is the creation of an initial test by either programming or by recording. 
- Next step, will be to use the data driver wizard. 
- Go to the table menu and select the option data driver wizard. 
- The purpose of the data driver wizard is to convert your test scripts in to a data driven test and to parameterize the data values. 
- The third step will involve the creation of column in the data table for all the synchronization points and check points whose values are to be parameterized. - Then you should enter dummy values in every row and column but all the dummy values should be unique from each other. 
- Fourth step is to open up the assign parameter dialogue box from the table menu. 
- Then you should change the expected values of the synchronization points and check points to be used from the data table. 
- Now fifth and the final step involves running your tests in update mode by selecting update mode from the run mode box. 
- Give the run command to run your tests and while the test is running the winrunner will be reading the expected values from the data table. 
- But since you have changed the expected values, Winrunner will not be able to find these and thus will recapture the values from the application software and save them as the expected values. 
- Later, you can run the same tests in verify mode for verification of the behaviour of your software system or application.

When should we synchronize the tests?

- Whenever you feel that there your software system or application is showing some inconsistencies in its performance or behaviour, you can synchronize the tests as it will compensate for these inconsistencies in your application during a test run. 
- When you introduce a synchronization point in the test scripts you are instructing your winrunner to suspend the current test run and continue the test after getting a cue.

Synchronization Settings

- Winrunner offers many testing options like delay_msec, min_diff and timeout_msec. 
- These testing options can be modified using appropriate synchronization settings.
- These testing options can be set globally by using the below mentioned corresponding options:
  1. Time out for check points and CS statements
  2. Delay for window synchronization and
  3. Threshold for difference between bitmaps
- You can get these options by going to the general options dialogue box, the selecting run, then settings, then run and then selecting synchronization categories. 


Friday, August 3, 2012

What is a Load Test Results Summary Report?


Load testing is one of the most important testing that is carried out under performance testing and involves putting demands or load on the software system or application in order to measure its response and also the quality of response. 


About Load Testing

1.Load testing forms a very convenient means for determining the behavior of the software system or application under question and under both normal as well as peak conditions. 
2.Load testing helps a lot regarding the identification of the maximum operating capacity of the software system or application plus the identification of elements which are causing degradation of the software system.
3.Load testing becomes stress testing when the load is raised above the normal usage patterns. 
4.The load is raised to such limits where the probability of expecting the errors is quite high.
5.There exists no boundary between the transition of the load testing in to stress testing. 
6.The goals of the load testing are still not so specific.
7.Load testing is actually categorized under non functional testing. 
8.Load testing involves the practice in which the expected usage of the software system or application is modeled by simulating the multiple users using the application concurrently.


About Load Test Result Summary Report

1. A good load testing report says much about the software system or application.
2. A good report is always presentable to the customer as well as the manager.
3. A load test results summary report is simply a cut short and modified version of the original load testing reports. 
4. The original load testing reports are quite lengthy and difficult to understand for a customer. Therefore, a summary of this report is prepared which is short enough and simple to understand. 
5. You cannot expect your customer to go through the whole bulky report rather you need to provide them with a glimpse of everything. 
6. A load test results summary report serves all these purposes. 


Elements of Load Test Summary Report


1. Load test goals: 
A load test differs from functional tests in the way that a load test cannot fail or pass without the inclusion of any extra conditions. We mean to say that you cannot test a software system or application stands a load in general rather you test it against some specific load having specific performance parameters.

2. Technical description of the test goals: 
Once you know what your goals are, the requirements need to be formalized and transformed in to a technical description that you can apply to the load testing tool. You need to define aspects like:
a)   Type of load to be given to the software system or application,
b)   Number of virtual users to be employed in every test phase.
c)   Acceptable response time and so on.

     3. Realistic emulation of the virtual users: 
    Most important element of the load test results summary report.  This section lays down the division of the all potential real users of the software system or application in to a number of different types based on their expected behavior. The special script developed for every user is also mentioned alongside. In addition to this the user sessions are also mentioned.

     4. Execution of the test: 
     It mentions what all tests were executed and with what load. 
   
     5. Analyzation of the test results:  
    It includes the result of the test whether pass or fail and valuable information obtained from the tests. It also mentions the following:
    a)   Number of errors
    b)   Response times 
    c)   Number of sessions or requests per second and so on.

    6. Problems and improvement suggestions. 


Saturday, July 28, 2012

What is virtual user script? Why do you need to parametrize fields in your virtual user script?


Nowadays, the concept of the virtual user is quite common in the field of load testing. 

What is a Virtual User?


- Virtual user is one of the quite useful tools have been ever invented in the field of software engineering. 
- Virtual users can be used in a number of ways for testing load, stress or capacity of any software system or application you want. 
- It will be the easiest to define a virtual user as a virtualized representation of a real world user which has been specifically designed for simulating the same interactions and behaviors with the software system or application or web site to be tested in a way that a real world user would do exactly. 

Let us take an example, suppose at a peak your web site got 100 users over a particular hour. It becomes quite easy for you to simulate the same behavior using 100 virtual users making use of the scripts that invoke quite similar interaction and the navigation exactly as your real users do. Today such virtual users are also available that can playback the recorded scripts. 

In this article we discuss about what a virtual user script is and what is the need for parameterizing the fields in a virtual user script.  

What is a Virtual User Script & Need to Parametrize fields?


The fact that almost all of the scripts of the virtual user are automated is quite common. 
- For each and every automated script a particular entry point is marked by the script statement in virtual user. 
- From this point, the actions of the automated scripts are much similar to that of the real world users. 
- At any point these virtual user scripts can be made to click on any of the buttons or the windows, type some words, and move the mouse around and so on.
- Not only scripts, there are certain functions that are supported well by the virtual user and these functions can act as an extension to the virtual user scripts. 
- These functions have been given a general name called “tasks”. 
- These tasks consist of a procedure along with a list of parameters and in some cases they may also include an optional return value. 
- The information regarding the environment of the target computer is also collected by the virtual user with help of a statement called the match statement. 
A specific environment element is searched by this match statement with the help of some descriptor traits like the following:
  1. Static text
  2. Edit text
  3. Pictures
  4. Icons
  5. User items and so on.
- There is one more kind of statement that is used and is called the collect statement.
- It is used to collect all elements of a certain type in to the list.
- Afterwards the virtual user interacts with the software system or application environment using certain keywords like:
  1. Select
  2. Drag
  3. Type
  4. Close
  5. Click and so on.
- Common objects of the operating system like windows, buttons, bars, menus and scrolls are accessed by the virtual users. 
- The virtual user software package comes with a log file feature using which one can write out all the information from within a script. 
- This feature also provides the scripter with information regarding the current run time state of the virtual user scripts. 
- These virtual user scripts can also be debugged whenever required by logging with the printh statement. 
Another fact about virtual user is that there exists no type checking which serves as a very good idea to log the parameters that serve as input to every task.




Facebook activity