My offline inspection mock agrees with calls it should reject

TheoBrown0932 · 31 Jul 2026, 11:22 UTC

Reply to discussion
TH
TheoBrown0932
I am testing UR5e inspection-result parsing on our training bench without the controller. The coupon is fixture-mounted in the application, but this is only a software test. My mock returns true for every method. I need it to expose interface mistakes without pretending it simulates the cell.

15 replies

LI
LiamBell0664
Replying to TheoBrown0932

What would a wrong method name do today?

7 points
AN
AnikaBarnes0595
Replying to TheoBrown0932

Start by making the substitute implement only the interface your application actually uses. Its return values should follow the installed library's documented contract; a universal success value hides both caller and parser errors.

17 points
JO
JonasAllen0285
Replying to AnikaBarnes0595

I have just been discussing test traces elsewhere. A small readable sequence helps here too: request, supplied response, parser decision. When the test fails, you can see whether the substitute delivered the intended case instead of wondering about fictional controller behaviour.

12 points
AL
AlexAdams0124
Replying to AnikaBarnes0595

Does that mean a recorded controller response is required before any test is useful?

-1 points
AN
AnikaBarnes0595
Replying to AlexAdams0124

No, Alex. Documented examples can support initial contract tests, provided their origin and version are recorded. Actual supported captures would later check assumptions that examples do not cover.

18 points
TH
TheoBrown0932
Replying to LiamBell0664

A wrong name currently gets the same true value. That is the first defect to remove. I also have no distinction between a failed read and a successful empty result.

17 points
LI
LiamBell0664
Replying to TheoBrown0932

Then test those two cases separately before adding a catalogue of imaginary faults.

14 points
JO
JonasAllen0285
Replying to LiamBell0664

I disagree with waiting on all the awkward cases. A malformed response is cheap to supply, and the parser must not turn it into a plausible inspection result. No controller physics needed for that.

18 points
LI
LiamBell0664
Replying to JonasAllen0285

Fair. I meant finish the basic distinction first, not omit malformed input.

12 points
AL
AlexAdams0124
Replying to TheoBrown0932

Put that distinction in the handover too. Someone will otherwise call every empty result a communication failure.

25 points
TH
TheoBrown0932
Replying to AnikaBarnes0595

The substitute now rejects names outside our small interface. I have separate fixtures for a supported result, an unsuccessful response and missing data. The missing-data case exposed a parser assumption.

22 points
AN
AnikaBarnes0595
Replying to TheoBrown0932

Useful finding. Does the test assert the caller's visible outcome as well as the parser's return? An old result left on screen could still make this appear successful.

8 points
JO
JonasAllen0285
Replying to AnikaBarnes0595

And do not make every test use a fresh application instance. One success followed by a failure is a different sequence from starting with a failure.

14 points
TH
TheoBrown0932
Replying to JonasAllen0285

That sequence is missing. Thank you, Jonas. I had tested those inputs only in isolation. I will add it before calling the software checks complete.

19 points
AL
AlexAdams0124
Replying to TheoBrown0932

Which contract version will travel with the fixtures? That would help the next person judge a mismatch.

20 points

Add to the discussion

Welcome to Application Robot

Everyone can read the forum. Sign in or create an account to start a discussion, reply, or upload photos.

Forgot your password?

By creating an account, you agree to our Terms and Conditions and community guidelines. Read our Privacy Policy for how your information is handled.