Chapter 39. Importance of Test-Driven Development for Coders
Let`s discuss the importance of test-driven development. First and foremost, if the terms TDD or BDD, which are short for test- and behavior-driven development, are foreign to you, they are the practice of building code tests for applications.
And even more specifically, TDD and BDD are software development processes in which you create a test that sets an expectation before implementing any code.
An example of using TDD to create a feature for returning a full name from a user class would be to:
- Create a test that calls a new method, such as
full_name
, that combines the first and last name of a user and returns a string combining the names into a single value: - Then we'd run the test, knowing ...
Get Skill Up: A Software Developer's Guide to Life and Career 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.