Subscribe by Email


Showing posts with label Invalid. Show all posts
Showing posts with label Invalid. Show all posts

Tuesday, May 28, 2013

Concept of page fault in memory management

Page fault is also known as the pf or #pf and can be thought of as a trap that the hardware raises for the software whenever the program tries to access a page that has been mapped to an address space in the virtual memory but has not been loaded in the main memory. 

In most cases, the page fault is handled by the operating system by helping in accessing the required page at an address space in the main or the physical memory or sometimes by terminating the program if it makes an illegal attempt to the access the page.

- Memory management unit is the hardware that is responsible for detecting the page faults and is located in the processor. 
- The software that helps the memory management unit in handling the page faults is the exception handling software and is seen as a part of the OS. 
- ‘Page fault’ is not always an error.
- These are often seen as a necessary role player in increasing the memory. 
- This can be made available to the software applications that makes use of the virtual memory of  the operating system for execution.
- Hard fault is the term used by the Microsoft instead of page fault in the resource monitor’s latest versions.

Classification of Page Faults

Page faults can be classified in to three categories namely:

1. Minor: 
- This type of fault is also called the soft page fault and is said to occur when the loading of the page in to the memory takes place at the time of the fault generation, but the memory management unit does not mark it as being loaded in the physical memory. 
- A page fault handler is included in the operating system whose duty is to make an entry for the page that is pointed to by the memory management unit. 
- After making the entry for it, its task is to give an indication that the page has been loaded. 
- However, it is not necessary that the page must be read in to the memory. 
This is possible if the different programs share the memory and the page has been loaded in to the memory for the various applications. 
- In the operating systems that apply the technique of secondary page caching, the page can be removed from the working set of the process but not deleted or written to the disk.

2. Major: 
- Major fault is actually a fault that many operating systems use for increasing the memory for the program that must be available as demanded by the program. 
- The loading of the parts of the program is delayed by the operating system from the disk until an attempt is made by the program for using it and generating the page fault.
- In this case either a non – free page or a page in the memory has to be found by the page fault handler. 
- When the page is available, the data from it can be read by the operating system to the new page in the main memory, thus easily making an entry for the required page.

3. Invalid: 
- This type of fault occurs whenever a reference is made to an address that does not exists in the virtual address space and therefore it has no page corresponding to it in the memory. 
- Then the code by which the reference was made has to be terminated by the page fault handler and give an indication regarding the invalid reference. 


Saturday, July 14, 2012

What are characteristics of fuzz technique? What are uses of fuzz technique?


Fuzz testing or fuzzing as it is commonly known as, is another type of very popular mixed software testing methodology i.e., it can be either implemented as a black box testing technique or white box testing technique or even as grey box testing technique, though the latter case being very rare. 
- It also provides the options for running it manually or by some semi automated or fully automated processes. 
- Unexpected, invalid or random data is what all is fed as input data values to the test cases created for the fuzz testing of a software system or application. 
- After the arrangement of the test input data values for the test cases, the whole software system or application is subjected to an inspection to determine if at all it is experiencing any problems like crashes, memory leaks or failure of the code assertions that are nothing but built in defects in the software system or application. 
- Fuzz testing or fuzzing is actually a testing methodology that is categorized under the category of the security testing and is often used for security checks of a software system or application. 

Fuzz testing if further divided results in to two sub categories as described below:
1. Generation based fuzz testing: 
This type involves creation of entirely new set of input data based on the model input data and
2. Mutation based fuzz testing: 
This type is concerned with the generation of new set of data by mutating the existing samples.

Fuzz testing lays more emphasis more on the network protocols and the file formats of the software system or application than the other aspects of the system. But this does not hold necessary that only the network protocols and file formats should undergo fuzz testing, other aspects of the input data for the system can also be subjected to the fuzz testing. Common input for the fuzz testing basically includes:
  1. Key board events
  2. Mouse events
  3. Environment variables and
  4. API calls sequence.
The unusual input forms are:
Such as those being mentioned below can also be subjected to fuzz testing:
  1. Shared memory
  2. Contents of the data base of the software system or application and
  3. Inter leaving of threads (precise)
The input data which manages to cross the trust boundary of the software system or application catches the attention of the testers more than any other happening during the testing. The origination of the fuzz testing is traced back to the University of Wisconsin and discovered by the professor Barton Miller. 

