Skip to content

Lesson 9 (Unit Testing & TDD)

Courtney Frey edited this page Apr 13, 2022 · 2 revisions

Lesson 9: Unit Testing

In the prep work for this lesson, the students learned:

  1. What unit testing is and why it is important.
  2. How to use Jasmine for testing.
  3. What test driven development (TDD) is and how to use it to write solid code.

Announcements

  1. More info to come... when in doubt, check with the class Candidate Engagement Manager!

For Part-Time Students:

  1. When your third graded assignment becomes available, make sure to check it out! Starting as soon as possible is key to finishing those graded assignments on time!

For Full-Time Students:

  1. Assignment 2 due at end of Day 15

Large Group Time (Instructor)

Lesson 9 Topics That Require Careful Attention

  1. Reinforce why unit testing is important. If you can share an instance where properly testing your code saved you a huge headache, please do!
  2. Live coding is your friend for this lesson!
  3. Q & A for the chapter exercises or perform a walkthrough.
  4. What "edge case" means, plus examples.
  5. What does "describe" do compare to "it"? Review syntax, and encourage descriptive feedback messages.
  6. Studio intro:
    1. The exercises practiced using unit tests to validate existing code. The studio flips this to a TDD scenario - the students must write tests BEFORE creating any of the code.

Studio (TF Notes)

Lesson 9 Studio

  1. The studio is divided into parts that are in the proper order for TDD. Remind students to not skip around the different steps!
  2. Reinforce the benefits of writing tests before the code.
  3. If many of the students have the same questions or problems with writing their first test, consider going through that as a group.
  4. This would be a good studio for the students to work on in pairs. Each student still needs to submit their own final project, but collaborating on the code helps with the learning curve.