Building quality software, with low defect counts, conformance to specifications and a clean code base is an important goal for any growing software company. Really high quality can only be maintained by introducing process & automation into the development process. This talk gives an overview of different tools that can help increase software quality, using a Ruby on Rails app as the example environment.
12. def update(post, title)
@user = User.first
if @user.logged_in
if @user.type == "admin"
@user.type.permissions.each do |permission| {
if (permission == "update_permission") {
if post
begin
post.title = title
post.save
rescue
display_error("This horrible code is not workin!")
end
else
display_error("No Post provided")
end
}
}
elsif @user.type == "other"
return
else
display_error("Invalid User Type")
end
else
#What do here?
end
end
BAD CODE
23. HOW CAN WE AVOID CHAOS?
Specification
Automated Testing
Continous Integration
Coding guidelines / Code Analysis
Reproducible development environment
26. BDD FRAMEWORKS CAN BE USED TO
SPECIFY SOFTWARE
Cucumber Framework: http://cukes.info/
Feature: Search courses
Courses should be searchable by topic
Search results should provide the course code
Scenario: Search by topic
Given there are 240 courses which do not have the topic "biology"
And there are 2 courses, A001 and B205, that each have "biology" as one of the topics
When I search for "biology"
Then I should see the following courses:
| Course code |
| A001 |
| B205 |
Acceptance Test
39. CONTINOUS INTEGRATION
Every time code is pushed:
• Run Static Analyzer
• Run All tests
• Measure Code Coverage
• Run the Build Process
Working product can be shipped at any time!
If anything breaks we find out right away
42. MINIMUM CONFIGURATION
git clone git@github.com:MakeGamesWithUs/www-makeschool.git
./server start
./server test
start rails server
run test suite
• Git repository contains the definition of a Docker container
+ a Fig configuration describing services
• App runs in Virtual Machine providing the same
environment for all developers