简体中文界面。帖子、指南及政策正文保留原文;未对原文作自动翻译。

My offline inspection mock agrees with calls it should reject

TheoBrown0932 · 2026年7月31日 11:22 UTC

回复讨论
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 条回复

LI
LiamBell0664

What would a wrong method name do today?

7
AN
AnikaBarnes0595

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
JO
JonasAllen0285

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
AL
AlexAdams0124

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

-1
AN
AnikaBarnes0595

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
TH
TheoBrown0932

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
LI
LiamBell0664

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

14
JO
JonasAllen0285

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
LI
LiamBell0664

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

12
AL
AlexAdams0124

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

25
TH
TheoBrown0932

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
AN
AnikaBarnes0595

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
JO
JonasAllen0285

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
TH
TheoBrown0932

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
AL
AlexAdams0124

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

20

参与讨论

欢迎来到 Application Robot

所有人都可以阅读论坛。登录或注册后即可发起讨论、回复或上传照片。

忘记密码?

注册账号即表示你同意我们的 使用条款 社区准则。请阅读我们的 隐私政策 ,了解我们如何处理你的信息。