High-quality software practices

High-quality software practices

The purpose of the talk is to show some of the methodologies, tools and practices performed in Crowd Interactive that have helped us to become a world-class company.

Talk given to Tech Women Community during their 14th monthly meetup

6c137ee3013821b517c4b9beed0145df?s=128

Fernando Perales

June 03, 2015
Tweet

Transcript

  1. 2.
  2. 3.

    Bs. c. Computer Engineering @ CUCEI Software engineer @ Crowd

    Interactive http://ferperales.net Advocate @ FLOSS Passionate @ Web Development
  3. 4.
  4. 5.
  5. 6.
  6. 7.
  7. 8.
  8. 9.
  9. 10.
  10. 11.
  11. 12.
  12. 13.
  13. 14.
  14. 16.
  15. 17.
  16. 18.
  17. 22.

    “A collaborative approach to defining requirements and business-oriented functional tests

    for software products based on capturing and illustrating requirements using realistic examples instead of abstract statements”
  18. 26.

    Feature: Login In order to use the application As a

    user I want to be able to login Scenario: with invalid credentials Given I visit the / page And I have entered demo as my username And I have entered demo1234 as my password When I press Sign in Then I will be shown a message error Scenario: with valid credentials Given I have created an account in the past And I visit the /events page And I have entered demo as my username And I have entered demo1234 as my password When I press Sign in Then I will be redirected to events page
  19. 27.
  20. 28.

    “It is a Business Readable, Domain Specific Language that lets

    you describe software's behaviour without detailing how that behaviour is implemented”
  21. 37.

    “A comprehensive to- do list, expressed in priority order based

    on the business value each piece of work will generate”
  22. 38.
  23. 40.

    “A system that records changes to a file or set

    of files over time so that you can recall specific versions later”
  24. 41.
  25. 44.

    “A software testing method by which individual units of source

    code are tested to determine whether they are fit for use”
  26. 45.
  27. 46.

    class User < ActiveRecord::Base # Method that checks if a

    user has a @crowdint.com account def has_crowdint_account? !!self.email.match(/@crowdint.com$/) end end
  28. 47.

    require 'rails_helper' describe User do let(:user_with_crowdint_account) { User.create email: 'demo@crowdint.com'

    } let(:user_with_gmail_account) { User.create email: 'demo@gmail.com' } describe '.has_crowdint_account?' do it 'returns true when email ends with "@crowdint.com"' do expect(user_with_crowdint_account.has_crowdint_account?).to be_truthy end it 'returns false when email ends with "@crowdint.com"' do expect(user_with_gmail_account.has_crowdint_account?).to be_falsy end end end
  29. 48.
  30. 51.
  31. 53.

    “A test method in which examples are used to describe

    the behavior of the application, or of units of code”
  32. 55.

    Feature: Login In order to use the application As a

    user I want to be able to login Scenario: with invalid credentials Given I visit the / page And I have entered demo as my username And I have entered demo1234 as my password When I press Sign in Then I will be shown a message error Scenario: with valid credentials Given I have created an account in the past And I visit the /events page And I have entered demo as my username And I have entered demo1234 as my password When I press Sign in Then I will be redirected to events page
  33. 57.

    Feature: Login In order to use the application As a

    user I want to be able to login Scenario: with invalid credentials Given I visit the / page And I have entered demo as my username And I have entered demo1234 as my password When I press Sign in Then I will be shown a message error Scenario: with valid credentials Given I have created an account in the past And I visit the /events page And I have entered demo as my username And I have entered demo1234 as my password When I press Sign in Then I will be redirected to events page
  34. 59.

    Feature: Login In order to use the application As a

    user I want to be able to login Scenario: with invalid credentials Given I visit the / page And I have entered demo as my username And I have entered demo1234 as my password When I press Sign in Then I will be shown a message error Scenario: with valid credentials Given I have created an account in the past And I visit the /events page And I have entered demo as my username And I have entered demo1234 as my password When I press Sign in Then I will be redirected to events page
  35. 60.

    And(/^I have entered (.*) as my username$/) do |username| fill_in

    'user[login]', with: username end And(/^I have entered (.*) as my password$/) do |password| fill_in 'user[password]', with: password end
  36. 61.

    Feature: Login In order to use the application As a

    user I want to be able to login Scenario: with invalid credentials Given I visit the / page And I have entered demo as my username And I have entered demo1234 as my password When I press Sign in Then I will be shown a message error Scenario: with valid credentials Given I have created an account in the past And I visit the /events page And I have entered demo as my username And I have entered demo1234 as my password When I press Sign in Then I will be redirected to events page
  37. 62.

    Given(/^I have created an account in the past$/) do @user

    = FactoryGirl.create :user, username: 'demo', password: 'demo1234' End Then(/^I will be shown a message error$/) do expect(page).to have_content 'Invalid login or password.' end When(/^I press Sign in$/) do click_button 'Sign in' end Then(/^I will be redirected to home page$/) do expect(page).to have_content 'Login successful' end Then(/^I will be redirected to (.*) page$/) do |url| path = URI.parse(current_url).path expect(path).to match "/#{url}" end
  38. 63.
  39. 65.
  40. 68.
  41. 70.
  42. 71.
  43. 72.

    role :demo, %w{example.com example.org example.net} task :uptime do on roles(:demo),

    in: :parallel do |host| uptime = capture(:uptime) puts "#{host.hostname} reports: #{uptime}" end end
  44. 76.

    “Continuous Integration is the practice of merging development work with

    a Master/Trunk/Mainline branch constantly so that you can test changes, and test that changes work with other changes” http://blog.assembla.com/AssemblaBlog/tabid/12618/bid/92411/Continuous-Delivery-vs- Continuous-Deployment-vs-Continuous-Integration-Wait-huh.aspx
  45. 77.

    “Continuous Delivery is the continual delivery of code to an

    environment once the developer feels the code is ready to ship.” http://blog.assembla.com/AssemblaBlog/tabid/12618/bid/92411/Continuous-Delivery-vs- Continuous-Deployment-vs-Continuous-Integration-Wait-huh.aspx
  46. 78.

    “Continuous Deployment is the deployment or release of code to

    Production as soon as it is ready” http://blog.assembla.com/AssemblaBlog/tabid/12618/bid/92411/Continuous-Delivery-vs- Continuous-Deployment-vs-Continuous-Integration-Wait-huh.aspx
  47. 79.
  48. 82.
  49. 83.
  50. 85.
  51. 86.
  52. 89.

    scss_files: "**/*.scss" linters: BangFormat: enabled: true space_before_bang: true space_after_bang: false

    BorderZero: enabled: true convention: zero # or `none` ColorKeyword: enabled: true ColorVariable: enabled: true Comment: enabled: true DebugStatement: enabled: true
  53. 90.
  54. 93.
  55. 94.
  56. 96.
  57. 97.
  58. 102.