#49 Embedded Unit Testing

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024
  • This is the first lesson about embedded software testing and its central role in software development. You will also see some ways of testing embedded software on the host computer and embedded targets and how to obtain the necessary tools.
    Contents with Timestamps:
    -------------------------
    🕑 0:45 Evolutionary principles for creating complex systems
    🕑 2:00 On the Origin of Software by Artificial Selection :-)
    🕑 3:00 Waterfall process and why it cannot work
    🕑 4:00 Agile software development / Test-Driven Development (TDD)
    🕑 5:20 Artificial selection
    🕑 6:00 Software testing levels: Unit testing
    🕑 6:30 Unit testing harness (a.k.a., Unit testing framework)
    🕑 7:05 Embedded-Test (ET) unit testing harness
    🕑 7:40 Downloading and installing ET
    🕑 8:00 Testing embedded code on the host
    🕑 8:30 ET basic example (on the host)
    🕑 9:30 Obtaining the command-line tools for testing
    🕑 10:00 QTools collection of tools for testing on Windows
    🕑 11:38 Installing QTools on Windows
    🕑 12:20 Explanation of the basic ET example (CUT and tests)
    🕑 14:30 Testing assertions in ET
    🕑 14:46 No need for "test runners" in ET
    🕑 15:10 Overview of ET examples
    🕑 15:35 James Grenning's "TDD for Embedded C" book and "dual-targeting"
    🕑 16:22 Benefits of dual-targeting
    🕑 17:00 Testing on embedded targets
    🕑 17:32 Running tests on the TivaC LaunchPad
    🕑 18:30 Running tests on the STM32 NUCLEO-C031 board
    🕑 19:55 Adapting ET to run on embedded targets
    🕑 21:20 The built-in ET adaptation for the host computers
    🕑 21:44 Conclusions
    🕑 22:23 Confusion about what is being tested
    🕑 22:57 The need to discard less relevant tests
    End Notes:
    ----------
    Companion web page to this video course
    www.state-mach...
    Project download for this lesson:
    www.state-mach...
    GitHub repository for projects for this video course:
    github.com/Qua...
    Transcript of this lesson:
    www.state-mach...
    Referenced software:
    --------------------
    📥 QTools collection of open-source tools for embedded systems development
    on Windows, Linux, and macOS
    Quantum Leaps GitHub repository, 2023
    github.com/Qua...
    📥 Embedded-Test (ET) Embedded Test (ET) -- The Super-Simple Embedded Test
    Quantum Leaps GitHub repository, 2023
    github.com/Qua...
    📥 Unity unit testing framework Simple Unit Testing for C
    ThrowTheSwicth GitHub repository, 2023
    github.com/Thr...
    📥 CppUTest unit testing and mocking framework for C/C++
    CppUtest GitHub repository, 2021
    github.com/cpp...
    📥 GoogleTest - Google Testing and Mocking Framework
    Google GitHub repository, 2023
    github.com/goo...
    ▶ Windows Subsystem for Linux (WSL) Tutorial & How To
    Gary Explains RUclips video, 2019
    • Windows Subsystem for ...
    Books and articles:
    -------------------
    📖 James W. Grenning, "Test Driven Development for Embedded C",
    The Pragmatic Programmers, 2011,
    pragprog.com/t...
    📖 John Gall, "Systemantics: How Systems Work and Especially How They Fail"
    Quadrangle; 1977,
    docdrop.org/do...
    📖 Miro Samek, “On the Origin of Software by Means of Artificial Selection"
    Quantum Leaps Blog, 2011
    www.state-mach...
    Music credits:
    --------------
    🎵 The background music comes from:
    www.bensound.c...

