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


推荐阅读
  • Explore how Matterverse is redefining the metaverse experience, creating immersive and meaningful virtual environments that foster genuine connections and economic opportunities. ... [详细]
  • 本文深入探讨了 Java 中的 Serializable 接口,解释了其实现机制、用途及注意事项,帮助开发者更好地理解和使用序列化功能。 ... [详细]
  • 本文将介绍如何编写一些有趣的VBScript脚本,这些脚本可以在朋友之间进行无害的恶作剧。通过简单的代码示例,帮助您了解VBScript的基本语法和功能。 ... [详细]
  • 扫描线三巨头 hdu1928hdu 1255  hdu 1542 [POJ 1151]
    学习链接:http:blog.csdn.netlwt36articledetails48908031学习扫描线主要学习的是一种扫描的思想,后期可以求解很 ... [详细]
  • 深入解析JVM垃圾收集器
    本文基于《深入理解Java虚拟机:JVM高级特性与最佳实践》第二版,详细探讨了JVM中不同类型的垃圾收集器及其工作原理。通过介绍各种垃圾收集器的特性和应用场景,帮助读者更好地理解和优化JVM内存管理。 ... [详细]
  • 本文详细介绍了如何在BackTrack 5中配置和启动SSH服务,确保其正常运行,并通过Windows系统成功连接。涵盖了必要的密钥生成步骤及常见问题解决方法。 ... [详细]
  • 数据管理权威指南:《DAMA-DMBOK2 数据管理知识体系》
    本书提供了全面的数据管理职能、术语和最佳实践方法的标准行业解释,构建了数据管理的总体框架,为数据管理的发展奠定了坚实的理论基础。适合各类数据管理专业人士和相关领域的从业人员。 ... [详细]
  • 使用 Azure Service Principal 和 Microsoft Graph API 获取 AAD 用户列表
    本文介绍了一段通用代码示例,该代码不仅能够操作 Azure Active Directory (AAD),还可以通过 Azure Service Principal 的授权访问和管理 Azure 订阅资源。Azure 的架构可以分为两个层级:AAD 和 Subscription。 ... [详细]
  • 深入解析Spring Cloud Ribbon负载均衡机制
    本文详细介绍了Spring Cloud中的Ribbon组件如何实现服务调用的负载均衡。通过分析其工作原理、源码结构及配置方式,帮助读者理解Ribbon在分布式系统中的重要作用。 ... [详细]
  • 深入解析:手把手教你构建决策树算法
    本文详细介绍了机器学习中广泛应用的决策树算法,通过天气数据集的实例演示了ID3和CART算法的手动推导过程。文章长度约2000字,建议阅读时间5分钟。 ... [详细]
  • DNN Community 和 Professional 版本的主要差异
    本文详细解析了 DotNetNuke (DNN) 的两种主要版本:Community 和 Professional。通过对比两者的功能和附加组件,帮助用户选择最适合其需求的版本。 ... [详细]
  • UNP 第9章:主机名与地址转换
    本章探讨了用于在主机名和数值地址之间进行转换的函数,如gethostbyname和gethostbyaddr。此外,还介绍了getservbyname和getservbyport函数,用于在服务器名和端口号之间进行转换。 ... [详细]
  • 本文详细介绍了Java中的访问器(getter)和修改器(setter),探讨了它们在保护数据完整性、增强代码可维护性方面的重要作用。通过具体示例,展示了如何正确使用这些方法来控制类属性的访问和更新。 ... [详细]
  • 本题探讨如何通过最大流算法解决农场排水系统的设计问题。题目要求计算从水源点到汇合点的最大水流速率,使用经典的EK(Edmonds-Karp)和Dinic算法进行求解。 ... [详细]
  • 优化局域网SSH连接延迟问题的解决方案
    本文介绍了解决局域网内SSH连接到服务器时出现长时间等待问题的方法。通过调整配置和优化网络设置,可以显著缩短SSH连接的时间。 ... [详细]
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社区 版权所有