0% found this document useful (0 votes)
68 views43 pages

Se Unit V

This document contains a question bank with answers related to user interface design and testing. It includes questions about the characteristics of a good user interface, different types of user interfaces like graphical and text-based interfaces, menu-based interfaces, and command language based interfaces. Additional questions cover topics like component-based GUI development, the X window system, visual programming, coding standards, GUI design methodology, code review, and common programming errors found during code inspection.

Uploaded by

velkandha28
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views43 pages

Se Unit V

This document contains a question bank with answers related to user interface design and testing. It includes questions about the characteristics of a good user interface, different types of user interfaces like graphical and text-based interfaces, menu-based interfaces, and command language based interfaces. Additional questions cover topics like component-based GUI development, the X window system, visual programming, coding standards, GUI design methodology, code review, and common programming errors found during code inspection.

Uploaded by

velkandha28
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

CHRIST COLLEGE OF ENGINEERING & TECHNOLOGY, PUDUCHERRY


DEPARTMENT OF CSE
Unit-V
QUESTION BANK WITH ANSWER

User Interface Design and Testing: Characteristics of a good User Interface – Types – Fundamentals of
Component based GUI Development – A User Interface Design methodology – Coding – Software
Documentation – Testing – Unit Testing – Black Box testing – White Box testing – Debugging – Program
Analysis tools – Integration testing – Testing Object Oriented programs – System Testing – Issues.

PART-A (2 MARKS)

1. List the characteristics of a user interface. (May 16)


• Speed of learning.
• Speed to recall
• Error prevention
• Consistency
• Feedback
• Support for multiple skill levels
• Error recovery (undo facility)
• User guidance and on-line help

2. Differentiate manual user guidance and online help system.


• Online help system help users to know about the operation of the software any time while
using the software
• The guidance messages prompt the user regarding the options he has regarding the next
command, and the status of the last command, etc.

3. Differentiate mode-based interface and the module's interface.

Unit – 5 Question Bank with Answer Page 1 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• A modeless interface has only a single mode and all the commands are available all the time
during the operation of software
• In a mode-based interface, different sets of commands can be invoked depending on the mode
in which the system is working.

4. List out the types of user interface. (Nov 15)


• Command language based interfaces
• Menu-based interfaces
• Direct manipulation interfaces

5. Compare Graphical user interface with text-based user interface.


Graphical User Interface Text-based User Interface

Multiple windows with different Multiple windows with different information cannot
information can be simultaneously be simultaneously be displayed on the screen
be displayed on the screen
Iconic information representation Iconic information representation and symbolic
and symbolic information information manipulation is not possible
manipulation is possible
Supports command selection using It is not attractive one
an attractive and user friendly menu
selection system.
Graphics terminal with graphics A cheap alphanumeric display terminal
capability is Expensive

6. List the characteristics of command language based interface


• A command language-based interface is based on designing a command language which the
user can use to issue the commands
• It allows fast interaction with the computer and simplifies the input of complex commands.

Unit – 5 Question Bank with Answer Page 2 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• A command language- based interface can be made concise requiring minimal typing by the
user

7. What are the disadvantages of command language-based interface?


• Difficult to learn and require the user to memorize the set of primitive commands
• Most users make errors while formulating commands in the command language
• Command language-based interfaces are not suitable for casual and inexperienced users

8. What the types to menus?


• Scrolling menu - enable the user to view and select the menu items that cannot be
accommodated on the screen
• Walking menu -structure a large collection of menu items.
• Hierarchical menu - menu items are organized in a hierarchy or tree structure

9. What are the issues raised in designing a command language-based interface


• Reduce the number of primitive commands that a user has to remember
• Minimize the total typing required while issuing commands

10. What do you mean by component-based GUI development style?


• A development style based on widgets (window objects) is called component-based (or
widget-based) GUI development style.
• Use widgets as building blocks is because they help users learn an interface fast

11. Give the necessity of component-based GUI development.


Component-based GUI development recognizes that every user interface can easily be built from a
handful of predefined components such as menus, dialog boxes, forms, etc.

12. What is meant by window management system?


• A window management system is a resource manager.

Unit – 5 Question Bank with Answer Page 3 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• It keeps track of the screen area resource and allocates it to the different windows that seek to
use the screen. It simplifies the task of a GUI designer.
• A WMS consists of two parts a window manager, and a window system

13. What is an X window?


• A windowing system, which is used to provide the basic framework for a GUI environment:
drawing and moving windows on the display device and interacting with a mouse and
keyboard.
• The X-window functions are low-level functions written in C language which can be called
from application programs

14. Draw the architecture of an X system.

15. Define X server and X protocol.


• The X server runs on the hardware to which the display and keyboard attached. The X server
performs low-level graphics, manages window, and user input functions.
• The X server controls accesses to a bit-mapped graphics display resource and manages it.

Unit – 5 Question Bank with Answer Page 4 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• The X protocol defines the format of the requests between client applications and display
servers over the network.
• The X protocol is designed to be independent of hardware, operating systems, underlying
network protocol, and the programming language used.

16. What is meant by visual programming?


• A drag and drop style of program development, which has number of visual objects (icons)
representing the GUI components are provided by the programming environment.
• Visual programming language greatly reduces the effort required to develop the interface
Eg.Visual Basic, Visual C++,etc

17. Write about good coding standards.


• Rules for limiting the use of global
• Contents of the headers preceding codes for different modules
• Naming conventions for global variables, local variables, and constant identifiers
• Error return conventions and exception handling mechanisms
• Do not use a coding style that is too clever or too difficult to understand
• Avoid obscure side effects
• Do not use an identifier for multiple purposes
• The code should be well-documented
• The length of any function should not exceed 10 source lines
• Do not use goto statements

18. What are the steps involved in designing GUI methodology?


