An energy module accepts one or more intervals, each containing a finite nonnegative power PiP_iPi in watts and a finite positive duration Δti\Delta t_iΔti in seconds. Its public contract returns total energy in joules:
A replacement keeps the same inputs and output type but calculates the ordinary arithmetic mean of the powers and multiplies it by the total duration. It passes tests with one interval and tests with equal interval durations.
A proposed additional test supplies 60 W60\ \text{W}60 W for 10 s10\ \text{s}10 s, followed by 180 W180\ \text{W}180 W for 30 s30\ \text{s}30 s. Which review decision best tests and preserves the documented contract?
Multiply every returned result by 1.25 in reporting; this corrects the proposed unequal-duration test without changing the module.
Add the unequal-duration test expecting 6000 J; use duration-weighted power internally while retaining the documented input and output contract.
Approve after testing two 120 W intervals lasting 20 s each; this sufficiently checks the replacement's aggregation behaviour.
Reject unequal durations at input; keep arithmetic averaging internally and retain the existing public description of accepted intervals.
Unlock full course notes by signing up
Following quantities through module handoffs
A heater-test program has three modules. Its input adapter converts elapsed time from minutes to seconds. Its calculation module accepts constant power in watts and elapsed time in seconds, returning E=PΔtE=P\Delta tE=PΔt in joules. Its reporting module divides the energy in joules by 1000 to display kilojoules.
The recorded power is 135 W135\ \text{W}135 W and the elapsed time is 2.50 min2.50\ \text{min}2.50 min. What energy should the reporting module display? Give your answer in kilojoules, to two decimal places.
Checking independence between batch calls
A laboratory program calls an energy-summary module once per test batch. Its interface promises to return the total energy for the current batch, in joules, independently of earlier batches.
Two implementations use the same inputs and output units:
Implementation R resets its internal total to zero at the start of every call, adds the current batch's readings, and returns the total.
Finding a failure between tested modules
A mechanical-work program uses an input adapter, a calculation module, and a reporting module. The calculation contract is W=FdW=FdW=Fd, with force in newtons, displacement in metres, and work returned in joules. Reporting converts joules to kilojoules.
After support for a new recorder is added, these tests are observed:
Which response best uses this evidence while preserving the documented module contracts?
Reusing results after overlapping input changes
An engineering analysis program separates its work into three modules:
The geometry module takes geometry data and returns section properties. Each call takes 0.8 s.
The stiffness module takes section properties and a material's elastic modulus, a measure of its resistance to elastic deformation. Each call takes 1.5 s.