Download presentation
Presentation is loading. Please wait.
Published byVilhelm Martinsson Modified over 6 years ago
1
On the Design and Development of Program Families
Roy Mammen Jerry Cheng Sharan Mudgal Doug Paida
2
Overview What is a “program family”? Classical method Newer techniques
Comparison of classical method to the newer techniques Conclusions
3
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.
4
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
5
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.
6
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.
7
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 …
8
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.
9
New Techniques Stepwise Refinement Module Specification
10
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.
11
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.
12
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
13
How SRs Defines a family
Each possible implementation of an operator defines a family member.
14
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.
15
Module Specification Intermediate Stages
Specifications of externally visible behavior of multi-procedure modules. Implementation decisions and sequencing of events are postponed.
16
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).
17
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.
18
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..
19
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
20
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.
21
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
22
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)
23
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.
24
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.
25
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.
26
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.
27
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()
28
Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.