Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-20-2008, 06:25 AM
AndrewD AndrewD is offline
 
Join Date: Jul 2002
Location: Scotland
Posts: 3,486
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Automating testing

Has anyone any suggestions on ways of automating the testing of vb hacks? I've reached a point where it is impossible to run anything like complete regression tests, and even the straightforward manual tests have become extremely tedious.
Reply With Quote
  #2  
Old 10-20-2008, 10:34 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't see how you can really automate testing, as each modification will require different scenarios.
Reply With Quote
  #3  
Old 10-20-2008, 12:43 PM
AndrewD AndrewD is offline
 
Join Date: Jul 2002
Location: Scotland
Posts: 3,486
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
I don't see how you can really automate testing, as each modification will require different scenarios.
You develop standard test suites for the modification, which then get run as part of a regression process for new releases. What I'm looking for is some sense of the best way of doing these for a web-based application built around vbulletin.
Reply With Quote
  #4  
Old 10-20-2008, 01:25 PM
nexialys
Guest
 
Posts: n/a
Default

try/error is the best regression test possible... the more you code, the more you know how codes have to be made anyway.. you can't be perfect on first try... (ok, i am, but hey, i have 20 years of coding in the hands.)
Reply With Quote
  #5  
Old 10-20-2008, 03:16 PM
AndrewD AndrewD is offline
 
Join Date: Jul 2002
Location: Scotland
Posts: 3,486
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nexialys View Post
try/error is the best regression test possible... the more you code, the more you know how codes have to be made anyway.. you can't be perfect on first try... (ok, i am, but hey, i have 20 years of coding in the hands.)
Ditto, my friend, I started serious coding in 1973, including professional responsibility for leading the maintenance team responsible for a million line commercial package, but careers and approaches move on. I do understand the value of hand-on testing but also the need for more automated approaches when the task become too big.

To give a sense of scale, the modification I'm talking about is currently about 25K lines of code, and has gone through over a hundred main releases over four full versions of vbulletin during the last five years, each time offering significant changes in feature set and extensions. I've not seen any regression tools that are well-suited to handling the testing task. Has anyone else?
Reply With Quote
  #6  
Old 10-20-2008, 04:15 PM
nexialys
Guest
 
Posts: n/a
Default

if YOU did not find anything, who could, seriously ?!...
Reply With Quote
  #7  
Old 10-20-2008, 04:40 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 10-20-2008, 07: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
  #9  
Old 10-20-2008, 07:37 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vBulletin's code is a pain to test just as yours will be because it's not broken up enough. It may be a lecture, but there is truth to it. The more automation, the more you can test automatically. FYI vBulletin is moving to a full OOP design because it's easier to make changes to and test. Anyway ...

What are you wanting to test, exactly? Do you want to test your code on several environments often, or quickly test the code function itself?

and yeah... please ignore nexials.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04346 seconds
  • Memory Usage 2,244KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (7)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete