热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何集成/单元测试软件硬件接口-Howtointegration/unittestsoftwarehardwareinterfaces

Imworkingonasmallfunprojectsthatbuildsarobot.Weastheprogrammersareworkingparallel

I'm working on a small fun projects that builds a robot. We as the programmers are working parallel to the people building the robot. So it is very often the case that we are trying to run changed software and the builders have changed the hardware. If the software tests are not running it is always a hard thing to figure out if the software or the hardware fails or even worse if the integration fails. There are some hard parts with an automatic testing for this issues.

我正在开发一个构建机器人的小型有趣项目。我们作为程序员正在与建造机器人的人并行工作。因此,我们经常尝试运行已更改的软件并且构建器已更改硬件。如果软件测试没有运行,那么确定软件或硬件是否出现故障总是很难,如果集成失败则更糟糕。有一些硬件可以自动测试这个问题。

We have figured out some ways of breaking things down so we have rc control to let the robot go through some movements without software assuring that he still works. Then we start some software tests that make the robot going some defined figures to show that the software behaves in the same way as before. But this always comes down to a very time consuming task because you can't automate it and someone has to start the test, watch the test and try to figure out if the robot did what it should do.

我们已经找到了一些破坏方法,所以我们有控制权让机器人在没有软件的情况下通过一些动作来确保他仍在工作。然后我们开始一些软件测试,使机器人运行一些定义的数字,以显示软件的行为与以前一样。但这总是归结为一个非常耗时的任务,因为你不能自动化它,有人必须开始测试,观察测试并试图弄清楚机器人是否应该做它应该做的事情。

Another problem is that constant testing with our real hardware is wearing out parts of our hardware, joint, motors, gear wheels and so on.

另一个问题是,使用我们的真实硬件进行的持续测试会损坏我们的硬件,接头,电机,齿轮等部件。

But not testing has proven to cause so much trouble and consume so much time that I would like to know what kind of techniques are used in other projects which are dealing with hardware software interaction and if there are tools out there that can be used.

但是,测试已经证明不会造成太多麻烦并且消耗了太多时间,我想知道在处理硬件软件交互的其他项目中使用了哪种技术,以及是否有可以使用的工具。

2 个解决方案

#1


The interface between the robot and the software must be defined first ; not necessarily exhaustively, this could be done incrementally. Start small, for instance with basic moves (forward, backward), then, once it has been fully tested, both in isolation and integrated, add some behaviour (e.g. turn left, turn right), retest. That way, the whole team can use what it learned all along the project to extend the interface, possibly minimizing interface reworks.

必须首先定义机器人和软件之间的接口;不一定详尽无遗,这可以逐步完成。从小开始,例如基本移动(向前,向后),然后,一旦完全测试,无论是隔离还是集成,添加一些行为(例如左转,右转),重新测试。这样,整个团队可以使用它在整个项目中学到的东西来扩展界面,可能最大限度地减少界面返工。

The Progress before Hardware article describes such a process in greater details, focusing on the Test-Driven-Development (TDD) aspect.

硬件之前的进展文章更详细地描述了这样一个过程,重点是测试驱动开发(TDD)方面。

See also answers to the How to do TDD with hardware question.

另请参阅如何使用硬件问题进行TDD的答案。

#2


I think it's a very interesting situation.

我认为这是一个非常有趣的情况。

I believe there's no problem with your testing process. If you mock your robot and test against this mock, it's all good.
If the hardware robot acts different as your mocked robot, there's another big problem: The communication.

我相信你的测试过程没有问题。如果你嘲笑你的机器人并对这个模拟器进行测试,这一切都很好。如果硬件机器人与你的模拟机器人不同,那就是另一个大问题:沟通。

The interface between the software and the hardware is the "protocol" specification. In my opinion it must not be changed without discussion. The hardware guys may not change it and you software guys not, too! You only may change it together. In your situation, everybody changes it on his own.

软件和硬件之间的接口是“协议”规范。在我看来,没有讨论就不能改变。硬件人员可能不会改变它,而软件人员也不会改变它!你只能一起改变它。在你的情况下,每个人都自己改变它。

