En Route To Industry: Tips on Transferring from College into Industry
BDD workshop for JavaScript developers
1. BDD for RIAs with JavaScript
2013 Workshop Tour
Carlos Ble
carlosble.com
@carlosble
2. Warning
This workshop is very demanding so please:
●
Ask anything you need.
●
Give me feedback.
●
Take notes.
●
Pay attention.
●
Be responsible.
●
Get ready to share code with
others.
3. Effective communication
Your only goal when communicating should be
to … Communicate!
Don't talk or write to...
●
Demonstrate how smart you are
●
Convince others
●
Fight others
●
Avoid the uncomfortable silence
●
Think out loud
No one is more important than you, and you are not more
important than anyone else. What others think about you, is
not your business.
4. The seven rules of Angel Lafuente
1ª. Nunca la palabra antes que el pensamiento.
2ª. No interrumpir la frase o idea.
3ª. Frase breve.
4ª. Mirada interpelante.
5ª. Gesto libre.
6ª. Silencios.
7ª. Velocidad posible y adecuada
Those who master silence,
master spoken word.
http://www.ulpgc.es/hege/almacen/download/48/48279/manual_del_curso.pdf
5. Listen to yourself:
use your common sense
Be honest to yourself because your intuition
and feelings are telling you all the time what is
more appropriate in every situation.
Pay attention to your gut feelings because
they don't cheat you.
Listen carefully to others to be empathetic to
them.
Do what you know you ought to do.
6. Where are you standing?
Is everything OK with you and your environment?
●
Breath
●
Sleep well
●
Eat well
●
Work out
●
Workplace environment must have good conditions
●
Try to learn about yourself
There are several techniques to help you practice
self-control and self-discover y :
●
Meditation
●
Yoga
●
Martial arts
●
Team sports
●
Extreme sports
●
And much more!
7. Where are you standing?
Is everything OK with you and your environment?
●
Breath
●
Sleep well
●
Eat well
●
Work out
●
Workplace environment must have good conditions
●
Try to learn about yourself
There are several techniques to help you practice
self-control and self-discover y :
●
Meditation
●
Yoga
●
Martial arts
●
Team sports
●
Extreme sports
●
And much more!
8. Be a good team player
Don't make assumptions
Don't take it personally
Do your best
Be precise and specific with your words
See also the Core Protocols
9. BDD is a set of values and practices
Build the thing right
dannorth.net/introducing-bdd/
dannorth.net/whats-in-a-story/
chrismdp.com/2013/01/bdd-is-not-cucumber/
[Over]simplification:
specification by example + outside-in TDD
10. Lean development and
Impact Mapping
Build the right thing, avoid waste
en.wikipedia.org/wiki/Lean_software_development
impactmapping.org/drawing.php
11. What, not how: the amazing happens
when you just write the minimum code
Case Study: LiveTeamApp.com
●
No password or registration required.
●
Group chat and individual chat rooms.
●
GUI tailored to users according to their feedback.
●
Pomodoro integrated with team monitor and and chat.
●
New features are delivered in a matter of hours.
●
Everything is covered by tests.
Remember: Just make your acceptance tests
pass deferring any other decision as much as
possible.
13. The specifications workshop
50-70% of the defects are in the requirements...
●
Focus on what, not how
●
Avoid GUI details in the examples
●
All the roles together in the workshop:
●
Facilitator
●
Stakeholders
●
Business Analysts
●
Product Owners
●
Testers
●
Developers
●
Face to face conversation
●
Time, an important investment:
●
2 hours for a week sprint seems reasonable
14. Good books out there
●
Bridging the communication gap
●
Specification by Example
●
Impact Mapping
●
ATDD by Example
●
The cucumber book
15. Starting with the user story
Title (one line describing the story)
Narrative:
As a [role]
I want [feature]
So that [benefit]
Acceptance Criteria: (presented as Scenarios)
Scenario 1: Title
Given [context]
And [some more context]...
When [event]
Then [outcome]
And [another outcome]...
17. Wait a moment:
Three types of JavaScript
➢
With TDD
➢
Without TDD
➢
For Frameworks
18. BDD for RIAs: the process
A Rich Internet Application is very different from a Website!
19. App core: Passive View pattern
Outside-in:
Blue: test-driven with unit tests, using test doubles.
Green: test-driven with unit tests, using test doubles.
Pink: test-driven with integration tests.
20. Outside-in development
Good understanding of test doubles:
●
Stubs: programmed to return answers.
●
Spies: will remember calls.
●
Mocks: will fail on unexpected calls.
●
Fakes: almost like the real system, just faster or repeatable.
How to write scenarios where some objects don't exists
already? Remember the UML :-)
Key rules:
●
Do not mock artifacts you don't own.
●
Use stubs for queries and mocks/spies for
actions.
21. Exercise: the flow
1. Connecting the Business API with
the service.
2.Connecting the UI with the service.
3.Implementing the service.
4.Implementing the interactor.
5.Implementing the databinder.
All of them are UNIT TESTS
22. Advice: let the team follow code
changes
●
Initialize a code repository for the exercises
(Git, Mercurial, or whatever you prefer).
●
Make commits small enough that just by
looking at the “diff” anyone can understand
what the change is.
●
This usually means, no more than 10 lines of
code.
●
Try to commit on red, on green, and eventually
on refactor.
●
This is a great way to document code changes.