Unit 4SE
Unit 4SE
Unit 4SE
A good user interface should be easy to learn, avoiding complex syntax and semantics. Users
shouldn't need to memorize commands or information across screens. Key factors for
enhancing learning speed include:
Metaphors and intuitive command names: Using familiar real-life examples or objects
(metaphors) in interface design helps users relate quickly. For instance, a text editor
mimicking writing tools or a shopping cart metaphor for selections simplifies learning.
Consistency: Commands should be consistent across the interface, enabling users to apply
knowledge from one area to others easily.
Component-based interface: Familiarity with standard interface components from other
applications accelerates learning.
Measuring training time and practice needed by users determines a user interface's speed
of learning.
Speed of use: Speed of use in a user interface refers to how efficiently users can perform
tasks. It focuses on minimizing time and effort for starting and executing commands.
Designing interfaces carefully reduces this time, making tasks faster. Simplifying commands
and minimizing mouse movements enhance efficiency.
Speed of recall: Speed of recall is how quickly users remember how to use an interface. It's
crucial for occasional users. Making the interface based on metaphors, clear commands, and
intuitive names improves recall speed.
Error prevention: Error prevention in a user interface is essential. Monitoring user errors
helps determine the interface's effectiveness. Consistency in naming and procedures, along
with simple commands, reduces error chances. Additionally, interfaces should prevent users
from inputting incorrect values.
Aesthetic and attractive: Aesthetic appeal is vital in a user interface. It grabs users'
attention and enhances their experience. Graphics-based interfaces are particularly
advantageous in this regard compared to text-based ones.
Consistency: consistency in commands is crucial for users to understand and navigate the
interface easily. It aids in learning, recall, and reduces errors.
Feedback: Feedback is essential in a user interface. Users should be informed about the
progress of their requests, especially if it takes more than a few seconds. This prevents
confusion, especially for novice users who might panic without feedback. Periodic updates
on command processing progress are beneficial.
Support for multiple skill levels: A good user interface should accommodate users of
different skill levels. Novices prioritize usability, while experienced users seek efficiency.
Complex commands deter beginners, while lengthy sequences slow down experts. Initially,
users focus on learning speed, later emphasizing command efficiency. As users gain
familiarity, they look for advanced options like hot-keys and macros tailored to their skill
levels.
Error recovery (undo facility): Error recovery, such as an undo feature, is crucial in a user
interface. It allows users to correct mistakes made while issuing commands, ensuring they
aren't inconvenienced. Without this capability, users may feel frustrated and helpless.
User guidance and on-line help: Users seek guidance and on-line help when they either
forget a command or are unaware of some features of the software. Whenever users need
guidance or seek help from the system, they should be provided with appropriate guidance
and help.
+--------------------+
| Easy to Learn |
| - Clear & Familiar | (Metaphors, Intuitive Commands)
| - Consistent |
+--------------------+
|
V
+--------------------+
| Fast to Use |
| - Minimal Effort | (Simple Commands, Few Clicks)
| - Easy to Remember |
+--------------------+
|
V
+--------------------+
| Few Errors |
| - Consistent |
| - Clear & Familiar |
+--------------------+
|
V
+--------------------+
| Appealing |
| - Visually Pleasing|
+--------------------+
|
V
+--------------------+
| All Levels Welcome |
| - Beginners: Easy |
| Start |
| - Experts: Efficient|
| Use |
+--------------------+
|
V
+--------------------+
| Recover from Mistakes| (Undo Feature)
+--------------------+
|
V
+--------------------+
| Help When Needed | (Guidance, Online Help)
+--------------------+
On-line help system: When users ask for help in the software, they want the help
messages to be relevant to what they're doing. So, a good help system should pay
attention to what the user is doing and give advice that fits the situation. Also, the
help messages should be adjusted based on how experienced the user is. A good
help system should use pictures and animations from the screen, not just repeat
what's in the manual.
Guidance messages: Guidance messages should help users with their next actions, show the
system's current status, and give updates on their last command. A good system should
adjust the guidance based on the user's experience level and the type of interface they're
using. Users should also be able to turn off detailed messages if they want.
Error messages: Error messages pop up when a user makes a mistake or when something
goes wrong with the system, like running out of memory or losing connection. Users prefer
clear error messages that explain the problem and suggest how to fix it. The messages
should be polite and not embarrassing. If needed, users should be able to get more help by
using the online help system.
• Advantages:
• Can be implemented on inexpensive alphanumeric display terminals.
• Generally more cost-effective compared to graphical terminals.
•
• Disadvantages:
•
• Limited in simultaneous interaction with multiple items.
• Less intuitive representation and manipulation of information compared to
GUIs.
• Usually relies on text-based commands, which may not be as user-friendly as
GUI menus
three categories:
Command language-based interfaces
Menu-based interfaces
• Command design focuses on reducing the number of basic commands users must
remember and minimizing typing.
• Designers choose meaningful yet concise mnemonics (command names) to
streamline user input. Shorter mnemonics are assigned to commonly used
commands.
• Designers decide whether users can customize command names to their
preferences, balancing usefulness with increased interface complexity.
• Designers consider whether users can combine basic commands to create complex
ones. While this feature benefits experienced users, it may not be necessary for
inexperienced users.
• Hierarchical menus:
o Hierarchical menus organize items in a tree structure, suitable for managing
large choices but may cause navigational difficulties for users.
9.3.3 Direct Manipulation Interfaces
Direct manipulation interfaces, also known as iconic interfaces, present visual models to
users, such as icons or objects. Users issue commands by interacting directly with these
visual representations. Icons are easily recognizable and language-independent, but
experienced users may find them limiting. Complex commands are challenging to execute,
as actions must be performed individually on each object, unlike using a command to delete
multiple files at once. Example: Dragging individual file icons to a trash bin icon for deletion
means repeating the action for each file, unlike using a command like "delete ." to delete all
files in a directory at once.
9.4 FUNDAMENTALS OF COMPONENT-BASED GUI DEVELOPMENT
Graphical user interfaces became popular in the 1980s because before then, graphics
terminals were too expensive. Back then, a graphics terminal cost much more than a high-
end personal computer today. Also, the terminals didn't have the capabilities we have now,
like raster graphics.
Early GUIs, like the one on the Apple Macintosh, required programmers to create everything
from scratch, from drawing lines to handling menus. Now, user interfaces are made using
pre-made components like menus and dialog boxes, making development faster and more
consistent. Window systems also provide basic functions for managing windows, saving
developers time and effort.
9.4.1 Window System
Most modern graphical user interfaces rely on a window system. This system generates
displays through windows, which are the basic entities in the interface. Let's first define
what a window is.
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 has two parts: the client area and the non-client area. The client area is where
applications display content, while the non-client area controls the window's appearance
and behavior, like its borders and controls for moving or resizing. The window manager
oversees the non-client area.
The window manager is like a client on top of the window system, using its services to
control how windows look and act. Different window managers can be created using the
same window system. Application programmers can use window system services directly to
develop the user interface. The relationship between the window manager, window system,
and applications is shown in Figure 9.4. Users can interact with applications or with the
window manager for actions like resizing or moving windows, and both the application and
window manager use services of the window manager.
Developing user interfaces directly using the basic window system routines can be
complicated. That's why most user interface development systems offer widgets, which are
high-level abstractions. A widget is like a simplified window object. An object is a bunch of
related data with operations defined on them. For a window object, the data includes things
like size and position, while the operations include resizing, moving, and drawing. Widgets
are standard components used to build user interfaces, and interfaces are usually made by
combining multiple widgets.
Component-based development
A development style based on widgets is called component-based GUI development. It's
advantageous because it helps users learn interfaces quickly. With this style, different
applications use the same basic components, so users can apply their knowledge from one
app to another. Also, it reduces the programmer's work, as they mainly integrate pre-made
components rather than writing everything from scratch.
VISUAL PROGRAMING:
Visual programming is when you build programs by dragging and dropping visual objects
(like icons) representing GUI components. You can easily create the interface by placing
these components where you want. It's like building with blocks. This style of programming
is popular for making interfaces but can also be used for other things like designing factories
or simulations. It's a simple way to develop interfaces and reduces a lot of effort.
Visual Basic and Visual C++ are popular visual programming languages. With Visual C++, you
design menu bars, icons, and dialog boxes before adding them to your program. These are
called resources. You can set their shape, position, type, and size without writing any C++
code first.
10.1 CODING
During coding, developers use the design document, which includes both high-level and
detailed designs. They code each module according to its specifications outlined in the
document.
The objective of the coding phase is to transform the design of a system into code in a high-
level language, and then to unit test this code.
Good software development organizations have coding standards that their programmers
must follow. These standards help maintain consistency and offer business advantages.
Adhering to a coding standard ensures uniformity, making code easier to read, understand,
and maintain. The main advantages of adhering to a standard style of coding are the
following:
A coding standard gives a uniform appearance to the codes written by different engineers.
5.Coding guidelines:
The following are some representative coding guidelines that are recommended by many software
development organisations.
Do not use a coding style that is too clever or too difficult to understand: Code should be
easy to understand. Complex coding can make maintenance and debugging difficult and
costly.
Avoid hidden side effects: Side effects of a function include changing passed parameters,
global variables, or performing I/O operations. Hidden side effects are not obvious from the
code, making it hard to understand. For example, if a function changes a global variable or
performs file I/O without clear indication, it makes the code difficult to grasp.
- They ease the transition when staff changes, allowing new engineers to learn quickly.
- Good documents help managers track project progress and measure achievements.
Different types of software documents can broadly be classified into the following:
Meaningful variable names are the most valuable type of internal documentation for
understanding code. This is more useful than code comments, especially if the comments
are trivial. Good software organizations prioritize meaningful variable names in their coding
standards and guidelines, as they significantly aid code comprehension.
Gunning’s fog index is a metric to measure how easy a document is to read. It tells you how
many years of education someone needs to understand it easily. For example, if a document
has a fog index of 12, someone who finished 12th grade should find it easy to understand.
The fog index is calculated based on the complexity of the words and sentences in the
document.
The fog index is calculated using two factors. First, it looks at the average number of words
per sentence, which shows if sentences are long and hard to understand. Second, it
measures the percentage of complex words in the document. A complex word is one with
many syllables. Note that a syllable is a group o f words that can be independently pronounced. For
example, the word “sentence” has three syllables (“sen”, “ten”, and “ce”). Words having more than
three syllables are complex words and presence of many such words hamper readability of a
document.
10.4 TESTING
The aim of program testing is to find defects, but it's impossible to guarantee a program is
error-free. This is because programs have large input data domains, making exhaustive
testing impractical. For example, even testing a function with floating point numbers would
take millions of years with millions of testers. However, testing is still crucial, as it helps find
a large percentage of defects and reduces errors in a system.
Terminologies
In software testing, there are specific terms that are commonly used. Let's go over a few
important ones standardized by the IEEE Standard Glossary of Software Engineering
Terminology [IEEE90]:
• A mistake is any action by a programmer that leads to incorrect results during
program execution. For example, forgetting to initialize a variable or overlooking
errors like division by zero are mistakes.
• An error is the incorrect result caused by a mistake. For instance, calling the wrong
function is an error.
In software testing, "error," "fault," "bug," and "defect" are often used interchangeably.
However, in hardware testing, "fault" has a different meaning compared to "error" and
"bug."
Example 10.4: Suppose you have two programs that do the same thing. How do you know
which one is easier to test?
Answer: A program is easier to test if it needs fewer test cases to check it thoroughly.
Basically, simpler programs are easier to test. You can measure complexity with metrics like
the number of decision statements. So, a more testable program has a lower complexity.
A "failure mode" is a way the software can go wrong that you can see. For instance, in a
railway ticket booking program, failing to book an available seat, booking the wrong seat, or
crashing the system are failure modes.
"Equivalent faults" are bugs that cause the same failure mode. For example, in C, dividing
by zero or accessing illegal memory both crash the program. These are equivalent faults
because they both lead to the same failure.
Verification checks if each phase of software development produces the right output based
on the input of the previous phase. Validation checks if the final software meets the
customer's requirements.
Verification:
Validation :
- Testing in validation focuses on system testing to see if the software meets requirements.
- Validation requires executing the software.
- It's done to ensure the right product is built for the customer.
Verification aims to catch errors early to reduce costs, while validation confirms that the
software meets the customer's needs.
While verification is concerned with phase containment of errors, the aim of validation is to check
whether the deliverable software is error free.
Verification and validation are like different types of bug filters. To ensure high product
reliability affordably, development teams need to do both. Together, they're called "V and
V" activities.
Based on the above discussions, we can conclude that: Error detection techniques = Verification
techniques + Validation techniques
4. Error correction: Making appropriate changes to the code to fix the identified errors.
These activities are shown in Figure 10.2. Test cases are designed and executed, failures are
debugged to find errors, and then errors are corrected. Debugging is often the most time-
consuming activity.
UNIT TEST:
Unit testing happens after a module has been coded and reviewed. Usually, the coder of the
module does this. Before starting unit testing, we need to design the unit test cases and set
up the testing environment. Let's talk about what's needed for unit testing.
Driver: A driver module should include the data structures accessed by the module under
test. It also needs to have the code to call the various functions of the unit under test with
the right parameter values for testing.