- 2.5 hours on-demand video
- 10 articles
- 7 downloadable resources
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- Develop Embedded and System Software in C using Unit Tests.
- Apply Test Driven Development practices and design patterns to your own projects.
- Produce quality, maintainable, and self-documented software designs through test-first thinking.
- Understand how to use the open source Unity test framework
- Take over the world.
- You should have basic proficiency in C programming.
- You should have some experience with Embedded or Systems Programming. If you've ever dealt with a register or bit mask, you're our kind of people.
- No prior testing experience is required.
- While certain tools are required for this course, they're all free, and we'll guide you through all necessary installation and configuration as we go.
Welcome to Dr. Surly’s School for Mad Scientists!
Unit Testing and Test Driven Development help smart, capable developers like you create robust, reliable, and maintainable software that lets you sleep soundly at night. In this course you will apply these concepts to embedded code and system software in C.
This course introduces the Unity framework, key principles, and a variety of techniques so that you can apply Unit Testing and Test Driven Development in complex and low-level C code. Once you’ve completed this material or if you’re already familiar with TDD and xUnit frameworks our course Interaction Testing, Mocking & Embedded Software in C is a great next step.
Dr. Surly’s School for Mad Scientists
When you’re trying to take over the world you learn two things quite quickly. First, you end up building lots of technology like death rays and such that requires high quality firmware. Second, minions, climate-altering satellites, and lairs are expensive. While Dr. Surly’s lab has become quite proficient at software design and testing, supplemental revenue to fund all manner of villainy is a necessary evil. It’s all part of the standard world domination business model, and you get to benefit.
In This Course You Will:
Develop in C using Test Driven Development. Write real, executable tests on your first day.
Learn concepts from Agile, XP, Scrum, and Lean practices for producing well designed, high quality, scope-managed, and self-documented code.
Utilize the free, open source tool Unity in real-world testing scenarios. No toy examples.
Follow us through real-world programming examples and see techniques and patterns for unit testing tricky code.
Encounter big idea philosophies for process, design, and testing.
Apply your new skills to challenging practice problems.
Connect with a supportive community.
Learn How To Apply Unit Testing To Your Embedded and System C Software
You will learn skills that have become staples in higher level languages but are sadly underutilized in the C world. In particular, you will learn to write unit tests in the uniquely challenging setting of embedded and system software.
Of course, the test-driven techniques you will learn produce code that enables thorough, smart testing. But, a happy side effect of TDD is code that tends to adhere to generally good design principles. You won’t only be learning testing in this course but also good design.
This Course Includes:
0x1D (29) Code-centered lectures
0x05 (5) Development projects
0x12 (18) Helpful resource-packed supplemental primers, guides, and how-to's
Links, quizzes, helpful hints, and more
Can’t decide? Need something more? Please write us at… email@example.com
Join us in our mission to take over the world (with quality embedded software)!
- This course is for C developers seeking to learn Unit Testing and Test Driven Development. If you are new to the C language or programming for hardware, this course may be too advanced for you.
Welcome to our mad scientist lab. If you're going to take over the world some day, inevitably you're going to be building electronics and programming low level code. You may be insane, but you're not dumb. You're taking this course to learn structured and responsible testing practices for low-level code. We're going to be working in C and using open source tools like Unity and CMock to get you writing tests as soon as possible for a variety of example projects. You learn best by doing and so there's plenty of doing in this course.
If you want to know more about Dr. Surly, the patron saint of mad scientist firmware developers, you can read his much abridged life story. It's one page, and it's attached.
Unit testing embedded and system code is a relatively new development. In fact, the tool we use in this course was created at a time when many thought such things couldn't be done.
The nuts and bolts of Section 2 is to push off lots of yacking at you until later in favor of getting you writing tests as soon as possible. Don't worry. We will address your inevitable questions soon enough. Please be patient.
We need to get you set up before you tear into writing tests. That means being familiar with the documentation we provide and your options for a development environment. In this lecture we discuss:
- All the core documentation you'll want to reference regularly plus a variety of thorough treatments of topics related to this course but outside its immediate scope.
- Options for development (a readymade web-based sandbox or do-it-yourself local environment).
This lecture covers your options for asking questions not addressed in the course material. For instance, you may need help debugging issues in the previous step (lecture). Or, you may have specific technical or philosophical questions that arise during the rest of the course.
The testing setup we employ early on is easy to use and generally problem free. Our supplemental documents cover lots of issues and potential questions. But if you're stuck, you have several options for help.
In this lecture we explain what's happening under the hood of these testing tools and why the tools were designed the way they are. We break down a project's code in diagrams to show how your source and test code live separately but in harmony.
We get into the nitty gritty of how and where you actually run your executable unit tests:
- Locally (native)
- In a simulator
- On target
And we address the scope of testing approaches:
For more on the fine details of unit, integration, and system testing, please see our supplemental "Extra Goodness" document (document archive attached to Lecture 4): What's the difference? Unit, Integration, and System Testing.
If you want to really dig in to understand a testing framework like Unity:
- Go ahead and look at Unity's source code: https://github.com/ThrowTheSwitch/Unity/
- Take a gander at MinUnit — A minimal unit testing framework for C in 3 lines of code: http://www.jera.com/techinfo/jtns/jtn002.html
In this lecture we walk you through creating a new embedded source module from scratch. You will begin building a real GPIO module and unit testing all the necessary register settings as you build up the code from requirements. You'll be developing the source and the tests together. We identify and demonstrate good practices as we go.
In this lecture we share useful resources on the concepts covered in the previous lecture. Additionally we point you to a variety of studies on and philosophical discussions about the value and tradeoffs of unit testing itself. With the materials of this lecture you will be able to speak intelligently to your colleagues about both the pros and cons of unit testing practice. We also assign some homework.
In this lecture we further develop the embedded GPIO module we began in this section and we pick up the pace a little. We continue demonstrating test-first and behavior-driven test development for additional pieces of the GPIO interface.
And, we specifically address good practices for working with:
- Newly implemented but mostly blank functions
- Error codes and conditions
- Bounds checking
Registers are fairly simple—except when they're not. Different processors use different styles of register interaction and produce a variety of behaviors. See our supplemental document (attached in Lecture 4): Testing Special Cases for more perspective on testing tricky register interactions.
In this lecture we take a step back and discuss two important concepts underlying the decisions we've been making along the way:
- Do the Simplest Thing That Could Possibly Work
- Ya Ain’t Gonna Need It
These are powerful concepts that may feel a little wrong at first. We explain why they are a good way to work and how testing plays nice with these approaches. We then demonstrate them in action in testing the Init() function of our GPIO module.
In this lecture we work through a case that seems complicated on its surface. Our mantra of Simplest Thing That Could Possibly Work seems to lead us to call source functions in our unit tests that are outside the test case under development. We show how to think through decomposing these rather common cases into tests and also introduce setUp() and tearDown() within the testing framework.
We discuss where all our work so far belongs in the grand scheme of things and explain how and where our testing approach applies beyond only the work we've done so far.
This section will help you think about the “edges” of your code and how testing applies to common scenarios of state machines, math functions, and data containers.
For an in-depth look at testing special cases (e.g. main(), for() loops, various register setting scenarios), see our supplemental "Extra Goodness" document (in the archive attached to Lecture 4): Testing Special Cases.
We review all the work we've done in all the sections of our course and where it falls in the scheme of things. Go on towards world domination with your mad scientist plans.
For an in-depth look at testing special cases (e.g. main(), for() loops, various register setting scenarios), see our supplemental "Extra Goodness" document (in the archive attached to Lecture 4): Testing Special Cases. Heck, take a look at all the documents in the archive as they will address many issues we can't cover in the main course.