• Examine the use case model of the software. Interview, discuss, and review the GUI issues
with the end-users.
• Task and object modeling
• Metaphor selection
• Interaction design and rough layout
• Detailed presentation and graphics design

Unit – 5 Question Bank with Answer Page 5 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• GUI construction
• Usability evaluation

19. What is code review?


• A cost-effective strategy, which is used for reduction in coding errors and to produce high
quality code.
• Types:
a. code inspection
b. code walk through.

20. Define code inspection .List out some classical programming errors during code inspection.
• A technique, which is used to discover some common types of errors caused due to oversight
and improper programming
• Use of uninitialized variables.
• Jumps into loops.
• Non-terminating loops.
• Incompatible assignments.
• Array indices out of bounds.
• Improper storage allocation and de-allocation
• Mismatches between actual and formal parameter in procedure calls.
• Use of incorrect logical operators or incorrect precedence among operators.
• Improper modification of loop variables.
• Comparison of equally of floating point variables, etc

21. What is clean room testing?


• It is a type of testing where testing is done by non programmer.
• A rigorous inspection process to test the code by other person (not programmer) to achieve
zero-defect software.
22. Define software documentation. (Nov/Dec 16)

Unit – 5 Question Bank with Answer Page 6 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• Software documentation is written text or illustration that accompanies computer software or


is embedded in the source code. It either explains how it operates or how to use it, and may
mean different things to people in different roles. Documentation is an important part of
software engineering.

23. Differentiate Block box and white box testing. (Nov 15)

Block box testing white box testing


In Black Box testing is primarily concentrate on In White Box testing is primarily concentrate on
the functionality of the system under test. the testing of program code of the system under
test like code structure, branches, conditions,
loops etc.
Black Box testing can be started based on White Box testing can be started based on Detail
Requirement Specifications documents. Design documents.
Black box testing is the Software testing method White box testing is the software testing method
which is used to test the software without in which internal structure is being known to
knowing the internal structure of code or tester who is going to test the software.
program.

24. Explain the necessity of documentation.


• Good documents enhance understandability and maintainability of a software product. They
reduce the effort and time required for maintenance.
• Use documents help the users in effectively using the system.
• Good documents help in effectively handling the manpower turn over problem.
• Production of good documents helps the manager in effectively tracking the progress of the
project

25. Differentiate internal documentation and external documentation.

Unit – 5 Question Bank with Answer Page 7 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• Internal documentation is the one in which various information regarding the program is
enlisted in the program itself i.e. in the form of comments.
• On the contrary, external documentation is the one that is prepared separately to inform the
users about the system.

26. What is program testing?


• Testing a program consists of providing the program with a set of test inputs (or test cases) and
observing if the program behaves as expected.
• If the program fails to behave as expected, then the conditions under which failure occurs are
noted for later debugging and correction

27. What is unit testing? (Nov/Dec 2016)


• Unit testing is undertaken after a module has been coded and successfully reviewed.
• Unit testing (or module testing) is the testing of different units (or modules) of a system in
isolation.

28. What is black box testing? (May 16)


• In the black-box testing, test cases are designed from an examination of the input/output
values only.
• No knowledge of design or code is required.

29. What is meant by boundary value analysis?


• Boundary value analysis is a software testing technique in which tests are designed to include
representatives of boundary values in a range.
• Boundary value analysis-based test suite design involves designing test case using the values
at the boundaries of different equivalence classes.

30. Define control flow Graph(CFG).

Unit – 5 Question Bank with Answer Page 8 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• A control flow graph describes the sequence in which the different instructions of a program
get executed.
• It shows the sequence of instructions that are to be followed to develop a program.

31. Explain mutation testing.


• In mutation testing, the software is first tested by using an initial test suite built up from the
different white box testing strategies.
• After the initial testing is complete, mutation testing is taken up. The idea behind mutation
testing is to make few arbitrary changes to a program at a time.

32. Explain data flow based testing.


• Data flow-based testing method selects test paths of a program according to the locations of
the definitions and uses of different variables in a program.
• For a statement numbered S, let
• DEF(S) = {X/statement S contains a definition of X}, and USES(S) = {X/statement S contains
a use of X} For the statement S:a=b+c;, DEF(S) = {a}. USES(S) = {b,c}.
• The definition of variable X at statement S is said to be live at statement S1, if there exists a
path from statement S to statement S1 which does not contain any definition of X.

PART-B (11 MARKS)

Unit – 5 Question Bank with Answer Page 9 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

1. Explain in detail about User interface design and characteristic of good user interface.
User Interface Design

Introduction
• In any software product, user interface portion is responsible for all interactions with the
user.
• In the early days of computer, no software product had any user interface:
✓ all computers were batch systems
no interactions with users were supported.

• We know that things are very different now:


✓ almost every software product is highly interactive.
• Users interact with a software product through its user interface:
✓ user-interface portion of any software is directly relevant to the users.
✓ many users judge a software from its user interface.
• User interface design:
✓ a practical and important problem.
• Aesthetics apart, a difficult to use interface:
✓ leads to higher levels of user errors
✓ leads to user dissatisfaction.
• Users become particularly irritated when a system behaves in unexpected ways,
✓ issued commands do not carry out actions according to intuitive expectations of
users.
• A significant portion of the total development effort:
✓ spent in developing the user interface.
• For many interactive applications:
✓ as much as 50% of the total development effort is spent on the user interface
part.
• If the user interface is not developed systematically:
o effort required to develop the interface would increase tremendously :

Unit – 5 Question Bank with Answer Page 10 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

✓ leading to customer dissatisfaction.


• It is important to carefully study
✓ user interface design concepts.

Characteristics of Good User Interfaces


