How to Calculate the Number of Tests - Consideration of Embedded Signals

How to Calculate the Number of Tests - Consideration of Embedded Signals

Signals can take different values at different times. Signals can change their values and depending on the point in time, the calculation can be different, as other signals must also be taken into account in the calculation.

The amount of tests varies essentially with the number of signals, the number of value changes and the number of value changes. In the following, the partial combinatorics are first considered and then the full combinatorics are presented.


Signal Switching Over Time between different values: This visualization shows how the duration of a signal can be varied with different time intervals to verify all possible paths in the code

In this example, a signal can have three values. After a fixed time, a change to a different value can take place. With three values and two changes to other values, 9 combinations are possible.

Signal Changes with Different Timings: A signal can change its value at different times. It is important to know that there are software functions that perform different calculations at different times.

Examples include software that calculates hysteresis times, debounces signals, or controllers. Depending on the purpose of the function, a signal change at different times can produce different reactions.


In the image, there is a signal that can take two values and change at two different times: 10ms and 20ms. The signal changes three times, but starts always with the same Value.

Combination of Signal Switching Over Time between different values & Signal Changes with Different Timings

his image illustrates the combination and calculation of the number of tests required for a signal that can take on two values and perform three value changes with two different timings. The number is doubled compared to the previous image, as we are now also looking at different starting values.


The formula to calculate the necessary number of tests is depicted as follows:

Where:

  • n = number of input interfaces with temporal impact on output interfaces.
  • signalECR = number of representatives per signal (e.g., dark, twilight, bright => 3).
  • p = number of switches (Triple Switch = 4, Dual-Switch = 3, Mono-Switch = 2).
  • m = number of temporal parameters with impact on inputs.
  • timeECR = number of representatives per timing (e.g., 10ms, 20ms => 2).


By analyzing the image, we can determine all the possible combinations and the corresponding number of tests necessary to ensure comprehensive test coverage. This approach ensures that all possible signal states and timing behaviors are verified, which is crucial for the reliability and robustness of the embedded system.



Combinations of Signal Switching: This visualization shows how two signals can be changed at different times. For each switch point, there are three options: before the other signal changes, simultaneously, and after the other signal changes.

Two signals can be switched to each other at different times. Let's take signal 1 as a reference. A second signal: can change its value before signal 1, at the same time or later. This consideration must be taken into account for each signal change. Two signal changes for two signals result in 9 combinations.

The combinatorics increase exponentially with the number of signals and the number of value changes.

Where:

  • n = number of input interfaces with temporal impact on output interfaces.
  • p = number of switches (Triple Switch = 4, Dual-Switch = 3, Mono-Switch = 2).
  • timeECR = number of representatives per timing (e.g., 10ms, 20ms => 2).


This image shows the combinatorics of two signals that are switched against each other at different times. Each signal can only be switched between two values. Compared to the previous image, the combinatorics are 4 times higher.

Where:

  • n = number of input interfaces with temporal impact on output interfaces.
  • signalECR = number of representatives per signal (e.g., dark, twilight, bright => 3).
  • p = number of switches (Triple Switch = 4, Dual-Switch = 3, Mono-Switch = 2).


The sum of the full combinatorics (X) is calculated according to the following formula:

  • n = number of input interfaces with temporal impact on output interfaces.
  • signalECR = number of representatives per signal (e.g., dark, twilight, bright => 3).
  • p = number of switches (Triple Switch = 4, Dual-Switch = 3, Mono-Switch = 2).
  • m = number of temporal parameters with impact on inputs.
  • timeECR = number of representatives per timing (e.g., 10ms, 20ms => 2).


Example calculations of the number of necessary tests (X) for different input variables.



Conclusion

The formulas provided are instrumental in determining the number of possible combinations that can arise when testing multiple signals. It becomes readily apparent that even with a few signals, the number of representative values can quickly lead to high combinatorial complexity. This complexity must be considered when selecting the number of representatives.

Moreover, the number of signals is of critical importance. If a device under test (DUT) has too many interfaces, the exponential dependencies can rapidly lead to an unmanageable number of tests. This scenario must be taken into account, especially during the software architecture and design phases.

Note: These formulas illustrate the full combinatorial potential (for calculating necessary tests in black-box testing). It is important to recognize that full combinatorial testing is not always required. With white-box analysis, certain combinations can potentially be excluded. This consideration should be reflected in the test strategy.

Eduard Drusa

CMRX memory protected realtime microkernel for MCUs | Software is not a crankshaft

8 个月

Just swap the word "signal" for word "state". Magically, it will become valid for state changes inside the software, which can happen concurrently. People of automotive do pretty terrible job realizing these two are basically the same.

要查看或添加评论,请登录

Robert Fey的更多文章

社区洞察

其他会员也浏览了