by: bhargavi h. goswami, assistant professor, …resume: resumes execution. run: restarts execution....

71
By: Bhargavi H. Goswami, Assistant Professor, Sunshine Group of Institutions.

Upload: others

Post on 28-May-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

By: Bhargavi H. Goswami,Assistant Professor,

Sunshine Group of Institutions.

Page 2: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

• Introduction: – Computing Involve two main activities:

• Program Development• Use of application software

– Programs that help us for developing and using other programs, are called software tools, which perform various house keeping task involved in program development & application usage.

• Definition: Software Tool is a system program which – 1. Interface program with the entity generating its input

data, or– 2. Interfaces the results of a program with the entity(user)

consuming them.

• The entity generating the data or consuming the results may be – A program or– A user.

Page 3: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

• Example: File rewriting utility• It organizes the data in file to make it suitable for processing

by a program. Eg. Converting pipe delimited file to excel file.• For this, it may perform:

– Blocking/De-Blocking,– Padding / Truncation,– Sorting, etc.

• In this chapter we‟ll study software tools for– Program Development and– User Interface.

Originator

Raw Program or Data

S/W Tool

Transformed Program or Data

Consumer

Page 4: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

1. Program design, coding and documentation

2. Preparation of program to machine readable form.

3. Program translation, linking & loading.

4. Program testing & debugging.

5. Performance Tuning.

6. Reformatting data and/or results of a program to suit other programs.

Page 5: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

• In this topic we will cover following points in detail:a) Program Design & Coding

b) Program Entry & Editing

c) Program Testing & Debugging

d) Enhancement of Program Performance.

e) Program Documentation

f) Design of Software Tools

• Program Pre-Processing

• Program Instrumentation

• Program Interpretation

• Program Generation.

Page 6: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

• Two category of Tools:– Program Generators– Programming Environments

• Program Generators:– Generates a program which performs a set of functions

described in its specifications.– Saves design efforts. How?– Answer: Specifies what functions a program should be

performing instead of how function should be implemented.

– Coding efforts are saved. How?– Program is generated instead of hand coding.

• Programming Environment:– Supports program coding by incorporating awareness of

programming language syntax and semantics of language editors.

Page 7: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

• These tools are text editors or more sophisticated programs with text editors as front ends.

• Two modes of Editor Function:– Command Mode– Data Mode

• Command Mode: Accepts user commands specifying function to be performed.

• Data Mode: In this user “keys in” text to be added to file.

• What is the problem here?– Failure to recognize current mode.– Results to mixing up of command and data mode.

Page 8: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

• Solution / Remedy: Two Approaches– Approach 1: Quick Exit

• Quick exit from data mode through ESC key.

• Eg: Vi Editor.– Approach 2: Screen Mode

• Also called “what u see is what u get” mode.

• Cursor works for command mode.

• And key stroke is the data mode.

• Special key combination signify commands.

• Benefit: Need not to indicate that data input ends.

• Eg: Turbo C

Page 9: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

• Steps for program testing and debugging:– 1. Selection of test data for programs.

– 2. Analysis of test results to detect errors.

– 3. Debugging.

• Software Tools assisting for testing and debugging to programmers may of following forms:– 1. Test Data Generators

– 2. Automated Test Drivers

– 3. Debug Monitors

– 4. Source Code Control System

Page 10: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Test Data Generators:◦ Help user selecting test data for programs.

◦ Ensure thoroughly testing of programs.

Debug Monitors:◦ Helps us in obtaining information for

localization of errors.

Source Code Control System:◦ Helps keep track of modifications in the

source code.

Page 11: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Automated Test Drivers:

Help in regression testing.

After every modification, program correctness is verified by subjecting it to standard set of tests.

Regression Testing:

◦ Many sets are prepared as test data and then,

◦ Given as input to programs.

◦ The driver then selects one set of test data at a time and organizes execution of program on that data.

Problems with Automated Test Drivers:

◦ 1. Wastage of testing efforts on in-feasible paths. i.e Path which is never followed during execution .

◦ 2. Testing complex loop structures.

