A laboratory compares two program designs for the four workflows shown below.
Proposal A began with a top-down decomposition into workflows. Each workflow has its own separate implementations of every routine it uses, including indirectly called routines. No implementations are shared between workflows.
Proposal B began by assembling reusable building blocks from the bottom up. It has one shared implementation each of Validate, Calibrate, Summarize, and Offset. Its workflows use those implementations according to the same logical dependencies.
A specification change requires revised behaviour in Offset and Summarize. All routine inputs and outputs remain compatible. Only implementations of these two routines need editing; their callers need checking but no code changes.
Use this maintenance model:
Complete the table with exact integers. Count separate implementations revised, complete workflow checks required, and total maintenance time in minutes for each proposal.
Unlock full course notes by signing up
Matching contracts at an integration boundary
A bottom-up design reuses a speed component whose contract requires distance in metres and elapsed time in seconds, and returns speed in metres per second. A measurement source supplies distance in metres and elapsed time in milliseconds.
For a test measurement, the source supplies 24 m24\ \text{m}24 m and 3000 ms3000\ \text{ms}3000 ms. Which integration choice respects the speed component's documented input contract and produces the correct reported units?
Choosing temporary code for incomplete designs
Two teams are testing incomplete engineering programs. Complete each description using either stub or driver. Each term is used once.
In a top-down pump-monitoring design, the real monitoring coordinator is ready, but the pressure-reading routine it calls is unavailable. A temporary routine occupies that missing component's place and returns representative pressure readings. This replacement is a ________.
In a bottom-up vibration-analysis design, a reusable peak-detection routine is ready, but the application that will call it has not been built. A temporary test program supplies sample inputs, calls the real routine, and checks its returned results. This test program is a ________.
Recognizing a combined design strategy
A vibration-reporting program receives each measurement record as several fragments. Fragments can have different lengths, and some samples are marked invalid. A fragment may contain no valid samples even when other fragments in the record contain valid data.
The report must show one root-mean-square (RMS) vibration value calculated from all valid samples in the complete record. Invalid samples must be excluded. The report must show unavailable only when the complete record contains no valid samples.
For valid sample values xix_ixi, the required record value is
Repairing a composition that loses required information
A power-monitoring program must report the arithmetic mean and the largest value of four original power readings, all in watts.
An existing block-summary component consumes exactly two readings, returns their arithmetic mean in watts, and then permanently discards those original readings. Another existing component formats a report when given an overall mean and a peak, both in watts. You may add surrounding components, but you cannot change the block-summary component. Each original reading is accessible before it enters that component.
A proposed bottom-up assembly processes consecutive pairs and reports the mean and maximum of the two returned block means.