嵌入式硬件测试自动化 [英] Test Automation with Embedded Hardware

查看:213
本文介绍了嵌入式硬件测试自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人能够直接在嵌入式硬件上自动化测试?



具体来说,我正在考虑自动化电池的单元测试层模块。我们需要对硬件层代码有更大的信心。我们的很多项目都使用中断驱动定时器,ADC,串行io,串行SPI器件(闪存)等。



这是否值得吗?



我们通常定位:



处理器:8位或16位微控制器(一些DSP内容)

语言:C(有时是c ++)。

解决方案

当然可以。在汽车行业,我们为每个新产品使用了100,000美元的定制测试仪,以验证硬件和软件是否正常运行。



然而,开发人员还构建了一个更便宜的$ 1,000)测试仪,包括一堆USB I / O,A / D,PWM输入/输出等,并在工作站上使用脚本,或专用的HIL / SIL测试软件,如MxVDev。



环路硬件(HIL)测试可能是您的意思,它只是涉及一些USB硬件I / O连接到设备的I / O,计算机上的软件运行测试



是否值得依赖。



在高可靠性行业(飞机,汽车等)中,客户指定了非常广泛的硬件测试,因此您只需获得出价。



在消费行业,使用非复杂项目通常不值得。



任何项目都有参与的程序员很少,但是真正的很有可能在硬件上进行夜间回归测试,很难正确地模拟硬件到满足自己的软件测试所需的程度。 p>

测试然后在问题进入构建时立即显示。



通常您执行黑盒和白盒测试 - 您的诊断代码在设备上运行,允许您监视硬件中的信号和内存(例如可能只是调试器,或者可能是您写的代码,对总线上的消息做出反应)。这将是白盒测试,您可以在其中看到内部发生的情况(甚至会导致某些事情发生,例如无法测试的关键内存错误,而不会自动引入错误)。



我们还运行了一堆黑盒子测试,诊断路径被忽略,只有I / O被刺激/阅读。



对于便宜的设置,您可以通过USB和/或以太网(如Atmel UC3系列)获得100美元的微控制器板,您可以连接到设备并运行基本测试。



它对产品维护特别有用 - 当项目完成后,存储几个工作板,测试器和一套完整的CD软件。当您需要进行修改或调试问题时,可以轻松地将其全部备份,并通过一些知识(测试后)对主要功能进行更改进行处理。



-Adam


Has anyone had success automating testing directly on embedded hardware?

Specifically, I am thinking of automating a battery of unit tests for hardware layer modules. We need to have greater confidence in our hardware layer code. A lot of our projects use interrupt driven timers, ADCs, serial io, serial SPI devices (flash memory) etc..

Is this even worth the effort?

We typically target:

Processor: 8 or 16 bit microcontrollers (some DSP stuff)
Language: C (sometimes c++).

解决方案

Sure. In the automotive industry we use $100,000 custom built testers for each new product to verify the hardware and software are operating correctly.

The developers, however, also build a cheaper (sub $1,000) tester that includes a bunch of USB I/O, A/D, PWM in/out, etc and either use scripting on the workstation, or purpose built HIL/SIL test software such as MxVDev.

Hardware in the Loop (HIL) testing is probably what you mean, and it simply involves some USB hardware I/O connected to the I/O of your device, with software on the computer running tests against it.

Whether it's worth it depends.

In the high reliability industry (airplane, automotive, etc) the customer specifies very extensive hardware testing, so you have to have it just to get the bid.

In the consumer industry, with non complex projects it's usually not worth it.

With any project where there's more than a few programmers involved, though, it's really nice to have a nightly regression test run on the hardware - it's hard to correctly simulate the hardware to the degree needed to satisfy yourself that the software testing is enough.

The testing then shows immediately when a problem has entered the build.

Generally you perform both black box and white box testing - you have diagnostic code running on the device that allows you to spy on signals and memory in the hardware (which might just be a debugger, or might be code you wrote that reacts to messages on a bus, for instance). This would be white box testing where you can see what's happening internally (and even cause some things to happen, such as critical memory errors which can't be tested without introducing the error yourself).

We also run a bunch of 'black box' tests where the diagnostic path is ignored and only the I/O is stimulated/read.

For a much cheaper setup, you can get $100 microcontroller boards with USB and/or ethernet (such as the Atmel UC3 family) which you can connect to your device and run basic testing.

It's especially useful for product maintenance - when the project is done, store a few working boards, the tester, and a complete set of software on CD. When you need to make a modification or debug a problem, it's easy to set it all back up and work on it with some knowledge (after testing) that the major functionality was not affected by your changes.

-Adam

这篇关于嵌入式硬件测试自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