Navigation
next
The Tao of Testing
»
The Tao of Testing
¶
A Field Manual for Software Engineers
¶
Java Edition v1.08
¶
Copyright 2013 Jason Polites
¶
@jplts
http://www.polites.com
Preface
Language Use
Definitions
Unit Test
Black Box Test
Integration Test
Manual Test
Load/Scale Test
Infrastructure Test
QA Test
UAT (User Acceptance Testing)
Chapter 1 - A Case for Testing
Why bother testing?
Humans make mistakes
More code means more bugs
More code means more elusive bugs
The role of the test
Tests change the way you write code
Chapter 2 - Do we need QA?
Why we don’t need QA
Manual testing doesn’t scale
Manual testing requires humans, who make mistakes
Engineers won’t test if they don’t have to
Why we DO need UAT
The whole is greater than the sum
Engineers are not always right
Sometimes it’s just not testable
Manual user segmentation
Automated user segmentation
Chapter 3 - Dependency Injection
Dependency Injection Primer
Dependency injection & mocks
Singleton until told otherwise
Dependency Injection is a design pattern, not a framework
Chapter 4 - How to Write Tests
Rules of the road
Rule #1 Don’t confuse unit tests with integration tests
Rule #2 Unit tests should be deterministic
Rule #3 Inject dependencies where possible
Rule #4 Don’t test external code
Rule #5 Unit tests should only test a single unit
Rule #6 Don’t mix test code and production code
Rule #7 Integration tests shouldn’t contribute to code coverage
Rule #8 Write tests before fixing bugs
Rule #9 Don’t use software tests to verify the environment
Rule #10 Ensure tests are isolated and idempotent
Guidebook for writing tests
Mocking dependencies to create isolated tests
Using a Dependency Injection framework (where applicable)
Detecting code duplication and invalid code paths
Misuse of (live) integration tests
Correct use of (live) integration tests
Pitfalls and pro tips
Chapter 5 - Objections
Dealing with objections
We need integration tests to “really” test the code
We shouldn’t test implementation, only behavior
Automated tests cannot replace QA
Testing increases development time
Conclusion
Table Of Contents
Preface
Chapter 1 - A Case for Testing
Chapter 2 - Do we need QA?
Chapter 3 - Dependency Injection
Chapter 4 - How to Write Tests
Chapter 5 - Objections
Conclusion
Navigation
next
The Tao of Testing
»