Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

how to ensure scripts run exactly how you want them to?

Jan 26, 2012 7:16PM PST

<span style="'line-height:" 115%; font-family: "Times New Roman","serif"; font-size: 12pt; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;'>How could you ensure that all of your scripts will run exactly how you
want them to? And is there a downside to this?

Discussion is locked

- Collapse -
Answer
Test.
Jan 26, 2012 7:24PM PST

In fact, test, test, and test again, under all sorts of conditions and on different computers, (depending what scripts you are talking about). Try your best to break the script and get colleagues to do the same, because if any of you can, then you can bet that it will break in normal usage as well.

Error trap it. Make sure that if any error occurs the script doesn't just hang or lock up, but exits.

There's no quick way to do this, and the downside is your time and effort.

Mark

- Collapse -
Answer
Re: scripts
Jan 26, 2012 7:26PM PST

There's a whole branch of Software Engineering devoted to testing. Useful stuff.
Although programming them in a sound way beats testing and debugging bad code for getting a reliable result, testing still is necessary.

Kees