Uses of Fuzz Testing


The fuzz testing has emerged as a software testing technique with more than one uses:
  1. For the testing of large projects having a budget just enough for the development of the test tools it can be employed as black box testing technique.
  2. It is a very feasible and affordable software testing technique and has a high benefit- to - cost ratio.
  3. The fuzz testing proves helpful in providing a sample stating the behavior of the software system or application generated in a random manner.
  4. It very effectively demonstrates the exception handling capability of a piece of the source code of the program without crashing.
  5. Fuzz testing gives an assurance for the maintenance of the overall quality of the software system or application rather than just acting as a testing tool for finding bugs.
  6. Fuzz testing can also be used as a substitute for the formal methods employed for exhaustive testing of the software system.
  7. One can rely on fuzz testing for determining the reliability of the software system as an application of static analysis, code audits or partial rewrites.


Tuesday, April 17, 2012

Explain the concepts of syntax test technique?

Very few people are familiar with the term syntax test technique. We shall discuss about this testing technique but after a brief discussion about the syntax of the programming languages.

Every real world language in this world has got certain rules following which the meaningful statements and sentences can be drafted from the raw words. These rules are collectively known as the syntax of the language. Similarly syntax also exists for the computer programming languages.

About Syntax and Syntax Test Technique



- Each programming language has got its own unique syntax.

- The syntax is known to define the surface of a language.

- Type of syntax of a language depends on the type of the programming i.e., whether it is a text based language or a visual based language.

- Syntax forms a part of the semantics.

- The syntax test technique involves the process of parsing i.e., the linear sequence of the tokens is transformed in to a hierarchical syntax tree.

- Parsing is also an effort and time consuming process but, nowadays several automated tools are available for this purpose also and are quite effective in generating parses.

- These parses are generated using the language grammar specifications as stated in the Backus- Naur form.

- Backus- Naur forms as well as regular expressions of the lexicon together comprise the syntax of the textual programming languages.

- There are other rules called productions which are used to classify the syntax in to different categories.

- The syntax just describes whether or not the program is valid.

- It is the semantics which describe the meaning of the program.

- It is not necessary that a syntactically correct code of the program should be semantically correct also.

Steps of Syntax Test Technique


A typical syntax testing technique consists of the following steps:

1. Identification of the format of the target language.

2. Definition of the syntax of the target language in to formal notation like Backus- Naur form.

3. Testing the syntax under normal conditions by keeping the Backus- Naur form of the language under adequate coverage. This is the minimal requirement for carrying out a syntax test.

4. Testing of the garbage conditions i.e., testing the software system against the invalid input test data. This condition has a high pay off and automation is highly recommended.

5. Debugging of the whole software program.

6. Automation of the test execution process. This is necessary since a lot of test cases are required for the effective syntax testing.

7. For carrying out the whole process, 3 most frequent wrong actions have been identified as shown below:

(a) The recognizer could not identify the string which was good.
(b) The recognizer accepted a bed string.
(c) The recognizer crashed or hanged during the process of the recognition of the good and bad strings.
(d) Any incorrectness in the Backus- Naur specifications can spoil a good string and turn it in to a bad one.

8. There should be a proper testing strategy since all the strings cannot be tested.

9. Only one error should be generated and tested each time.

10. First, all the single errors should be tested using specifically created test cases, then the double errors and lastly the triple errors are tested.

11. Your focus should be on one level at a time.

Dangers related to Syntax Testing


Certain dangers have also been identified related to the syntax testing:

(a) It is quite common for the testers to forget the normal cases.

(b) While testing, testers often go overboard with the testing combinations.

(c) Syntax testing is often taken very lightly since it is pretty easy when compared to the structural testing.

(d) A lack of knowledge about the program can make you to execute many test cases. So its better to have a thorough study of the program before you test it.


Sunday, March 18, 2012

Explain the concepts of fuzz test technique?

WHAT IS FUZZ TESTING?

- Fuzz testing is the formal name for fuzzing which as we know is another software testing technique that involves playing with the software system or application using all types of possible invalid input test data.

- By the invalid input test data we mean it can be either unexpected data or random data i.e., any other type of test data other than the specified input data type.

- It is not necessary that the fuzz testing should always be automated; it can also be semi automatic though keeping the whole process fully automated consumes less time and effort.

