Real Life Testing CS310 Guest Lecture (why testing can be both - - PowerPoint PPT Presentation

real life testing cs310 guest lecture
SMART_READER_LITE
LIVE PREVIEW

Real Life Testing CS310 Guest Lecture (why testing can be both - - PowerPoint PPT Presentation

Real Life Testing CS310 Guest Lecture (why testing can be both hellish and satisfying) Andrew Eisenberg Tasktop Technologies @werdnagreb (twitter) Automated tests of some form are really, really , REALLY important (and fun) About me


slide-1
SLIDE 1

Real Life Testing CS310 Guest Lecture

Andrew Eisenberg Tasktop Technologies @werdnagreb (twitter)

(why testing can be both hellish and satisfying)

slide-2
SLIDE 2

Automated tests of some form are really,

really, REALLY

important

(and fun)

slide-3
SLIDE 3

About me

  • Rice University 94-98
  • Morgan Stanley 00-02
  • UBC Grad School 02-08
  • SpringSource/VMware/Pivotal

08-13

  • Tasktop 13-now

My grad school days (it was very stressful)

slide-4
SLIDE 4

Why should we test?

Make sure the thing we built is really the thing we thought we built

slide-5
SLIDE 5

No, really…why should we test?

  • Correctness

– over time

  • Confidence to change
  • Documentation

– Capture design decisions – Communicate to new team members – Communicate to future you

  • Make sure you are building the right thing
slide-6
SLIDE 6

How to test?

  • Just try it out
  • Hire someone else to try it out
  • Write more code that does this automatically

What are the problems with each of these?

slide-7
SLIDE 7

What kinds of tests are there?

Single components Multi-components Everything together Note: oversimplification, and not correct. But: useful (and roughly Tasktop strategy)

  • Unit
  • Integration
  • System
slide-8
SLIDE 8

Unit Testing

  • Single components

– Class, module, file, etc

  • Mock/stub dependencies
  • Code coverage important

– (but don’t rely on coverage alone)

  • Must be fast!
  • Run before committing
slide-9
SLIDE 9

JUnit (Java) Jasmine (JavaScript)

Unit testing frameworks I use daily

slide-10
SLIDE 10

SHOW ME SOME ?*#! CODE ALREADY

slide-11
SLIDE 11

Integration Testing

  • Multiple components

– package, folder, project – interactions between components

  • No mocking/stubbing
  • Speed less important
  • (Usually) run before committing
slide-12
SLIDE 12

JUnit (Java) Protractor (JavaScript)

Integration testing frameworks I use daily

slide-13
SLIDE 13

SHOW ME SOME ?*#! CODE ALREADY

slide-14
SLIDE 14

System tests

  • Entire system

– multiple scenarios

  • A complex beast

– There are no frameworks for this – Specific to each product

  • Slow
  • Stability is an issue
  • Run sometimes
slide-15
SLIDE 15

SHOW ME SOME ?*#! CODE ALREADY

slide-16
SLIDE 16

Testing is…

  • …really, really important.
  • …hard to do right.
  • …something that requires effort.
  • …different things to different people.
  • …about more than just correctness.
  • …unit, integration, system.
  • …a joy and a curse.
slide-17
SLIDE 17
slide-18
SLIDE 18

Andrew Eisenberg @werdnagreb (twitter)