Page 276 - DCAP404 _Object Oriented Programming
P. 276
Unit 12: Console I/O
Notes
The book covers Mercury Interactive's WinRunner, Segue Software's SilkTest, and IBM
Rational SQA Robot. There are case studies that illustrate the use of LoadRunner, JMeter,
TestDirector and so forth.
As in hospitals where the severity of the problem determines whether the patient will be
in a ward or ICU, software defects are classified depending on their impact on the
functionality of the software.
"Critical defects result in system-crash, while major ones may result in some portions of
the application difficult to use." There are also minor defects; these "can be tolerated" as in
the case of "lack of help for some functionality, spelling mistake in an error message and
so on."
For IT managers, it would be a critical defect to be ignorant of how software is tested; that
would be a flaw with a potential to cause a career to crash.
12.5 Summary
C++ accomplishes input/output operations using concept of stream. A stream is a series of
bytes whose value depends on the variable in which it is stored.
This way, C++ is able to treat all the input and output operations in a uniform manner.
Thus, whether it is reading from a file or from the keyboard, for a C++ program it is
simply a stream.
A stream is a source of sequence of bytes.
A stream abstracts for input/output devices. It can be tied up with any I/O device and
I/O can be performed in a uniform way.
The C++ iostream library is an object-oriented implementation of this abstraction.
It has a source (producer) of flow of bytes and a sink (consumer) of the bytes.
The required classes for the stream I/O are defined in different library header files.
Streams can also be tied up with data files.
Unformatted input/output is the simplest and most efficient form of input/output.
It is usually the most compact way to store data. Unformatted input/output is the least
portable form of input/output.
12.6 Keywords
C++ iostream Library: The C++ iostream library is an object-oriented implementation of this
abstraction.
Stream: A stream is a series of bytes whose value depends on the variable in which it is stored.
Unformatted Input/Output: Unformatted input/output is the simplest and most efficient form
of input/output.
12.7 Review Questions
1. Why should we use <iostream> instead of the traditional <cstdio>?
2. How can we get std::cin to skip invalid input characters?
LOVELY PROFESSIONAL UNIVERSITY 269