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=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:


Test

Observed result

Call calculation directly with F=160 NF=160\ \text{N} and d=0.25 md=0.25\ \text{m}

40 J40\ \text{J}

Call reporting directly with 40 J40\ \text{J}

0.040 kJ0.040\ \text{kJ}

Run the complete program with a recorder entry of 160 N160\ \text{N} and 25 cm25\ \text{cm}

4.000 kJ4.000\ \text{kJ}


Which response best uses this evidence while preserving the documented module contracts?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Modular Programming Questions: