Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
For 2023 - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
The Typist and the Engineer

Do you need to test a new piece of software or hardware? You sit there, and you type in your tests, and your check the results. It gets much more difficult when you're testing something that's multiuser and interactive; do the users interfere with each other? Does it work every time? Testing systems such as this can be time-consuming (and boring!), and it's easy to overlook errors if one set of answers is subtly different to another.

Expect (based on Tcl) allows you to automate testing such as this by using two "magic" commands - send and expect - to send a string out to the item under test, and check the response. Expect doesn't have a huge user base, but it's a lifesaver for those specialist requirements that need it.

Can you type as fast as your computer can transmit information? No - you can't - so to make testing from Expect more realistic, an option to send (-h) lets the text be send at "human" speed. You can even define the foibles of your human being if you wish, for example:

set send_human {.1 .25 2 .05 1.5}
send -h "This is a message coming out as if it was typed by a typist\n"


set send_human {.3 .4 0.6 .1 3}
send -h "This is a lett\b\b\b\bmessage coming out as if it was typed by an engineer\n"

In our first example, there's an average gap of 0.1 seconds between characters in words, and 0.25 between characters at the word end. The figure 2 defines the "shape", which is a measure on consistency; 2 is reasonable for a typist, a lower figure indicating a much more erratic person entering data and a higher figure giving greater consistency. The absolute minimum time between characters is 0.05 seconds, and the absolute maximum is 1.5 seconds.

Can you work out what the parameters mean for our second example, the engineer?

See also Expect - advanced training module

Please note that articles in this section of our web site were current and correct to the best of our ability when published, but by the nature of our business may go out of date quite quickly. The quoting of a price, contract term or any other information in this area of our website is NOT an offer to supply now on those terms - please check back via our main web site

Related Material

Tcl/Tk - Tcl, Tcl/Tk and Expect - General
  [2429] - ()
  [2474] - ()
  [2504] - ()
  [2681] - ()
  [3192] - ()
  [3286] - ()
  [4206] - ()
  [4434] - ()
  [4460] - ()
  [4616] - ()

Tcl/Tk - More on Expect
  [435] - ()
  [1173] - ()
  [1411] - ()
  [1475] - ()
  [1531] - ()
  [2475] - ()
  [3009] - ()
  [3448] - ()

resource index - TclTk
Solutions centre home page

You'll find shorter technical items at The Horse's Mouth and delegate's questions answered at the Opentalk forum.

At Well House Consultants, we provide training courses on subjects such as Ruby, Lua, Perl, Python, Linux, C, C++, Tcl/Tk, Tomcat, PHP and MySQL. We're asked (and answer) many questions, and answers to those which are of general interest are published in this area of our site.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2023: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/solutions/tcl-the- ... ineer.html • PAGE BUILT: Wed Mar 28 07:47:11 2012 • BUILD SYSTEM: wizard