Speed of learning:
• A good user interface should be simple to learn.
• Most users are put off by complex syntax and semantics of the command issue
procedures.
• A good user interface should not require users to memorize commands.
• An important factor affecting the speed of learning is consistency:
• Once, a user learns about a command,
• should be able to use similar commands even in different circumstances for carrying
out similar actions.
• Users can learn about an interface faster, if it is based on:
✓ day-to-day real life examples (aka metaphors)
✓ use concepts with which users are already familiar.
• For example, interface of a text editor:
• can use concepts similar to writing on paper:
✓ such as cutting lines and paragraphs and pasting it at other places,
✓ users can immediately relate to it.
• Also, learning is facilitated by:
✓ intuitive command names
✓ symbolic command issue procedures.
Speed of use
• Speed of use is determined by:
✓ the time and effort necessary to initiate and execute different commands.
✓ The time and user effort necessary to execute different commands should be
minimal.
• Examples of bad interfaces:

Unit – 5 Question Bank with Answer Page 11 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

✓ users required to type in lengthy commands


✓ command issue involves moving the mouse to widely different areas of the
screen
✓ can slow down the operating speed of users.
Speed of recall
• Once users learn how to use an interface:
✓ their speed of recall about using the interface should be maximized.
• The speed of recall is improved if the interface is based on:
• metaphors
• symbolic command issue procedures
✓ intuitive command names.
Error rate
• A good user interface should
✓ minimize the scope of committing errors.
• Error rate can be easily measured:
✓ count the errors committed by different users.
• Error monitoring can be automated:
✓ instrument user interface with monitoring code
✓ record the frequency and types of errors committed by different users
✓ later display statistics of various kinds of user errors.

Reduce error possibilities


• Consistency of command names,
• Consistency of command issue procedures,
• Consistency in behavior of similar commands
• Simplicity of command issue procedure, etc.

Attractiveness

Unit – 5 Question Bank with Answer Page 12 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• A good user interface should be attractive:


• An attractive user interface catches user attention and fancy.
• In this respect,
✓ graphics-based user interfaces have a definite advantage over text-based
interfaces.

Consistency
• Consistency of commands is very desirable.
✓ allow users to generalize the knowledge about one aspect of the interface to
another.
• Consistency helps in:
✓ speed of learning,
✓ speed of recall,
✓ also helps in reduction of error rate.

Feedback
• A good user interface must provide constant feedback to user actions:
✓ For example, if any user request takes more than few seconds to process, the user
must be informed that his/her request is still being processed.
✓ If possible, the user should be periodically informed about the progress made in
processing the command.
• In the absence of any response from the computer for a long time:
✓ a novice user might even start recovery/shutdown procedures in panic.
• Support for multiple skill levels

A good user interface:


✓ should support different levels of sophistication in command issue procedures:
✓ users with different experience levels prefer different types of interfaces.
• Experienced users are more concerned about speed of command issue:
✓ whereas users pay prime importance to usability aspects.

Unit – 5 Question Bank with Answer Page 13 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• Novice users discouraged by:


✓ cryptic command names
✓ complex command issue procedures.

Elaborate commands:
✓ slow down command issue procedure
✓ put off experienced users.
• As users become familiar with an interface:
✓ look for faster command issue procedures such as "hot-keys", "macros", etc.

Error Recovery (Undo facility)


• All categories of users commit errors.
✓ A good interface should allow users to undo mistakes..

Users are inconvenienced:


✓ if they can not recover from even simple errors.
• User Guidance and On-line Help
• Users might need guidance or seek help from the system.
• User Guidance is provided through two broad category of methods:
✓ On-line help system
✓ Guidance and error messages produced
✓ in response to user actions.

On-line Help System


• Generic help messages are not very useful:
✓ on-line help messages should be tailored to the context in which help is
invoked.
• A good on-line help should:
• provide messages in context-dependent way.
✓ keep track of what a user is doing

Unit – 5 Question Bank with Answer Page 14 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• help messages should be tailored to user's experience level.


• should take advantage of graphics capabilities of the screen
✓ not just be a copy of the user manual.

Guidance Messages
• The guidance messages should be carefully designed:
• prompt the user:
✓ next actions he/she might take,
✓ current status of the system,
✓ progress made so far in processing the command
• A good guidance system should have:
✓ different levels of sophistication for different categories of users.
✓ users should have an option to turn off detailed messages.

Error Messages
• Error messages should be polite.
• Error messages should not be associated with noise:
✓ might embarrass the user.
• The messages should suggest how a given error can be rectified.
• If appropriate,
✓ the user should be given the option of invoking on-line help
✓ to find out more about the error situation.

Mode-Based versus Modeless Interface


• A mode is a state or collection of states:
✓ in each state (or mode) different types of commands are available.
• Modeless interface: same set of commands are available at all times.
• Mode-based interface: different sets of commands are available depending on the mode in
which the system is, i.e.
• based on the past sequence of the user commands.

Unit – 5 Question Bank with Answer Page 15 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• A mode-based interface can be represented using a state transition diagram:


✓ each node (state) of the state transition diagram represents a mode.
✓ Every state (node) of the diagram annotated with command names meaningful
in that state.

Graphical User Interface (GUI) versus Text-Based User Interface


• In a GUI:
✓ several windows with different information can be simultaneously displayed on
user‟s screen.
✓ This is perhaps the biggest advantage of GUI user can simultaneously interact
with several related items at any time can even run many unrelated applications
• Iconic information representation and symbolic information manipulation is possible in a
GUI.

Symbolic information manipulation:


✓ such as pulling an icon representing a file into a trash can for deleting
✓ intuitively very appealing
✓ user can instantly remember it.
• A GUI can support command selection:
✓ using an attractive and user-friendly menu selection system.
• In a GUI, a pointing device can be used:
✓ a mouse or a light pen to issue commands.
• The use of a pointing device
✓ makes command issue procedure simpler.
• On the flip side, a GUI requires:
✓ special terminals with graphics capabilities
✓ requires special input devices such a mouse.
• In contrast, a text-based interface:
✓ can run even on cheap alphanumeric terminals:

