A navigation team writes a function convert_force(f_lbf) that converts a thruster…
PHYSICS · Multi-part · Fermi University Physics · Computational Physics · Research software practice, verification and validation · Research software practice, verification and validation
Scientific Computing for Physicists, Ch Is the equation solved right? Testing, debugging and code verification
Problem
A navigation team writes a function convert_force(f_lbf) that converts a thruster force from pound-force to newtons, using the factor 1lbf=4.448N. Their test file contains only this test. def test_convert_force(): result = convert_force(1.0) assert result > 0 The coverage tool reports 100% line coverage for convert_force. Someone argues: "Coverage is 100% and the test passes, so convert_force is verified."
((a)) Explain what is wrong with this argument, distinguishing what the coverage figure establishes from what the assertion checks.
((b)) Give a replacement assertion for test_convert_force, stated in words and as an inequality or equality with a numerical tolerance, that would fail if convert_force returned its argument unconverted (as if it silently used a factor of 1 instead of 4.448) yet would pass the correct function.
((c)) State, in one sentence, which of the three documented failure modes (Patriot, Ariane 5, Mars Climate Orbiter) this situation is analogous to, and name the one property the replacement test checks that the original test does not.