introduce continuous integration into the development process. choose integrity since it’s light-weighted, easy to configure, good support for git and works for ourselves on our own install.
2. Continuous Integration
• A software development practice
where members of a team integrate
their work frequently
• Each integration is verified by an
automated build (including test)
• significantly reduced integration
problems
4. Continuous Integration
• Maintain a code repository
• Automate the build
• Every commit should be built
• Make the build self-testing
• Keep the build fast
• Everyone can see the results
5. CI Solutions for Rails
• CruiseControl.rb http://cruisecontrolrb.thoughtworks.com/
• Cerberus http://cerberus.rubyforge.org/
• Run Code Run http://runcoderun.com/
• Integrity http://integrityapp.com/
9. Integrity - Build
• The building environment is almost
identical to your development
environment
• Standalone CI server
• DB Server
• rake ci WITH_PACKAGE_TEST=1
25. Flog
The higher
the score, the
harder it is to
test
26. Flog
Code Seen as flog flog report
class Test class Test Test#blah: (11.2)
def blah def blah # 11.2 = 6.0: eval
a = eval "1+1" a = eval "1+1" # 1.2 + 6.0 + 1.2: branch
if a == 2 then if a == 2 then # 1.2 + 1.2 + 0.4 + 1.2: ==
puts "yay" puts "yay" # 1.2 1.2: puts
end end 1.2: assignment
end end 0.4: lit_fixnum
end end
27. Reek
• detects common code smells
might be hard to read,
• Class Variable maintain or evolve,
• Control Couple rather than things
that are specifically
• Data Clump wrong
• Duplication
• Feature Envy
• Large Class
• Long Method
• Long Parameter List
• Nested Iterators
• Simulated Polymorphism
• Uncommunicative Name
• Utility Function
28. Reek
Duplication Feature Envy
def double_thing() class Cart
@other.thing + @other.thing def price
end @item.price + @item.tax
end
end
def double_thing() class Cart
thing = @other.thing def price
thing + thing @item.price_with_tax
end end
end
class Item
def price_with_tax
price + tax
end
end