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
Testing, automatización y otros secretos contra...
Search
Jano González
October 27, 2012
Programming
2
840
Testing, automatización y otros secretos contra el dolor de cabeza
Presentación para el Encuentro Linux 2012
Jano González
October 27, 2012
Tweet
Share
More Decks by Jano González
See All by Jano González
Containerizing your monolith
janogonzalez
0
330
Migrando a Microservicios
janogonzalez
1
280
Extracting services from a monolith
janogonzalez
3
250
¿Después de 10 años, realmente entiendo esta industria?
janogonzalez
3
440
Microservices in Practice
janogonzalez
7
640
Two programmers in one
janogonzalez
1
140
The Bipolar Programmer
janogonzalez
4
580
Ruby for your two internal programmers
janogonzalez
4
230
Ruby for Java minds
janogonzalez
4
1k
Other Decks in Programming
See All in Programming
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
53
18k
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
9
1.8k
Rails アプリ地図考 Flush Cut
makicamel
1
120
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
1
210
Writing documentation can be fun with plugin system
okuramasafumi
0
120
ML.NETで始める機械学習
ymd65536
0
210
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
210
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
180
Formの複雑さに立ち向かう
bmthd
1
890
PRレビューのお供にDanger
stoticdev
1
210
新宿駅構内を三人称視点で探索してみる
satoshi7190
2
110
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
680
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Building an army of robots
kneath
303
45k
YesSQL, Process and Tooling at Scale
rocio
172
14k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
4 Signs Your Business is Dying
shpigford
182
22k
Documentation Writing (for coders)
carmenintech
67
4.6k
Thoughts on Productivity
jonyablonski
69
4.5k
It's Worth the Effort
3n
184
28k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.3k
Transcript
testing, automatización y otros SECRETOS contra el dolor de cabeza
> el CHARLISTA
@janogonzalez
HopIn
@dynlangchile
> EL PROBLEMA
CH CH CH CHANGES
CAMBIO constante
CASTILLOS DE NAIPES
muchas tareas MANUALES
muchas tareas RUTINARIAS
propenso a ERRORES
SEÑALES DE HUMO
FEEDBACK TARDÍO
DOLOR DE CABEZA
PREVENIR ES MEJOR QUE CURAR
> CÓDIGO
APRENDE y USA LAS CONVECIONES
Ruby
Python
PHP
Java
> WTFM
Siempre CREA UN README
instrucciones para INSTALAR
UN EJEMPLO VALE MIL PALABRAS
DOCUMENTA CLASES y MÉTODOS
> BUILD
EL BUILD DEBE SER AUTOMÁTICO
make / rake / ant / etc...
> SCM
git
hg
svn
VERSIONA TODO
$ git init
$ git add README
$ git commit -m “Initial commit”
CREA COMMITS ATÓMICOS
$ git log --oneline 0e48171 Add password recovery to login
page 7b11d9b Create login page 69c32e9 Create project structure b543a0c Initial commit
usa buenos mensajes
$ git commit -m “Changes” ¡MAL!
$ git commit -m “Add password recovery in login” BIEN
$ git commit -m “CLOSE [84712] Add password recovery in
login” BIEN
USA bien LOS BRANCHES
$ git checkout -b password- recovery
$ git checkout -b wip-password- recovery
BRANCH PRINCIPAL DEPLOYABLE
USA LOS TAGS
$ git tag 1.0.0 -m “Initial release”
COMMIT EN FORMA TEMPRANA
PUSH EN FORMA TEMPRANA
> DEPENDENCIAS
MANEJO EN FORMA DECLARARTIVa
comportamiento predecible
<project> ... <dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId>
</dependency> </dependencies> ... </project> Maven
$ mvn clean install Maven
source 'https://rubygems.org' gem 'sinatra' gem 'json' gem 'sequel_pg', require: 'sequel'
gem 'koala' gem 'redis' gem 'mini_magick' gem 'aws-sdk' group :test do gem 'rack-test' end Bundler
$ bundle install Bundler
{ "require": { "monolog/monolog": "1.2.*" } } Composer
$ php composer.phar install Composer
> configuración
DATOS POR AMBIENTE
SEPARADO DEL ENTREGABLE
> TESTING
JUNIT / RSPEC / MOCHA / etc...
existen dos estrategias
UNITARIO / ACEPTACIÓN
PROBAR COMPONENTE AISLADO Unitario
CENTRADO en PROBAR UN FEATURE Aceptación
independiente
repetible
automatizado
> CI
Jenkins
CC
Travis
CREANDO BUILDS automáticos
Bajar código Compilar Ejecutar Pruebas Ejecutar Métricas Entregable
> DEPLOYMENT
cap
fab
CREANDO deploys automáticos
$ cap staging deploy cap
$ cap staging deploy:rollback cap
$ cap -s tag=1.0.0 production deploy cap
> Más ALLá
LEVANTAR AMBIENTES AUTOMÁTICAMENTE
> EJEMPLOS
> CONCLUSIONES
ACEPTA EL CAMBIO
AUTOMATIZA TODO LO QUe PUEDAS
OBTEN FEEDBACK TEMPRANO
Y SIEMPRE MEJORA
> ¡GRACIAS!
http://upload.wikimedia.org/wikipedia/commons/2/21/David_Bowie_Chile.jpg http://upload.wikimedia.org/wikipedia/commons/0/01/Card_castle6.JPG http://upload.wikimedia.org/wikipedia/commons/1/1c/Frederic_Remington_smoke_signal.jpg http://upload.wikimedia.org/wikipedia/commons/a/ad/Migraine.jpg