- Semi automatic process is used only when there is manual interference required in the testing.

- After feeding the invalid input data to the software system or application, the behavior of the system is monitored for any exceptions like hanging, crashing or failing of the code assertions that are built in and also check for any memory leaks.

From the above discussions we can easily make out that the fuzz testing has been developed for testing of the security related issues of the software system or application. Till now two types of fuzz testing have been identified namely:

1. Mutation based testing
2. Generation based testing

CONCEPTS OF FUZZ TESTING

- Fuzz testing was developed to complement the negative testing and syntax testing.

- Both of the above types of the fuzz testing can be either employed as white box testing technique or black box testing technique or as a mix of the two techniques i.e., grey box testing.

- Whatever technique may be used, it is focussed up on the common target i.e., network protocols, file formats and so on.

- Though these two are the usually targeted elements, almost any type of input test data for the program can be subjected to the fuzz testing.

- The most common types of input data include:
1. Sequence of API calls
2. Environment variables
3. Mouse events
4. Keyboard events etc.

- Apart from just testing the input test data types, even some elements like shared memory, contents of a data base, interleaving of threads etc can also be tested by the fuzz test.

- But, usually the input that is able to cross the trust boundary of the security of the software system or application is targeted.

- Among all other approaches to fuzz testing, the one which is mostly preferred is the black box approach.

- This approach is mostly employed for the testing of large software projects having a budget for the development of the testing tools.

- Fuzz testing is included in the class of the software testing techniques that offer a high benefit – to – cost ratio.

- Like other software testing techniques, fuzz testing also has a drawback which is that it is able to develop only a sample of the behavior of the software system.

- In some rare cases, if the software passes the fuzz test, it merely indicates that only a part of the software system can effectively handle the unexpected input data types without any problem.

- This tells us that fuzz testing can be considered as an overall quality assurance factor and not merely just a bug finding tool.

- Fuzz testing is also not to be taken as a substitute neither for the formal methods nor for the exhaustive testing.

- It also gives us a gross measurement of the reliability of the software.

- Based on the results of the fuzz testing, it can be decided that which part needs a partial rewrite, static analysis or code audits.


Thursday, March 8, 2012

What is meant by negative testing?

Negative testing is one of the most sought after software testing methodology. Negative testing is the counterpart of positive testing.

Facts about Negative Testing

- Negative testing is really very helpful when it comes to handling the invalid input test data and abnormal behavior of the software system or application.

- The purpose of the negative testing is to prevent such situations in which the invalid data might be taken by the system and which in turn may disrupt the functioning of the whole software system or application.

- For example, when a user tries to enter numerical data in the alphabetic field, the software system displays a message like “incorrect data type”.

- Such response from the software system or application is required since it avoids the crashing or hanging of the whole system by preventing input of invalid data.

- Not only this, the negative testing helps one improve the quality of the software system or application by knocking out its weak points.

- In positive testing, giving some invalid data as input to the system is considered to be an exception but this is not so in the case of negative testing.

- In negative testing, giving some exceptional input to the software system or application is treated just like a normal event.

- Negative testing is all about testing the exceptions.

- Usually for a better software testing results, both the negative testing as well as positive testing are combined together and implemented.

- Using such a testing methodology provides greater test coverage rather than using just one of the either mentioned software testing methodologies.

Situations which are typically tested by the negative testing:

1. Filling up fields by user
- Most of the web sites as well as web applications require the user to fill up all the fields that are marked compulsory.
- To test this functionality, leave all the marked fields blank and hit the submit button and observe the response of the site or the application.
- The expected outcome here can be a message asking you to fill up all the compulsory fields.

2.Checking correspondence between field and data type
- Negative testing also checks the correspondence between the field and data types.
- For example, the different fields in a form can accept the specified type of data. - To test this, you can enter various sorts of invalid data types in to those fields and check the behavior of the application.

3. Checks allowed limits and data bounds
- It also checks for the allowed limits and allowed data bounds.
- Fields in a form can accept data only within a specified data range and not above or below that.
- This can be tested in two ways. You can either enter value that is less than the lower range of the data or you can enter value that is above the specified range.
- Another example can be of text box which accepts only a finite number of characters.
- You can test it by inputting less or more number of characters.

4. Checking reason ability of input data. - Negative testing is also an effective tool for checking the reasonability of the input data.
- The age fields in some web forms etc do not allow any negative integers and also no floating point value.
- This can be tested by simply putting in the wrong data types like a negative integer.

5. Tests the web sessions
- Negative testing can also be used to test the web sessions either for timing or for log-in purposes.
- There are some web pages for viewing which you first have to log in.
- This can be tested by trying to open that web page without logging in.

Negative testing is pretty easy to be carried out manually, but still you can find many automation tools for it.


Thursday, March 1, 2012

What are different boundary related defects?

Like there is a separate testing methodology for each aspect of a software system, there is a testing technique called “boundary value analysis” for testing the boundary values of a software system or application.

WHAT IS BOUNDARY VALUE ANALYSIS?
- Boundary value analysis consists of test cases which include the boundary value representatives of the software program.
- Boundary values are the values which lie on the maximum and minimum edges of an equivalence partition.
- These maximum and minimum values can be either input values or output values of the software program.
- These boundary values of the software are the main seat for the defects or errors that are responsible for the faults in the software.
- This property of the boundary values finds them useful in the test cases.
- These input and output values are taken from the specifications of the component.
- The values contained in each of the sets are processed by the software system or application exactly in the same way.
- While creating the test cases for the boundary value analysis it is very important to keep in mind both the invalid and valid partitions even though there is no need for invalid partitions.
- Whenever an invalid partition is encountered by the application, the test case is designed as such that it helps the application control the partition in a proper way instead of faltering.
- The boundary is located exactly between any two set partitions and the behavior of the software system or application.
- The value at a boundary can either be maximum or minimum.
- The values at the boundaries are absolute and cannot be exceeded.
- In order to make correct assumptions about the software system or application you need to understand the boundary limits correctly.
- Apart from boundaries there are threshold values and these values cannot be exceeded unless modified.
- The threshold values can be modified to suit your needs.
- But you should keep in mind that hanging the threshold values can affect the performance of your input data.
- The boundary values are generated and verified through observation and testing. - While testing the workload is increased till the software system starts giving its maximum efficient performance.
- Some of the components of a system have capability to handle more loads than the other components.
- In such a case the average value of the load should be calculated and assigned to the software system or application.
- High latency is showed by some of the features and functionalities as compared to the others which operate under acceptable values.
- In such a case the maximum value is calculated on the basis of the usage of the features and functionality such that the overall performance of the software system or application remains unaffected and acceptable.
- If some of the components are operating on the limits exceeding those limits that were used during the testing, the acceptable limits of the other components will be affected.

Therefore, it is important to implement a good capacity management so that effective limits are established. We are now clearly stating some boundary related defects:


1. Numeric boundaries
2. Boundary on numerosity
3. Boundary within the data structures
4. Equality as a boundary
5. Boundary on space
6. Boundary in loops
7. Boundary in time
8. Errors in calculations
9. Out- dated constants
10.Invisible boundaries
11.Hardware related boundaries


Monday, January 11, 2010

Overview of Demand Paging

Demand paging follows that pages should only be brought into memory if the executing process demands them. This is often referred to as lazy evaluation as only those pages demanded by the process are swapped from secondary storage to main memory. Contrast this to pure swapping, where all memory for a process is swapped from secondary storage to main memory during the process start-up.

In pure demand paging a page is never moved from the backing store into main memory until that page is referenced. It is the responsibility of the operating system to check where the page is in main memory and OS uses an internal table for this. Operating system reads that page after finding it, and in order to reflect change, the page table is updated. So by using this process it is possible to run a process even its entire memory image is not taken from backing store into main memory.
In this way demand paging is a better approach then paging and it also increases the degree of multiprogramming and allows a process to run even it exceed the physical space allocated for it.

An invalid page is one that currently resides in secondary memory. When a process tries to access a page, the following steps are generally followed:
- Attempt to access page.
- If page is valid (in memory) then continue processing instruction as normal.
- If page is invalid then a page-fault trap occurs.
- Check if the memory reference is a valid reference to a location on secondary memory. If not, the process is terminated (illegal memory access). Otherwise, we have to page in the required page.
- Schedule disk operation to read the desired page into main memory.
- Restart the instruction that was interrupted by the operating system trap.


Facebook activity