The Missing Ingredient
by Salman Ansari
- I am a walking ad for United Colors of Benetton
I did the startup thing (involver) in San Francisco
- I moved to NYC after Oracle acquisition
- I taught Ruby & Rails at General Assembly in NYC
- I'm Head Lecturer at iExperience
- I'm an audiophile who DJs for fun
- Lastly, before you ask...
I'M NOT RELATED
TO AZIZ ANSARI
- Why Test?
- The Choppy Waters
- Seeking Help
- The Missing Ingredient
- The TDD Flow
- We often find peers/guidance that encourages us to test
- Resources on how to test are readily available
- The general assumption is that testing is good
- Most people don't know why they should test
- Resources on why to test are scarce
- Before we adopt a solution, we must comprehend
what problems it is solving
- I learned the why the hard way...
Too many bugs
- When a new feature is complete, write tests to cover it.
- If we hit a bug on production, write a test for that case.
- Otherwise, continue development as usual.
No real change in bug frequency
Increase in developer frustration
Low team confidence in testing
- Began working with a team experienced in Agile, TDD, and pair programming.
- We were looking for them to help us reduce the bugs, but they helped us identify a number of other issues...
- Untracked work => unecessary code
- Fear of breaking changes => lack of refactors
- Inadequate docs => uninformed technical decisions
- Ambiguous feature specs => features 'lost in translation'
- Ineffective tests => lots of bugs
- It's incredibly helpful to get help
- Our problems were far deeper than we thought
- Testing alone could not solve all our problems
- We needed to change our entire development flow
The Missing Ingredient:
- Work outside-in: start from the business view
- Ensure specifications are clear & complete
- Only write tests to satisfy a story requirement
- Only write code to make a test pass
- Leave the codebase cleaner than you found it
- Less bugs
- Less QA rejections
- Less features 'lost in translation'
- Greater iteration speed
- Greater customer satisfaction
- More documentation
- More stress-free refactors
- More happiness :)
It makes you happy.
The TDD Flow
User Can Add New TV Shows
As a user,
When I am on the TV show list page,
And I click on the "New" button,
Then I should be redirected to a "New Show" page
When I fill in the text box for "Title" with a valid title,
And I fill in the text box for "Description" with a valid description,
And I click "Submit",
Then I should see a success message "Your TV show was created successfully"
And I should be taken to the TV show list page,
And I should see the new show in the list
Rinse & Repeat
- Go for Green
- Test by Hand
- Clean Up & Refactor
- Deliver with a Smile
- Make sure you know why before you jump
- Model your entire process around testing
- Let the business needs drive your work
- Testing is a universal concept
- Don't be discouraged; iterate regularly
- Optimize for happiness
The Missing Ingredient
By Salman Ansari