O documento discute porque erros acontecem em programas de computador e como lidar com eles. Apresenta várias causas comuns de erros como má arquitetura de software, uso inadequado de abstrações e falta de atualização de sistemas. Também dá dicas sobre como prevenir e resolver erros, como testes automatizados, deploy frequente e monitoramento. Conclui enfatizando a importância do trabalho de desenvolvedor para evitar problemas.
3. Ada Lovelace
“Think of my horror then at just
discovering that the table & diagram
(over which I have been spending
infinite patience & pains) are seriously
wrong, in one or two points”.
1843
6. “As soon as we started programming,
we found to our surprise that it wasn't
as easy to get programs right as we
had thought. Debugging had to be
discovered. I can remember the exact
instant when I realized that a large
part of my life from then on was going
to be spent in finding mistakes in my
own programs”.
(Maurice Wilkes, 1949)
7. "There is no program that, given a
description of an arbitrary computer
program, can decide whether the
program finishes running or continues to
run forever".
(Alan Turing, 1936)
11. Martin Fowler’s Code Smells
Duplicated Code
Long Method
Large Class
Long Parameter List
Divergent Change
Shotgun Surgery
Feature Envy
Data Clumps
Primitive Obsession
Switch Statements
Parallel Inheritance Hierarchies
Lazy Class
Speculative Generality
Temporary Field
Message Chains
Middle Man
Inappropriate Intimacy
Alternative Classes with Different Interfaces
Incomplete Class Libraries
Data Class
Refused Bequest
Comments
22. Segunda Lei de Arquitetura
de Software de Borba
(Borba's 2nd Software Architecture Law)
23. Segunda Lei de Arquitetura
de Software de Borba
(Borba's 2nd Software Architecture Law)
Toda arquitetura definida que
comprovadamente funciona
estará errada em breve.
24. As coisas mudam
• Tecnologias mudam
• Requisitos/Planos/Negócios mudam
• Pessoas mudam
• Usuários mudam
• TUDO MUDA. O TEMPO TODO.
40. class AddCurrentToVendor < ActiveRecord::Migration
def up
articles = select_all('SELECT * FROM articles')
articles.each do |article|
first_vendor = select_one("SELECT * FROM vendors WHERE article_id = #{article['id']}")
if first_vendor
update("UPDATE vendors SET current=#{quoted_true} WHERE id=#{first_vendor['id']}")
end
end
end
def down
remove_column :vendors, :current
end
end
Migrations (Rails)