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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2016, 02:04 PM
jagtpf jagtpf is offline
 
Join Date: Mar 2015
Location: Scotland
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Script Testing

Hi Guys,

Would anyone like to share their testing procedures. I'm used to programming languages that allow line-by-line, or section, steps - evaluating as the routine progresses. With vB it seems that's not a method that can be used. It's OK vB advising to learn by looking at others' scripts, but there's little that can be gained (?) without a deeper evaluation than appears possible - or am I missing something quite obvious?

Using a PHP or xml tester seems not an option....

warm thanks

Geoff
Reply With Quote
  #2  
Old 01-04-2016, 04:01 PM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Most of us have a test/dev site setup.
Reply With Quote
2 благодарности(ей) от:
jagtpf, MarkFL
  #3  
Old 01-04-2016, 04:44 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Generally testing involves giving a script values for whatever post/get/db variables its looking for (both valid and invalid values) and checking to see if I get expected behaviour. Behaviours can be in multiple forms including checking the visible markup (i.e. xhtml, javascript, css) as well as verifying data sent to or received from the db by using manual queries. As noted above this is all done on a test site so as not to pooch a live site.
Reply With Quote
3 благодарности(ей) от:
Dragonsys, jagtpf, MarkFL
  #4  
Old 01-05-2016, 06:47 AM
jagtpf jagtpf is offline
 
Join Date: Mar 2015
Location: Scotland
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks guys, though of course having a test site is only one aspect to consider.

Funnily enough some things that don't work on the test site, work on the live (and vice versa).

But some long scripts that involve a lot of actions, how do you keep track? It seems inefficient to play guessing at least some of the time and not to be able to use a good php/xml editor/diagnostic to check.
Reply With Quote
  #5  
Old 01-05-2016, 02:27 PM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jagtpf View Post
Funnily enough some things that don't work on the test site, work on the live (and vice versa).
This usually happens because of hard coded variables, or something which makes the script not be universal (lazy coding, or different strictness settings in PHP)

Quote:
Originally Posted by jagtpf View Post
But some long scripts that involve a lot of actions, how do you keep track? It seems inefficient to play guessing at least some of the time and not to be able to use a good php/xml editor/diagnostic to check.
I use Notepad++ for the coding, and then test on my test sites (one on Windows/IIS and one on Linux/Apache). I have a few scripts with thousands of lines, and have never had an issue doing things this way.
Reply With Quote
  #6  
Old 01-05-2016, 03:39 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jagtpf View Post
Funnily enough some things that don't work on the test site, work on the live (and vice versa).
This will usually be caused by the fact that your test site is not identical to your live site, including but not limited to, php version/settings, mysql version/settings, vb version/settings, installed mods verion/settings, data on your live site is different from your test site, and a host of others as well.

Quote:
But some long scripts that involve a lot of actions, how do you keep track? It seems inefficient to play guessing at least some of the time and not to be able to use a good php/xml editor/diagnostic to check.
You write extra code, that you remove later, which outputs running data either to the screen or to a file on the server which you can review to determine how far you got, or like vbulletin upgrades you have steps and and you output stuff before and after each step to be able to figure out where things went wrong if they do wrong. If doing this last one, make sure each step is small so that figuring what is wrong to fix it only has to look at a few different things. The bigger each step is the more complex it is to debug the step.
Reply With Quote
Благодарность от:
Dragonsys
  #7  
Old 01-05-2016, 03:41 PM
jagtpf jagtpf is offline
 
Join Date: Mar 2015
Location: Scotland
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dragonsys View Post
This usually happens because of hard coded variables, or something which makes the script not be universal (lazy coding, or different strictness settings in PHP)



I use Notepad++ for the coding, and then test on my test sites (one on Windows/IIS and one on Linux/Apache). I have a few scripts with thousands of lines, and have never had an issue doing things this way.
Thanks . I use scite as editor, fairly basic but good and simple (like me!)

Obviously the days when one could use a 'record new macro' as a starter are long gone.

--------------- Added [DATE]1452074302[/DATE] at [TIME]1452074302[/TIME] ---------------

Quote:
Originally Posted by squidsk View Post
This will usually be caused by the fact that your test site is not identical to your live site, including but not limited to, php version/settings, mysql version/settings, vb version/settings, installed mods verion/settings, data on your live site is different from your test site, and a host of others as well.
One obvious quirk is the Test Site has a "Master Style" and yet the Live one doesn't have one (in view).

Best place then, for a test bed, is on the main server!



--------------- Added [DATE]1452074597[/DATE] at [TIME]1452074597[/TIME] ---------------

One question that keeps bugging me is where to put files on the server. Some are obvious, such as "images"/"admincp" etc - but "includes""clientscripts" ?

[S]Does anyone know of a list of vBulletin variables - and what each one does .... ?[/S] Ah - I can glean something using Firebug DOM
Reply With Quote
Благодарность от:
Dragonsys
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 07:16 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.05289 seconds
  • Memory Usage 2,242KB
  • 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
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete