On the Design and Development of Program Families

Slides:



Advertisements
Similar presentations
Programming Types of Testing.
Advertisements

Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Multiprocessing Memory Management
Informationsteknologi Friday, November 16, 2007Computer Architecture I - Class 121 Today’s class Operating System Machine Level.
Translation Buffers (TLB’s)
1 Lecture 9: Virtual Memory Operating System I Spring 2007.
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Copyright © 1998 Wanda Kunkle Computer Organization 1 Chapter 2.1 Introduction.
Computer Organization and Architecture
CSCI2413 Lecture 6 Operating Systems Memory Management 2 phones off (please)
On the Design and Development of Program Families Roy Mammen Jerry Cheng Sharan Mudgal Doug Paida.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Virtual Memory.
Chapter 3 Memory Management: Virtual Memory
On the Development of Program Families D. L. Parnas Presentation by Sagnik Bhattacharya Siddharth Dalal.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Cohesion and Coupling CS 4311
CE Operating Systems Lecture 3 Overview of OS functions and structure.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
1 Lecture 8: Virtual Memory Operating System Fall 2006.
Project 4 Awards First Place Group 7 Samuel Bartlett Michael Phillips Norman Chen.
Computer System Structures
Virtual Memory.
Processes and threads.
CE 454 Computer Architecture
Chapter 2 Memory and process management
CSE 120 Principles of Operating
The Development Process of Web Applications
Paging COMP 755.
ITEC 202 Operating Systems
Chapter 9: Virtual Memory
COMBINED PAGING AND SEGMENTATION
External Sorting Chapter 13
Some Real Problem What if a program needs more memory than the machine has? even if individual programs fit in memory, how can we run multiple programs?
William Stallings Computer Organization and Architecture
Swapping Segmented paging allows us to have non-contiguous allocations
Object oriented system development life cycle
Storage Virtualization
Lecture 10: Virtual Memory
Programmable Logic Controllers (PLCs) An Overview.
Chapter 11: File System Implementation
Evolution in Memory Management Techniques
Chapter 9: Virtual-Memory Management
Machine Independent Features
Chapter 2: System Structures
Objective of This Course
External Sorting Chapter 13
Process Description and Control
A Simulator to Study Virtual Memory Manager Behavior
CSE 451: Operating Systems Autumn 2005 Memory Management
Translation Buffers (TLB’s)
Outline Chapter 2 (cont) OS Design OS structure
Chapter 29: Program Security
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Translation Buffers (TLB’s)
Regression Testing.
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CENG 351 Data Management and File Structures
System calls….. C-program->POSIX call
Translation Buffers (TLBs)
Operating Systems Concepts
COMP755 Advanced Operating Systems
Operating Systems: Internals and Design Principles, 6/E
Cache writes and examples
External Sorting Chapter 13
Review What are the advantages/disadvantages of pages versus segments?
CSE 542: Operating Systems
Presentation transcript:

On the Design and Development of Program Families Roy Mammen Jerry Cheng Sharan Mudgal Doug Paida

Overview What is a “program family”? Classical method Newer techniques Comparison of classical method to the newer techniques Conclusions

What is a “program family”? Set of programs with so much in common that it pays to study their common properties first, before analyzing the individual members. A typical example is the set of editions of an application or operating system.

Why are program families of interest? Multiple versions are unavoidable. - Varying hardware configurations. - Varying demands of users. - Opportunity to improve a program. Production and maintenance of multiversion programs can be expensive. Planning to develop as a program family from the start can help cut these costs, decrease time to get a new product to market. Database systems that need to run on different OS’s (Cache?) Windows XP editions (varying user demands) Production/Maintenance Separate manuals Separate maintenance groups Cut costs Common pieces to the family are developed once

Software Product Lines Groups of software products sharing a common set of features that satisfy the needs of a particular market. Develop common, reusable components that can be tailored using parameters or other means. Build as much of a product using existing components first, then do a minimal amount of new programming. Benefits: faster time to market, increased reliability, reduced costs. Non-software Sony Walkman Ideas Build a shared software architecture which controls the composition of smaller software components Divisional developers reconfigure combination of ready-to-use components, make minor modifications Product Line Benefits Reduced time to market Increased reliability (reuse of components that are already proven) Reduced cost (from using previously developed components) Examples Swedish company developed family of naval ship control systems. Members designed for all types of ships from cruisers to submarines for navies all over the world. Nokia. Family covering 32 mobile phones, 6 protocol standards, and a wide variety of features and capabilities.

Product Line Example Cummins, Inc. Manufacturer of diesel engines and engine control system software. 1993 – needed to produce 20 new systems, but had staff to produce just 6. Brought together developers from different geographic markets to create a common set of software components. Development time for new engine control system reduced from a year to just days. Software Engineering Institute of Carnegie-Mellon holds an annual Software Product Line conference “Hall of Fame” spotlights success stories. Cummins 10 years ago – needed to produce 20 new systems, but had staff and resources to produce just 6. Adopted product line approach. Today – 20 software builds have been parlayed into well over 1000 separate products. Cycle time – reduced from 250 person-months to just a few.

How are families produced? The “classical” method - Develop a working program. - Make some design decisions - Apply these to the working program to produce next version. - And so on …

Disadvantages Removal of decisions is not easily done. Therefore, some descendants may contain the results of decisions made early on that no longer apply to later versions. You have to completely finish a program before being able to produce the next family member. Point 1: May lead to performance deficiencies that would not be there if the program were designed from scratch. To remove these extraneous things now would involve a great deal of reprogramming.

New Techniques Stepwise Refinement Module Specification

Stepwise Refinement Basic Idea Develop the system “step by step” as a series of working prototypes, with each one having greater functionality than the previous one.