Remedy/Solution: Manual Testing

Conclusion:

◦ Automated testing can be used for first batch of errors at low cost.

◦ This would free programmers and help them concentrate to tackle more complex aspects of testing.

Test Drivers

Program Under

Execution

Set of Test

Data

Page 12: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Testing:--

Execution Path: ◦ Used by test data selection◦ It is a sequence of program statements visited during an

execution.◦ For testing, program is viewed as set of execution path.◦ Test data generator determines conditions which must be

satisfied by program input for flow of control along the specific execution path.

◦ Eg: x:= sqrt(y) + 2.5;

if x>z then

a:=a+1.0;

else

---

---◦ Execution path is traversed only if x>z.◦ To test this, test data generator must select a value for y

and z such that x>z.◦ For eg: y = z2, then only z value is to be selected.

Page 13: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Producing Debug Information:

Aids localization & removal of errors.

Such information can be produced ◦ Static or/and

◦ Dynamic

Static:-◦ Form of debug information produced static are

Cross reference listing

List of undefined variables

Unreachable statements.

◦ They determine cause of program malfunction.

◦ Collection of such information is performed by “Data Flow Analysis Techniques”.

Page 14: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Eg: No Statements

10 sum := x + 10;◦ If x is not defined till we reach statement 10, then it

is clear that x is un-defined.

◦ Depends on: Flow of Control.

Dynamic:-◦ Produced at execution time

◦ Form of debug information produced dynamic are

Value dumps

Execution traces

◦ Helps determine execution path & variable assuming value for it.

◦ Most PLs provide this.

◦ Eg: Trace & Dump

Page 15: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

1. Debug Unit ( <file no>,<list of options>)◦ Debug output is written in <file no> file.

◦ Trace: Trace of labeled statement executed

◦ Sub trace: Trace of subprograms called

◦ init(<list>): Trace of assignment made to each variable in the list.

◦ subchk (<list>): Subscript range check, array out of bound.

2. At <label>◦ Indicated actions are executed when label is

encountered.

◦ Trace on: Trace is enabled.

◦ Trace off: Trace is disabled.

◦ Display <list>: Values of variable in list are written in debug file.

Page 16: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Drawback?◦ Volume of information produced by dump and trace

are very large.

Solution?◦ Debugging.

Page 17: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Debugging:-

To improve effectiveness of debugging, get option of “Dynamically specify trace & dump”.

Who would provide this solution?◦ Ans: Compiler and Interpreters.

How?◦ By setting breakpoints (stop)

◦ Change variables during debugging.

◦ Set & remove breakpoints dynamically during execution.

Eg: Break Points & Dump Facilities◦ (a) stop on <list of labels>

◦ (b) dump at <label> <list of variables>

Page 18: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Eg: Interactive Debugging Facilities:◦ This commands can be issued when program

reaches breakpoints.

◦ Display <list of variables>

Displays values of variables.

◦ Set <variable> = <exp>

Assign value.

◦ Resume:

Resumes execution.

◦ Run:

Restarts execution.

Page 19: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Debug Monitors:◦ Debugging is provided by debug monitor software.

◦ Executes program that is being debugging under its own control.

◦ Provides execution efficiency.

◦ Performs dynamically specified debugging actions.

◦ Can be made language independent.

◦ Eg: DDT (Dynamic Debugging Techniques) of DEC-10 language.

Page 20: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Program efficiency depends on ◦ Efficiency of Algorithm◦ Efficiency of Coding

Is Optimization needed?◦ Yes.

But, optimization of compiler improves efficiency of Code but not efficiency of algorithm.

Sol: Only programmers can improve efficiency of Algorithm.

Problem with this solution?◦ It is Time Consuming◦ And not cost effective

Page 21: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Remedy? Focus on code that is consuming much of the execution time.

How to do that? Using “Performance Tuning Tools” we can identify such code.

Eg: Module # of % of exe

Name Statements Consumption

A 150 4.00

B 80 6.00

C 35 90.00

Less than 3% of code consumes more than 50% execution time.

Page 22: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Profile Monitor: Is a software tool that collects information regarding execution behavior of a program.

