目前用于测试固件的可用软件工具有哪些?

发布于 2024-10-24 15:00:59 字数 87 浏览 2 评论 0原文

我是一名软件工程师,将/可能被聘为固件测试工程师。我只是想了解市场上用于测试固件的一些软件工具。您能否介绍一下它们并解释一下它们为固件提供的测试类型?提前致谢。

I'm a software engineer who will/may be hired as a firmware test engineer. I just want to get an idea of some software tools available in the market used in testing firmware. Can you state them and explain a little about what type of testing they provide to the firmware? Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

涙—继续流 2024-10-31 15:00:59

测试有多种形式,可以在不同阶段进行。除了编写代码之前的设计验证之外,代码测试还可以分为单元测试、集成测试、系统测试和验收测试(尽管确切的术语和阶段数量可能非常不同)。在 V 模型中,这些将与需求和设计开发的阶段水平对应。此外,在开发和维护中,您可能会执行回归测试 - 确保已修复的错误在应用其他更改时保持固定状态。

就工具而言,可分为静态分析和动态分析。静态工具在不执行的情况下分析源代码,而动态分析则关注代码在执行期间的行为。一些(昂贵的)工具执行“抽象执行”,这是一种静态分析技术,可以确定代码在执行过程中如何在没有实际执行的情况下失败,这种方法的计算成本很高,但可以比传统的动态分析处理更多的执行路径和变量状态。

静态分析最简单的形式是代码审查;让人类阅读您的代码。即使是这种表面上手动的过程,也有一些工具可以提供帮助,例如 SmartBear 的 Code Collaborator。同样,动态分析的最简单形式是在调试器中简单地单步执行代码,甚至仅使用各种测试场景运行代码。第一个可能由程序员在单元开发和调试期间完成,而后者更适合验收或集成测试。

虽然做得好的代码审查可以消除大量错误,尤其是设计错误,但它在查找由编程语言的微妙或神秘语义引起的某些类型的错误方面可能并不那么有效。这种错误适合使用静态分析工具自动检测,例如 Gimpel 的 PC-Lint 和 FlexeLint 工具,或者Programming Research 的 QA 工具,尽管成本较低的方法,例如将编译器的警告级别设置为高并使用多个编译器进行编译也很有用。

动态分析工具有多种形式,例如代码覆盖率分析、代码性能分析、内存管理分析和边界检查。

高端工具/供应商包括 CoverityPolySpace(抽象分析工具),康塔塔LDRAKlocwork。处于较低端(价格方面,不一定有效)的是 PC-Lint 和 Tessy,甚至开源的splint(仅限 C),以及大量单元测试工具

Testing comes in a number of forms and can be performed at different stages. Apart from design validation before code is even written, code testing may be divided into unit testing, integration testing, system testing and acceptance testing (though exact terms and number of stages may very). In the V model, these would correspond horizontally with stages in requirements and design development. Also in development and maintenance you might perform regression testing - ensuring that fixed bugs remain fixed when other changes are applied.

As far as tools are concerned, these can be divided into static analysis and dynamic analysis. Static tools analyse the source code without execution, whereas dynamic analysis is concerned with the behaviour of the code during execution. Some (expensive) tools perform "abstract execution" which is a static analysis technique that determines how the code may fail during execution without actual execution, this approach is computationally expensive but can process far more execution paths and variable states than traditional dynamic analysis.

The simplest form of static analysis is code review; getting a human to read your code. There are tools to assist even with this ostensibly manual process such as SmartBear's Code Collaborator. Likewise the simplest form of dynamic analysis is to simply step through your code in your debugger or even to just run your code with various test scenarios. The first may be done by a programmer during unit development and debugging, while the latter is more suited to acceptance or integration testing.

While code review done well can remove a large amount of errors, especially design errors, it is not so efficient perhaps at finding certain types of errors caused by subtle or arcane semantics of programming languages. This kind of error lends itself to automatic detection using static analysis tools such as Gimpel's PC-Lint and FlexeLint tools, or Programming Research's QA tools, though lower cost approaches such as setting your compiler's warning level high and compiling with more than one compiler are also useful.

Dynamic analysis tools come in a number of forms such as code coverage analysis, code performance profiling, memory management analysis, and bounds checking.

Higher-end tools/vendors include the likes of Coverity, PolySpace (an abstract analysis tool), Cantata, LDRA, and Klocwork. At the lower end (in price, not necessarily effectiveness) are tools such as PC-Lint and Tessy, or even the open-source splint (C only), and a large number of unit testing tools

何处潇湘 2024-10-31 15:00:59

以下是我发现有用的一些固件测试技术...

  1. PC 上的单元测试;即从固件中提取一个功能,并在更快的平台上编译和测试它。例如,这可以让您详尽地测试一个功能,而这在现场会非常耗时。

  2. 使用自由运行的硬件计时器来检测固件中断处理程序:进入和退出时的滴答声以及中断计数。跟踪每个中断处理程序的最小和最大频率以及周期。该数据可用于进行速率单调分析或截止时间单调分析。

  3. 使用标准协议(例如 Modbus RTU)来按需提供一系列状态数据。这可用于配置和验证数据。

  4. 使用自动构建过程将固件版本号构建到代码中,例如,通过从源代码存储库获取版本信息。使用#3 使版本号可用。

  5. 使用 lint 或其他静态分析工具。使用 -Wall 要求 lint 和编译器发出零警告。

  6. 通过将固件的 CRC 嵌入到代码中并在运行时检查它的方法来增强您的构建工具

