Test Automation Oren Rubin - Testim.io
Jul 15, 2015
Who are you?
● Company specialty?
o Backend? Frontend? Mobile?
● Current development?
o how frequent are the releases?
● QA or dev team?
o Write code or manage?
Software Architecture Class
Q: How to write large scale applications?
A: You don't, you aim for small reusable
components
Testing Theory - La järɡən
● Unit Tests
● Integration Tests
● End to End Tests
● Functional Tests
● Smoke Tests
● Load Tests
● Acceptance Test
Testing Theory
The Assertions can differ:
Functional, UI, Timing, Memory consumption
Test starts Initial State Some StateSetup Stimuli Assertions Tear down
Testing Theory
Black Box
● Check against the API
● Can be done by others
White Box
● Look inside (gory details)
● Usually same person
Testing Metrics
Black Box
● Users stories
● Response time
● Memory consumption
(memory leaks)
White Box
● Code coverage
● Loop edge cases:
o Never go in
o Go in once
o More than once
Unit Tests.. find the diffs
Bad Code
● Long methods
● Tightly Coupled
● Unreadable
● Hard root cause
● Use Global
Good Code
● Short methods
● Loose Coupling
● Readable
● Easy bug detection
● Separation of
Concerns
Unit Tested Code
● Short methods
● Loose Coupling
● Readable
● Easy bug detection
● Separation of
Concerns
Testing Theory - Unit Tests
Assertions
● State changed
● callbacks (methods) were called
Test starts Initial State Some StateSetup Stimuli Assertions Tear down
Testing Theory - Unit Tests
Assertions
● State changed
● callbacks (methods) were called
Test starts Initial State Some Statea =new A() a.f() assert(a.x = 5)
Jasmine
● Very simple
● Great docs: http://pivotal.github.com/jasmine/
● Load is by an HTML scaffold
● Completely standalone
● Custom Matchers: expect('moshe').toBeMoshe();
● Easy to filter tests
● Nested describe blocks (each has beforeEach)