# Unit Testing vs HIL Testing

- Show: [The Pragmatic Embedded Podcast](https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast)
- Published: 2022-06-02
- Length: 37m
- Page: https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2022-06-02-unit-testing-vs-hil-testing
- Listen: https://agileembeddedpodcast.com/episodes/unit-testing-vs-hil-testing-5244TxKe

## Summary

Jeff Gable and Luca engineer discuss a listener's question on whether to prioritize unit testing or Hardware-in-the-Loop (HIL) testing for embedded systems. They argue that while HIL tests are crucial for validating system-level requirements and subsystem interactions, unit tests are essential for rapid feedback, refactoring safety, and catching low-level faults early. The hosts conclude that a hybrid approach is necessary, recommending that teams start with unit tests while simultaneously building the infrastructure for system-level testing to avoid technical debt.

## Chapters

- [0:00](https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2022-06-02-unit-testing-vs-hil-testing#t=0) Introduction: Listener's Unit vs HIL Question
- [1:36](https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2022-06-02-unit-testing-vs-hil-testing#t=96) The Pitfalls of Poor Unit Testing and TDD
- [4:08](https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2022-06-02-unit-testing-vs-hil-testing#t=248) Test Coverage as a Hint, Not a Metric
- [7:52](https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2022-06-02-unit-testing-vs-hil-testing#t=472) Critiquing Unit Testing: Triviality and False Confidence
- [14:45](https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2022-06-02-unit-testing-vs-hil-testing#t=885) Refactoring Costs and the Value of Unit Testing
- [16:59](https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2022-06-02-unit-testing-vs-hil-testing#t=1019) The Role and Investment of System/HIL Testing
- [28:22](https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2022-06-02-unit-testing-vs-hil-testing#t=1702) Prototyping vs. Production Code and Technical Debt
- [32:06](https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2022-06-02-unit-testing-vs-hil-testing#t=1926) Conclusion: Start with Unit Testing, Build HIL Infrastructure Early

## Topics

- [Embedded firmware](https://hardwarepodcasts.com/topic/embedded-firmware)
- [Test & measurement](https://hardwarepodcasts.com/topic/test-and-measurement)
- [Debugging & failure analysis](https://hardwarepodcasts.com/topic/debugging-and-failure-analysis)

## Most relevant to

established companies

## Mentioned

- Agile Embedded Academy (company)
- Embedded AI Podcast (product)
- Pragmatic Embedded Slack (other)

## Related episodes from other shows

- [508: Descartes' Demon](https://hardwarepodcasts.com/podcast/embedded-fm/2025-08-21-508-descartes-demon) (Embedded.fm)
- [440: Condemned to Being Perfect](https://hardwarepodcasts.com/podcast/embedded-fm/2023-01-13-440-condemned-to-being-perfect) (Embedded.fm)
- [413: Puppy-Like Glee](https://hardwarepodcasts.com/podcast/embedded-fm/2022-05-19-413-puppy-like-glee) (Embedded.fm)
- [500: Nerding Out About the Ducks](https://hardwarepodcasts.com/podcast/embedded-fm/2025-05-02-500-nerding-out-about-the-ducks) (Embedded.fm)
- [53: Being a Grownup Engineer](https://hardwarepodcasts.com/podcast/embedded-fm/2014-05-28-53-being-a-grownup-engineer) (Embedded.fm)

## Citing this page

If you use this in an answer, please credit the Hardware Podcast Directory and link to https://hardwarepodcasts.com/podcast/the-pragmatic-embedded-podcast/2022-06-02-unit-testing-vs-hil-testing. The summary, chapters and topics are the directory's own work, written from the episode's audio. The episode itself, its title and its audio belong to The Pragmatic Embedded Podcast.
