Liskovs

[Summer, Stefan, Amalia, Ian, Sean]

Test Driven Development :

Be cooler than your other programming friends

 

  • What is TDD?
  • What is BDD?
  • Why TDD?
  • Business Reasons for TDD/BDD
  • Testing Demonstration
  • User Stories

What we're covering:

Test Driven Development :

 

  • Software development process
  • 10 - 15 yrs old
  • You write tests before you write code
  • Then Program to pass tests
  • Each test should be a highly specific
  • (the more specific the better)

encourages simple designs and inspires confidence.

Kent Beck

WHY TDD?!


- Lean Code

- Reduced defects

- Forces thinking

 

 

 

Inputs // Outputs

So...what is BDD?

BEHAVIOR DRIVEN DEVELOPMENT

A newer coding concept than TDD, and arguably the evolution.

In contrast to TDD, BDD is not directly concerned with the functionality of the actual code of the project. It instead asks the more fundamental question of what tests and coding actually need to be done at all.

 

It’s the step before TDD even happens, and thus BDD ensures that the TDD process is focused and on track.

 

🤔

How does BDD work?

Like TDD it tests that an objective has been completed, but instead of the literal validity of code, getting tests to pass requires that the code fulfills the final aim of the project.

⌨️ Given the customer has logged into their account

💰 They see an accurate representation of their current account X value

💸 When the customer transfers Y amount to their account

✅ Then the new current account balance should be X + Y

Wow. So glad you asked!

💣🔥🔥🔥🔥🔥

What's an example of the syntax?

BDD in conslusion

It is a semantically accessible test that we can now write TDD tests and code to satisfy.

 

It provides an overarching structure that guides what TDD should be accomplishing.

✨⭐️🌏🚦✈️

 Said in another way, desired behavior & specification is what drives our software development, not the other way around!

 

Process // Differences

So you might ask, why do businesses use TDD?

 

Some key reasons for considering TDD are:

 

  • Reduce development costs
  • Time reduction in the development process
  • Improved programmer productivity
  • Clean, well-defined code
  • Shortened turnaround time
  • Generates proof that the developed code works as expected

REAL WORLD EXPERIENCE

 

  • Self taught Programmer 
  • Software Engineer II: ZuKeeper Team 
  • Programming: JavaScript, Java, C++, C#

SOFTWARE ENGINEER ZULILY 

What is ZuKeeper? 

ZuKeeper

  • A tool for curating products into events 
  • A internal domain where the events were PUSHED to the real website

ZuKeeper = EVERYTHING at Zulily

ZUKEEPER

" I HATE TDD" 

* I interviewed 3 software engineers & they all agree.

"TDD's are not practical" 

  • Feature "too dangerous to change"
  • Mountain to climb for it to work 
  • disrupts creativity 
  • Zulily system too complex 

1 Test...2 Test... 90923872394 Test...

Filter()

Filter products that are not available in certain states

NEW FEATURE @ ZULILY

TEAM MENTALITY 

Coworker: “first make the feature work. Then make it work well. And if you have time afterwards, write tests for it”. 

friend: "we never have time"

Best Case Scenario For TDD To Work

1. understand all of the requirements of ZuKeeper

2. Not be bothered to make tests for all features at the company 

3. Have a time machine to 2009 

It's DEMO TIME suckas

TL:DR

  • TDD / BDD methods are commonly used, but not universally loved
  • Coding to Test lets you code in smaller chunks and when used consistently, can be a time saver
  • Forces thinking ( inputs // outputs)
  • Creates lean code

Liskov

By iharvey

Liskov

  • 402