Stepwise Refinement Intermediate Stages Working prototypes with abstract implementations of some operators and operand types. Design Decision = Refinement step. Implementation decisions are postponed to later stages. Sequencing of events are made early in this technique.

Example: Virtual Memory Management Step 1: Action.1 If (page fault), then (save the status & switch to kernel mode). Action.2 “Run page fault replacement algorithm”, to find the old page. Action.3 If (old page has been changed), then (modify the corresponding disk space). Action.4 “Update the page table entry” for the old page ( bit valid=0). Action.5 “Load the new page in to the memory” form the disk. Action.6 “Update the page table entry” for the new page. (bit valid=1). Refinement Step2: (Two possible Design Decisions for Action.2) Least Recently Used FIFO Not recently used 2a Linked list of all pages 2b Array of all pages with R, M bits

How SRs Defines a family Each possible implementation of an operator defines a family member.

Module specification Basic Idea (Information Hiding) Design Decisions that differentiate family members are identified and hidden in modules. Rest of the program can be written independently of design decision that differentiate members.

Module Specification Intermediate Stages Specifications of externally visible behavior of multi-procedure modules. Implementation decisions and sequencing of events are postponed.

Module Specification Unambiguous specification of a module’s functions. What does it depend on? (input/state). What does it produce? (outputs/side effects). What does it do exactly? (I/O correspondence). What can go wrong? (exceptions/error outputs).

Example: Virtual Memory Management Modules Page_Replacement module. Update_PageTable module. Read_Disk module. Contains procedures to load the requested page from the disk to memory (RAM). Write_Disk module. Modifies the actual content of the old page in the disk, if it has been changed before replacement . Master Control.

How MSs Defines a Family Implementation methods used within modules. Variation in external parameters. Use of subsets. Applications that make use of subset of programs described by the set of module specifications. Example: OS Versions. Each possible implementation of operands and operators defines family. More than one version having the same module specification except for types of operands. Applications that make use of subset of programs described by the set of module specifications..

Classical Method Sequential Completion Particular member is developed to working stage Each decision reduces the set of possible programs Modify the working program to get another Descendants could share some of its ancestor’s characteristics which are not appropriate Could result in performance deficiencies

Example Program families for sorting. First develop a program to sort for a given input of integers. Read the list Sort the list Print the output Just by changing the parameters for the program to include float, double and strings, program families for sorting can be obtained.

Classical vs. New Methods Intermediate stages not well defined Intermediate stages are completely specified Earliest common ancestor is a complete program Unlikely to be the case Intermediate stages are non-deliverable as they are not represented precisely Intermediate stages, though incomplete can be offered as a contribution Section 10.6: Representing Intermediate Stages

Stepwise Refinement Technique Advantages No overhead involve in designing first complete program “Rollback” feature Disadvantages Possible overhead caused by design decision changes Narrower family Advantage 1) Since sequential stage is simply a more refine stage of the previous one, it’s easier to maintain the complexity of the program. 2) Using Stepwise Refinement technique, every stage of the program is complete except the actual implementation of the functions and its parameters. When a design decision changes, developer need not discard the whole program and rewrite it. They can simply go back to the previous stage. Disadvantage 1) possible overhead caused by roll back. In practice, it’s rarely the case that a set of design decisions are isolated by themselves. They’re usually have a relation with each other. (e.g. the result of a previous decision affects the next following decision.) When this happens, we have to discard the invalid decision along with the valid ones and re-implement the valid ones. 2) By making decision early, we’re restricting how wide this program family gets. (I.e. different versions)

Module Specification Technique Advantages Shorter Development time Minimal overhead in maintenance/changes to a module Broader family Disadvantages All decisions must be well specified Overhead in initial specification Advantage 1) Since every module is independent of each other, we can develop each modules in parallel. (similar to divide and conquer) 2) Again, since every module is isolated from each other, a change in a single module will not affect/ require changes to another module, hence less overhead. Easier to debug since we can pin point which module to modify since each module is task oriented. 3) By making the decision later, we’re not restricting how wide our program family can be or how many variation of final program we can obtain. Disadvantage 1) We have to spend a good amount of time to find all design decision which are not common to the program family and create a module to hide each design decision. This will ensure that this set of module will be independent of each other. 2) this result in initial overhead.

Conclusion Which is better? They’re complementary of each other. They may be used together to develop a program family. Example (Simulation of a simple memory management system) A program can start out with Stepwise Refinement technique then ends with Module Specification technique or vice versa.

Simulation of a simple memory management system Requirements Parse through a list of pid with its corresponding request of memory size/block to allocate or de-allocate. Allocate memory block using 3 different allocation policy. First fit, Best fit & Buddy system (Power of 2) De-allocate memory block. Buddy up after de-allocation and etc.

Example (cont.) Main() {…. While (not finishing reading line) { Read line() allocate() or deallocate() if deallocate buddy up memory blocks Log fail/sucess goto next line } …. Do read line allocate or deallocate if deallocate try to buddy up memory blocks if allocate log if it pass of fail while not end of file And etc… 1) First we can use modulate specs to determine which sets of design decision can be isolated from the rest. Then we can use stepwise refinement to layout the template/sequence of execution of the program. Then we can use focus on the individual function/module.

Example (cont.) Allocate Buddy-up Buddyup_firstfit() Alloc_firstfit() Buddyup_bestfit() Alloc_bestfit() Alloc_binarysystem() Buddyup_binarysystem() Deallocate Depending on how detail you wish to get. We can apply stepwise refinement to the module itself. 2)Using a combination of the 2 technique we have develop a simple program which simulate 3 different policy used by a memory management. Program family. Dealloc_firstfit() Dealloc_bestfit() Dealloc_binarysystem()

Questions?