Subscribe by Email


Showing posts with label Systems. Show all posts
Showing posts with label Systems. Show all posts

Tuesday, June 25, 2013

Explain about demand paging and page replacements

These are two very important concepts of memory management strategies in the computer operating systems namely demand paging and paging replacements. 

About Demand Paging
- Demand paging is just the opposite concept of the anticipatory paging. 
Demand paging is actually a memory management strategy developed for managing the virtual memory.
- The operating system that makes use of demand paging technique, a copy of the disk page is made and kept in the physical memory whenever a request is made for it i.e., whenever a page fault occurs. 
- It is obvious that the execution of a process starts with none of its page loaded in to the main memory and follows by a number of page faults occurring one after the other until all of its required pages have been loaded in to the main memory. 
- Demand paging comes under the category of the lazy loading techniques. 
This strategy follows that only if the process in execution demands a page, then only it should be brought in to the main memory. 
- That’s why the strategy has been named as demand paging. Sometimes it is even called as the lazy evaluation. 
- Page table implementation is required for using the demand paging technique.
- The purpose of this table is to map the physical memory to the logical memory. 
- This table uses a bit wise operator for marking a page as valid or invalid. 

The following steps are carried out whenever a process demands for a page:
  1. An attempt is made for accessing the page.
  2. If page is present in the memory the usual instructions are followed.
  3. If page is not there i.e., is invalid then a page fault is generated.
  4. Memory reference to a location in the virtual memory is checked if it is valid or not. If it’s an illegal memory access then the process is terminated. If not the requested page has to be paged in.
  5. The disk operations are scheduled for reading the requested page in to the physical memory.
  6. Restarting the instruction that raised the page fault trap.
- The nature of this strategy is itself of great advantage. 
- Upon availability of more space in the physical memory, it allows execution of many processes leading to a decrease in the context switching time.
- At the time of program start up, less latency occurs during loading. 
- This is because the inflow and outflow of the data between main memory and secondary memory is very less.


About Page Replacement
- When less number of real memory frames is available, it leads to invoking a page stealer. 
- This stealer searches through the PFT (page frame table) for pages to steal. 
This table stores references to the pages which are required and modified. 
- If the requested page is found by the page stealer, it does not steal it but the reference flag is reset for that page. 
- So in the pass when the page stealer comes across this page, it steals this page. 
- Note that in this pass the page was flagged as un-referenced. 
- Any change made to the page is indicated by means of the modify flag.
- If the modify flag of the page to be stolen is set, then a page out call has to be made before the page stealer does its work. 
- Thus, the pages that form a part of the currently executing segments are written to so called paging space and the persisting segments are in turn written to the disk. 
- The page replacement is carried by the algorithms called the page replacement algorithms. 
- Besides this, these also keep a track of the faults. 


Monday, July 9, 2012

List out the technical details of mock object?


Mock objects are much in talk these days and seem to be marking themselves as one of the effective tools in carrying out unit testing. 

What are Mock Objects?


- Mock objects are simulated objects counterparts of the original or the non mock object that is intended to mimic the behaviour and working of the original non mock object in a way that is controlled and defined. 
- Classes with heavy code bases are such a pain to test and can be tested only by the mock objects. 
- Ever tried implementing unit tests in a project but failed to do so because of the dependency of the module and difficulty in its isolation?
- Within a budget and time constraint it becomes difficult for configuring and setting up all the external dependencies of the modules. 
- Mock objects are a feasible option for overcoming such problems. 
- Problem with most of the mock tools is that they do not come with documentation so it becomes difficult to work them out. 
- These technical details of mock objects are the center point of this article. 
- Since the mock objects simulate the real object, they are said to possess the same interface as that of the real objects that they are imitating. 
- Nowadays many mock object frame works are available using which the programmers and developers can specify which all methods are to be invoked by the mock object and in which order. 
- Also, the parameters that have to be passed to the mock object can be specified along with the values that will be returned by the mock object. 
- We have divided the technical details of the mock objects in to three categories:
1. Mocks, fakes and stubs
2. Setting expectations
3. Writing log strings

Mocks, fakes and stubs: 
- Some consider the mock objects and fakes to be different things saying that the fakes are much simpler than the mock objects. 
- The fakes are simply used to represent just the interface of the object which they are mimicking and responses that they return are pre-arranged. 
- Thus, we can say a set of method stubs is provided by the fake objects. 
- On the other hand, the mock objects are fake objects but they help in determining whether some other object passes or fails the test to which it is subjected. 
- It does so by the verification whether of the interaction if any took place on the object. 
Everything else apart from these two i.e., fake objects and mock objects is considered to be a stub. 
- Stub is anything unreal is fake and based up on its usage it can be classified as stubs and mocks. 
- Mock objects possess a little more functionality which is that their method implementations contain assertions that are truly theirs. 
- This furthermore implies that the context of each and every call is examined by the true mock object.
- The examination includes the checking of the order of calling of the methods and performing tests on the data that has been passed as arguments to the method calls.

Setting expectations: 
It is ensured by a mock setting that the calls to the system will cause the system to throw some exception like getting hanged or crashing.

Writing log strings: 
Mock methods can be used to make an entry to the public log strings which otherwise could result in invisible performance sapping bugs.


Monday, May 21, 2012

What is the use of a mock object in test driven development?


Over the years the idea of the mock object was materialized and today they are being used in numerous testing and development methodologies. Nowadays mock objects find their use in many testing methodologies like the unit testing and also in development processes such as the test driven development process. 
This article is focused up on the use of a mock object in the test driven development process. But, before moving further we shall give a brief discussion regarding the concepts of the mock object so that understanding the use of mock object in the test driven development becomes easy for you. 

Mock objects are known as the fake objects that in a way simulate the behaviour of an original or to say a non mock object whenever any of the following conditions are prevalent:
     
     1. If the non mock supplies non deterministic output.
     2. If the non mock object is difficult to be reproduced or recreated.
     3. If the non mock object is quite slow i.e., is using a complete data base.
     4. If the non mock object tends to change its behaviour.
     5. If the non mock object does not yet exists.
     6. If the non mock object demands information and methods exclusive to the testing purposes.

   

What are Mock Objects?


- Mock objects are nothing but fake objects but with a little more purpose of testing the other non mock objects with the method implementations having assertions of their own. 
- They are employed for the examination and verification of the context of each and every method call.
- Apart from this, they are also used to determine the order in which the methods are called and implemented using data that was passed as the arguments in the method calls.
Mock settings are an effective means for ensuring that an exception is generated by the software system or application when the subsequent calls to it are made like it may hang, fail or crash etc. 
With the mock settings, it has become possible to test the client behaviors against all the realistic faulty conditions as well as they can be developed also in the back end sub systems. 
- Without the use of mock objects it will be too difficult to test these conditions. 
- The mock system provides a simple and flexible way to test the realistic fault conditions since proper consideration is given to them.
- With the mock methods it has become easy to add entries to a public log string. 

Use of Mock Object in TDD


Now coming to the use of mock objects in the test driven development, mock objects are used in 
the test driven development during the writing of the software. 

- With the help of mock objects the programmers and developers are able to write and unit test functionality in a defined area by using the mock objects that provide all the interface requirements of the complex real objects rather than using the complex collaborating and underlying classes and objects. 
- With the help of mock objects the programmers are able to focus properly on the testing of the behavior of the SUT or system under test. 
- They don’t have worry about the objects on which it is dependent. 
- There are some practical speed issues also involved with the use of mock objects in the test driven development apart from the complexity issues.
- To develop a realistic piece of software employing the test driven development may require hundreds of unit tests. 
- If any communication is developed between these unit tests and the data bases, networked systems and web services, then it is possible that the suite of unit tests will become quite slow. 


