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
Have you ever tested your tests?
Search
Rafael Machado
November 09, 2019
Programming
2
91
Have you ever tested your tests?
Rafael Machado
November 09, 2019
Tweet
Share
More Decks by Rafael Machado
See All by Rafael Machado
Evolução da arquitetura do Magalu e os desafios da modularização
rakaramos
0
61
Contratos fortes com programação funcional
rakaramos
1
15
Other Decks in Programming
See All in Programming
自動テスト実行結果の目的を整理する / Organizing objectives of automated test results
twada
PRO
10
2.1k
Introduction for Open Source Swift Workshop
giginet
PRO
0
180
イベントストーミングによるオブジェクトモデリング・オブジェクト指向プログラミングの適用・開発プロセスの変遷・アーキテクチャの変革 / Object modeling with Event Storming.
nrslib
12
3k
TCAの Shared Stateって どういう仕組みになってんの?
yimajo
0
330
Deno に Web 標準 API を実装する / Implementing Web Standard API to Deno
petamoriken
0
350
決断するための勇気、そのためのBacklog / Courage to make decisions, Backlog for that.
seike460
PRO
4
1.9k
BuefyのMaintainerを引き継いだ件
kikuomax
0
520
The Future of C++ Interoperability: Insights from Porting a Game to Swift
teamhimeh
0
270
Dockerで始めるAWS Lambda開発
stutkhd0709
13
2.5k
MySQL のインデックスの種類をおさらいしよう! / overviewing indexes in MySQL
okashoi
0
170
GitHub Copilot Tips and Tricks
yuichielectric
26
7.4k
phpunit/php-code-coverageって何をしてるんだ #phperkaigi
o0h
PRO
2
220
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
40
12k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.3k
Building a Scalable Design System with Sketch
lauravandoore
455
32k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
226
16k
Making Projects Easy
brettharned
106
5.4k
We Have a Design System, Now What?
morganepeng
42
6.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
14
2.6k
Faster Mobile Websites
deanohume
296
30k
Adopting Sorbet at Scale
ufuk
66
8.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
657
120k
KATA
mclloyd
14
11k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
24
2.2k
Transcript
HAVE YOU EVER TESTED YOUR TESTS?
Henrique Morbin iOS @ Consumer
Rafael Machado iOS @ Driver
AGENDA 1. SOFTWARE QUALITY & METRICS 2. CODE COVERAGE 3.
MUTATION TESTING 4.MUTER: AUTOMATED MUTATION TESTING FOR SWIFT
SOFTWARE QUALITY & METRICS
CODE COVERAGE
None
class Tests: XCTestCase { func test_view() { let sut =
ViewController(presenter: .dummy) XCTAssertNotNil(sut.view) } }
55% VALIDATION
COVERAGE ISN’T EVERYTHING
?
MUTATION TESTING
HOW DOES IT WORK?
None
None
None
MUTATION SCORE = Mutants killed Total of mutants
MUTATION OPERATORS
None
C# JAVASCRIPT JAVA PYTHON SWIFT C/C++ OBJECTIVE-C
Muter Automated mutation testing for Swift
DISCOVERY TESTS REPORT
None
$ muter init
!// muter.conf.json { "executable": “/usr/bin/xcodebuild", "arguments": [ "-project", "ExampleApp.xcodeproj", "-scheme",
"ExampleApp", "-sdk", "iphonesimulator", "-destination", "platform=iOS Simulator,name=iPhone 8", "test" ], "exclude": ["AppDelegate.swift"] }
$ muter
$ muter —output-xcode
None
$ muter —files-to-mutate "/Sources/**/*.swift"
$ muter —files-to-mutate \ $(echo \"$(git diff "--name-only HEAD HEAD~1
| tr '\n' ‘,')\")
RECAP COVERAGE ISN’T EVERYTHING PAPERS HIGH COST MUTATION SCORE FEW
OPERATORS ARE ENOUGH
THANK YOU
#VemProiFood