Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Skill Up: A Software Developer's Guide to Life and Career
  • Toc
  • feedback
Skill Up: A Software Developer's Guide to Life and Career

Skill Up: A Software Developer's Guide to Life and Career

By : Jordan Hudgens
4 (2)
close
Skill Up: A Software Developer's Guide to Life and Career

Skill Up: A Software Developer's Guide to Life and Career

4 (2)
By: Jordan Hudgens

Overview of this book

This is an all-purpose toolkit for your programming career. It has been built by Jordan Hudgens over a lifetime of coding and teaching coding. It helps you identify the key questions and stumbling blocks that programmers encounter, and gives you the answers to them! It is a comprehensive guide containing more than 50 insights that you can use to improve your work, and to give advice in your career. The book is split up into three topic areas: Coder Skills, Freelancer Skills, and Career Skills, each containing a wealth of practical advice. Coder Skills contains advice for people starting out, or those who are already working in a programming role but want to improve their skills. It includes such subjects as: how to study and understand complex topics, and getting past skill plateaus when learning new languages. Freelancer Skills contains advice for developers working as freelancers or with freelancers. It includes such subjects as: knowing when to fire a client, and tips for taking over legacy applications. Career Skills contains advice for building a successful career as a developer. It includes such subjects as: how to improve your programming techniques, and interview guides and developer salary negotiation strategies.
Table of Contents (5 chapters)
close
4
Index

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:

  1. 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:
    Importance of Test-Driven Development for Coders
  2. Then we'd run the test, knowing that it will fail:
    Importance of Test-Driven Development for Coders
  3. Then we would go and add a barebones implementation of the code:
    Importance of Test-Driven Development for Coders

    This will get the test passing:

  4. Then we'd go back and refactor the implementation to ensure it conforms to best practices and that the refactor...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete