Test-Driven Development

Test Driven Development helps you write code without defects and with almost 100% unit test coverage. As a side effect you will have a set of examples of usage of your code that will improve your team collaboration.

The nearest dates
30.1.2025 Praha

Test-Driven Development (TDD), is a technique based on writing code in extremely short cycles (one cycle typically takes a few minutes). In each cycle, a test is first written to prove that the desired functionality does not work yet. In the second phase, the production code is modified to pass the new test and all previous ones. The last phase is then called refactoring, or improving the code structure without changing the functionality.

Test-Driven Development typically leads to writing much better code than when code is written without tests. For example, programmers naturally almost stop using the debugger because they don’t need it. In addition, code is naturally covered by tests over time, leading to less fear of changes in the future.

The training is a practical  introduction of Test-Driven Development. The participants will go through the technique step by step and let them acquire design and coding skills on practical examples. 90% of the training is hands-on working with the code. The examples are selected so that they are easy to understand and clearly demonstrate the benefits of TDD such as having a perfect control of the code being written, increased test coverage or incremental development.

Goals of the Training

The goals provides practical experience with TDD and skill required to use the technique later in their daily work. The course is directed to both junior and senior developers that have no previous experience with TDD. After the training you will be able to write code that will be more modular, covered by automated unit test by almost 100% and will be almost without errors. The code will be easy to refactor due to the high modularity and test coverage.

Amount1 day
Formpersonally or remote
pairing
3 time a two-hour block with some pauses
Pro koho je určendeveloper
tester
Scrum team member
architect
training is possible in any programming language, e.g. JavaScript/TypeScript, C#, Java, python, atd.
TDD cycle

Training content

Block 1. Introduction to Test Driven Development

You will reveal the secret of effective programming with TDD. You will learn the Red-Green-Refactor loop. You will try TDD on a simple example and get the feeling of control over the code being written that you will never lose.

Block 2. Code expansion with Test Driven Development

You will learn to expand more complicated code step by step. You will learn the ZOMBIEs technique  (Zero-One-Many-Boundary-Interface-Exception) that will help you to choose the next test so that it is manageable and you are able to keep control over the growing and more complex code.

Block 3. Incremental Value Delivery

You will learn to deliver value by tiny, well understandable pieces. At the beginning you will receive short instructions. The next step is to create a backlog of 10-20 microrequirements. Each of these microrequirements delivers customer value. You will then implement them one by one in the next 45 minutes. In other words, you will deliver customer value every few minutes.

Block 4. Testing code with dependencies

What are the most difficult problems when you need to work with the code that has dependencies? Slow and brittle tests that are hard to write. What can you do? You will learn to look for seams – places in the code that can be isolated for testing. And then four methods that can be used to write tests – integration tests, mocking, using inheritance and dependency injection. You will try the benefits and drawbacks of each method with practical examples.

Bonus

What does research say about Test Driven Development? What improvements of your products and your professional skills can you expect when you will use TDD regularly?

This training is just introduction to TDD. It will be more valuable when it will be followed by using TDD on your own code, ideally with an experienced mentor.

Participant requirements

  • basic programming knowledge
  • ability to write code in one of the following languages: JavaScript, C#, Java, python
  • ability to write a simple unit test in one of these languages.

Technical requirements(BYOD)

  • A computer with any OS
  • Docker
  • Visual Studio Code with the DevContainers extension

This training is just an introduction to TDD. It is highly recommended to follow up with a long and intense practice on the specific company exmples, ideally under a supervision of an experienced mentor.

Testimonials

“We have been talking about TDD and the fact that we could use it in our work for some time in our company. But it was rather a partisan action of a few enthusiasts, waiting for general understanding and recognition. This happened after a workshop with Robert, who managed to explain the benefits of this approach even to the less enthusiastic developers in a simple and practical way. Everyone really enjoyed the workshop and we are already making plans together to incorporate TDD into our daily development lives. Thank you very much!”

Anita Bak, Easy Software