Thursday, September 16, 2010

Types of Software Systems : Batch Systems, Event Control Systems, Process Control Systems, Advanced Mathematical Models, Message Processing Systems

The type of software system refers to the processing that will be performed by that system.
Batch systems:
These are a set of programs that perform activities which do not require any input from the user. For example, when you type something on word document, you press the key you require and the same gets printed on the monitor. This is performed by the batch systems. These systems contain on or more Application Programming Interface (API) which perform various tasks.

Event Control Systems:
These systems process real time data to provide the user with results for what command was given. For example, when something is typed on the word document and press Ctrl+S, it tells the computer to save the document. These real time command communications to the computer are provided by the event controls that are pre-defined in the system.

Process Control Systems:
There are two or more different systems that communicate to provide the end user a specific utility. When two systems communicate, the co-ordination or data transfer becomes vital. Process Control Systems are the one's that receive data from a different system and instructs the system which sends the data to perform specific tasks based on the reply sent by the system which received the data.

Advanced Mathematical Models:
Systems, which make use of heavy mathematics fall into the category of mathematical models. Usually, all the computer software make use of mathematics in some way or other. An example of advanced mathematical model is the simulation system which uses graphics and control the positioning of software on the monitor or decision and strategy making software.

Message Processing Systems:
A simple example of this type of system is SMS management system used by the mobile operator which handle incoming or outgoing messages. Another system which is noteworthy is the system used by the paging companies.


Tuesday, August 31, 2010

Features of Software Reliability Testing and what are reliability techniques.

Computer systems are an important part of our society. Reliability refers to the consistency of a measure. A test is considered reliable if we get the same result repeatedly. Software Reliability is the probability of failure-free software operation for a specified period of time in a specified environment. Software Reliability is also an important factor affecting system reliability.
A completely different approach is “reliability testing”, where the software is subjected to the same statistical distribution of inputs that is expected in operation.
Reliability testing will tend to uncover earlier those failures that are most likely in actual operation, thus directing efforts at fixing the most important faults.
The fault-finding effectiveness of reliability testing to deliver on its promise of better use of resources, it is necessary for the testing profile to be truly representative of operational use.
Reliability testing is attractive because it offers a basis for reliability assessment.
Reliability testing may be performed at several levels. Complex systems may be tested at component, circuit board, unit, assembly, subsystem and system levels.
A key aspect of reliability testing is to define "failure".

Software Reliability Techniques
- Trending reliability tracks the failure data produced by the software system to develop a reliability operational profile of the system over a specified time.
- Predictive reliability assigns probabilities to the operational profile of a software system.


Friday, April 9, 2010

Overview of LocalTalk Protocol

LocalTalk refers to the physical networking -- that means the built-in controller in many Apple computers, the cables and the expansion cards required on some systems. The "official" Apple cabling system typically uses a "bus topology" where each device in the network is directly connected to the next device in a daisy chain. The illustration on the Farallon book cover below gives an idea of how a bus looks.
Ethernet is the most-used method of Macintosh networking and all new Macs sport an Ethernet port, but the longevity of Macs mean there's still a bunch out there with serial ports (i.e., LocalTalk support) but no Ethernet. New iMacs and G4s lack serial ports, so can't network directly with older LocalTalk Macs and printers.

LocalTalk implementation utilized the Mac's RS-422 printer port with twisted-pair cabling and 3-pin DIN connectors. Systems were daisy-chained together and required adapters to work with the Mac's onboard DB-9 or 8-pin DIN connectors. LocalTalk provided a fairly speedy 230.4 kbps networking speed, very useable for file sizes and traffic levels of the day - compare this to the still used 56 kbps modem.

