[#37231] Announcing New Ruby Book Under Development! — <robert.calco@...>

Everybody:

31 messages 2002/04/02
[#37250] Re: [ANN] Announcing New Ruby Book Under Development! — "John" <jyeung@...> 2002/04/02

Have you checked out?

[#37279] About efficiency — Jean-Hugues ROBERT <jean_hugues_robert@...> 2002/04/02

[#37289] Re: About efficiency — nobu.nokada@... 2002/04/03

Hi,

[#37291] Re: About efficiency — Sean Middleditch <elanthis@...> 2002/04/03

On Tue, 2002-04-02 at 20:16, nobu.nokada@softhome.net wrote:

[#37232] seeking to understand... — Mark Probert <probertm@...>

38 messages 2002/04/02
[#37255] Re: Ruby, python, perl, ... — Chris <chris@...> 2002/04/02

In article <87d6xhaoif.fsf@jenny-gnome.dyndns.org>,

[#37281] Is eval a code/design smell? — "Chris Morris" <home@...>

I seem to have an inherent distaste for eval, but I don't know why. I've

51 messages 2002/04/03
[#37323] Re: Is eval a code/design smell? — Ron Jeffries <ronjeffries@...> 2002/04/03

On Wed, 03 Apr 2002 00:15:10 GMT, "Chris Morris" <home@clabs.org> wrote:

[#38034] Re: Is eval a code/design smell? — Ian Macdonald <ian@...> 2002/04/11

On Wed 03 Apr 2002 at 20:35:30 +0900, you wrote:

[#38045] Re: Is eval a code/design smell? — Sean Middleditch <elanthis@...> 2002/04/11

On Thu, 2002-04-11 at 01:40, Ian Macdonald wrote:

[#38061] Re: Is eval a code/design smell? — Ian Macdonald <ian@...> 2002/04/11

On Thu 11 Apr 2002 at 22:07:03 +0900, you wrote:

[#38063] Re: Is eval a code/design smell? — Sean Middleditch <elanthis@...> 2002/04/11

On Thu, 2002-04-11 at 12:06, Ian Macdonald wrote:

[#38064] Re: Is eval a code/design smell? — ts <decoux@...> 2002/04/11

>>>>> "S" == Sean Middleditch <elanthis@awesomeplay.com> writes:

[#38066] Re: Is eval a code/design smell? — Sean Middleditch <elanthis@...> 2002/04/11

On Thu, 2002-04-11 at 12:25, ts wrote:

[#38067] Re: Is eval a code/design smell? — ts <decoux@...> 2002/04/11

>>>>> "S" == Sean Middleditch <elanthis@awesomeplay.com> writes:

[#38068] Re: Is eval a code/design smell? — Sean Middleditch <elanthis@...> 2002/04/11

On Thu, 2002-04-11 at 12:42, ts wrote:

[#38069] Re: Is eval a code/design smell? — ts <decoux@...> 2002/04/11

>>>>> "S" == Sean Middleditch <elanthis@awesomeplay.com> writes:

[#38072] Re: Is eval a code/design smell? — Sean Middleditch <elanthis@...> 2002/04/11

On Thu, 2002-04-11 at 12:59, ts wrote:

[#37342] regular expression question — "Firestone, Mark - Technical Support" <mark.firestone@...>

Thanks for the help with the tread questions guys... I have one about (gasp)

16 messages 2002/04/03

[#37385] TextPad replacement for Linux? — Tobias Reif <tobiasreif@...>

TIA,

25 messages 2002/04/03

[#37397] Really new-new-newbie question :) — "Philip Mateescu" <philip@...>

Hi,

13 messages 2002/04/03

[#37454] ModRUBY question — George Moschovitis <gmosx@...>

Hi everybody,

18 messages 2002/04/04

[#37470] Test the result of an initialization ? — jayce@... (Jayce Piel)

17 messages 2002/04/04

[#37540] Fibonacci Number Generators — jzakiya@... (Jabari Zakiya)

Hi, I'm a newbie, coming to Ruby from a

14 messages 2002/04/04

[#37549] OO/Ruby Terminology — <james@...>

I added a wiki page for Ruby book development ...

22 messages 2002/04/05
[#37808] Re: OO/Ruby Terminology — <bbense+comp.lang.ruby.Apr.07.02@...> 2002/04/10

-----BEGIN PGP SIGNED MESSAGE-----

[#37861] RE: OO/Ruby Terminology — <james@...> 2002/04/10

> From: bbense+comp.lang.ruby.Apr.07.02@telemark.stanford.edu

[#37944] Re: OO/Ruby Terminology — Chris <chris@...> 2002/04/10

In article <PGEPJIFLPEPOHCKEEEIKIEFADCAA.james@rubyxml.com>,

[#37963] RE: OO/Ruby Terminology — <james@...> 2002/04/10

> From: Chris [mailto:chris@cmb-enterprises.com]

[#37617] Addition to file.c (File.extension) — Mike Hall <mghall@...>

18 messages 2002/04/05
[#37736] Re: Addition to file.c (File.extension) — matz@... (Yukihiro Matsumoto) 2002/04/08

Hi,

[#37653] Switching from PHP to Ruby - Comments Please — Jim Freeze <jim@...>

Hi:

34 messages 2002/04/06

[#37746] ruby-dev summary 16501-16750 — TAKAHASHI Masayoshi <maki@...>

Hi all,

17 messages 2002/04/08

[#37833] Ruby as replacement for VB? — "Robb Shecter" <rs@...>

Hi,

19 messages 2002/04/10
[#37923] Re: Ruby as replacement for VB? — Michael Davis <mdavis@...> 2002/04/10

Robb Shecter wrote:

[#39153] Re: Ruby as replacement for VB? — "Euan Mee" <xlucid@...> 2002/04/26

On 11 Apr 2002, at 1:03, Michael Davis wrote:

[#37835] crypting ruby source — Ludo <coquelle@...>

Hi,

32 messages 2002/04/10
[#38280] Re: crypting ruby source — web2ed@... (Edward Wilson) 2002/04/14

Ludo <coquelle@enib.fr> wrote in message news:<3CB31298.13A44B26@enib.fr>...

[#38044] RFC - class_added callback — Michal Rokos <m.rokos@...>

Hello,

16 messages 2002/04/11

[#38046] GetoptLong question — djberg96@... (Daniel Berger)

Hi all,

16 messages 2002/04/11
[#38051] Re: GetoptLong question — "Pit Capitain" <pit@...> 2002/04/11

On 11 Apr 2002, at 22:16, Daniel Berger wrote:

[#38101] How to Make a Method Ineffective Efficiently? — William Djaja Tjokroaminata <billtj@...>

Hi,

15 messages 2002/04/11
[#38135] Re: How to Make a Method Ineffective Efficiently? — Jean-Hugues ROBERT <jean_hugues_robert@...> 2002/04/12

Hello,

[#38159] Re: How to Make a Method Ineffective Efficiently? — William Djaja Tjokroaminata <billtj@...> 2002/04/12

Thanks for all the responses. I just want to add the final

[#38126] Ruby/Google — Ian Macdonald <ian@...>

Hi,

19 messages 2002/04/12

[#38136] Idea for a new shorthand — "Hal E. Fulton" <hal9000@...>

OK, maybe this is an idea no one will like. Or

17 messages 2002/04/12

[#38167] Why Object#class Is Inconsistent in "==" and "case"? — William Djaja Tjokroaminata <billtj@...>

Hi,

12 messages 2002/04/12

[#38199] not vs !, and vs && — <james@...>

I'm confused about the behavior of 'not'. The Pickaxe and Ruby21Days books

17 messages 2002/04/12

[#38238] Barnes & Noble putting on the squeeze — David Alan Black <dblack@...>

Hello --

11 messages 2002/04/13

[#38239] Freshmeat article about Ruby — Tobias DiPasquale <anany@...>

Hi all,

28 messages 2002/04/13
[#38447] Re: Freshmeat article about Ruby — Joel VanderWerf <vjoel@...> 2002/04/16

Tobias DiPasquale wrote:

[#38457] Re: Freshmeat article about Ruby — David Alan Black <dblack@...> 2002/04/16

Hi --

[#38560] Re: Freshmeat article about Ruby — Mark Hulme Jones <mjones@...> 2002/04/18

David Alan Black <dblack@candle.superlink.net> writes:

[#38561] Re: Freshmeat article about Ruby — Paul Brannan <pbrannan@...> 2002/04/18

On Fri, Apr 19, 2002 at 01:07:22AM +0900, Mark Hulme Jones wrote:

[#38562] Re: Freshmeat article about Ruby — Pat Eyler <pate@...> 2002/04/18

On Fri, 19 Apr 2002, Paul Brannan wrote:

[#38564] Re: Freshmeat article about Ruby — Jack Herrington <jack_d_herrington@...> 2002/04/18

On 4/18/02 9:30 AM, "Pat Eyler" <pate@eylerfamily.org> wrote:

[#38648] Ruby golf (FFT) Was: Freshmeat article about Ruby — Christian Szegedy <szegedy@...> 2002/04/19

Jack Herrington wrote:

[#38657] Re: Ruby golf (FFT) Was: Freshmeat article about Ruby — David Alan Black <dblack@...> 2002/04/19

Hello --

[#38331] mime type — Tobias Reif <tobiasreif@...>

Hi all,

15 messages 2002/04/15

[#38338] Compiling Ruby on Mac OS X — Alwyn <alwyn@...>

I've downloaded the latest Stable Snapshot and tried building it. It

18 messages 2002/04/15

[#38449] Help wanted for statvfs extension — djberg96@... (Daniel Berger)

Hi all,

35 messages 2002/04/16
[#38470] Re: Help wanted for statvfs extension — "James F.Hranicky" <jfh@...> 2002/04/17

On Wed, 17 Apr 2002 05:04:06 +0900

[#38525] resolv.rb Bug — "Roy J. Milican" <roy@...>

Greetings,

18 messages 2002/04/17

[#38627] Imlib2-Ruby 0.4.0 — Paul Duncan <pabs@...>

I just posted Imlib2-Ruby version 0.4.0, my Ruby bindings for Imlib2

12 messages 2002/04/19

[#38635] Threads creating threads creating threads... — Tobias Peters <tpeters@...>

I have already asked this question in [ruby-talk:19661], but I will ask it

12 messages 2002/04/19

[#38694] Ruby on .NET? — Ron Jeffries <ronjeffries@...>

I scanned the .net threads here and didn't see whether there is, or is not, an

37 messages 2002/04/19
[#38696] RE: Ruby on .NET? — "repeater" <repeater@...> 2002/04/19

recently found:

[#38839] building extensions-- new vs initialize — "Norman Makoto Su" <normsu@...>

Hi, I'm trying to build a ruby extension in C. While looking at the pickaxe CD

14 messages 2002/04/23

[#38910] Numberic#prev — Sean Chittenden <sean@...>

I do a lot of incrementing and decrementing of values: it'd be nice if

36 messages 2002/04/24

[#39047] A Wild Idea: What do you think? — Jim Freeze <jim@...>

Hi:

16 messages 2002/04/26

[#39122] RE: A Wild Idea: What do you think? — "Morris, Chris" <chris.morris@...>

> > OK, then let's have it in Texas. How about August? Oh, what do you

28 messages 2002/04/26
[#39123] Re: A Wild Idea: What do you think? — Jim Freeze <jim@...> 2002/04/26

On Sat, Apr 27, 2002 at 03:15:21AM +0900, Morris, Chris wrote:

[#39176] Re: A Wild Idea: What do you think? — Pat Eyler <pate@...> 2002/04/27

On Sat, 27 Apr 2002, Jim Freeze wrote:

[#39177] Re: A Wild Idea: What do you think? — David Alan Black <dblack@...> 2002/04/27

Hi --

[#39228] RubyConf.new(2002) - ideas for agenda — "Daniel Berger" <djberg96@...>

Ok - so I'm probably jumping the gun here, but hey, what the heck.

27 messages 2002/04/28

[#39394] ncurses, mingw32 — tony summerfelt <snowzone5@...>

i've been away from ruby for awhile, it was time to dust off the pickaxe book

13 messages 2002/04/30

RE: article about testers using Ruby.

From: "Bob Calco" <robert.calco@...>
Date: 2002-04-19 02:15:40 UTC
List: ruby-talk #38608
Brian:

See comments below...

-----Original Message-----
From: Brian Marick [mailto:marick@testing.com]
Sent: Wednesday, April 17, 2002 9:45 PM
To: ruby-talk ML
Subject: RFC: article about testers using Ruby.


I've written a first draft of an article with several ulterior motives. One
is to keep exposing testers to Ruby.

What are the other(s)?

 Would anyone like to comment on my first draft?

Sure.

I'm not assuming any programming background, so I'm simplifying or even
distorting some truths in the interests of understanding.

Hmmm. A strange way to go about teaching... but then again I'm odd: I'm the
kind of guy who likes to align my understanding with the truth, however
horrifying it may be. ;)

 For example, it seemed easier to pretend there's more of a difference
between getters and setters and other kinds of methods than there really is.

Why don't you just say:

---
"Programmatically speaking, 'getters' (e.g., 'getValue()') and 'setters'
(e.g., 'setValue()') are just plain old methods. They are so-called only by
way of social convention to tell the user of a class that he or she has
restricted access to certain private data. One may set private data only by
using a 'setter' method (if provided), and one may acquire the current value
of a certain private piece of data by calling its 'getter' method (if
provided).

"A setter must take a value of the correct type as its only input, and it
has the option of ignoring your input completely if for some good reason it
doesn't like it; a getter must return the current value of the correct type
on demand. If one or both are not provided, it means you have no business
mucking with that private data, by design it's intended to be the class's
internal problem entirely (whether you like it or not). This, in a nutshell,
is what programmer geeks and nutty professors refer to as 'encapsulation' --
controlled access to data intended to be private or internal to the class.

"Getters and setters that you use or write yourself are supposed to be
interfaces to the mysteries inside the black box, like buttons and digital
displays on a telephone -- most people would freak if they saw the tangle of
wires and circuits hidden underneath their sleek, fashionably colored (not
to mention overpriced) designer cordless phones. To call a friend, you need
know only how to dial their number. The hidden stuff inside the phone (most
of which you never see and mercifully have no access to) handles all the
gory details."
---

Testers I talk to (and I do a lot of training in the area of automated
testing) tend to get the point when I explain it that way. The ones that
don't have no business in front of a computer keyboard, as keyboards tend to
short out when exposed to large quantities of dripping drool.

What I'm saying is: Testers really aren't as stupid as they and everybody
else think they are. Well, some are. Then again, so are some developers I've
met in my time. But most are not -- they just never trusted their own
intelligence enough to really apply it on the job. Chalk it up to a bad
childhood and a screwed up education system or something. Bottom Line: Don't
talk down to reach the masses - it may make you feel smarter, but it won't
help the ones that really want to learn make any more sense of this stuff.
Just speak plainly and without pretense -- the folks who will appreciate
your morsels of wisdom will rise to the occasion.

 And I refer to [0, 29, 123] as a "list", since that notion is more likely
to be familiar than "array". Am I going too far?

Gee... I guess I just don't see the big cliff there...

I'm also using win32ole. In the article, I write a test for Word.

I wish Microsoft would do that once in a while... ;)

 This is the first time I've used win32ole and only the second time I've
talked programmatically to Word.

Do you wan't the truth? It kinda shows... :(

But practice makes perfect! (Or is that, 'perfect practice makes
perfect'...? I forget.) ;)

 How's my explanation? Again, I simplified a bit, and I might plain
misunderstand something.

See embedded comments below...

I'd need comments in about a week. I can supply a Word document. I should be
able to provide PDF, but "print to PDF" has suddenly stopped working.
Rebooting might fix it, but I suspect this NT machine knows I'm thinking of
replacing it with a Mac.

Trust me, your NT machine cannot and does not know this. :)

-------------
Shunning the GUI  [I don't like the title. Testers should shun NOTHING. They
should have a zeal about finding new ways to break things that strikes fear
in the hearts of developers (well, weak developers anyway).]

Graphical user interfaces make test automation hard.  [I disagree: they pose
a particular set of challenges that serious automated test engineers need to
know how to overcome, but they do not make automation 'hard' per se. Just
tedious at times.] The problems are well-known. Specialized tools are
required to drive the GUI  [Specialized tools are required to do any kind of
non-trivial testing -- just look at the large number of professional
developer tools, ranging from debuggers, to profilers, to code coverage
analyzers, etc.; does this mean it should not be done?] . Those tools are
often confused by the common programming practice of inventing custom user
interface controls.  [The root cause of this problem vis a vis record/replay
tools is the fact that the only way to hook a GUI object for this purpose is
to register callbacks to various events associated with a given object class
with the Windows event message system, and this requires knowing *how* to
register callbacks to custom windowed objects, which most tools manage for
you. There is no confusion per se on the part of the tool. Most professional
tools, like MI WinRunner (or, for Unix, XRunner), allow you to register
custom classes as you become aware of them and insofar as they behave more
or less like analogous controls, they work fine. Other times more radical
methods are needed, like writing custom object hooks using windows message
cracking macros and other lower level techniques, and registering them with
the tool. Most professional tools provide API's for this. The *only* objects
that record/replay tools choke on (at least on Windows) are non-windowed
(i.e., "graphical") controls. These are nearly impossible to hook in any
reliable way, because windows cannot see the pictures inside them, no matter
how much they may look like standard controls to users. For instance, Access
and FoxPro use graphical controls instead of Windowed controls to minimize
overhead. As a result, they are the bane of every record/replay tool on the
market.]  When they are used in the simplest way, the tools lead to fragile
tests that tend to break en masse when the GUI changes.  [Well, if the
scripts aren't engineered to be reusable, modular, robust, then yes, they
will be fragile. But usually some planning/design and scripting standards
and best practices tend to stiffen those scripts against the elements pretty
well.] Making the tests resistant to change requires elaborate and sometimes
awkward testing frameworks.  [No, just a little sound test engineering.
There is (or should be) nothing awkward about having to think and plan a
little bit before you dive into scripting a test suite.]

Sometimes you must pay this price. Other times, there are alternatives. In
this article, I'll show you one: testing through the program's scripting
interface.

[OK, I'll stop here to explain the enormous gap in your thinking. The
assumption that using an application's scripting interface instead of its
GUI sounds like a nice alternative to the real work of engineering real test
suites with sophisticated record/replay tools against modern-day complex
GUIs, but there is an enormous danger here: You assume that the script
interfaces, particularly COM script interfaces, are flawless and complete.
In reality, they are neither, especially during testing. At all events, you
cannot assume that. And I'll take it a step further: The COM interface
itself must be rigorously tested (and Lord knows Ruby is good for that!),
and cannot be relied upon during testing to provide accurate, reliable,
dependable test data above and beyond their own conformance to whatever
requirements drove their development. Period. I do not trust that a COM
method call to save a file is an adequate substitute for clicking on the
"Save File" button and seeing if something other than "Save File" pops up.
They are apples and oranges and the assumption that these two seemingly
similar things (clicking "Save File" and scripting the "saveFile()" method)
are in fact the same at the code level is naive.]

 My example will be testing Microsoft Word through the interface you'll
often hear described as COM (Component Object Model) or OLE (Object Linking
and Embedding). It's the interface that allows you to embed Excel
spreadsheets in Word documents and vice versa.

[Actually, OLE is a distinct technology built on top of the general-purpose
COM architecture, as is Structured Storage, ADO, and a whole host of
Microsoft technologies.]

 It's also the interface that allows you to write a Visual Basic or Perl
program that uses Word to generate form letters. Since automated tests are
programs, the same interface is dandy for testing.

[Uhhh ... no. That interace itself needs to be tested quite separately from
the GUI behavior, as I explained above, and is not a substitute for GUI
testing.]

This approach can be used with interfaces other than COM. For example, web
services are becoming popular. These applications can be accessed from
anywhere over the internet, and they usually use an interface called SOAP.
[Why do you say this? SOAP is actually relatively new, and there are a bunch
of other far more pervasive protocols out there... read up on it.]  Tests of
such an application would look quite like what you'll see below.

[Testing web services directly via the internet protocol is not a bad
point... it can be done independently of testing the web client GUI to test
the core service functionality... but you still gotta test the GUI before
you deploy it...]

This article will give you four things:

1.      A feel for what a scripting interface looks like.

[The feeling: Warm, tingly, and at times disturbingly like petting a wet
iguana...? ;) ]

2.      An example of how to write tests against one.

[Key distinction: Writing tests AGAINST a scripting interface, vs. Writing
tests USING a scripting interface... two very different propositions.]

3.      Some exposure to the scripting language I think is best for testers,
Ruby. I assume no programming background.

4.      An appreciation of the benefits of shunning the GUI.

 [Scratch this point... Rephrase in the positive: "An appreciation for the
fact that there are often more ways to test an application's functionality,
and more functionality to test, than you might otherwise think." Something
like that. My motto: Shun nothing!!! Plan your attack! Then -- attack! ]

;)

I hope this helped... BTW, I'm co-authoring the "Ruby Developer's Handbook"
by Sams, which focuses on using Ruby as a toolsmith's langauge for general
software engineering, including with particular attention to Ruby as a test
script language. It should be out early next year, as we are in the early
stages of writing it at this time.

-- Bob Calco

--
"Act always so as to increase the number of choices." -- Heinz von Foerster

In This Thread