DEV Community

Emeka Icha
Emeka Icha

Posted on

TDD: write better code in less time (a tech talk summary note)

Speaker: Evan Dorn
Link: https://www.youtube.com/watch?v=HhwElTL-mdI

Why do some programmers not write test?

Programmers are smart people. And smart people can make progress without process. Professionals in other fields first design, plan and prepare before they implement. So should programmers. TDD is a way to do this.

Note: Below points are taken verbatim from the talk. You should really watch the talk. It is awesome.

TDD(Test Driven Development) defined

  • Decide what the code will do.
  • Write a test that will pass if the code does that thing.
  • Run the test, see it fail. (A very important step.)
  • Write the code.
  • Refactor.

TDD Provides

  • design and plan before you code.
  • document your design.
  • proof that code implements design.
  • encourages design of testable code.

Testable code is

Conclusion

Processes might feel tedious initially but they are necessary to transition from a 'programmer' to a software engineer. And they pay off in better productivity, cleaner codebase and better designed system.

Also see: TDD on wikipedia

Top comments (0)