Profile monitor gives its analysis in the form of “Execution Profile”.

Eg: Execution profile:

Program Alpha Execution Profile.

Program Name % Execution Time

Main Program 11.15

Sub1 41.59

Sub2 15.54

Meor 31.72

Program meor consumed 31.72 % of total time.

Lets analyze individual statements of program meor.

Page 23: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

#True

% Time # Exec Statements

31.72 5 subroutine meor(eoper)

0 integer eoper(10)

00.08 5 k = 9

30.74 39 do 10 i1 = 1,10

04.35 39 j = i1 +k

3 09.35 39 if (sw.eq.1) goto 50

26 04.44 36 if(eoper(j).eq.b1) goto 15

4 02.06 10 if(eoper(j).eq.zero) goto 20

00.21 6 pr = eoper(j)

00.21 6 goto 10

----

----

02.01 39 continue 10

----

----

00.59 5 end

Page 24: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Analysis of MEOR: The subroutine meor consumed 31.72 % of total

execution time. In that, do loop of meor consumed 30.74 %. Thus we can say that its important to optimize the

loop. Again, if statements consume more than half of the

loop execution time. What if we exchange 2nd IF with 3rd IF? Would this

benefit us? Yes or no? Ans: No benefit. Reason? 2nd IF is mostly true and 3rd

IF is mostly false. Y to go through if which is mostly false? Right?

Thus, there appears little scope for optimizing meor. Conclusion: Helps programmer to focus on code optimization of

particular statements or improving algorithm. Execution Counters can be obtained in generation of

code. Eg: IITFORT compiler, Preprocessor.

Page 25: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Projects suffer from lack of up to date documentation.

Hence, automatic documentation tools are motivated.

These tools work on source program to develop documents for them.

Eg: Flow Charts

IO specification (shows files & records)

Page 26: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

A. Program Pre-processing

B. Program Instrumentation

C. Program Interpretation

D. Program Generation

Page 27: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Used to support static analysis of program.

Generates:◦ Reference listing

◦ List of un-referenced (un-defined) symbol

Uses:◦ Test data generators

◦ Documentation aids

Page 28: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Implies insertion of statement in program.

The instrumented program is translated by standard translators.

Used by:◦ Execution Profiles

i.e How many times statement is executed.

◦ Debug Monitors

i.e where execution has reached

Page 29: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Call debug_mon(const_i)At 10, display total

---------

--------

At 20, display term

-------

--------

Thus, every time debug monitor receives control, it checks if it has reached statement 10 or 20.

Page 30: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Motivated by absence of translation phase in processing a program.

Most of the requirements which are met by software tools are ad-hoc.

This helps eliminate translation phase from program execution.

These tools suffers from ◦ Poor efficiency

◦ Poor portability

Then too, programs that is generated is efficient & can be made portable with few efforts.

Page 31: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Task

SpecificationInterpretation Results

Interpretation:Data

Task

Specification

ProgramGeneration Results

Program Generation:Data

GeneratingProgram

Page 32: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Need input as screen specification. Now formatted program will be in form of a

function which becomes a part of application. Requires less memory than interpretation. Also speedy in comparison of interpreters. Permit dynamic changes in specification. Provides execution efficiency. Also provides code space efficiency. Each specification is considered as new

function and integrated with application.

Page 33: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

1. Line 2. Stream 3. Screen 4. Word Processor 5. Structure Editor

Line & stream editors typically maintain multiple representation of text.

Display Form shows text of sequence of lines. Internal Form performs edit operation.

Page 34: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Scope of edit operation in line editor is limited to line of text.

Line is designated either ◦ Positional (sr. no) or

◦ Contextually (context symbol)

Advantage: Primary Simplicity.

Page 35: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Views entire text as a stream of characters.

Permit edit operation to cross line boundaries.

Support character, line and context oriented commands.

Indicated by ◦ Position of text pointer or

◦ Search commands.

Eg: Dos File

Page 36: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Doesn‟t display text in the manner in which it would appear for printing.

Uses “what u see is what u get” principle.

