Your SlideShare is downloading. ×
Planning for Debugging
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Planning for Debugging

2,548
views

Published on

talk at London Perl Workshop 2008

talk at London Perl Workshop 2008

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,548
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Planning for debugging Ed Freyfogle London Perl Workshop 28 Nov. 2008
  • 2. Nestoria?
  • 3. What could go wrong? datasources Nestoria output Lots of data, many sources, 4 languges ETL, geocoding, deduplication …. HTML, whitelabels, API, widgets, FBML …. All with very few developers Internal tools, reporting, invoicing …
  • 4.  
  • 5. Developers, not firefighters Bad Good
  • 6. Obvious first steps
    • Version Control
      • svn, trac
    • Build enviroment
      • local, staging, live
    • Tests
      • nightly, prelaunch, postlaunch
  • 7. Documentation Bad: no documentation Worse: incorrect documentation
  • 8. Who do you trust? You make mistakes. Computers don’t.
  • 9. >./connect_to_database.pl --help Prints command needed to access database Usage: ./connect_to_database.pl --database [listings|searchindex] --country no default, (de|es|it|uk) --database type of DB --help --product_type default=realestate --type no default, (failover) --verbose Umm, the backup DB is on server 3, right? Don’t guess. Know
  • 10. Logging
    • Make it easy to turn on/off
    • Log4Perl
    • Have cleanup strategy
  • 11. Measure twice, cut once
  • 12. my $script = ‘~/somescript.pl’; my $procs = determine_procs(); my $groups = some_test() ? 2 : 3; my $cmd = $script . ’ --groups ’ . $groups . ’ --procs ’ . $procs; system($cmd); Rome is burning. You have 10 seconds. What does this code do?
  • 13. my $script = ‘~/somescript.pl’; my $procs = determine_procs(); my $groups = some_test() ? 2 : 3; my $cmd = $script . ’ --groups ’ . $groups . ’ --procs ’ . $procs; execute_cmd($cmd); sub execute_cmd{ my $cmd = shift; if ($dryrun){ print STDERR “would have run $cmd ”; } else { system($cmd); } } Better:
  • 14. Don’t make me think
    • --help, --dryrun, --verbose
    • Getopt::Long
    • Term::ProgressBar
  • 15. Invest now
    • schedule code review/learning
    • “ upgrade day”
      • keep an easy to edit list of ideas (wiki)
    • have an email/alerts strategy
    • CPAN is your friend
      • Perl::Metrics::Simple
  • 16. Get help To: Nestoria team From: [email_address] Subject: Bug I think there is a bug. The page doesn’t seem to wrk. Pls fix.
  • 17. Better To: Nestoria team From: [email_address] Subject: Bug I think there is a bug. The page doesn’t seem to wrk. Pls fix. HTTP_X_FORWARDED_FOR     81.136 .*.* SERVER_ADDR     10.10.*.* HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 7.0; … Cookie        MjEwREhQZ1JzeEl1NDAxMjIzNTY4MjE4A5A
  • 18. Get help (cont.)
  • 19. Help me to help you
  • 20. Shameless plug Join us! You’ll love our API….
  • 21. Questions? http://www.nestoria.co.uk http://blog.nestoria.co.uk

×