Test-Driven Development and Unit Testing
2 day course Place: TBD
1.800 Eur (Classroom)
Request more information
Lena Bernhardsson – SE, DK, NO
+46 (0) 40 59 22 09
lena.bernhardsson@nohau.se
Heidi Lehtomäki – Finland
phone: +358 40 196 0142
heidi.lehtomaki@nohau.fi
Training material and lunch are included (Lunch is not included for Online Courses)
The Test Driven Development process implies in its purest form:
- 1st, define what/how the feature shall be tested
- 2nd, implement code forming the feature and make its test(s) to pass
- 3rd, refactor the code in order to fit into an appropriate standard – i.e., an architecture.
The driving force behind TDD is the Unit Test
The principal goal of unit testing, in embedded systems, is to take the smallest piece of testable code in an application e.g. a device driver. Then isolate it from the rest of the code, and determine whether it behaves as expected. Chiefly it is the outer observable behavior we are verifying.
Each unit is tested separately before integrated into higher order modules. Unit testing has proven its worth in that a large percentage of defects are identified during its use.
Goal/Benefits
This training provides the participant with a number of concepts around TDD in terms of unit testing:
- Test-Driven Development – TDD
- Decoupling
- Software Architecture with Testability in Mind
- Embedded TDD Strategies
- DRY: Don’t Repeat Yourself!
Audience/Participants
This training is aimed for embedded system software designers/C-programmers dealing with development of new features, as well as maintaining existing legacy systems.
Outline
- Test-Driven Development – TDD
- Why TDD?
- What’s TDD
- Benefits of TDD in an Embedded System Context
- Decoupling – The Art of Decreasing Links and Dependencies in order to Achieve Unit Testability
- Why:
- Facilitates Testing
- Facilitates Extension/Replacement
- Variants
- Facilitates Porting
- Architecture with Decoupling in mind
- Legacy – How to Tackle a Monolith
- Blank Paper – Just go for it!
- Hybrid – Legacy and New Features in Harmony
- Why:
- Designing Code with Testability in mind
- The Fewer Execution Paths, the Better!
- Controlling Behavior – or avoiding if-else
- Function Pointers
- Tables
- Embedded TDD Strategies – an Overview
- Dual Targeting – Target- vs. Development Environment
- Mocking – Provide and Expect
- Dealing with Legacy Code