L
L
little_schoolboy2015-05-18 17:29:50
C++ / C#
little_schoolboy, 2015-05-18 17:29:50

Where to start in unit testing for a microcontroller and is it worth it?

I have been writing for 8-bit microcontrollers in C for several years. Does anyone have experience with using unit test writing? What features to start with? Is there any reason?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Cheremisin, 2015-05-19
@little_schoolboy

Actually there is nothing complicated. We write the same unit tests, and add the results of asserts to a separate memory area. It is then easy to view it for the presence of units (you can even do a bit shift). In other words, we only need to write an assert function that compares its two arguments and sets the result to the next bit (or byte) in the allocated memory area (0 is good, 1 is bad). Based on the position in memory, we calculate the failed assert. If there is a lot of memory, then you can also add an argument with the test number to the assert, then we will have one byte of the test number, the second - the result.
Well, by the way, you can log in this way right in the operating mode, you just need to make a cyclic buffer in the assert and a pointer to the current element.
And in fact, at one time I debugged it. Suitable for debugging very fast processes!!!!

U
UA3MQJ, 2015-05-20
@UA3MQJ

A very original solution
habrahabr.ru/post/212507

S
Sergey Sapov, 2015-05-28
@softmart

There is a sense, even more than for a PC. Because the cost of an error is higher and access to the logs is more difficult than on a PC. I use
cutest.sourceforge.net

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question