Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Testing is Overrated

Testing is Overrated

A look at the problems with automated testing, and other techniques that can be used to improve software quality, such as user experience testing and code reviews.

Delivered at RubyFringe in Toronto.

For more references and more details, see this talk's page on my website:

Luke Francl

July 18, 2008
Tweet

More Decks by Luke Francl

Other Decks in Programming

Transcript

  1. Test::Unit RSpec Shoulda TDD BDD unit tests behaviors test-first test-along

    Selenium story runner Watir rcov green bar coverage test cases fixtures mock stub Mocha object mother autotest fuzz random miniunit
  2. total_withholdings = 0 employees.each do |employee| if employee.government_retirement_withheld < MAX_GOVT_RETIREMENT

    government_retirement = compute_government_retirement(employee) end company_retirement = 0 if employee.wants_retirement && eligible_for_retirement(employee) company_retirement = get_retirement(employee) end gross_pay = compute_gross_pay(employee) personal_retirement = 0 if eligible_for_personal_retirement(employee) personal_retirement = personal_retirement_contribution(employee, company_retirement, gross_pay) end withholding = compute_withholding(employee) net_pay = gross_pay - withholding - company_retirement - government_retirement - personal_retirement pay_employee(employee, net_pay) total_withholdings = total_withholdings + withholding total_government_retirement = total_government_retirement + government_retirement total_retirement = total_retirement + company_retirement end save_pay_records(total_withholdings, total_government_retirement, total_retirement) 1 6 17
  3. def test_last_day_items_are_privacy_scoped_for_non_friends non_friend = create_user story = stories(:learning_no) story.published_at =

    10.minutes.ago story.save! story = stories(:aaron_private_story) story.published_at = 5.minutes.ago story.save! items_for_non_friend = accounts(:quentin_and_aaron).last_day_items assert_privacy_status(items_for_non_friend, "Public") end You can’t test code that’s not there
  4. def test_critical_functionality begin ... Bunch of stuff to exercise code

    ... # Commented out by Luke to fix test failure # assert "Some important assert", condition rescue # Don't let anything fail this test! end end
  5. Unit testing 50% 25% 75% Code reviews Code inspections Prototyping

    System test 100% 0% Defect Detection Rates of Selected Techniques