A variation of LocalTalk, called PhoneNet used standard unshielded twisted pair telephone wire with 6 position modular connectors (same as used in the popular RJ11 telephone connectors) connected to a PhoneNet transceiver, instead of the expensive shielded twisted-pair cable. In addition to being lower cost, PhoneNet-wired networks were more reliable due to the connections being more difficult to accidentally disconnect.
A LocalTalk-to-Ethernet Bridge is a network bridge that joins the physical layer of the AppleTalk networking used by previous generations of Apple Computer products to an Ethernet network. Some LocalTalk-to-Ethernet Bridges only performed Appletalk bridging. Others were also able to bridge other protocols. For example: TCP/IP in the form of MacIP.


Monday, February 15, 2010

Overview Of Distributed Systems

A distributed system is a collection of processors that do not share memory or clock. Each of the process has its own clock and memory and the processors communicate with each other through various communication lines. These processors are referred to by different names such as sites, machines, hosts, nodes, computers and so on.
A distributed system provides the user with access to various resources that the system maintains. A distributed system must provide various mechanisms for process synchronization and communication, for dealing with the deadlock problem, and other failures which are not encountered in a centralized system.

There are 4 reasons for building distributed systems :
- Resource sharing : If a number of different sites are connected to one another, then a user at one site may be able to use the resources available at another.
- Computation speedup : If a computation can be partitioned into sub computations that can run concurrently, availability of a distributed system may allow us to distribute the computation among various sites, to run the computation concurrently.
- Reliability : If one site fails in distributed system, the remaining sites can potentially continue operating. The failure of the site must be detected by the system and the appropriate action may be needed to recover from failure.
- Communication : Information can be exchanged when several sites are connected to one another by a communication network.

The advantage of a distributed system is that these functions can be carried over great distances.


Sunday, February 14, 2010

Hierarchical Storage Management (HSM)

Hierarchical Storage Management (HSM) is a data storage technique which automatically moves data between high-cost and low-cost storage media. HSM systems exist because high-speed storage devices, such as hard disk drive arrays, are more expensive (per byte stored) than slower devices, such as optical discs and magnetic tape drives. While it would be ideal to have all data available on high-speed devices all the time, this is prohibitively expensive for many organizations.

Instead, HSM systems store the bulk of the enterprise's data on slower devices, and then copy data to faster disk drives when needed. In effect, HSM turns the fast disk drives into caches for the slower mass storage devices. The HSM system monitors the way data is used and makes best guesses as to which data can safely be moved to slower devices and which data should stay on the fast devices.

A hierarchical storage system extends the storage hierarchy beyond primary memory and secondary storage to incorporate tertiary storage — usually implemented as a
jukebox of tapes or removable disks.
It usually incorporates tertiary storage by extending the file system.
* Small and frequently used files remain on disk.
* Large, old, inactive files are archived to the jukebox.
HSM is usually found in supercomputing centers and other large installations that have enormous volumes of data.


Tuesday, October 27, 2009

Overview to System Simulation Tools

System simulation tools provide the software engineer with the ability to predict the behavior of a real-time system prior to the time that it is built. In addition, these tools enable the software engineer to develop mock-ups of the real-time system, allowing the customer to gain insight into the function, operation, and response prior to actual implementation.
Tools in this category allow a team to define the elements of a computer-based system and then execute a variety of simulations to better understand the operating characteristics and overall performance of the system. Two broad categories of system simulation tools exist :
- General purpose tools that can model virtually any computer-based system.
- Special purpose tools that are designed to address a specific application domain.

REPRESENTATIVE TOOLS :
- CSIM : Developed by Lockheed Martin Advanced Technology labs, is a general purpose discrete-event simulator for block diagram-oriented systems.
- Simics : Developed by Virtutech, is a system simulation platform that can model and analyze both hardware and software-based systems.
- SIX : Developed by Wolverine Software, provides general purpose building blocks for modeling the performance of a wide variety of systems.


Introduction to System Simulation

