Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building a testing culture
Search
Pedro Tavares
June 02, 2018
Programming
0
110
Building a testing culture
Pedro Tavares
June 02, 2018
Tweet
Share
More Decks by Pedro Tavares
See All by Pedro Tavares
Diving into Merkle Trees
ordepdev
1
360
Harvest, Yield, and Scalable Tolerant Systems
ordepdev
0
110
Things you should know about Database Storage and Retrieval
ordepdev
0
100
Building a testing culture
ordepdev
0
1k
Things you should know about Database Storage and Retrieval
ordepdev
0
1.2k
GitLab as an Application Lifecycle Management Suite
ordepdev
0
220
Consumer Driven Contracts
ordepdev
0
1.1k
Optional<Java>
ordepdev
0
1.1k
Microservices? You have to
ordepdev
0
1.1k
Other Decks in Programming
See All in Programming
ドメイン・ファーストで考える問題解決に役立つモデル設計 / Domain First Model Design
suzushin54
1
960
Enhancing Applications with Accessibility API
kishikawakatsumi
3
850
決断するための勇気、そのためのBacklog / Courage to make decisions, Backlog for that.
seike460
PRO
4
1.9k
孤独のCTOグルメという やや奇抜な企画をやった目的と効果
shoheimitani
3
1k
Compiling Python to WebAssembly with py2wasm
syrusakbary
0
130
Laravel OpenAPIによる"辛くない"スキーマ駆動開発
kentaroutakeda
2
2.1k
プロンプトエンジニアリング入門
tomokusaba
2
970
Dockerで始めるAWS Lambda開発
stutkhd0709
13
2.5k
App Router への移行は「改善」となり得るのか?/ Can migration to App Router be an improvement
takefumiyoshii
1
110
Parallel Socket Communication in Swift
s_shimotori
0
210
クソコード動画『カプセル化 Mk-II』 で考える 上手くカプセル化できない理由 / encapsulation2
minodriven
11
7.1k
WasmOS: Wasmを実行する自作Microkernel
riru
0
370
Featured
See All Featured
Web development in the modern age
philhawksworth
201
10k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
355
22k
How to train your dragon (web standard)
notwaldorf
71
5.1k
Into the Great Unknown - MozCon
thekraken
10
830
Faster Mobile Websites
deanohume
296
30k
Mobile First: as difficult as doing things right
swwweet
215
8.5k
Product Roadmaps are Hard
iamctodd
43
9.6k
Building Adaptive Systems
keathley
29
1.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
242
12k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
Six Lessons from altMBA
skipperchong
19
2.9k
Large-scale JavaScript Application Architecture
addyosmani
501
110k
Transcript
TESTING building CULTURE
https://ordepdev.me/posts/test-driven-developers
THIS IS NOT ABOUT TDD!
@ordepdev
First of all Why testing?
“It’s time for software developers to take up the mantle
of responsibility for what they produce.
Testing is the engineering rigour of software development.
Responsibility — the state or fact of being accountable or
to blame for something.
Rigour — the quality of being extremely thorough and careful.
Software Engineering
An engineering discipline that is concerned with all aspects of
software production.
MUCH MORE THAN CODING!
Types of Bad Software Projects
1. Without tests.
Zero Automated Tests.
ZERO!
Lack of professionalism?
Lack of skills?
Lack of knowledge?
Lack of time to test?
It can be all of them.
What about software quality?
Relax, we test all features with manual testing.
None
2. With Wrongly Designed Tests..
Testing is HARD.
https://twitter.com/codepipes/status/987934900111138816
Testing pitfalls: coupling.
Implementation Boundary Testing Boundary
Implementation Boundary Testing Boundary ✅ ✅ ✅ ✅ ✅ ✅
✅ ✅ ❌ ❌
Uncertainty and Doubt.
Implementation Boundary Testing Boundary ✅ ✅ ✅ ✅ ✅ ❌
❌ ❌ ❌ ❌
Testing pitfalls: performance.
Taking too much time? — that’s a no run.
Types of Testing
1. Testing after the implementation.
2. Testing during the implementation.
3. Testing that reproduce bugs.
It’s our job to build a testing culture!
But how?
5 rules.
1. Every change must have tests.
50 100 150 200 Development Unit Tests Functional Tests System
Tests Production The cost of bugs
Bugs in production are embarrassing and costly.
2. Write more than unit tests.
https://twitter.com/pwlporto/status/999258562370170880
We do not know how much an increase in coverage
can decrease the number of defects.” “
https://ordepdev.me/posts/code-coverage
Mutation testing!
def add(x,y) x + y end def add(x,y) x -
y end Source Code Mutation
Property-based testing! https://hypothesis.works/articles/quickcheck-in-every-language
http://blog.jessitron.com/2013/04/property-based-testing-what-is-it.html
Contract testing! https://martinfowler.com/bliki/ContractTest.html
https://ordepdev.me/posts/boost-your-confidence-with-consumer-driven-contracts
Model-based testing! http://mit.bme.hu/~micskeiz/pages/modelbased_testing.html
Instead of writing hundreds of test cases, write an abstract
model of the system and generate a set of test cases.” “
None
Formal methods! https://www.infoq.com/presentations/aws-testing-tla
Formal methods use mathematical proof as a complement to system
testing in order to ensure correct behavior.” “
3. Bug fixing must have tests.
Don’t repeat the same bug hunting — write a test!
4. Testing code must be reviewed.
A well-designed test suite is much easier to read, understand
and evolve.
Testing code is production code!
5. Test suites must be consistent.
L12. assertEquals(input, expectation); L35. assertEquals(expectation, input); L43. assertThat(input).isEqualTo( expectation); Assertions
L12. assertEquals(input, expectation); L35. assertEquals(expectation, input); L43. assertThat(input).isEqualTo( expectation); Assertions
L12. createEntity L35. create_withValidPayload_success L43. create_withValidPayload_shouldPersistEntity Test Methods
L12. createEntity L35. create_withValidPayload_success L43. create_withValidPayload_shouldPersistEntity Test Methods
We must share the same values, practices, and tools.
Enforce them through code reviews, static analysis, and style checking
tools.
5+1.Test suites must be visible.
A failed test is a failed build!
Wrapping up.
People who are successful at automating tasks tend to work
this way in every aspect of their jobs. It is just how they work; it is part of their culture. “ ”
Manual work is a bug. acmqueue | january-february 2018
ALWAYS BE AUTOMATING!
GO AND FIX YOUR BROKEN CULTURE!
TESTING building CULTURE @ordepdev ordepdev.me Thanks!