Critical embedded systems (CES) have become ubiquitous in whether medical, automotive, or industrial. Software failures in such systems are potentially disastrous and could lead to serious consequences not only financially but also life-threatening. However, besides their omnipresence, CES complexity have grown to extreme measures, faced with this increase, manufacturers and suppliers are increasingly interested in effective methods of testing logical correctness and verifying that software parts are error-free.Software testing is a collection of methods used to detect and correct bugs and faults found in software code. The first stage of software testing is unit testing, a widely used technique where individual units of source code are isolated, often divided up into classes and functions, and tested separately to aid in the verification of the behavior and functionality of the system. In this chapter, an overview of GoogleTest (GTest), a xUnit C++ testing framework will be performed, and a comparison of different available unit test frameworks for use in the C++ language. On account of the complexity provided by critical embedded systems, it is difficult to isolate and test the system's behavior, mocking techniques were considered to enable a real implementation to be replaced with a fake implementation, the replacement allowed to overcome the challenges related to hardware dependencies and external factors. Further, this chapter describes GoogleMock, a part of GoogleTest C++ testing framework that makes the tests run in isolation.
翻译:关键嵌入系统(CES)已变得无处不在,无论是医疗、汽车还是工业系统。这些系统中的软件故障具有潜在的灾难性,并可能导致严重后果,不仅在财政上而且危及生命。然而,除了无处不在之外,CES的复杂性已发展到极端的措施,面对这种增长,制造商和供应商越来越关心检验逻辑正确性的有效方法,并核查软件部件是无误的。软件测试是用来检测和纠正软件代码中发现的错误和缺陷的一套方法。软件测试的第一阶段是单位测试,这是一种广泛使用的技术,其中单个源代码单位被孤立,往往分为不同类别和功能,并单独测试以协助核查系统的行为和功能。本章将概述GoogleTest(Gest),一个XUnit C++测试框架,比较C+语言中使用的不同现有单位测试框架。考虑到关键嵌入系统所提供的复杂性,很难分离和测试系统行为,一种广泛使用的技术,这种技术被广泛使用,即单个源代码被孤立,往往分为不同的类别和功能,并被单独测试,用来协助核查系统的行为和系统行为。在本系统的行为和功能和功能功能功能的测试中进行测试。在本章上,将用一个真正的测试框架取代一个假的硬件测试,可以取代一个硬性测试。