My first SDK example should probably do less

RaviServo_07c421 · 2026年9月8日 12:06 UTC

回复讨论

主帖中文翻译暂不可用,以下显示英文原文;回复保留原文。 查看英文原文

RA
RaviServo_07c421
I want to learn how a Python application handles robot status before I connect it to any equipment. For an offline exercise, would you start with one saved response and a parser, or build a mock controller first? I can write either. I am less sure which will stop me learning the wrong assumptions about a real controller.

7 条回复

HA
HazelBell0658

I'd start with the parser and a few clearly labelled inputs, including a failure. A mock controller is another program you have to check before its reassuring answers mean anything

0分
RA
RaviServo_07c421

Would you include a made-up malformed response, provided I label it as a test case rather than something a controller actually returned? I want to check rejection, not build a pretend protocol from memory.

0分
LU
LucyAbbott0045

Yes. Separate invented negative tests from documented examples. Neither needs access to the production network.

0分
RA
RaviServo_07c421

For those invented negative cases, would you check just that the parser rejects them, or the reason it gives too? I'm thinking of a missing value versus a value with the wrong type. Both are failures, but a single 'bad response' message would leave me guessing.

0分
OW
OwenAdams0138

Check the reason. Not necessarily every word of the message. Otherwise a wording improvement can break a test whose behaviour is unchanged

0分
FE
FelixBench_531229

Would you keep the input beside the expected reason? I'd find a case called 'wrong type' hard to follow if I had to discover which field you changed

0分
LU
LucyAbbott0045

Yes. Show the changed field and expected rejection. Keep the invented input visibly labelled as an exercise.

0分

参与讨论

欢迎来到 Application Robot

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

忘记密码?

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