Комментарии • 18

  • @Jonasmelonas
    @Jonasmelonas 5 месяцев назад +1

    Still as a senior embedded software developer, your videos are amazing. Thank you.

  • @IsaacC20
    @IsaacC20 9 месяцев назад +4

    I love this series so much. Have been tuning in since episode 1! It's so broad and comprehensive.

  • @bhups200689
    @bhups200689 7 месяцев назад +2

    i dont know whether it makes any sense or not but for any beginner your content is GOLD. Sometimes one can wonder that should i continue making this content when the views are limited and there is a looooot of effort goes into making even a single video. but trust me dear your work is a veryyyy big help and i can say for hundreds of others like me who feel the same way just not expressing enough.

  • @vadumsenkiv8773
    @vadumsenkiv8773 9 месяцев назад +2

    Thank you. Looking forward for next series on UT!

  • @joshuadavid9424
    @joshuadavid9424 9 месяцев назад +1

    ❤Excellent thought process, disruptive

  • @Lendlav
    @Lendlav 9 месяцев назад +2

    Happy new year 🎉

  • @AkosLukacs42
    @AkosLukacs42 9 месяцев назад +1

    3:30 gold!

  • @ANOCEANGROUND
    @ANOCEANGROUND 9 месяцев назад +1

    Bunch of test frameworks to choose from
    Gtest, unity, cunit. Which one to choose from?
    Need to keep an eye on integration test as well.
    @samek please also schedule one series for python or perl script for automation.

    • @StateMachineCOM
      @StateMachineCOM  9 месяцев назад +3

      Which testing framework? How about ET ( github.com/QuantumLeaps/Embedded-Test ). It is simple, but as capable as Unity. (Support for "mocking" in ET will be added in the future).
      Regarding using Python for testing, I've already made some videos: "Testing of Event-Driven Embedded Software with Python", Part-1 ( ruclips.net/video/dt7Vy02W5DU/видео.htmlsi=rbYd1OktGAJA6_Cy ) and Part-2 ( ruclips.net/video/1L4bAOZHdIc/видео.htmlsi=mhaj-jdUIYT4GKgZ ) --MMS

    • @JuPrgn
      @JuPrgn 9 месяцев назад

      Ceedling is really great too and remove the need to add every tests manually (Ceedling use Unity and Cmock...) given the title I expected this video will speak or mention something about it 😅

    • @StateMachineCOM
      @StateMachineCOM  9 месяцев назад +2

      @@JuPrgn I don't have a video about Ceedling yet, but I do about "mocking" with Unity and Cmock (see ruclips.net/video/dt7Vy02W5DU/видео.htmlsi=qCLxTn8V3EEbcIqk&t=578 ). But to inform viewers unfamiliar with Cmock and Ceedling, they are written in Ruby.

    • @JuPrgn
      @JuPrgn 9 месяцев назад +2

      @@StateMachineCOM I love your video I am a bit late (did not watched all yet) cause I discovered your channel 3 months ago but you have great teaching skills and your content is really valuable !

  • @KiranNayakfastbitlab
    @KiranNayakfastbitlab 9 месяцев назад +1

    Hello Miro, Great video . at 18:33 I was expecting it would report the test result to your QuTest tool. Does QuTest utility work with ET? Thank you

    • @StateMachineCOM
      @StateMachineCOM  9 месяцев назад +1

      Thank you for bringing up QUTest. I didn't mention it in this introductory video about testing because QUTest is a bit more advanced and more innovative than the traditional approach based on the xUnit heritage. QUTest is also not related to ET, which is much more like the other traditional testing frameworks, so it should feel more familiar. The two testing approaches (QUTest based on software tracing) and ET (based on the traditional xUnit) are complementary and useful for different things. ET is good for testing low-level algorithms (e.g., the "ring-buffer" implementation mentioned in the video). QUTest is much better for testing interactions, such as those occurring in event-driven systems. --MMS

  • @nunustone7133
    @nunustone7133 9 месяцев назад

    Happy new year, and thanks for the overview to the testing topic.
    What is your opinion to the fuzzing subject with tools like AFL++ in the embedded system section?

    • @StateMachineCOM
      @StateMachineCOM  9 месяцев назад +1

      I'm not familiar with AFL++ and have never seen it used for embedded software. But anything that finds defects could be potentially valuable. It seems that AFL++ would require testing on the host, which confirms the usefulness of "dual-targeting". --MMS

  • @ashrafkamel1287
    @ashrafkamel1287 7 месяцев назад

    Does ET have a code coverage output?

    • @StateMachineCOM
      @StateMachineCOM  7 месяцев назад

      Code coverage can be recorded by adding the option --coverage to the gcc compiler (in the Makefile). This will generate coverage data in a file, which you can analyze with the utility called gcov. Please google for "gcov". All this will work on the *host* computer right away (that's why I always recommend the "dual targeting" technique.) Obtaining coverage in an embedded target is possible, but more involved and ET currently does not support it. --MMS