Unit – 5 Question Bank with Answer Page 16 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

✓ Graphics terminals are usually much more expensive than alphanumeric


terminals.
• Increasing availability of:
✓ terminals with graphics capability
✓ bit-mapped high-resolution displays
✓ significant amount of local processing power.

2. Describe fundamentals of component-based GUI Development. (Nov 2015)


Fundamentals of Component-based GUI Development Window
• A window is a rectangular area on the screen.
• A window can be considered to be a virtual screen, in the sense that it provides an interface
to the user for carrying out independent activities, e.g. one window can be used for editing a
program and another for drawing pictures, etc.
• A window can be divided into two parts: client part, and non-client part.
• The client area makes up the whole of the window, except for the borders and scroll bars.
• The client area is the area available to a client application for display.
• The non-client part of the window determines the look and feel of the window.
• The look and feel defines a basic behavior for all windows, such as creating, iconifying the
windows. A basic window with its different parts is shown in fig.

Fig: Window with client and user areas marked


Window Management System (WMS)

Unit – 5 Question Bank with Answer Page 17 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• A graphical user interface typically consists of a large number of windows. Therefore, it is


necessary to have some systematic way to manage these windows.
• Most graphical user interface development environments do this through a window
management system (WMS).

• A window management system is primarily a resource manager.

• It keeps track of the screen area resource and allocates it to the different windows that seek to
use the screen.

• From a broader perspective, a WMS can be considered as a user interface management system
(UIMS) – which not only does resource management, but also provides the basic behavior to
the windows and provides several utility routines to the application programmer for user
interface development.

• A WMS simplifies the task of a GUI designer to a great extent by providing the basic behavior
to the various windows such as move, resize, iconify, etc. as soon as they are created and by
providing the basic routines to manipulate the windows from the application such as creating,
destroying, changing different attributes of the windows, and drawing text, lines, etc.

• A WMS consists of two parts


✓ 1. a window manager, and
✓ 2. a window system

Unit – 5 Question Bank with Answer Page 18 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

Fig.Window Management System

Window Manager and Window System


• Window manager is the component of WMS with which the end user interacts to do various
window-related operations such as window repositioning, window resizing, iconification, etc.
• The window manager is built on the top of the window system in the sense that it makes use
of various services provided by the window system.
• The window manager and not the window system determines how the windows look and
behave.
• In fact, several kinds of window managers can be developed based on the same window
system.
• The window manager can be considered as a special kind of client that makes use of the
services (function calls) supported by the window system.

Window Manager
• The window manager is responsible for managing and maintaining the non-client area of a
window.

• Window manager manages the real-estate policy, provides look and feel of each individual
window.

Unit – 5 Question Bank with Answer Page 19 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

Types of widgets (window objects)


• Different interface programming packages support different widget sets. However, a
surprising number of them contain similar kinds of widgets, so that one can think of a generic
widget set which is applicable to most interfaces.

• The following widgets are representatives of this generic class.

Label widget.
✓ This is probably one of the simplest widgets.
✓ A labelwidget does nothing except to display a label, i.e. it does not have any other interaction
capabilities and is not sensitive to mouse clicks.
✓ A label widget is often used as a part of other widgets.

Container widget.
✓ These widgets do not stand by themselves, but existmerely to contain other widgets.
✓ Other widgets are created as children of the container widget.
✓ When the container widget is moved or resized, its children widget also get moved or resized.
✓ A container widget has no callback routines associated with it.

Pop-up menu.
✓ These are transient and task specific.
✓ A pop-up menuappears upon pressing the mouse button, irrespective of the mouse position.

Pull-down menu.
✓ These are more permanent and general. You have tomove the cursor to a specific location and pull
down this type of menu.

Dialog boxes.
✓ We often need to select multiple elements from a selectionlist.
✓ A dialog box remains visible until explicitly dismissed by the user.
✓ A dialog box can include areas for entering text as well as values.

Unit – 5 Question Bank with Answer Page 20 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

Push button.
✓ A push button contains key words or pictures that describethe action that is triggered when you
activate the button.
✓ Usually, the action related to a push button occurs immediately when you click a push button unless
it contains an ellipsis (…).
✓ A push button with an ellipsis generally indicates that another dialog box will appear.

Radio buttons.
✓ A set of radio buttons is used when only one option hasto be selected out of many options.
✓ A radio button is a hollow circle followed by text describing the option it stands for.

Combo boxes.
✓ A combo box looks like a button until the user interactswith it.
✓ When the user presses or clicks it, the combo box displays a menu of items to choose from.
✓ Normally a combo box is used to display either one-of-many choices when space is limited, the
number of choices is large, or when the menu items are computed at run-time.

X-Window.
• The X-window functions are low-level functions written in C language which can be called
from application programs. But only the very serious application designer would program directly
using the X-windows library routines.
• Built on top of X-windows are higher-level functions collectively called Xtoolkit.Xtoolkit
consists of a set of basic widgets and a set of routines to manipulate these widgets.
• One of the most widely used widget sets is X/Motif. Digital Equipment Corporation (DEC)
used the basic X-window functions to develop its own look and feel for interface designs called
DECWindows.

Popularity of X-Window
• One of the important reasons behind the extreme popularity of the X-window system is
probably due to the fact that it allows development of portable GUIs.

Unit – 5 Question Bank with Answer Page 21 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• Applications developed using X-window system are device-independent.

Fig.Network-independent GUI

• Now-a-days many user interface development systems support network-independent GUI


development, e.g. the AWT and Swing components of Java.

Architecture of an X-System
• The X-architecture is pictorially depicted in fig.. The different terms used in this diagram are
explained below
X-server.
✓ The X server runs on the hardware to which the display and keyboard attached. The X server
performs low-level graphics, manages window, and user input functions.
✓ The X server controls accesses to a bit-mapped graphics display resource and manages it.

