Test-driven development

As our applications grow in both size and complexity, it is more important than ever for us to deliver software with as few bugs as possible. Manual testing is inconsistent and slow, which means we need to adopt a more methodical way of ensuring the quality of our software. This need has brought about the notion of test-driven development. Test-driven development is a development cycle that repeats a small set of steps to ensure each line of code is tested. The steps in the test-driven development life cycle are:

  • Adding a test
  • Running the tests
  • Writing the code
  • Running the tests again
  • Refactoring the code

The first thing we want to do is write a test to verify some functionality. This creates a requirement for the code that we ...

Get TypeScript Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.