View Single Post
  #8  
Old 10-20-2008, 06:26 PM
AndrewD AndrewD is offline
 
Join Date: Jul 2002
Location: Scotland
Posts: 3,486
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SirAdrian View Post
nexia... please

I'm assuming you are talking about your download manager? Usually unit testing is done with object oriented code, because then you re-use much more code than you would be otherwise making it easy to test. Test small chunks independently, and then it will all click together if it is planned out properly.

Fire up simpletest or your favorite testing application and begin writing unit tests for your classes and functions. If your code is broken into logical chunks as it should be, then testing will be easy to do. Most vB mods aren't written in OOP or if they are they are just large library files and not really utilising it as much as they could.

If you cannot test the code, then rewrite the code so it is testable.

If you want more help with this I'd probably send you to the PHP application design forum at sitepoint as there are a few helpful people there who are very active. The fact that it is a vBulletin modification should have little bearing on the ability to test it.
Thanks for pointing me to sitepoint. I don't really need a lecture on coding standards - I've been responsible for giving too many people such lectures in my time and it wears thin.

I'm sure you understand that while OO-design is extremely powerful, it is not a panacea for the systematic testing of many different options and localising external code instabilities, particularly when the base product is in a state of flux. The problem is not only the new features that I write myself - it's their overall integration alongside many different products and add-ons into users' sites, and people's expectation of absolute reliability from day 1.

vb itself was not written in an OO style until well into the development of LDM, and is still in large part not OO. php functionality is not yet stable, and one has to work with other people's hacks, on sites that are running in multiple languages, multiple operating systems and multiple versions of php/sql. So developing add-on code that is supposed to live smoothly through these releases is not just down to the quality of the local design, and a degree of automation would be useful.

Like you, I'm also disappointed that so many on this site seem to prefer to be smart-alecs rather than try to give helpful answers to the question asked.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02339 seconds
  • Memory Usage 1,768KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete