Page 275 - DCAP404 _Object Oriented Programming
P. 275
Object-oriented Programming
Notes
other languages but he thinks C++ is the best. Why? "Perhaps because of the power it gives
the programmer." But, remember, that this power is a double-edged sword. Also, "knowing
C++ makes learning other programming languages easier." What's the best way to learn
programming? "Write programs."
Let's say, you ask, what's a programming language? The author begins with an analogy:
"When you enter a darkened room and want to see what is inside, you turn on a light
switch. When you leave the room, you turn the light switch off. The first computers were
not too different than that light switch." From there you move on to `Hello World,' and
before you dump C++ and say `Cruel World', the author would lead you to the innards of
the language, all the while keeping you in good humour.
For instance, to explain bits and bytes, he writes: "While people live at street addresses,
what is stored at each memory address is a byte. Don't worry, I have not misspelled
Dracula's favourite pastime." Similarly, the chapter on variables begins thus: "Recently,
while in a crowded room, someone yelled `Hey, you!' I and a number of other people
looked up, because none of us could tell to whom the speaker was referring." So? "We use
names to refer to each other. Similarly, when you need to refer in code to a particular item
of information" call it by name.
"Variables, like people, have a lifetime," Kent would write in a different chapter. "A
person's lifetime begins at birth. A variable's lifetime begins when it is declared. A person's
lifetime ends with death.
A variable's lifetime ends when it goes out of scope." That's some philosophy demystified,
shall we say?
Test at all costs
WANT to get into software testing as a career? Go for Dr K.V.K.K. Prasad's Software
Testing Tools, published by Dreamtech Press (www.wileydreamtech.com) .
"Many software engineers have a wrong notion that software testing is a second-rate job,"
notes the preface. For them, what's first rate is development. "These engineers tend to
forget that testing is a part of development." How?
Because only through testing can you deliver a quality product. Prasad lists the four
criteria for a software project's success: "Meet all quality requirements; be developed
within the time frame; be developed within the budget; and maintain a cordial relationship
among the team members."
Testing is detested because it is tough. Testing process is iterative. So, test the software in
the lab, and also in actual working environment (called beta testing). Any test creates
stress for those who are tested; and `stress testing' is to test the software "at the limits of its
performance specifications". You accept that testing is important, but `acceptance testing'
is the most important testing, the author would emphasise. It decides whether the client
approves the product or not.
Oracle is a popular name in software, but test oracles are people or machines used for
checking the correctness of the program for the given test cases, explains the book. "Human
test oracles are used extensively if the program does not work." In ancient times, when
people had a problem, it's said they'd go to a priest or priestess, called an oracle. He or she
would act as a medium for divine advice or prophecy. The word is derived from Latin
oraculum, from ovare, speak.
Contd...
268 LOVELY PROFESSIONAL UNIVERSITY