“ Nothing makes a system more flexible than a suite of tests. Nothing.— Robert C. Martin (Uncle Bob)
Are unit tests causing you pain? Are they constantly failing whenever you make changes to your production code? Do you spend a lot of time fixing them when they break? Are they difficult to set up and run? Do you have a hard time maintaining or structuring your unit test code? Are they causing you headaches from time to time? Are you ready to give up on writing unit tests or have you already done so?
Or do you just want to step up your game and want to learn more about how to write readable and maintainable unit tests?
This course is for software developers who want to improve upon their existing skills for writing unit tests. By the end of this course, students will have gained the knowledge to build loosely coupled, highly maintainable and robust unit tests that are trustworthy and improve the overall code quality of your software applications. The content of this course is based on 15+ years of experience with Test-Driven Development. This knowledge is essential for becoming a senior-level software developer or a technical lead.
- Why we need automated tests
- Taxonomy of tests
- Solitary versus sociable tests
- The test pyramid
- State versus behaviour verification
- Test-Driven Development (TDD)
- Clean unit tests
- The DRY principle
- The Single-Responsibility Principle (SRP)
- The DAMP principle
- Other characteristics of maintainable unit tests
- Arrange, Act, Assert (AAA)
- AAA per test method
- Single assert per test
- Setup / TearDown
- AAA per test class
- Assert last principle
- Naming unit tests
- Public interfaces
- Object mother
- Test data builder
- State versus behaviour verification (again)
- Indirect inputs and outputs
- SUT builder
- Auto mocking container
- Fixture object
- Making clear observations
- Failing tests
- Single assert per test
- Procedural versus object state verification
Although the examples that are used throughout this course are written in C#, the principles and guidance discussed here are broadly applicable to other platforms and programming environments as well. So students will be able to universally apply this knowledge throughout the rest of their careers as software developers. Nonetheless, having a good understanding of the following topics will definitely make it easier to pick up the content of this course:
- A decent understanding of an object-oriented programming language, preferably C# or Java.
- At the very least some first experiences writing unit tests for production code.
- Basic or intermediate knowledge of the NUnit and/or xUnit test frameworks.
- Basic or intermediate knowledge of mocking frameworks like Moq, NSubstitute or Rhino Mocks.
This course takes 2 full days to complete.
“ Test-Driven Development (TDD) isn’t something that comes naturally. It’s a discipline, like a martial art, and just like in a Kung Fu movie, you need a bad-tempered and unreasonable master to force you to learn the discipline.— Harry Percival ("Test-Driven Development with Python")
Contact us at email@example.com or call +32 496 38 00 82
Thank you for visiting my website. I’m a professional software developer since Y2K. A blogger since Y2K+5. Provider of training and coaching in XP practices. Curator of the Awesome Talks list. Past organizer of the European Virtual ALT.NET meetings. Thinking and learning about all kinds of technologies since forever.