Test Driven Development with C# - from Padawan to Jedi - Scott Sauber - NDC Porto 2023

Learn the fundamentals of Test-Driven Development (TDD) with C# and take your coding skills from Padawan to Jedi.

Key takeaways
  • TDD is a methodology for writing code, not tests.
  • Test-Driven Development (TDD) helps to write better code by forcing you to think about what the code should do before writing it.
  • The main reason to write tests is to ensure that the code works as expected and to avoid bugs.
  • It is important to write unit tests that test individual components in isolation.
  • Integration tests are used to ensure that different components work together correctly.
  • End-to-end tests are used to test the entire system.
  • It is better to write tests that are self-validated, meaning they contain their own assertions and can determine on their own whether they pass or fail.
  • When writing tests, it is important to test for both happy paths and sad paths.
  • It is also important to test for unexpected inputs and edge cases.
  • TDD helps to minimize manual work and ensures that the code is correct before it is deployed.
  • Tests should be written for the behavior of the system, not just for the code.
  • When writing tests, it is important to think about what the code should do and then write the test to ensure that it behaves correctly.
  • The most confidence comes from writing automated tests that run quickly and reliably.
  • Code should be designed so that it is easy to test.
  • TDD helps to avoid dependencies and makes it easier to refactor code.
  • It is important to write tests for the entire system, not just for individual components.
  • If you can delete code without breaking the system, it is testable.
  • The testing pyramid is a concept that suggests that there should be more unit tests and fewer integration tests.
  • TDD helps to ensure that the system meets the requirements.
  • Writing tests for the system behavior helps to ensure that the system meets the requirements.
  • The term “TDD” is often misused, and it is important to understand what it means.
  • The most important thing is to start writing tests early and often.
  • TDD is a skill that can be learned and improved with practice.
  • Tests can be used to catch bugs and ensure that the system works correctly.
  • TDD helps to avoid bugs and ensures that the system is reliable.
  • Code can be refactored, but it should be refactored after a test is written.
  • The goal of TDD is to ensure that the system is testable and maintainable.
  • TDD helps to ensure that the system is reliable and maintainable.
  • Tests can be used to catch bugs and ensure that the system works correctly.
  • The most important thing is to start writing tests early and often.
  • TDD is a skill that can be learned and improved with practice.