June 21, 2021
Nikolay Kostov (Nikolay.IT)
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
- “Tests First” approach
- Test-driven development (TDD)
Code and Test Approach
- Code and Test approach steps
- Write code
- Write unit test
- Run and succeed
- Time flow
Test-driven Development steps
- Pick а test
- Compile and fail
- Write enough code to compile
- Run test and fail
- Write code to pass test
- Create a tests list
- Time flow
- Write test
- Remove duplication
Why TDD?
- TDD helps finding design issues early
- Writing code to satisfy a test is a focused activity
- 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