Systems simulation is a set of techniques for using computers to imitate, or simulate, the operations of various kinds of real-world facilities or processes.The computer is used to generate a numerical model of reality for the purposes of describing complex interaction among components of a system. The complexity of the system surges from the stochastic (probabilistic) nature of the events, from the rules for the interactions of the elements, and the difficulty to perceive the behavior of the systems as a whole with the passing of time.

When to use simulations?
Systems that change with time, such as a gas station where cars come and go (called dynamic systems) and involve randomness.Modeling complex dynamic systems theoretically need too many simplifications and the emerging models may not be therefore valid. Simulation does not require that many simplifying assumptions, making it the only tool even in absence of randomness.

System terminology:
- State: A variable characterizing an attribute in the system.
- Event: An occurrence at a point in time which may change the state of the system.
- Entity: An object that passes through the system.
- Queue: It is a task list.
- Creating: Creating is causing an arrival of a new entity to the system at some point in time.
- Scheduling: Scheduling is the act of assigning a new future event to an existing entity.
- Random variable: A random variable is a quantity that is uncertain.
- Random variate: A random variate is an artificially generated random variable.
- Distribution: A distribution is the mathematical law which governs the probabilistic features of a random variable.


Sunday, October 25, 2009

Introduction to System Modeling

A model is a simplified representation of a system at some particular point in time or space intended to promote understanding of the real system. A system is understood to be an entity which maintains its existence through the interaction of its parts. A model is a simplified representation of the actual system intended to promote understanding. Whether a model is a good model or not depends on the extent to which it promotes understanding. Since all models are simplifications of reality there is always a trade-off as to what level of detail is included in the model. If too little detail is included in the model one runs the risk of missing relevant interactions and the resultant model does not promote understanding. If too much detail is included in the model the model may become overly complicated and actually preclude the development of understanding.

System modeling shows how the system should be working. To construct a system model, the system engineer should consider the following factors :
- Assumptions : It reduces the number of possible permutations and variations, thus enabling a model to reflect the problem in a reasonable manner.
- Simplifications : It enable the model to be created in a timely manner.
- Limitations : It helps to bound the system.
- Constraints : It will guide the manner in which the model is created and the approach taken when the model is implemented.
- Preferences : It indicates the preferred architecture for all data, functions, and technology. The preferred solution sometimes comes into conflict with other restraining factors.yet, customer satisfaction is often predicated on the degree to which the preferred approach is realized.


Sunday, May 25, 2008

TYPES OF SOFTWARE SYSTEMS

BATCH SYSTEMS : They are a set of programs that perform certain activities which do not require any kind of input from the user. Batch systems contain one or more API which perform various tasks.

Ex: When something is typed on a word document by pressing a key, same is displayed on the monitor. The process of conversion of user input of the key to machine language and then displaying what you have typed on monitor is performed by batch system.

EVENT CONTROL SYSTEMS : These systems process real time data to provide the user with results for the command that has been given.

Ex: When you press Ctrl + S, it tells the computer to save the document. This communication is provided by the event controls that are pre-defined in the system.

PROCESS CONTROL SYSTEMS : When two systems communicate, the co-ordination or data transfer becomes vital. Process control systems are the one’s that receive data from a system and instruct the sending system to perform specific tasks based on the reply sent by the receiving system.

PROCEDURE CONTROL SYSTEMS : These systems are one’s which control the functions of another system.

MESSAGE PROCESSING SYSTEMS : A simple example to explain these kind of systems is the SMS management software used by the mobile operator which handles the incoming and outgoing messages.

DIAGNOSTIC SOFTWARE SYSTEMS : These systems help in diagnosing the computer hardware components.
Ex: The “NEW HARDWARE FOUND” dialogue seen when you plug in a new device to the computer is an example of these kind of systems.

SENSOR & SIGNAL PROCESSING SYSTEMS : In these systems the computer receives input in form of signals and then transforms the signals to a user understandable output.


Facebook activity