Tootle returning to rails
-
Upload
andrew-grimm -
Category
Technology
-
view
114 -
download
2
Transcript of Tootle returning to rails
TOOTLE: RETURNING TO RAILSANDREW GRIMM ROROSYD JUNE 9 2015
MY CAREER SO FAR…
UNIVERSITY OF SYDNEY
• Bachelor of Science (Bioinformatics) Honours Class I (Biology)
• Final undergraduate year half biology, half computer science
• Honours year involved a bioinformatics project
CHILDREN’S HOSPITAL AT WESTMEAD
• Worked on RettBASE, an online database of mutations to MECP2 which causes Rett syndrome
• Biological knowledge important, plus general computing skills, but not much programming
MARINE BIOLOGICAL LABORATORY
• Work related to the Encyclopedia of Life, a website aiming to have a series of pages for each species known to science
• ~ 6 months PHP, 6 months Ruby on Rails
UNSW AUSTRALIA
• Analysis of mutation in HIV
• Used Ruby (without Rails)
CURRENT POSITION
• Back-end Rails developer at a large product company
CHANGES FROM PREVIOUS TO CURRENT JOB
• Solo development => Group development
• Research => commercial environment
• Ruby => Rails
PULL REQUESTS
• Have to get two approvals for each pull request
• Advantage: Source of feedback
• Disadvantage: More work when you thought you’d finished
PACE OF WORK
• Previous job involved weekly or twice-weekly meetings
• Now daily standups and JIRA tickets
RUBY TO RAILS
• Bit more magical
TESTING
• In previous job used test/unit, real objects, and tested actual results
• Now use RSpec, factory girl. Techniques include mocking, and testing that one class is calling the correct methods on other classes and objects.
COMPARISON OF TESTING TECHNIQUES: SCENARIO
• A product has a delivery postcode, which must be four digits, and must be to a location we deliver to
• ‘Sydney’ is not valid, because it isn’t 4 digits
• ‘0800’ is not valid, because we don’t deliver there
• ‘2000’ is valid, because we deliver there
TESTING TECHNIQUES: REAL OBJECTS
• Is a product with postcode ‘Sydney’ invalid?
• Is a product with postcode ‘0800’ invalid?
• Is a product with postcode ‘2000’ valid?
TESTING TECHNIQUES: MOCKING
• Testing that Product successfully uses postcode format validation
• The format validator says that the postcode does not contain 4 digits. Is the postcode valid?
• The format validator says that the postcode does contain 4 digits. Is the postcode valid?
WHY THE DIFFERENCE?
• Can’t do dependency injection
• Have to intercept calls to objects or classes
INHERITANCE
• Delegation (as opposed to inheritance):
• spreadsheet = Library::Spreadsheet.new
• spreadsheet.serialize(@spreadsheet_filename)
• Inheritance
• class MutationSpreadsheet < Library::Spreadsheet
• end
MAGIC
• Ruby-only style:
• length_validator = LengthValidator.new(dna)
• length_validator.valid?
• Rails style:
• validates :dna, length: true