X-protocol.
✓ The X protocol defines the format of the requests between client applications and display
servers over the network.
✓ The X protocol is designed to be independent of hardware, operating systems, underlying
network protocol, and the programming language used.
X-library (Xlib).

Unit – 5 Question Bank with Answer Page 22 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

✓ The Xlib provides a set of about 300 utilityroutines for applications to call. These routines
convert procedure calls into requests that are transmitted to the server.
✓ Xlib provides low level primitives for developing an user interface, such as displaying a
window, drawing characteristics and graphics on the window, waiting for specific events,
etc.

Xtoolkit (Xt) .The Xtoolkit consists of two parts: the intrinsics and the widgets. We have already
seen that widgets are predefined user interface components such as scroll bars, push buttons, etc. for
designing GUIs.

Visual Programming
• Visual programming is the drag and drop style of program development. In this style of user
interface development, a number of visual objects (icons) representing the GUI components are
provided by the programming environment.
• The application programmer can easily develop the user interface by dragging the required
component types (e.g. menu, forms, etc.) from the displayed icons and placing them wherever
required.
• Thus, visual programming can be considered as program development through manipulation
of several visual objects.
• Reuse of program components in the form of visual objects is an important aspect of this
style of programming.
• Visual C++ provides tools for building programs with window-based user interfaces for
Microsoft Windows environments.

• In Visual C++, menu bars, icons, and dialog boxes, etc. can be designed easily before adding
them to program.

• These objects are called as resources. Shape, location, type, and size of the dialog boxes can
be designed before writing any C++ code for the application.

3. Explain in detail about GUI design methodology. (Nov 2015, May 16)
GUI design methodology

Unit – 5 Question Bank with Answer Page 23 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• GUI design methodology consists of the following important steps:

✓ Examine the use case model of the software. Interview, discuss, and review the
GUI issues with the end-users.
✓ Task and object modeling
✓ Metaphor selection
✓ Interaction design and rough layout
✓ Detailed presentation and graphics design
✓ GUI construction
✓ Usability evaluation

• The starting point for GUI design is the use case model.
• This captures the important tasks the users need to perform using the software.
• As far as possible, a user interface should be developed using one or more metaphors.
• Metaphors help in interface development at lower effort and reduced costs for training the
users.
• Over time, people have developed efficient methods of dealing with some commonly
occurring situations.
• These solutions are the themes of the metaphors.
• Metaphors can also be based on physical objects such as a visitor‟s book, a catalog, a pen, a
brush, a scissor, etc.
• A solution based on metaphors is easily understood by the users, reducing learning time
and training costs. Some commonly used metaphors are the following:

o White board
o Shopping cart
o Desktop
o Editor‟s work bench
o White page

Unit – 5 Question Bank with Answer Page 24 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

o Yellow page
o Office cabinet
o Post box
o Bulletin board
o Visitor‟s book

Task and Object Modeling


• A task is a human activity intended to achieve some goals. Example of task goals can be:
✓ reserve an airline seat
✓ buy an item
✓ transfer money from one account to another book a cargo for transmission to an
address
• A task model is an abstract model of the structure of a task.
• A task model should show the structure of the subtasks that the user needs to perform to achieve
the overall task goal.

• Each task can be modeled as a hierarchy of subtasks.

• A task model can be drawn using a graphical notation similar to the activity network model. Tasks
can be drawn as boxes with lines showing how a task is broken down into subtasks.

• An underlined task box would mean that no further decomposition of the task is required. An
example decomposition of a task into subtasks is shown in fig.

Fig.Decomposition of a task into subtasks

Unit – 5 Question Bank with Answer Page 25 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

State chart diagram for an order object


Selecting a metaphor
• The first place one should look for while trying to identify the candidate metaphors is the
set of parallels to objects, tasks, and terminologies of the use cases.
• If no obvious metaphors can be found, then the designer can fall back on the metaphors of
the physical world of concrete objects.
• The appropriateness of each candidate metaphor should be tested by restating the objects
and tasks of the user interface model in terms of the metaphor.
• Another criterion that can be used to judge metaphors is that the metaphor should be as
simple as possible, the operations using the metaphor should be clear and coherent and it
should fit with the users‟ „common sense‟ knowledge.
• For example, it would indeed be very awkward and a nuisance for the users if the scissor metaphor
is used to glue different items.
• Example: We need to develop the interface for the automation shop, where theusers can examine
the contents of the shop through a web interface and can order them.
• Several metaphors are possible for different parts of this problem.

Unit – 5 Question Bank with Answer Page 26 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

✓ Different items can be picked up from racks and examined. The user can
request for the catalog associated with the items by clicking on the item.
✓ Related items can be picked from the drawers of an item cabinet.
✓ The items can be organized in the form of a book, similar to the way
information about electronic components are organized in a semiconductor
hand book.
• Once the users make up their mind about an item they wish to buy, they can put them into a
shopping cart.

User interface inspection

• Nielson [Niel94] studied common usability problems and built a check list of points which can be
easily checked for an interface. The following check list is based on the work of Nielson [Niel94].
• Visibility of the system status. The system should as far as possiblekeep the user informed about
the status of the system and what is going on.
• Match between the system and the real world. The system shouldspeak the user‟s language
words, phrases, and concepts familiar to that used by the user, rather than using system-oriented
terms.
• Undoing mistakes. The user should feel that he is in control rather thanfeeling helpless or to be at
the control of the system.
• Consistency. The user should not have to wonder whether differentwords, concepts, and
operations mean the same thing in different situations.
• Recognition rather than recall. The user should not have to recallinformation which was
presented in another screen. All data and instructions should be visible on the screen for selection
by the user.
• Support for multiple skill levels. Provision of accelerations forexperienced users allows them to
efficiently carry out the actions they frequently require to perform.
• Aesthetic and minimalist design. Dialogs should not containinformation which are irrelevant and
are rarely needed. Every extra unit of information in a dialog competes with the relevant units and
diminishes their visibility.