In your situation, your teams seem to work against each other. So try to focus your efforts in your interface and especially your communication, not in your integration test that won't work anyway.

在您的情况下,您的团队似乎互相攻击。因此,请尽量将精力集中在您的界面上,尤其是您的沟通,而不是集成测试中无论如何都无法工作。

A suggestion of mine would be to use a robot's software mock as the one and only specification. So you can rely on your mock and there's a central point that defines the connection between hard- and software.
When the software guys want to change it, ok. They have to discuss it with you and you will change the software mock. If the hardware was changed and the mock not, you have an apology, because you develop against your specification.

我的建议是使用机器人的软件模拟作为唯一的规范。所以你可以依靠你的模拟,并且有一个中心点来定义硬件和软件之间的连接。当软件人想要改变它时,好吧。他们必须与您讨论,您将更改软件模拟。如果硬件被更改而模拟没有,那么您有道歉,因为您的规范是根据您的规范进行的。

Good luck!


推荐阅读
  • 长期从事ABAP开发工作的专业人士,在面对行业新趋势时,往往需要重新审视自己的发展方向。本文探讨了几位资深专家对ABAP未来走向的看法,以及开发者应如何调整技能以适应新的技术环境。 ... [详细]
  • 在1995年,Simon Plouffe 发现了一种特殊的求和方法来表示某些常数。两年后,Bailey 和 Borwein 在他们的论文中发表了这一发现,这种方法被命名为 Bailey-Borwein-Plouffe (BBP) 公式。该问题要求计算圆周率 π 的第 n 个十六进制数字。 ... [详细]
  • Irish budget airline Ryanair announced plans to significantly increase its route network from Frankfurt Airport, marking a direct challenge to Lufthansa, Germany's leading carrier. ... [详细]
  • 在Qt框架中,信号与槽机制是一种独特的组件间通信方式。本文探讨了这一机制相较于传统的C风格回调函数所具有的优势,并分析了其潜在的不足之处。 ... [详细]
  • 线段树详解与实现
    本文详细介绍了线段树的基本概念及其在编程竞赛中的应用,并提供了一个具体的线段树实现代码示例。 ... [详细]
  • Encountering frequent mismatches during Terraform apply operations, particularly with resource attributes. ... [详细]
  • 在尝试加载支持推送通知的iOS应用程序的Ad Hoc构建时,遇到了‘no valid aps-environment entitlement found for application’的错误提示。本文将探讨此错误的原因及多种可能的解决方案。 ... [详细]
  • 本文探讨了如何将个人经历,特别是非传统的职业路径,转化为职业生涯中的优势。通过作者的亲身经历,展示了舞蹈生涯对商业思维的影响。 ... [详细]
  • 本文介绍了SIP(Session Initiation Protocol,会话发起协议)的基本概念、功能、消息格式及其实现机制。SIP是一种在IP网络上用于建立、管理和终止多媒体通信会话的应用层协议。 ... [详细]
  • Go从入门到精通系列视频之go编程语言密码学哈希算法(二) ... [详细]
  • spring boot使用jetty无法启动 ... [详细]
  • Android与JUnit集成测试实践
    本文探讨了如何在Android项目中集成JUnit进行单元测试,并详细介绍了修改AndroidManifest.xml文件以支持测试的方法。 ... [详细]
  • 在将 Android Studio 从 3.0 升级到 3.1 版本后,遇到项目无法正常编译的问题,具体错误信息为:org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDemoProductDebugResources'。 ... [详细]
  • pypy 真的能让 Python 比 C 还快么?
    作者:肖恩顿来源:游戏不存在最近“pypy为什么能让python比c还快”刷屏了,原文讲的内容偏理论,干货比较少。我们可以再深入一点点,了解pypy的真相。正式开始之前,多唠叨两句 ... [详细]
  • 本打算教一步步实现koa-router,因为要解释的太多了,所以先简化成mini版本,从实现部分功能到阅读源码,希望能让你好理解一些。希望你之前有读过koa源码,没有的话,给你链接 ... [详细]
author-avatar
Fmyu的守护天使
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有