Displays screen full of text at a time.

Cursor positioning & editing is supported.

Effect of edit operation is visible on the screen same moment.

Useful during formatting of documents to be printed.

Eg: NotePad, WordPad.

Page 37: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Basically document editors Produce well formatted hard copy output. Features:

◦ Copy / Paste / Cut◦ Find / Replace◦ Spell Check

Wide spread among◦ Authors◦ Office Personnel◦ Computer Professionals

Eg: Word Start, MS word

Page 38: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Incorporates an awareness of structure of document.

Useful in browsing through document.

Creation & Modification is very easy.

Editing requirements are specified using structures.

Structure editors are also called syntax directed editors.

Eg: VB, NetBeans, EditPlus

Page 39: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Fundamental Functions of Editing are◦ Travelling◦ Editing◦ Viewing◦ Display

Travelling implies movement of the editing context to a new position within the text.

How can we do travelling?◦ Explicitly by user: Eg: Line Number command of line editor.

◦ Implied user command: Eg: Search command of a stream editor.

Page 40: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Viewing implies formatting of text in a manner desired by user.

Viewing is an abstract view.

Independent of physical characters of an IO Device.

Display component maps this view into the physical characteristics of display devices being used.

Display component determines where a particular view appears on screen.

Separation of viewing & display function gives possibilities like◦ Multiple windows on same screen◦ Concurrent edit operations on same display terminal.

Page 41: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Command Processor

EditingManager

TravellingManager

ViewingManager

EditingBuffer

ViewingBuffer

EditingFilter

ViewingFilter

Text HDD

Page 42: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Filters: Editing & Viewing filters operate on the internal form of text to prepare the forms suitable for editing & viewing.

Buffers: Forms prepared by filters are put in editing and viewing buffers respectively.

Managers: Viewing & Editing manager makes provision for appropriate display & editing of this text.

When updating or cursor position changes,◦ Filters operate on new text portion and then,

◦ Updates the content of buffer.

Page 43: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Editing

Changes are reflected

By editing filters

Internal form is Updated

Updates of content

In viewing buffer

Page 44: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Undo Function:

Nullify one or more of previous edit operations performed by the user.

How to implement undo function?

A) by storing a stack of previous views.

B) by devising an inverse for each edit operation.

But, what is the problem here?

If we implement multi level undo, we may face problem of overlapping edits.

Sol: Avoid using multi level undo.

Page 45: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Provide Following facilities:-Setting breakpoints in program

Initializing debug conversation when control reaches breakpoint

Displaying values of variables.

Testing user defined assertions & predicts involving program variables.

Debug monitor functions can be easily implemented in an interpreter.

But interpreters incur considerable execution time penalties.

Page 46: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Hence, debug monitors rely on instrumentation of program.

User must compile program under debug option.

To disable debug option for particular statements: no_op<statement number>

Compiler generates table (var nm, address).

Set break points with <si_Instruction><code>

Program executes on CPU until si_instruction is reached.

Code produces interrupt code.

Instead of <si_instruction> we can use◦ BC ANY◦ DEBUG_MON

Now debug monitor gains control & opens a debug conversation.

Page 47: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

(1) User compiles program under debugoption. Produces files:-- compiled code file-- debug info file

(2) User activates debug monitor & program name. Debug monitor opens:-- compiled code file-- debug information file

(3) User specifies debug requirements-- break points-- action to be performed-- instruments program-- builds debug table (statement no, action)

(4) Instrumented program gets control & executes up to breakpoint.

Page 48: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

(5) S/W interrupt is generated when

<si_instr> is executed.

-- control is given to debug monitor.

-- DM consults debug table & performs

debug action specified for breakpoints.

-- debug conversation starts

-- user may issue commands

-- modify breakpoints, actions

-- control returns to instrumented program.

(6) Step 4 and 5 are repeated until end of debug session.

Page 49: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Debugger example:Unix:

- sdb (Standard PL level debugger)- adb (Assembly level debugger)

IBMPC:- object code level debugger

Debug Assertion: is a relation between values of program variables.

Assertion can be associated by program statement.