Unit – 5 Question Bank with Answer Page 27 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• Help and error messages. These should be expressed in plain language(no codes), precisely
indicating the problem, and constructively suggesting a solution.
• Error prevention. Error possibilities should be minimized.

4. Elucidate Coding phase of software development in detail.

Coding
• The input to the coding phase is the design document.
• During coding phase:
✓ modules identified in the design document are coded according to the module
specifications.
• At the end of the design phase we have:
• module structure (e.g. structure chart) of the system
• module specifications:
✓ data structures and algorithms for each module.

• Objective of coding phase:


✓ transform design into code
✓ unit test the code.

Coding Standards
• Good software development organizations require their programmers to:
✓ adhere to some standard style of coding
✓ called coding standards.

• Many software development organizations:


✓ formulate their own coding standards that suits them most,
✓ require their engineers to follow these standards rigorously.

• Advantage of adhering to a standard style of coding:


✓ it gives a uniform appearance to the codes written by different engineers,

Unit – 5 Question Bank with Answer Page 28 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

✓ it enhances code understanding,


✓ encourages good programming practices.

• A coding standard
• sets out standard ways of doing several things:
✓ the way variables are named,
✓ code is laid out,
✓ maximum number of source lines allowed per function, etc.

Coding guidelines
• Provide general suggestions regarding coding style to be followed:
• leave actual implementation of the guidelines:
✓ to the discretion of the individual engineers.

• Code inspection and code walk throughs


✓ Detect as many errors as possible during inspection and walkthrough:
✓ detected errors require less effort for correction

• much higher effort needed if errors were to be detected during integration or system testing.

• After a module has been coded,


✓ code inspection and code walk through are carried out
✓ ensures that coding standards are followed
✓ helps detect as many errors as possible before testing.

Coding Standards and Guidelines


• Good organizations usually develop their own coding standards and guidelines:
✓ depending on what best suits their organization.
• We will discuss some representative coding standards and guidelines.

Representative Coding Standards


• Rules for limiting the use of globals:

Unit – 5 Question Bank with Answer Page 29 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

✓ what types of data can be declared global and what can not.

• Naming conventions for


✓ global variables,
✓ local variables, and
✓ constant identifiers.

• Contents of headers for different modules:


✓ The headers of different modules should be standard for an organization.
✓ The exact format for header information is usually specified.

• Header data:
✓ Name of the module,
✓ date on which the module was created,
✓ author's name,
✓ modification history,
✓ synopsis of the module,
✓ different functions supported, along with their input/output parameters,
✓ global variables accessed/modified by the module.

• Error return conventions and exception handling mechanisms.


• the way error and exception conditions are handled should be standard within an organization.
• For example, when different functions encounter error conditions
✓ should either return a 0 or 1 consistently.

Representative Coding Guidelines


• Do not use too clever and difficult to understand coding style.
✓ Code should be easy to understand.

• Many inexperienced engineers actually take pride:


✓ in writing cryptic and incomprehensible code.

Unit – 5 Question Bank with Answer Page 30 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• Clever coding can obscure meaning of the code:


✓ Hampers understanding.
✓ Makes later maintenance difficult.
• Avoid obscure side effects.

• The side effects of a function call include:


✓ modification of parameters passed by reference,
✓ modification of global variables,
✓ I/O operations.

• An obscure side effect:


✓ one that is not obvious from a casual examination of the code.
• Obscure side effects make it difficult to understand a piece of code.

• For example,
✓ if a global variable is changed obscurely in a called module,
✓ it becomes difficult for anybody trying to understand the code.
• Do not use an identifier (variable name) for multiple purposes.
✓ Programmers often use the same identifier for multiple purposes.
✓ For example, some programmers use a temporary loop variable
• also for storing the final result.
Example use of a variable for multiple purposes
for(i=1;i<100;i++)
{…..}
i=2*p*q;
return(i);

• The rationale given by programmers for such use:


✓ memory efficiency:
✓ e.g. three variables use up three memory locations,

Unit – 5 Question Bank with Answer Page 31 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

✓ whereas the same variable used in three different ways uses just one memory
location.

• There are several things wrong with this approach:


✓ hence should be avoided.

• Each variable should be given a name indicating its purpose:


✓ This is not possible if an identifier is used for multiple purposes.

• Leads to confusion and annoyance


✓ for anybody trying to understand the code.
✓ Also makes future maintenance difficult.

• Code should be well-documented.

Rules of thumb:

• on the average there must be at least one comment line


✓ for every three source lines.
• The length of any function should not exceed 10 source lines.

• Lengthy functions:
✓ usually very difficult to understand
✓ probably do too many different things.

• Do not use goto statements.

• Use of goto statements:


✓ make a program unstructured
✓ make it very difficult to understand.

Code Walk Through

Unit – 5 Question Bank with Answer Page 32 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• An informal code analysis technique.


✓ undertaken after the coding of a module is complete.
• A few members of the development team select some test cases:
✓ simulate execution of the code by hand using these test cases.
• Even though an informal technique:
• several guidelines have evolved over the years
• making this naive but useful analysis technique more effective.
• These guidelines are based on
✓ personal experience, common sense, and several subjective factors.
• The guidelines should be considered as examples:
✓ rather than accepted as rules to be applied dogmatically.
• The team performing code walk through should not be either too big or too small.
✓ Ideally, it should consist of between three to seven members.
• Discussion should focus on discovery of errors:
✓ and not on how to fix the discovered errors.
• To foster cooperation:
• avoid the feeling among engineers that they are being evaluated in the code walk through
meeting,
• managers should not attend the walk through meetings.