Here are some firmware testing techniques I've found useful...

  1. Unit test on the PC; i.e., extract a function from the firmware, and compile and test it on a faster platform. This will let you, for example, exhaustively test a function whereas this would be prohibitively time consuming in situ.

  2. Instrument the firmware interrupt handlers using a free running hardware timer: ticks at entry and exit, and count of interrupts. Keep track of min and max frequency and period for each interrupt handler. This data can be used to do Rate Monotonic Analysis or Deadline Monotonic Analysis.

  3. Use a standard protocol, like Modbus RTU, to make an array of status data available on demand. This can be used for configuration and verification data.

  4. Build the firmware version number into the code using an automated build process, e.g., by getting the version info from the source code repository. Make the version number available using #3.

  5. Use lint or another static analysis tool. Demand zero warnings from lint and from the compiler with -Wall.

  6. Augment your build tools with a means to embed the firmware's CRC into the code and check it at runtime.

故事灯 2024-10-31 15:00:59

我发现压力测试很有用。这通常意味着在短时间内给系统大量输入,然后看看它如何处理它。输入可能是

  • 需要处理大量数据的 A 文件。一个例子是一个包含需要由报警设备分析的波形数据的文件。
  • 在另一台机器上运行的应用程序接收的数据。例如,生成随机触摸屏按下/释放数据并将其发送到调试端口的设备的程序。

这些类型的测试可以消除许多错误(特别是在性能至关重要且有限的系统中)。一个好的日志系统也有利于追踪压力测试引发的错误的原因。

I have found stress tests useful. This usually means giving the a system a lot of input in a short time and see how it handles it. Input could be

  • A files with a lot of data to process. An example would me a file with wave data that needs to analyzed by a alarm device.
  • Data received by an application running on another machine. For example a program that generates random touch screen presses/releases data and sends it to a device of a debug port.

These types of tests can shake out a lot of bugs (particularly in systems where performance is critical as well as limited). A good logging system is also good to have to track down the causes of the errors raised by a stress test.

你げ笑在眉眼 2024-10-31 15:00:59

我们结合使用单元测试、集成测试和系统测试。

  • 单元测试涉及逻辑正确性,这里我们使用分支覆盖来确保程序中的所有代码路径都已得到验证。单元测试必须使用模拟和框架(例如 CMock)来完成。我们有一个 Zephyr RTOS 软件包,可以对嵌入式固件进行有效的 CMock 测试:https://github.com/swedishembedded/测试
  • 集成测试是通过编写示例应用程序和测试来完成的,这些应用程序和测试可以在真实硬件和本机 posix 上执行。这是通过使用支持本机 posix 作为目标的构建系统,然后使用 Unity 或 ZTest(zephyr 的本机)等测试断言库来验证运行代码时是否满足条件来完成的。这会测试 API 及其与真实硬件和其他软件组件集成时的行为。这里衡量成功的标准是 API 需求覆盖率:即针对 API 的输入和输出的测试用例。没有嘲笑。
  • 系统测试涉及测试被视为黑匣子的最终固件。最终固件必须在具有物理测试台的真实硬件上或在 CI 管道上的模拟硬件上执行。这种测试根据实际需求验证固件,可以表示为 Gherkin 语言机器人框架脚本。

这三种类型的测试共同满足了嵌入式固件质量保证的绝大多数要求。如果您需要示例和更多代码来帮助您在 Zephyr RTOS 上实现所有这些,那么您可以随时查看瑞典嵌入式平台 SDK 存储库中提供的代码:https://github.com/swedishembedded/sdk

We use a combination of unit testing, integration testing and system testing.

  • Unit testing is concerned with logical correctness and here we use branch coverage to make sure that all code paths through the program have been verified. Unit testing must be done using mocking and a framework for example like CMock. We have a Zephyr RTOS package that enables effective CMock testing of embedded firmware here: https://github.com/swedishembedded/testing
  • Integration testing is done by writing sample apps and tests that can be executed both on real hardware and on native posix. This is done by having a build system that supports native posix as a target and then using a test assertion library like Unity or ZTest (zephyr's native) to verify that conditions are met when running the code. This tests APIs and their behaviors when they are integrated with real hardware and other software components. The measure of success here is API requirement coverage: ie test cases targetting inputs and outputs to apis. No mocking.
  • System testing is concerned with testing the final firmware that is treated as a black box. The final firmware must be executed either on real hardware with a physical test bench or on simulated hardware on CI pipeline. This kind of test verifies the firmware against actual requirements which can be expressed as Gherkin language robot framework scripts.

Together, these three types of testing cover vast majority of requirements for quality assurance of embedded firmware. If you would like examples and more code that can help you implement all of these on Zephyr RTOS then you can always go through the code provided in the Swedish Embedded Platform SDK repository here: https://github.com/swedishembedded/sdk

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文