desenvolvimento orientado à introspecção
DESCRIPTION
Presentation at Labs Conf 2010TRANSCRIPT
![Page 1: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/1.jpg)
Desenvolvimento Orientado à Introspecção
Tomás D’Stefano@tomas_stefano
http://github.com/tomas-stefano
sábado, 6 de novembro de 2010
![Page 2: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/2.jpg)
Expectativas da Apresentação
sábado, 6 de novembro de 2010
![Page 3: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/3.jpg)
Auto-Disciplina
sábado, 6 de novembro de 2010
![Page 4: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/4.jpg)
Simplicidade
sábado, 6 de novembro de 2010
![Page 5: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/5.jpg)
Introspecção
sábado, 6 de novembro de 2010
![Page 6: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/6.jpg)
Como EU faço melhor?
sábado, 6 de novembro de 2010
![Page 7: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/7.jpg)
Onde EU estou perdendo o foco?
sábado, 6 de novembro de 2010
![Page 8: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/8.jpg)
Como EU me foco melhor?
sábado, 6 de novembro de 2010
![Page 9: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/9.jpg)
Onde EU desperdiço o meu tempo?
sábado, 6 de novembro de 2010
![Page 10: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/10.jpg)
Como EU torno mais simples?
sábado, 6 de novembro de 2010
![Page 11: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/11.jpg)
Onde EU estou errado?
sábado, 6 de novembro de 2010
![Page 12: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/12.jpg)
Você faz essas perguntas?
Frequentemente?
sábado, 6 de novembro de 2010
![Page 13: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/13.jpg)
O InfinityTest nasceu dessas perguntas!
sábado, 6 de novembro de 2010
![Page 14: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/14.jpg)
Princípios e ValoresConnascence!!!
Single Responsability Principle!
Open/Closed Principle!
Liskov Substitution Principle!
Dependency Inversion Principle!
Interface Segregation Principle!
http://bit.ly/cVIdOosábado, 6 de novembro de 2010
![Page 15: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/15.jpg)
Connascence
sábado, 6 de novembro de 2010
![Page 16: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/16.jpg)
Connascence of Nameclass Company def name 'SuccesSoft' endend
def increase_profit(company) company.nameend
sábado, 6 de novembro de 2010
![Page 17: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/17.jpg)
Connascence of Nameclass Company def name 'SuccesSoft' endend
def increase_profit(company) company.nameend
sábado, 6 de novembro de 2010
![Page 18: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/18.jpg)
Regra de Localidade
sábado, 6 de novembro de 2010
![Page 19: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/19.jpg)
Connascence of Position
[['Tomás', 21], [ 'SuccesSoft', 0.5]]
def add(contacts) contacts.each do |name, age| # ... endend
sábado, 6 de novembro de 2010
![Page 20: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/20.jpg)
COP => CON
class Contact attr_accessor :name, :ageend
sábado, 6 de novembro de 2010
![Page 21: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/21.jpg)
Regra do Grau
sábado, 6 de novembro de 2010
![Page 22: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/22.jpg)
Connascence of Algorithm
class Company def profit(profit) total = profit.inject(0) { |a, n| a + n } 100 + total end def profit?(profit) total = profit.inject(0) { |a, n| a + n } total > 0 end end
sábado, 6 de novembro de 2010
![Page 23: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/23.jpg)
COA => CONclass Company def profit(profit) 100 + total_profit(profit) end def profit?(numbers) total_profit(profit) > 0 end def total_profit(profit) profit.inject(0) { |a, n| a + n } end end
sábado, 6 de novembro de 2010
![Page 24: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/24.jpg)
Muito Mais!
sábado, 6 de novembro de 2010
![Page 25: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/25.jpg)
To Infinity and Beyond!
sábado, 6 de novembro de 2010
![Page 26: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/26.jpg)
RVM Ruby API
>> environment = RVM::Environment.new('1.9.2')=> #<RVM::Environment environment_name="1.9.2">
>> environment.expanded_name=> ‘ruby-1.9.0-p0’
sábado, 6 de novembro de 2010
![Page 27: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/27.jpg)
RVM Ruby API
RVM.environments('1.9.2,ree,jruby') do |env| env.ruby 'my_ruby_file.rb'end
# Roda nos 3 Rubies
sábado, 6 de novembro de 2010
![Page 28: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/28.jpg)
Linha de Comando
infinity_test --rspec
infinity_test --rubies=ree,1.9.2,jruby --rspec
infinity_test --rubies=ree,1.9.2,1.8.7 --test-unit
sábado, 6 de novembro de 2010
![Page 29: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/29.jpg)
Setup# ~/.infinity_test
infinity_test do notifications :growl do show_images :mode => :mario_bross end before_run { clear :terminal }end
sábado, 6 de novembro de 2010
![Page 30: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/30.jpg)
Notificação
sábado, 6 de novembro de 2010
![Page 31: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/31.jpg)
Setup Rubies! w00t!
# ./.infinity_test
infinity_test do use :rubies => %w(1.9.2 ree 1.8.7)end
sábado, 6 de novembro de 2010
![Page 32: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/32.jpg)
RSpec?# ./.infinity_test
infinity_test do use :test_framework => :rspecend
# Funciona para o Rspec 2.0.* ou 1.3.*
sábado, 6 de novembro de 2010
![Page 33: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/33.jpg)
Master Branch (Bundler)
* Possui um Gemfile? -> Então rode com ‘bundle exec’
sábado, 6 de novembro de 2010
![Page 34: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/34.jpg)
Local Commit(Heuristicas)
infinity_test do heuristics do add(‘my_file.rb’) do run :all => :tests end endend
$ infinity_test --heuristics
sábado, 6 de novembro de 2010
![Page 35: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/35.jpg)
Master Branch (Rails)infinity_test --rspec --rails
infinity_test --test-unit --rails
infinity_test --bacon --rails
infinity_test --rubies=ree,1.9.2 --rspec --rails
sábado, 6 de novembro de 2010
![Page 36: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/36.jpg)
Futuro
•Suportar o Rubinius
•Cucumber
•Cores no Test::Unit, Bacon e RSpec(bug) (Alguém me ajuda nisso?)
sábado, 6 de novembro de 2010
![Page 37: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/37.jpg)
Desenvolvimento Orientado à Diversão =)
sábado, 6 de novembro de 2010
![Page 38: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/38.jpg)
Desenvolvimento Orientado à Diversão =)
sábado, 6 de novembro de 2010
![Page 39: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/39.jpg)
Desenvolvimento Orientado à Diversão =)
sábado, 6 de novembro de 2010
![Page 40: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/40.jpg)
O que vem por aí?
sábado, 6 de novembro de 2010
![Page 41: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/41.jpg)
RubyCasts
sábado, 6 de novembro de 2010
![Page 42: Desenvolvimento orientado à introspecção](https://reader033.vdocuments.pub/reader033/viewer/2022052909/5599554a1a28ab7f408b46d0/html5/thumbnails/42.jpg)
Obrigado =PTomás D’Stefano
@tomas_stefanohttp://github.com/tomas-stefano
sábado, 6 de novembro de 2010