Code Inspection
• In contrast to code walk throughs,
✓ code inspection aims mainly at discovery of commonly made errors.
• During code inspection:
✓ code is examined for the presence of certain kinds of errors,
✓ in contrast to the hand simulation of code execution done in code walk throughs.
• For instance, consider:
✓ classical error of writing a procedure that modifies a formal parameter
✓ while the calling routine calls the procedure with a constant actual parameter.
• It is more likely that such an error will be discovered:
✓ by looking for this kind of mistakes in the code,

Unit – 5 Question Bank with Answer Page 33 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

✓ rather than by simply hand simulating execution of the procedure.


• Good software development companies:
✓ collect statistics of errors committed by their engineers
✓ identify the types of errors most frequently committed.
• A list of common errors:
✓ can be used during code inspection to look out for possible errors.
• Commonly made errors
✓ Use of uninitialized variables.
✓ Nonterminating loops.
✓ Array indices out of bounds.
✓ Incompatible assignments.
✓ Improper storage allocation and deallocation.
✓ Actual and formal parameter mismatch in procedure calls.
✓ Jumps into loops.

Code Inspection
• Use of incorrect logical operators
✓ or incorrect precedence among operators.
• Improper modification of loop variables.

• Comparison of equality of floating point values, etc.

• Also during code inspection, adherence to coding standards is checked.

5. Explain in detail about software documentation.


Software Documentation
• When developing a software product we develop various kinds of documents :

✓ In addition to executable files and the source code:


✓ users' manual,

Unit – 5 Question Bank with Answer Page 34 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

✓ software requirements specification (SRS) document,


✓ design document, test document,
✓ installation manual, etc.
• All these documents are a vital part of good software development practice.

• Good documents enhance understandability and maintainability of a software product.

• Different types of software documents can be classified into:


✓ internal documentation,
✓ external documentation (supporting documents).

Internal Documentation
• Internal documentation:
✓ documentation provided in the source code itself.
• External documentation:
✓ documentation other than those present in the source code.
• Internal documentation provided through:
✓ use of meaningful variable names,
✓ code indentation,
✓ code structuring,
✓ use of enumerated types and constant identifiers,
✓ use of user-defined data types, etc.
✓ module headers and comments
• Good software development organizations:
✓ ensure good internal documentation
✓ through coding standards and coding guidelines.
• Example of unhelpful documentation:
✓ a = 10; /* a made 10 */
• Careful experimentation suggests:
✓ meaningful variable names is the most useful internal documentation.

External Documentation

Unit – 5 Question Bank with Answer Page 35 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• Users' manual,
• Software requirements specification document,
• Design document,
• Test documents,
• Installation instructions, etc.
• A systematic software development style ensures:
✓ all external documents are produced in an orderly fashion.
• An important feature of good documentation is consistency.
• Unless all documents are consistent with each other, a lot of confusion is created for somebody
trying to understand the product.
• All the documents for a product should be up-to-date:
• Even a few out-of-date documents can create severe confusion.

Textual Documents
• Readability is an important attribute of textual documents.
• Readability determines understandability hence determines maintainability.
• A well-known readability measure of text documents:
✓ Gunning‟s Fog Index.
• F corresponds to the number of years of schooling to easily understand the document.

• A document is easy to understand if: all sentences are small use only 4 to 5 words each
• small number of characters used per word: normally not exceeding five or six characters

6. Discuss in detail about software testing. (May 2016, Nov /Dec 2016)
Software Testing:
• Testing is a process of executing a program with the intent of finding error.
• Software Testing are contains two types:
o Manual Testing and,
o Automation Testing
Manual Testing:

Unit – 5 Question Bank with Answer Page 36 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• Manual testing is the process of manually testing software for defects.


• It requires a tester to play the role of an end user, and use most of all features of the
application to ensure correct behavior.
• To ensure completeness of testing, the tester often follows a written test plan that leads them
through a set of important test cases.
Drawbacks of Manual Testing

(i)Time consuming.
(ii) More resources required.
(iii)Human Errors
(iv)Repetition of the Task
(v)Tiredness
(vi)Simultaneous auctions are not possible (Parallel)

Testing:Testing is a process of executing a program with the intent of finding error


• Unit Testing:
o It concentrates on each unit (Module, Component…) of the software as implemented in
source code.
o During this stage they conduct program level testing, with the help of the WBT techniques.
• Integration Testing:
o Putting the modules together and construction of software architecture.
o There are two types of approaches to conduct Integration Testing:
▪ Top-down Approach
▪ Bottom-up approach.
o Bottom-Up: This approach starts testing, from lower-level modules. drivers are used to
connect the sub modules. ( ex login, create driver to accept default uid and pwd)

Unit – 5 Question Bank with Answer Page 37 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

o Sandwich: This approach combines the Top-down and Bottom-up approaches of the
integration testing. In this middle level modules are testing using the drivers and stubs.

• System and Functional Testing:


o Product is validated with other system elements are tested as a whole.
o Conducted by separate testing team
o Follows Black Box testing techniques
o Depends on S/wRS
o Build level testing to validate internal processing depends on external interface processing
depends on external interface

• User Acceptance Testing: Testing by the user to collect feed back .

Unit – 5 Question Bank with Answer Page 38 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

7. Explain about Debugging and program analysis tools. (Nov /Dec 2016)
• Identifying errors in a program code and then fix them up are known as debugging
Need for debugging
• Once errors are identified in a program code, it is necessary to first identify the precise program
statements responsible for the errors and then to fix them.
• Debugging approaches The following are some of the approaches popularly adopted by
programmers for debugging.

Brute Force Method:


