Help:Lua debugging: Difference between revisions

Content deleted Content added
Causes of Script error: include the fact that you can actually access the error text (I didn't know this until today!)
Lua sandbox: more appropriate section name - Using Personal Sandbox for script development
Line 28:
A tactic, for dealing with older bugs, is to plan to run special extra test data to activate code areas, or show debug-display output, where new Lua script might be added, to provide a [[sanity check]] that the affected areas are functioning soundly, before adding too much new, detailed logic. In most cases, note: "''proofreading is the fastest form of testing"'' if having the patience, or mental memory power, to review the details of older source code. However, another tactic is to reserve specific test-data values to trigger debug-display code which dumps the values of all related data to the screen, or provides a call-tree list to ensure the logic flows into various function sections as expected. In many cases, human memory cannot cope with details beyond 5-9 variables, and so debug-display becomes an easier option, despite the extra time needed to write the debug-print statements into the Lua module. Be careful to proceed slowly, because once extensive amounts of new Lua script are added, then it can become a puzzling guessing game whether the problems were caused by "all the new stuff" rather than by pre-existing bugs in the older Lua script.
 
== Using Personal Sandbox for script development ==
== Lua sandbox ==
The English wikipedia has the [[mw:Extension:TemplateSandbox|Template Sandbox]] extension installed. There is a Synergy between the "template sandbox" and "Scribuntu" extensions, which allows to develop and modify Lua modules in private (i.e., in the user space) pages, before moving them to the global space.
=== How to use "Template Sandbox" to develop scribuntu module? ===