Debug monitors verifies assertion when execution reaches the statements.

If values matches, program execution continues otherwise, debug conversation opens.

Debug assertion eliminates need to produce voluminous information.

Page 50: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Is a system software. Provides integral facilities for

◦ Program creation◦ Editing◦ Execution◦ Testing◦ Debugging

Components1. Syntax directed editor2. Language Processor

-- Compiler-- Interpreter-- Both

3. Debug monitor4. Dialog monitor

Page 51: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Components are accessed through dialog monitor. Syntax directed editor incorporates front end. Editor performs syntax analysis and construct IR giving

abstract syntax tree. Compiler and debug monitor share IR. Thus, program execution or interpretation starts then. In between, any time during execution, programmer can

interrupt execution, resume program and restart execution.

Debug monitors provide easy accessibility to all functions. Also allow,

◦ Generation of program◦ Testing functions◦ Partial compilation and program execution.

Errors are indicated if encountered. Also permits

◦ reversible execution & ◦ step back execution

Page 52: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Is a syntax directed programming environment for PL/CS, which is subset of PL/I.

Contains:◦ Syntax directed editor

◦ Compilation & Interpretation schematic for execution.

◦ Collection of debugging tools

Template: Editor guides the user to develop a well structured program through use of templates. Templates has fixed syntax information & few place holders.

Page 53: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Placeholder: signifies position in a program where specific language constructs may be inserted by programmer. Eg. Statements or expressions.

Eg: /* comment */name : procedure options(main);declaration }{ statement }END name;

Eg: if condition }then {statement}else {statement}

{

cursor

Placeholder

{

Page 54: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

CPS replaces placeholder by template for that entity.

As user keys in program statements, they are converted to IR.

Also support placeholder expansion.

Screen has two parts:◦ Top part display current statement under execution.◦ Bottom part displays results & debug output.

User can interrupt execution at any moment & open debug conversation.

Advantage: Template governed approach guarantees syntactically valid programs.

Disadvantage: ◦ Insertion of a loop in existing program is difficult.◦ Absence of undo facility, which was resolved in later

enhancement of environment.

Page 55: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Role: Simplifying interaction of a user with an application.

Two aspects:◦ 1. Issuing Commands.◦ 2. Exchange of Data.

Requirement of UI?◦ Before requirement was small & hence small

applications.◦ But now, applications have become so large that one

programmer‟s team do not know any thing about other programmer‟s team working on same application.

◦ UI will keep track of information of functionalities & educating users for those applications.

Page 56: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Two components:◦ 1.Dialog Manager

◦ 2.Presentation Manager

1. Dialog Manager:◦ Manages conversation between user & application.

◦ Prompts user for command.

◦ Transmits command to application.

2. Presentation Manager:◦ Displays data produced by the application in

appropriate manner on screen.

Page 57: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

User Interface Covers Following Topics:

1. Command Dialogs

- Principle of command dialog design

2. Presentation of Data

3. Online Help

- Hypertext

4. Structure of User Interface

5. UIMS-User Interface Management Systems

- MenuLay

- HyperCard

Page 58: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Commands are issued to an application through a command dialog.

Three ways to implement command dialogs are:◦ 1. Command Languages

◦ 2. Command Menus

◦ 3. Direct Manipulation

Page 59: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

1. Command Languages: Similar to command languages for OS. Primitive Command Languages support:

◦ Imperative commands◦ Syntax: <action><parameters>

Sophisticated Command Language support:◦ Imperative commands (eg: instructions, statements)◦ Declarative commands (eg: algorithms)

Have their own syntax and semantics Problem with command language is?

◦ Need to learn syntax before using the application.◦ Needs large time and efforts.

Solution? On line help. How?

◦ Reduces syntax memorizing efforts.◦ But, than too it needs some efforts initially to use it.

Page 60: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

2. Command Menus:

Basic functionalities of application are reflected in menu choices.

Provides obvious advantage.

Hierarchy of menus explain functionality of applications. Eg. File, edit, view

Use can be simplified by “pull down” menu utilities. eg. C, vb(toolbar)

3. Direct Manipulation System:

Provides user with a visual display of universe of application. i.e. C Help, MSDN(for vb, online).

Display shows important objects in universe.

Actions or operations over objects are indicated using pointing devices eg. Cursor or mouse.

Eg: Spread Sheet

Page 61: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Principles of Command Dialog Design: These set of principles ensures effectiveness of command dialogs.◦ 1. Ease of Use◦ 2. Consistency in command structure◦ 3. Immediate feedback on user commands◦ 4. Error Handling◦ 5. On line help to avoid memorizing command details.◦ 6. Undo Facility◦ 7. Shortcuts for experienced users.

Command menus score over command languages on principles 1,2 & 5.

Command languages score over command menus on principles 7.

But that limitation is eliminated by „type ahead‟ facility (menu shortcuts) which is the aid to experienced users.

Recent trend is in development of direct manipulation system in graphics.

Page 62: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Data for an application can be input through free form typing.

Alternative option is form filling approach which is good for large volume of data.

Application results representation: Tables.

Summery results representation: Graphs, pie chart, etc.

Page 63: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Important to promote & sustain interest in use of an application.

It minimizes efforts of initial learning of commands.

Avoids using printed doc (books) to solve every doubts.

Forms:◦ Online explanations,◦ Demonstrations,◦ Tutorials,◦ Manuals.

Important aspect: fast access to efficient location of desirable information.

Eg: Hypertext

Page 64: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Hypertext:

Visualizes document consisting of hierarchical arrangement of information.

Provides variety of means to locate required information.

Forms:◦ Tables & Indexes

◦ String searching functions

◦ Means to navigate within documents

◦ Backtracking facilities

Effectiveness depends on efficiency of organization.

Page 65: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Two Components: 1. Presentation Manager: Responsible for

◦ Managing user‟s screen,◦ Accepting data,◦ Presenting results.

2. Dialog Manager: Responsible for◦ Interpreting user command◦ Implementing them by invoking related modules◦ Error messages◦ Online Functions◦ Organizing changes in view.

Page 66: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

ApplicationCode

PresentationManager

DialogManager

GraphicsPackage

--------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------

User

User

Interface

User Interface

Page 67: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Automates the generation of user interfaces.

Input to UIMS?

Specification of presentation & dialog semantics.

Output of UIMS?

Presentation and dialog managers of UI resp.

Types of Dialog Managers:◦ Grammar

◦ Event Descriptions

◦ Finite State Machines

Page 68: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Grammar:◦ Syntax & Semantics of commands are specified.◦ Interface gets activated when user starts writing programs.◦ Eg YACC

Event Based Approach:◦ Uses visual model of interface◦ Screen with ICON is displayed to user.◦ Event is generated by selecting icon.◦ Eg: VB

Drawback of Grammar & Event Based Approach?

Lack the notion of sequence of actions

Solution?

Finite State Machine:◦ Associate finite state machine with each states of machines.◦ Has additional power to co-ordinate concurrent activities in

different windows.◦ Eg: SCADA for PLC controller‟s programming

Page 69: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Menulay:

Is an early UIMS

Consist of set of icons.

Set of semantic actions are specified for each icon.

Action is performed when the icon is selected.

System generates following:◦ Set of Icon_Tables(name,description) of icon.

◦ Set of events and functions.

Same as VB.

Page 70: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Hypercard: This UIMS is object oriented & event oriented given by

Apple. A card: has associated screen layout and background. Contains buttons & fields. Button can be selected by mouse. Fields can be edited. Hypercard is thus a hierarchy of cards called stack. UI behavior is specified by associating

◦ An action in form of HyperTalk,◦ Button◦ Field◦ Card.

Hierarchy of cards determine sequence of actions performed.

Thus, follows interpretive schematic for implementing a UI.

Page 71: By: Bhargavi H. Goswami, Assistant Professor, …Resume: Resumes execution. Run: Restarts execution. Debug Monitors: Debugging is provided by debug monitor software. Executes program

Chapter Ends Here

Assignment Questions are coming soon…

Remain Ready for Chapter Test.