• This is the most common method of debugging but is the least efficient method.
• In this approach, the program is loaded with print statements to print the intermediate values with
the hope that some of the printed values will help to identify the statement in error.
• This approach becomes more systematic with the use of a symbolic debugger (also called a source
code debugger), because values of different variables can be easily checked and break points and
watch points can be easily set to test the values of variables effortlessly.
Backtracking:
• This is also a fairly common approach.
• In this approach, beginning from the statement at which an error symptom has been observed, the
source code is traced backwards until the error is discovered.
• Unfortunately, as the number of source lines to be traced back increases, the number of potential
backward paths increases and may become unmanageably large thus limiting the use of this
approach.

Cause Elimination Method:


• In this approach, a list of causes which could possibly have contributed to the error symptom is
developed and tests are conducted to eliminate each.
• A related technique of identification of the error from the error symptom is the software fault tree
analysis.

Program Slicing:
• This technique is similar to back tracking.

Unit – 5 Question Bank with Answer Page 39 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• The search space is reduced by defining slices.


• A slice of a program for a particular variable at a particular statement is the set of source lines
preceding this statement that can influence the value of that variable

Debugging guidelines
• Debugging is often carried out by programmers based on their ingenuity. The following are some
guidlines
o Many times debugging requires a thorough understanding of the program design.
o Trying to debug based on a partial understanding of the system design and implementation
may require an inordinate amount of effort to be put into debugging even simple problems.
o Debugging may sometimes even require full redesign of the system.
o In such cases, a common mistakes that novice programmers often make is attempting not
to fix the error but its symptoms.
o One must be beware of the possibility that an error correction may introduce new errors.
o Therefore after every round of error-fixing, regression testing must be carried out.

Program Analysis Tools

• A program analysis tool means an automated tool that takes the source code or the executable code
of a program as input and produces reports regarding several important characteristics of the
program, such as its size, complexity, adequacy of commenting, adherence to programming
standards, etc.
• Two broad categories of program analysis tools
✓ Static Analysis tools
✓ Dynamic Analysis tools

Static program analysis tools


• Static analysis tool is also a program analysis tool.
• It assesses and computes various characteristics of a software product without executing it.
• Typically, static analysis tools analyze some structural representation of a program to arrive at
certain analytical conclusions, e.g. that some structural properties hold.

Unit – 5 Question Bank with Answer Page 40 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• The structural properties that are usually analyzed are:


o Whether the coding standards have been adhered to?
o Certain programming errors such as uninitialized variables and mismatch between actual
and formal parameters, variables that are declared but never used are also checked.
• Code walk throughs and code inspections might be considered as static analysis methods.
• Used to denote automated analysis tools - a compiler can be considered to be a static program
analysis tool.

Dynamic program analysis tools


• Dynamic program analysis techniques require the program to be executed and its actual behavior
recorded.
• A dynamic analyzer usually instruments the code
• The instrumented code when executed allows us to record the behavior of the software for
different test cases.
• After the software has been tested with its full test suite and its behavior recorded, the dynamic
analysis tool caries out a post execution analysis and produces reports which describe the
structural coverage that has been achieved by the complete test suite for the program.
• For example, the post execution dynamic analysis report might provide data on extent statement,
branch and path coverage achieved.

8. Explicate testing of object oriented programs.

TESTING OBJECT-ORIENTED PROGRAMS


• Testing object-oriented programs is much more difficult and required much more cost and effort
as compared to testing similar procedural programs.

Unit – 5 Question Bank with Answer Page 41 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• Additional test cases are needed to be designed to detect bugs.


• Basic issues in testing object-oriented programs
✓ What is a Suitable Unit for Testing Object
✓ Do various Object-orientation features make testing easy?
✓ Why are traditional techniques considered not satisfactory for testing object-
oriented programs?
✓ Grey-Box testing of objects orientedprograms?
• What is a Suitable Unit for Testing Object-oriented Programs?
✓ Do various Object-orientation features make testing easy?
✓ Why are traditional techniques considered not satisfactory for testing object-
oriented programs?
✓ Grey-Box testing of objects oriented programs?

Grey-Box Testing of Object-oriented programs


• For object-oriented programs, several types of test cases can be designed based on the design
models of object-oriented programs. These are called the grey-box test cases.
• Types of grey-box testing based on UML models
✓ State-model-based testing
✓ Use case-based testing
✓ Class diagram-based testing
✓ Sequence diagram-based testing
• State-model based testing
✓ State coverage : Each method of an object are tested at each state of the object
✓ State transition coverage: It is tested whether all transitions depicted in the state
model work satisfactorily
✓ State transition path coverage: All transition paths in the state model are tested.
• Use case based testing
✓ Scenario coverage: Each use case consists of a mainline scenario and several
alternate scenarios.
✓ For each use case, the mainline and all alternate sequences are tested to check if
any errors show up

Unit – 5 Question Bank with Answer Page 42 of 43


C ACADEMIC YEAR: 2022-2023 REGULATION 2013-2014

• Class diagram-based testing


✓ Testing derived classes: All derived classes of the base class have to be
instantiated and tested.
✓ Association testing: All association relations are tested
✓ Aggregation testing: Various aggregate objects are created and tested.
• Sequence diagram-based testing
✓ Method coverage: All methods depicted in the sequence diagrams are covered
✓ Message path coverage: All message paths that can be constructed form the
sequence diagrams are covered.

Integration Testing of Object-oriented Programs


• Two main approaches
✓ Thread-based
✓ Use based
• Thread-based approach
✓ In this approach, all classes that need to collaborate to realize the behavior of a
single use case are integrated and tested.
✓ After all the required classes for a use case are integrated and tested, another
use case is taken up and other classes necessary for execution of the second use
case to run are integrated and tested.
✓ This is continued till all use cases have been considered.
• Use-based approach:
✓ Used-based integration begins by testing classes that either need no service
from other classes or need services from at most a few other classes.
✓ After these classes have been integrated and tested, classes that use the services
from the already integrated classes are integrated and tested
✓ This is continued till all the classes have been integrated and tested..

Unit – 5 Question Bank with Answer Page 43 of 43

You might also like