热门标签 | 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!


推荐阅读
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文讨论了如何使用IF函数从基于有限输入列表的有限输出列表中获取输出,并提出了是否有更快/更有效的执行代码的方法。作者希望了解是否有办法缩短代码,并从自我开发的角度来看是否有更好的方法。提供的代码可以按原样工作,但作者想知道是否有更好的方法来执行这样的任务。 ... [详细]
  • This article discusses the efficiency of using char str[] and char *str and whether there is any reason to prefer one over the other. It explains the difference between the two and provides an example to illustrate their usage. ... [详细]
  • 本文介绍了九度OnlineJudge中的1002题目“Grading”的解决方法。该题目要求设计一个公平的评分过程,将每个考题分配给3个独立的专家,如果他们的评分不一致,则需要请一位裁判做出最终决定。文章详细描述了评分规则,并给出了解决该问题的程序。 ... [详细]
  • Oracle分析函数first_value()和last_value()的用法及原理
    本文介绍了Oracle分析函数first_value()和last_value()的用法和原理,以及在查询销售记录日期和部门中的应用。通过示例和解释,详细说明了first_value()和last_value()的功能和不同之处。同时,对于last_value()的结果出现不一样的情况进行了解释,并提供了理解last_value()默认统计范围的方法。该文对于使用Oracle分析函数的开发人员和数据库管理员具有参考价值。 ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 也就是|小窗_卷积的特征提取与参数计算
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了卷积的特征提取与参数计算相关的知识,希望对你有一定的参考价值。Dense和Conv2D根本区别在于,Den ... [详细]
  • 3.223.28周学习总结中的贪心作业收获及困惑
    本文是对3.223.28周学习总结中的贪心作业进行总结,作者在解题过程中参考了他人的代码,但前提是要先理解题目并有解题思路。作者分享了自己在贪心作业中的收获,同时提到了一道让他困惑的题目,即input details部分引发的疑惑。 ... [详细]
  • Go Cobra命令行工具入门教程
    本文介绍了Go语言实现的命令行工具Cobra的基本概念、安装方法和入门实践。Cobra被广泛应用于各种项目中,如Kubernetes、Hugo和Github CLI等。通过使用Cobra,我们可以快速创建命令行工具,适用于写测试脚本和各种服务的Admin CLI。文章还通过一个简单的demo演示了Cobra的使用方法。 ... [详细]
  • SpringBoot整合SpringSecurity+JWT实现单点登录
    SpringBoot整合SpringSecurity+JWT实现单点登录,Go语言社区,Golang程序员人脉社 ... [详细]
  • 本文介绍了使用Spark实现低配版高斯朴素贝叶斯模型的原因和原理。随着数据量的增大,单机上运行高斯朴素贝叶斯模型会变得很慢,因此考虑使用Spark来加速运行。然而,Spark的MLlib并没有实现高斯朴素贝叶斯模型,因此需要自己动手实现。文章还介绍了朴素贝叶斯的原理和公式,并对具有多个特征和类别的模型进行了讨论。最后,作者总结了实现低配版高斯朴素贝叶斯模型的步骤。 ... [详细]
  • 十大经典排序算法动图演示+Python实现
    本文介绍了十大经典排序算法的原理、演示和Python实现。排序算法分为内部排序和外部排序,常见的内部排序算法有插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序等。文章还解释了时间复杂度和稳定性的概念,并提供了相关的名词解释。 ... [详细]
  • Ihaveaworkfolderdirectory.我有一个工作文件夹目录。holderDir.glob(*)>holder[ProjectOne, ... [详细]
  • 使用C++编写程序实现增加或删除桌面的右键列表项
    本文介绍了使用C++编写程序实现增加或删除桌面的右键列表项的方法。首先通过操作注册表来实现增加或删除右键列表项的目的,然后使用管理注册表的函数来编写程序。文章详细介绍了使用的五种函数:RegCreateKey、RegSetValueEx、RegOpenKeyEx、RegDeleteKey和RegCloseKey,并给出了增加一项的函数写法。通过本文的方法,可以方便地自定义桌面的右键列表项。 ... [详细]
  • MySQL多表数据库操作方法及子查询详解
    本文详细介绍了MySQL数据库的多表操作方法,包括增删改和单表查询,同时还解释了子查询的概念和用法。文章通过示例和步骤说明了如何进行数据的插入、删除和更新操作,以及如何执行单表查询和使用聚合函数进行统计。对于需要对MySQL数据库进行操作的读者来说,本文是一个非常实用的参考资料。 ... [详细]
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社区 版权所有