Topics covered:

  • Unit Testing Approaches
  • Code and Test Approach
  • Test-driven Development steps
  • Why TDD?
  • Myths and Misconceptions

Video (in Bulgarian)

Presentation Content

Unit Testing Approaches

  • “Code First” (code and test) approach
    • Classical approach
  • “Tests First” approach
    • Test-driven development (TDD)

Code and Test Approach

  • Code and Test approach steps
    1. Write code
    2. Write unit test
    3. Run and succeed
    4. Time flow

Test-driven Development steps

  1. Pick а test
  2. Compile and fail
  3. Write enough code to compile
  4. Run test and fail
  5. Write code to pass test
  6. Create a tests list
  7. Time flow
  8. Write test
  9. Remove duplication

Why TDD?

  • TDD helps finding design issues early
    • Avoids rework
  • Writing code to satisfy a test is a focused activity
    • Less chance of error
  • Tests will be more comprehensive than when written after code

Myths and Misconceptions

  • You create a 100% regression test suite
  • The unit tests form 100% of your design specification
  • You only need to unit test
  • TDD is sufficient for testing
  • TDD doesn’t scale (partially true)
    • Your test suite takes too long to run
    • Not all developers know how to test
    • Everyone might not be taking a TDD approach