Testing is Fun @Confoo.ca 2012

34
Testing is fun A developer's perspective

Transcript of Testing is Fun @Confoo.ca 2012

Page 1: Testing is Fun @Confoo.ca  2012

Testing is funA developer's perspective

Page 3: Testing is Fun @Confoo.ca  2012

1.

2.

3.

Why something is fun?

Unit, functional and Acceptance

testing – fun with Ruby on Rails

Quality Tests

Page 4: Testing is Fun @Confoo.ca  2012

Testers Vs. Developers: Code War

Page 5: Testing is Fun @Confoo.ca  2012

Testers + Developers = Quality Product

Page 6: Testing is Fun @Confoo.ca  2012

Fun is like beauty - it's in the eyes of the beholder

Page 7: Testing is Fun @Confoo.ca  2012

Why something is fun?

Page 8: Testing is Fun @Confoo.ca  2012

1. Why something is fun?

Problem solving

Pattern recognition

Creativity and lateral thinking

Page 9: Testing is Fun @Confoo.ca  2012

My Nephews and Nieces

1. Why something is fun?

Page 10: Testing is Fun @Confoo.ca  2012

Why a kid hate something?

1. Why something is fun?

Feeling of burden and boredom

Patience test

Tough to do

Page 11: Testing is Fun @Confoo.ca  2012

Why a kid like something?

1. Why something is fun?

Curiosity and involvement

Sense of accomplishment

Easy to do and easy to iterate

Page 12: Testing is Fun @Confoo.ca  2012

My Perspective

1. Why something is fun?

Page 13: Testing is Fun @Confoo.ca  2012

No, testing is not fun,

WHEN

Workbench-mess

Slow Tests

This works on my development box!

1. Why something is fun?

Page 14: Testing is Fun @Confoo.ca  2012

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

Page 15: Testing is Fun @Confoo.ca  2012

Unit, functional and Acceptance testing –

fun with Ruby on Rails

Page 16: Testing is Fun @Confoo.ca  2012

2. Unit, functional and Acceptance testing - fun with Ruby on Rails

(Development + Testing) Approach ?

Bottom-up (Inside-out) Top-down (Outside-in)

Page 17: Testing is Fun @Confoo.ca  2012

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

Page 18: Testing is Fun @Confoo.ca  2012

BDD

TDDATDD

DeveloperBA/PO

2. Unit, functional and Acceptance testing - fun with Ruby on Rails

Page 19: Testing is Fun @Confoo.ca  2012

Cucumber example

2. Unit, functional and Acceptance testing - fun with Ruby on Rails

Page 20: Testing is Fun @Confoo.ca  2012

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

Page 21: Testing is Fun @Confoo.ca  2012

Tests with guard

2. Unit, functional and Acceptance testing - fun with Ruby on Rails

Page 22: Testing is Fun @Confoo.ca  2012

Courtesy: https://github.com/visionmedia/git-extras

Page 23: Testing is Fun @Confoo.ca  2012

Patience test with cucumber100 tests & 1 sprint … a trivial example

Page 24: Testing is Fun @Confoo.ca  2012
Page 25: Testing is Fun @Confoo.ca  2012

Quality tests

Page 26: Testing is Fun @Confoo.ca  2012

Team testing timeWith friends and family

Page 27: Testing is Fun @Confoo.ca  2012

Metric Fu

3. Quality tests

Page 28: Testing is Fun @Confoo.ca  2012

Reek

3. Quality tests

Page 29: Testing is Fun @Confoo.ca  2012

Rcov

3. Quality tests

Page 30: Testing is Fun @Confoo.ca  2012

Flog

3. Quality tests

Page 31: Testing is Fun @Confoo.ca  2012

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!

Page 32: Testing is Fun @Confoo.ca  2012
Page 33: Testing is Fun @Confoo.ca  2012

https://joind.in/6023

Page 34: Testing is Fun @Confoo.ca  2012

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