Post on 05-Jul-2015
Testing is funA developer's perspective
blogger: http://gouravtiwari.blogspot.com
github: http://github.com/gouravtiwari21
email: gouravtiwari21@gmail.com
g.tiwari@tcs.com
twitter: @gouravtiwari21
1.
2.
3.
Why something is fun?
Unit, functional and Acceptance
testing – fun with Ruby on Rails
Quality Tests
Testers Vs. Developers: Code War
Testers + Developers = Quality Product
Fun is like beauty - it's in the eyes of the beholder
Why something is fun?
1. Why something is fun?
Problem solving
Pattern recognition
Creativity and lateral thinking
My Nephews and Nieces
1. Why something is fun?
Why a kid hate something?
1. Why something is fun?
Feeling of burden and boredom
Patience test
Tough to do
Why a kid like something?
1. Why something is fun?
Curiosity and involvement
Sense of accomplishment
Easy to do and easy to iterate
My Perspective
1. Why something is fun?
No, testing is not fun,
WHEN
Workbench-mess
Slow Tests
This works on my development box!
1. Why something is fun?
Clean Workbench
Run tests – every 30 secs!
Use right tools and right test data
1. Why something is fun?
Yes, I want to do it
WHEN
Unit, functional and Acceptance testing –
fun with Ruby on Rails
2. Unit, functional and Acceptance testing - fun with Ruby on Rails
(Development + Testing) Approach ?
Bottom-up (Inside-out) Top-down (Outside-in)
2. Unit, functional and Acceptance testing - fun with Ruby on Rails
Cucumber & RSpec
Outside-in approach
Only write what is meaningful
Close interaction of PO and developer
BDD
TDDATDD
DeveloperBA/PO
2. Unit, functional and Acceptance testing - fun with Ruby on Rails
Cucumber example
2. Unit, functional and Acceptance testing - fun with Ruby on Rails
Outside-in
2. Unit, functional and Acceptance testing - fun with Ruby on Rails
Given
…
When
…
Then
…
Pre-requisite
(masked data, mock, Stub)
…
Action
(invoke method)
…
Validate output
…
ScenarioStep 1
ControllerStep 4
ModelStep 5
ViewStep 3
StepsStep 2
Tests with guard
2. Unit, functional and Acceptance testing - fun with Ruby on Rails
Courtesy: https://github.com/visionmedia/git-extras
Patience test with cucumber100 tests & 1 sprint … a trivial example
Quality tests
Team testing timeWith friends and family
Metric Fu
3. Quality tests
Reek
3. Quality tests
Rcov
3. Quality tests
Flog
3. Quality tests
Easy to understand and easy to
follow steps are fun
With checks on code and code
quality, developer can have
sound sleep
ATDD, TDD and
BDD, DDD, anyother DD :
just concepts
development and testing
together is fun!
https://joind.in/6023
https://github.com/cucumber/cucumber/wiki/
http://rspec.info/
http://www.thewebsqueeze.com/web-design-articles/the-
mac-ruby-developers-toolkit-25-essential-apps.html
http://guides.rubyonrails.org/testing.html
http://metric-fu.rubyforge.org/
http://www.julianhermida.com/algoma/scotlteachingreso
urcesfeedback.htm