better unit testing with approval tests

24
Approval Test s Lynn Langit An open-source Unit Testing library SDC 2013

Upload: lynn-langit

Post on 14-May-2015

3.208 views

Category:

Technology


0 download

DESCRIPTION

Deck from my task for SDC2013

TRANSCRIPT

Page 1: Better Unit Testing with Approval Tests

Approval TestsLynn

Langit

An open-source Unit Testing library

SDC 2013

Page 2: Better Unit Testing with Approval Tests

Gold

en M

aste

rreceived

approved

Serialized Files

Page 3: Better Unit Testing with Approval Tests

Gettin

g it -

nuget

Page 4: Better Unit Testing with Approval Tests

Gett

ing it

- g

ithub

Page 5: Better Unit Testing with Approval Tests

Setu

p

Download Approvals

Select DiffTool(s)

Page 6: Better Unit Testing with Approval Tests

Dem

o –

Sta

rt U

p

Page 7: Better Unit Testing with Approval Tests

How

to A

ppro

ve

• Rename *.received to *.approved –

OR-

• Right click ‘Use whole file’

(DiffReporter)

Page 8: Better Unit Testing with Approval Tests

About

Report

ers

Page 9: Better Unit Testing with Approval Tests

Com

ple

x O

bje

cts

ArraysListsDatabase queriesXML, JSON

Page 10: Better Unit Testing with Approval Tests

Dem

o –

Arr

ays

Page 11: Better Unit Testing with Approval Tests

Com

bin

ati

ons

Combination Approvals

Page 12: Better Unit Testing with Approval Tests

Dem

o –

Test

a

GU

I

Page 13: Better Unit Testing with Approval Tests

Source - http://thesmithfam.org/blog/2012/03/05/the-code-quality-continuum/

Code Quality

Page 14: Better Unit Testing with Approval Tests

Why

Test

-Dri

ven?

Why TDD? Better spec / scope Define, then create (objects)

Do Verify Feedback/regression/granularity

But… Littered with Asserts?

Extra work less productivity?

Page 15: Better Unit Testing with Approval Tests
Page 16: Better Unit Testing with Approval Tests

How

Test-D

riven

TDD

BDD

Approval Tests fit with both

types

Think Bigger

Less Code

Scenarios Assert

Do

Verify

Page 17: Better Unit Testing with Approval Tests

Other LanguagesJava

Page 18: Better Unit Testing with Approval Tests

Approval Tests in Java…

Page 19: Better Unit Testing with Approval Tests

MapReduce

Page 20: Better Unit Testing with Approval Tests

Dem

o –

Test

ing

M

ap

Red

uce

Page 21: Better Unit Testing with Approval Tests

More

Info

rmati

on www.ApprovalTests.com

@LlewellynFalco@DanGilkersonLearn more – videos (.NET)

Page 22: Better Unit Testing with Approval Tests

Who wrote ApprovalTests?

Dan

Llewellyn

Page 23: Better Unit Testing with Approval Tests

Approval Tests@LynnLangit

Q & A

Page 24: Better Unit Testing with Approval Tests

www.TeachingKidsProgramming.org

• Free Courseware

• Teach a Kid (Ages 10 ++)

• Java or Microsoft SmallBasic

• recipes)