E-mail: Bertrand.Ibrahim@cui.unige.ch
Fax: (+41 22) 705 7780
Phone: (+41 22) 705 75 08
WWW: http://cuiwww.unige.ch/eao/www/Bertrand.html
Submitted to International Journal of Human-Computer Studies, Special Issue on Innovative Applications of the World Wide Web
Towards the end of 1993, we started a project that aimed at providing our first year computer science students with Web-based educational material that would help them with their data structure course. Our intent was to put the book used in this course [Ibrahim and Pellegrini (1989)] in a hypertextual form and allow the students to interactively "play" with the algorithms that were described in the book. The difficult part in the project was building a symbolic debugger that could be controlled through a Web-based user interface.
We presented a paper describing this project at the First WWW conference, at CERN, in 1994 [Ibrahim (1994)]. This first paper focused on the technical implementation details of the project, describing only superficially the user interface. The present paper will on the other hand only superficially discuss the implementation, focusing mostly on the use of forms to realize a complex user interface.
Since code fragments found in the book are very often incomplete programs, and given that we add procedure calls to the original code, we built a simple mechanism that allowed us to mark, in the final complete program, which lines were part of the book example, so that only these marked lines would be included in the HTML virtual document and displayed to the student.
When a student, reading the on-line version of the book, clicks on the icon beside a code fragment, the URL used does not actually correspond to an existing document, but rather activates the Pascal program that will return a form-based virtual document corresponding to the initial state of the symbolic debugger (Fig. 1). This form is the actual user interface through which the user will interact with the program.
Fig. 1: Initial document presented to the user.
At the top of the window, there is a row of command buttons (Fig. 2) that allow the user to step through the execution of the program. At the time this project was implemented, "submit" buttons within HTML forms could not have names associated with each of them to differentiate them from each other. If we had used submit buttons, the program would not have been able to tell which submit button the user had pressed. We therefore used image maps, even though we were not interested in the coordinates of the mouse cursor within the button over which the user clicked. We merely wanted to tell over which button the user clicked. Input widgets of type "Submit" can now include a "name" attribute that would allow us to use them as command buttons instead of the image maps described above.
(a) | |
<input type="image" name="BoutonContinue" src=".../BoutonStep.gif">
<input type="image" name="BoutonContinue" src=".../BoutonContinue.gif"> <input type="image" name="BoutonReset" src=".../BoutonReset.gif"> <input type="image" name="BoutonRefresh" src=".../BoutonRefresh.gif"> <input type="image" name="BoutonQuit" src=".../BoutonQuit.gif"> | (b) |
Fig. 2: a) Image maps representing command buttons; b) HTML syntax for the widgets. The "Step" button advances the execution by one instruction; the "Go" button resumes execution till a breakpoint is met; the "Reset" button puts the debugger back to its initial state; "Redisplay Variables" makes the debugger refresh the display with possibly newly selected variables; "Quit" stops the Pascal program and returns the user to the book section from which the algorithm was started.
(a) | |
(b) | <select name="code" multiple size=15> <option value="0002">_ _const <option value="0003">_ _ _MaxNbSommets=15; <option value="0006">_ _var ... <option value="0069">->_ _CmptrVisite := 0; ... <option value="0077">_ _ _ _ _end; { if } <option value="0078">_ _end; { TriTopoInverse } </select> |
Fig. 3: a) Multiple select widget showing the code; b) HTML syntax for the widget.
Fig. 4: Selecting lines in the code widget defines breakpoints to stop at and variables to display.
Fig. 5: After the user presses the Go button, execution will resume till a breakpoint is found. In this example, execution stopped on the "for" statement.
Fig. 6: The user selects one more variables and presses the Redisplay Variables button.
<img src="EmptyValueField.gif"> | <b>IndexSommet</b> <input type="text" name="var0264" size=1 value=""> |
(a) | (b) |
---|
Fig. 7: a) Representation of an empty numerical value field; b) HTML code for the widget.
<b>Bool</b> <select name="var0282" size=1> <option>false <option>true <option selected>- </select> | ||
(a) | (b) | (c) |
---|
Fig. 8: a) Representation of an undefined boolean variable; b) set of values of the single select widget; c) HTML code for the widget.
(a) | (b) | <b>NumDOrdre</b> <select name="sel0265" multiple size=2> <option selected value="0266">[1] <option selected value="0267">[2] <option selected value="0268">[3] <option value="0269">[4] <option value="0270">[5] ... <option value="0278">[13] <option value="0279">[14] <option value="0280">[15] </select> |
Fig. 9: a) An array is represented with a multiple select widget. b) HTML code for the array widget. c) By default, the first three components are initially displayed.
(a) | |
(b) | <b>UnSommet</b> <select name="sel0071" multiple size=2> <option selected value="0072">.v <option selected value="0073">.Next </select> <b>{ .v</b><input type="text" name="var0072" size=2 value="4"> <b>.Next</b> <select name="var0073" size=1><option selected>nil </select> <b>}</b> |
Fig. 10: a) Records are represented with a multiple select widget showing the record field names. Each selected component is then displayed based on its type. b) HTML syntax for the record and components widgets.
(a) | |
(b) | <b>First ^</b> <select name="sel0077" multiple size=2> <option selected value="0078">.v <option selected value="0079">.Next </select> <b>{ .v</b> <input type="text" name="var0078" size=2 value="3"> <b>.Next ^</b> <select name="sel0074" multiple size=2> <option selected value="0075">.v <option selected value="0076">.Next </select> <b>{ .v</b> <input type="text" name="var0075" size=2 value="5"> <b>.Next</b> <select name="var0076" size=1> <option selected>nil </select> <b>} }</b> |
Fig. 11: When a pointer variable (in this example, First) is selected, the whole chain structure is displayed, given that the referenced structure is a record with two fields, v and Next. a) Representation of the chain. b) HTML syntax for all the components.
Contexte courant : <select name="contexte" size=1> <option value="0000">1: Programme principal <option value="0260">2: TriTopoInv(13) <option value="0297">3: Visite(1) </select> | |
(a) | (b) |
---|
Fig. 12: a) The user can select from the call stack the context based on which values will be displayed. b) HTML syntax for the widget.
Fig. 13: The first time the program generates output, an input/output window is added beside the code widget.
Fig. 14: Program output gets added to the textarea widget as more output instructions are executed
On the down side, the user interface suffers somewhat from some shortcomings of the HTML syntax. For instance, because of the current form model, it is not possible to tell to the browser which item in a multiple select widget should be at the top of the visible area (assuming that the widget has more items than its size allows to show), nor is it possible for the server-side application to know how far the user has scrolled through such a multiple select widget. This means that it is not possible to "refresh" the display in such a way as to have a specific interesting section of a multiple select widget automatically visible. For instance, in our case, we would have wanted the widget showing the Pascal code to automatically scroll so as to make visible the line where execution stopped.
More generally, many screen design issues are difficult to resolve since there is no fine control over the widget position in the display window. This is the price to pay for portability and device independence. Actually, had the HTTP protocol included the ability for the server to query the browser for its document window size, it would been possible to include in the server-side application more sophisticated layout mechanisms. At some early stage, we wondered whether our symbolic debugger should force a line break after each variable display widget to make the screen more readable. But we decided against it as screen real estate is sometimes quite limited on some platforms and adding line breaks might extend the length of the virtual document beyond the size of the browser's document window, thus forcing the user to often use the browser scrollbar. The problem is that most browsers are rather slow when they have to scroll documents that are heavily loaded with form widgets.
Other concerns with our approach are related to timing considerations such as response time depending on network load and server load. We haven't had the opportunity to test our demonstration programs from an off-campus site, but response times for an on-campus client are usually within one or two seconds, except for start-up time which is around 10 to 15 seconds. In relation to server load, we have integrated a timing mechanism in the Pascal programs that are launched by the server so that they automatically time out after a certain period of inactivity. Indeed, because of the statelessness of the HTTP protocol, we could not be sure that the "quit" command would always be invoked and we didn't want to have a multitude of processes indefinitely waiting until the user explicitly clicked on the "Quit" button.
The most well known programming language for applets is Java, supported by both the Netscape browser and the HotJava browser. There is also an Ada compiler that can produce Java-compatible code. Less mature solutions include the SurfIt browser that can execute applets written in Tcl, and the Grail browser that can execute applets written in Python.
With all these alternatives, two main strategies can be deployed to use applets to implement an improved version of our symbolic debugger: the first strategy would still involve a server-side application, but a client side applet would allow us to implement a much more sophisticated page layout that would adapt to the characteristics of the client machine and make a more effective use of the screen real estate. This solution would also allow a substantial decrease in network traffic, as it would not be mandatory anymore to send the HTML code for the whole user interface after each interaction. Indeed, the server-side application could just send update information that the applet would use to change the content of the display. The second strategy would be to have the symbolic debugger run completely on the client machine as an autonomous applet. This latter strategy would offer the maximum flexibility, as it allows complete control of the screen layout and doesn't suffer from any network latency or server overload.
Ibrahim, B. & Pellegrini, C. (1989). Structuration des donnees informatiques, initiation et applications. Dunod informatique, Ed. Paris: Bordas. ISBN 2-04-018679-4
Site Hosting: Bronco