(Ebook) Artificial Intelligence Methods for Optimization of the Software Testing Process: With Practical Examples and Exercises (Uncertainty, Computational Techniques, and Decision Intelligence) by Sahar Tahvili, Leo Hatvani ISBN 9780323919135, 0323919138 download pdf
(Ebook) Artificial Intelligence Methods for Optimization of the Software Testing Process: With Practical Examples and Exercises (Uncertainty, Computational Techniques, and Decision Intelligence) by Sahar Tahvili, Leo Hatvani ISBN 9780323919135, 0323919138 download pdf
com
OR CLICK HERE
DOWLOAD EBOOK
ebooknice.com
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
ebooknice.com
ebooknice.com
ebooknice.com
(Ebook) Cambridge IGCSE and O Level History Workbook 2C -
Depth Study: the United States, 1919-41 2nd Edition by
Benjamin Harrison ISBN 9781398375147, 9781398375048,
1398375144, 1398375047
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044
ebooknice.com
ebooknice.com
For more information about the UCTDI series, please visit: https://www.elsevier.
com/books-and-journals/book-series/uncertainty-computational-techniques-
and-decision-intelligence
ARTIFICIAL
INTELLIGENCE
METHODS FOR
OPTIMIZATION OF THE
SOFTWARE TESTING
PROCESS
With Practical Examples and
Exercises
SAHAR TAHVILI
Product Development Unit, Cloud RAN, Integration and Test
Ericsson AB, Stockholm, Sweden
Division of Product Realisation
School of Innovation, Design and Engineering
Mälardalen University, Eskilstuna, Sweden
LEO HATVANI
Division of Product Realisation
School of Innovation, Design and Engineering
Mälardalen University, Eskilstuna, Sweden
Academic Press is an imprint of Elsevier
125 London Wall, London EC2Y 5AS, United Kingdom
525 B Street, Suite 1650, San Diego, CA 92101, United States
50 Hampshire Street, 5th Floor, Cambridge, MA 02139, United States
The Boulevard, Langford Lane, Kidlington, Oxford OX5 1GB, United Kingdom
Copyright © 2022 Elsevier Inc. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or any information storage and
retrieval system, without permission in writing from the publisher. Details on how to seek
permission, further information about the Publisher’s permissions policies and our arrangements
with organizations such as the Copyright Clearance Center and the Copyright Licensing Agency,
can be found at our website: www.elsevier.com/permissions.
This book and the individual contributions contained in it are protected under copyright by the
Publisher (other than as may be noted herein).
Notices
Knowledge and best practice in this field are constantly changing. As new research and experience
broaden our understanding, changes in research methods, professional practices, or medical
treatment may become necessary.
Practitioners and researchers must always rely on their own experience and knowledge in
evaluating and using any information, methods, compounds, or experiments described herein. In
using such information or methods they should be mindful of their own safety and the safety of
others, including parties for whom they have a professional responsibility.
To the fullest extent of the law, neither the Publisher nor the authors, contributors, or editors,
assume any liability for any injury and/or damage to persons or property as a matter of products
liability, negligence or otherwise, or from any use or operation of any methods, products,
instructions, or ideas contained in the material herein.
ISBN: 978-0-323-91913-5
– Sahar
I would like to dedicate this book to my parents who have always encouraged
me on my science journeys.
– Leo
This page intentionally left blank
Contents
1. Introduction 3
1.1. Our digital era for a better future 3
1.2. What is in this book? 4
1.2.1. What is in the practical examples and exercises? 5
1.2.2. What you will need 6
1.3. What is missing? 6
vii
viii Contents
References 171
9. Exercises 181
9.1. Python exercises and practice 181
9.2. Exercise 1: Data processing 182
9.3. Exercise 2: Natural language processing techniques 182
9.4. Exercise 3: Clustering 183
9.5. Exercise 4: Classification 183
9.6. Exercise 5: Imbalanced learning 184
9.7. Exercise 6: Dimensionality reduction and visualization 184
References 185
A.1.6. The conducted ground truth analysis for Case Study 7 and Case
Study 8, grouping log files based on failure causes – Ericsson AB 194
References 196
Index 197
This page intentionally left blank
List of figures
xiii
xiv List of figures
Figure 5.17 The clustered log entry using Log2Vec and HDBSCAN is
based on Survey 3, where C0 represents non-clusterable data
points and n indicates the size of each cluster. Embeddings
are dimensionally reduced using UMAP. 147
Figure 5.18 A synthetic dataset before and after SMOTE over-sampling. 159
Figure 6.1 A segment of the impact of artificial intelligence in software
development during 2020–2021. Sources: World Quality
Report [2] and Gartner’s special report [1]. 162
Figure 6.2 Some of the common artificial intelligence challenges.
Source: Author’s own contributions. 164
Figure 6.3 An artificial intelligence platform solution. Source: Author’s
own contributions. 165
Figure A.1 The corresponding ground truth for requirement
vectorization in Case Study 1, presented in Section 5.2.2. The
Singapore R151 project at Alstom Sweden AB is utilized for
conducting this ground truth analysis. 188
Figure A.2 The corresponding ground truth for requirement
vectorization in Case Study 2, presented in Section 5.2.4.
This figure shows a segment from the software architecture
designed for the Singapore R151 project. 189
Figure A.3 The corresponding ground truth for test case vectorization in
Case Study 3, presented in Section 5.3.2. This figure shows a
cut from a testing platform for the BR490 project at Alstom
Sweden AB, where the input–output signals, requirements,
and test cases are visualized. 190
Figure A.4 An example of an embedded directed graph of dependencies
for five test cases. 191
Figure A.5 The corresponding ground truth for test case vectorization
for Case Study 4, presented in Section 5.3.4. This figure
shows a cut from the software architecture designed for the
Singapore R151 project. 192
Figure A.6 Dependencies between test cases and requirements in
the Singapore R151 project. The red nods represent the
requirements and the blue nodes are the test cases. 193
Figure A.7 Classifying test cases into two main classes: dependent and
independent. 193
Figure A.8 The corresponding ground truth for similarity detection
between test scripts in Case Study 5 and Case Study 6,
presented in Section 5.4.2 and Section 5.4.3, respectively. This
xviii List of figures
xix
xx List of tables
Table 5.7 Parameters and versions of packages used for Case Study 3. 123
Table 5.8 A summary of the performance evaluation against ground
truth for clustering the dependent and independent test case
specifications, using the BR490 project at Alstom Sweden AB. 125
Table 5.9 The obtained results for classifying the test case specification
into dependent and independent classes employing the
proposed machine learning pipeline in Fig. 5.7 against the
ground truth in the Singapore R151 project. 129
Table 5.10 Some examples of different functions within individual test
scripts. 133
Table 5.11 A summary of the performance evaluation for classifying the
test scripts against the labeled data using the over-sampled
dataset. 134
Table 5.12 The performance metrics for evaluating the efficiency of
the proposed pipeline for similarity detection between test
scripts using Code2Vec and HDBSCAN. The performance of
the utilized model is evaluated against the labeled data on
both the original subsampled datasets. 136
Table 5.13 Some examples of the detected synonyms by the Log2Vec
model for the test logs. 141
Table 5.14 Some examples of the detected antonyms by the Log2Vec
model for the test logs. 141
Table 5.15 A sample of the obtained vectors for the log entries. In total
32 dimensions are derived for each log entry. 142
Table 5.16 An example of the high-level troubleshooting causes for each
class of the log entries. Class 0 is assigned for the unknown
failure causes. 142
Table 5.17 The results of the performance evaluation on the 25% of the
dataset for classifying log entries against the labeled data. 144
Table 5.18 A summary of the performance metrics on the full and
subsampled dataset against the labeled data. 146
Table A.1 A sample of the employed questionnaire at Ericsson AB for
detecting the similarities between test scripts written in Java.
We asked the testers to insert 1 if two test scripts have at least
one similar function and insert 0 if there is no similar function
between two test scripts. 194
Table A.2 A sample of the employed questioner at Ericsson for
detecting the failure causes and thereby the required
troubleshooting activities. 195
Biography
xxi
This page intentionally left blank
Preface
The story of writing this book started after we tried to conclude our re-
search in the fields of artificial intelligence and software testing. From 2015
to 2020, we published our research results in several conferences, journals,
and also Sahar’s PhD thesis. Then it was time to move on to the next chap-
ter in our careers. But we found ourselves seeking out a conclusion to this
research.
During this time we changed homes, cities, domains, and jobs, the
coronavirus outbreak started, and our homes became our offices, but our
research always stayed with us. We were always on the lookout for the next
step of our research. How we can find some new use cases? Is this research
applicable in other domains? How can we facilitate the testing effort in
today’s technology?
We still remember our first days in the industry as young researchers
with a heightened pressure to impress the testing team. The first time we
went to the Bombardier Transportation offices in Västerås (the company’s
name changed to Alstom Sweden AB), we met the integration testing team
and they showed us a comprehensive presentation about the testing process.
We found out how different real-world industrial software testing can be
from the theoretical descriptions and toy examples used in academia.
At that time, many concepts were unclear to us. Either due to our lack
of knowledge in the testing domain or the slight differences between theory
and practice. We still remember the complexity of the test configuration
figures, traceability matrix, testing pipelines, and numerous acronyms. We
did not even know from which point we should start. However, we trusted
in the process and that “hard work will pay off.” Then we started from
scratch.
After some time, we began to understand the testing process in the
industry. Also, the testing team began to understand our intentions and
ideas. During our research, we did not just focus on different artificial
intelligence-based solutions; we also developed a common understanding
between us and the stakeholders in the industry.
Within our daily close collaboration with engineers and testing teams at
Alstom Sweden AB and Ericsson AB, we realized that there is potential and
need for our research. On the other hand, continuously learning from the
testing experts pushed our limits and forced us out of our comfort zones.
xxiii
xxiv Preface
Finally, we are here now, presenting our book, discussing our experi-
ences, and sharing our challenges and discoveries with the readers. This
book is a beginning of a story, not just about artificial intelligence applica-
tions in the software testing domain, but also about overcoming the weak
points, fears, and restrictions by not giving up, asking questions, and always
learning. We are still at the beginning of an endless learning process. Sup-
port us and each other to be better; each one of us can make a difference.
Together we can make a massive change in both science and the world.
Acknowledgments
Our sincere thanks go to Pontus Östling, Gunnar le Grand, Dr. Sigrid Eldh,
Yulin Cui, Cristina Landin, and Anders Caspar at Ericsson AB, who have
invested their valuable time and always been supportive to us throughout
the work on this book.
We would like to express our sincere gratitude to the integration testing
teams at Alstom Sweden AB for their patience, motivation, and immense
knowledge. A very special thank you goes to Dr. Ola Sellin and Henrik
Jonsson at Alstom Sweden AB for their support during the research that
built the foundation of this book.
Our deepest gratitude goes to our families, friends, and also our col-
leagues: Dr. Nima Dokoohaki, Jonas Österberg, Dr. Hessam Shadman,
Dr. Anita Simhag, Iraj Mesdaghi, Professor Markus Bohlin, and Shahab
Darvish, who have always been there for us. Without them, we could have
never reached this far.
Stockholm
June 2022
xxv
This page intentionally left blank
PART ONE
Software testing,
artificial intelligence,
decision intelligence,
and test optimization
1
This page intentionally left blank
CHAPTER ONE
Introduction
“Learning is a profoundly important part of what makes us human. It is also
something good old-fashioned artificial intelligence struggled with.”
Luke Dormehl
1 In the context of this book, a black box is a system that can be viewed in terms of its
inputs and outputs, and its exact inner function remains hidden.
2 In contrast to the black box, white box systems can be fully inspected and their function-
ality can be observed.
Introduction 5
Definition 2.1. The software development life cycle is a process that aims
to design, develop, and test a software product [2].
The software development life cycle can mainly be divided into three
main activities: design, development, and evaluation. Each of the mentioned
activities can be further divided into several phases or steps. Fig. 2.1 shows
a customized version of a software development life cycle provided by us
through monitoring different software development life cycle processes at
several Swedish companies.
Figure 2.1 A customized version of a software development life cycle (SDLC). Source: Authors’
own contribution, inspired by the original model of the software development life cycle.
Table 2.1 Comparison of automated and manual software testing in six aspects.
Parameter Manual testing Automated testing
Test design Does not require the coding Drives a test-driven develop-
process. ment design.
Setup Requires a more straightfor- Requires less complex test exe-
ward test execution and system cution and system setup.
setup.
Processing Time-consuming and requires Significantly faster than man-
time human resources and observa- ual testing, does not require hu-
tion. It has a higher risk of miss- man judgment and observation.
ing out on the pre-decided test Also, it has a lower risk of miss-
deadline. ing out on a pre-decided dead-
line.
Cost Not cost-efficient for a large Not cost-efficient for a small-
product with a high volume of size product with a low volume
test cases. of test cases.
Accuracy Has a lower accuracy due to the Has a higher accuracy, since
possibility of bias and error in there is no testing fatigue due
the human judgment. to the tools and scripts.
Knowledge Requires just domain knowl- Requires both domain knowl-
edge in testing. edge in testing and program-
ming knowledge.
Figure 2.2 A customized version of a software testing life cycle model. Source: Authors’ own
contribution, inspired by the original model of the software testing life cycle.
ments are met [17]. However, in such as software development life cycle
some common activities are usually defined in a software testing life cycle
framework, based on the software product size, complexity, and company
policies. Fig. 2.2 provides an overview of a typical software testing life cycle,
including the following activities:
1. Requirement analysis. Requirement analysis refers to the analysis of
client and stakeholder system requirements. In this step, the test team
analyzes the requirements from a testing perspective. Since this step is
the first step of a software development life cycle, some business re-
quirements specification documents need to be shared in advance by
the stakeholders. Moreover, the testing team needs to check if all the
requirements are testable or not. The decision (e.g., mitigation strat-
egy) about the non-testable requirements and the automation feasibility
should be made in this step.
2. Test planning. In this step, the required resources (e.g., manpower,
tools), cost, and deadline need to be estimated based on the analyzed
requirements in the previous step.
3. Test development. The required activities in this step are directly
related to the testing procedures (manual, semi-automated, or fully au-
tomated). Test case specifications and test scripts will be created and
generated for the manual and automated testing procedures, respec-
tively. In some testing processes, a requirement traceability matrix needs
14 Artificial Intelligence Methods for Optimization of the Software Testing Process
Figure 2.3 The V-model in software testing. Source: Authors’ own contribution, inspired by the
original V-model.
Fig. 2.3 shows the structure of a typical V-model for testing a software
product. As we can see in Fig. 2.3, the verification (development) and vali-
dation (test execution) activities are performed side by side in downhill and
uphill shapes. Furthermore, the unit testing is the first level where the ac-
ceptance testing must occur as a final level of testing in the V-model. The
V-model is a popular approach especially in large industries because it saves
time by detecting the defects in an early stage of the testing process. Due
to the mentioned advantages, the conducted industrial case studies in this
book are mapped with the V-model.
16 Artificial Intelligence Methods for Optimization of the Software Testing Process
Figure 2.4 A Venn diagram of the software test artifacts. The red zone represents a manual
testing process, whereas the green zone indicates an automated (or semi-automated) testing
process. Source: Authors’ own contribution.
1 The IBM Rational DOORS Next Generation database is a leading requirements manage-
ment tool that makes it easy to capture, trace, analyze, and manage changes to information.
2 Alstom Sweden AB is the largest player in the Swedish railway market, with over 1000
trains delivered. Alstom is a multinational rolling stock manufacturer operating worldwide
in rail transport markets, active in the fields of passenger transportation, signaling, and lo-
comotives, with products including the AGV, TGV, Eurostar, Avelia, and New Pendolino
high-speed trains, in addition to suburban, regional, and metro trains and Citadis trams.
18
Artificial Intelligence Methods for Optimization of the Software Testing Process
Table 2.2 A requirements specification example for testing a train system, extracted from the DOORS database at Alstom Sweden AB.
ID Name Description Action type Link: Requires (>) Link: Provides (<) Module
280191 Critical GIVEN: TCMS receives critical relays Functional Signal: 273957 Signal: 273965 4967
relays status status from CTC Signal: 239030
THEN: TCMS-VDU shall display the
critical relays status on car level. Critical
relays are shown in ATP-ATO,
Propulsion and Brake screens.
Discovering Diverse Content Through
Random Scribd Documents
exchange a few ideas that to strangers might have the merit of
novelty.
So at eight bells, 8 p.m., as her lights were seen stationary abeam
about a mile away, a boat was lowered from the Eliza Adams into
which the captain and C. B. with the boat’s crew descended, and
pulled away into the darkness until the dim black hull of the vessel
they are bound to suddenly loomed huge and threatening from the
darkness.
“Ship ahoy!” roared the skipper. “Here’s Captain Taber of the Eliza
Adams come a gamming.”
“Welcome, Captain Taber, I knew it was you as soon as I heard ye
hail. This is the Matilda Sayer of Dartmouth, Captain Rotch.”
“Good lad,” yelled Captain Taber delightedly. “Pull two, stern three,
ah! unrow there;”—and as the boat ranged alongside he gripped the
man ropes and ascended the side ladder of rope like a goat climbing
a precipice.
While the two old friends greeted each other there was a whirring of
sheaves and down came the mate’s boat into the water. Dark forms
leapt into her and she pushed off, immemorial custom having
decided that in gamming when the captain visits a ship the mate of
that ship goes a visiting his fellow on board the other vessel. As they
pushed off into the darkness a voice was heard above, “Haul up and
hook on, chums,” and they did so, their boat being cheerily hoisted
into the position the other had left. For this was also a pleasant sea-
custom among whalers, being eminently practicable because of the
almost standard size of all whale boats.
Arriving on deck the four hands were immediately haled forrard, and
C. B. was welcomed in the half deck by the harponeers, where such
hospitality as they possessed was offered him and all hands crowded
around him eager to talk to him, and listen to what he had to say.
First of all with native courtesy they inquired what sort of a season
the Eliza Adams was having and other matters of that kind, but he
could not help noticing that they all looked curiously at him, as if
they could not quite make him out. At last the old carpenter, a fine
venerable Yankee, said—
“Whar d’ye hail from, mister?”
“I come from Norfolk Island,” replied C. B. pleasantly.
“Well, do tell,” ejaculated the cooper, “I didn’t know they was ever
any natives on Norfolk ’cept convicks from England, and I heerd that
they was done away with long ago. An’ yew don’ look like a Kanaka
neither.”
“Neither am I,” explained C. B. with gentle dignity. “Surely you must
have heard of the Pitcairn Islanders finding Pitcairn too small for
them, and a number of them being sent by the British Government
to Norfolk Island, which was given them to live in.”
A chorus of remembrance arose in a babel of voices until the old
carpenter, getting up, came close to C. B. and peered in his face
intently, at last remarking quietly, “Did your father ever go to sea in
a spouter, young feller?”
“Oh yes,” answered C. B.; “he was in the Rainbow and the Canton,
both New England whaleships, for a considerable time.”
“And what might his name be, if he’s still alive, as I hope?”
“Thank you, he’s still alive, or was three months ago, when I left
home, God bless him, and his name is Philip Adams!”
The effect upon the carpenter was electrical. He smote his thigh with
great violence and shouted—“Boys, thishyer fine specimen of a boy
is the son of the finest specimen of a man that ever trod God
Almighty’s earth. Nine months I was shipmates with him in the ole
Canton, and if ever a man was tried by a lot of ornery scalawags, he
was. He could a broke any one of ’em in pieces with his fingers; he
was as much above ’em at any kind o’ work as he was in strength
an’ good looks, yet that mis’ble gang used to chip him, poke fun at
him, play tricks on him, until I used to feel as if I could a killed ’em
myself, and I warn’t much better than they was. But never once did
anybody hear an angry word or a bad word of any kind outer his
mouth, never once did he miss a chance of doin’ even the worst of
his tormentors a good turn, and never once did anybody have real
cause of complaint about his work or anything that he did. And
when he left the ship to go home because his agreed time was up, I
never see such a carryin’ on, you’d a thought everybody on board
had lost father and mother and all their other relations. Young
man”—solemnly—“if you’re only one quarter as good a man as your
father was, the ship is entirely blessed by having ye aboard, and I’m
honoured at bein’ able to shake ye by the hand.”
There was a momentary pause as “Chips” sank down on his chest
again, and C. B.’s eyes glistened with heavenly pride at the honour
paid to that dear father whom he so fondly loved. Then he said—
“My dear dad is all you say of him, and all I am or ever likely to be
that’s any good I owe to him and mother. But he is a very quiet
man, especially about himself, and so we knew little of what he had
gone through. I understand it better now since I have been whaling
myself. I thank you with all my heart for what you have said about
him, it has done me more good than you can possibly imagine.”
There was rather an awkward pause after this, as if the other
members of the half deck hardly knew what to do with such a
prodigy as they now believed they had got in their midst. But the
carpenter came to the rescue by saying—
“Looky here, youngster, your father had a very tuneful voice of his
own, and although he didn’t talk much he would sing by the hour, all
about God and heaven and the like, and my! but it made me feel
right good. D’ye happen to take after him in that?”
C. B. flushed a little and replied—
“Since I’ve been to sea I’ve never sung a note except humming to
myself. But I used to sing at home a good deal, and I’ll be very glad
to try if you like. I only sing hymns, though.”
“That’s quite good,” hastily answered the carpenter, “your father
didn’t sing anything else either, an’ I don’t suppose any of us will
know the difference. We’re all more or less heathen, you know.”
So without further pressing C. B. lifted up his sweet tenor and sang
“O God of Bethel,” amid a silence that was positively painful in its
intensity of attention. And as soon as he had finished he was
disconcerted by a very tempest of applause and vociferous shouts of
“Same man sing agen. Bully for you, old hoss,” etc., etc. And nothing
loth C. B. sang again and again, his repertoire being tolerably
extensive and his memory as good as his bringing up would
naturally make it, until tired out he had to cry off. Then, and not till
then, it was found that all hands in the ship, forgetting the gam, had
crowded as near to the half deck as possible, charmed by the sweet
strains.
The whole incident brings forcibly to my memory an experiment of
my own once when gamming a ship called the Cornelius Howland off
the Three Kings, New Zealand. I was one of the visiting boat’s crew,
and after the usual topics of conversation flagged a song was called
for. I explained that I had some pretensions to a voice, but could
only sing hymns, for in the sect among whom I was converted it was
esteemed wrong to sing anything secular, and mortal sin to go to
any place of amusement whatever. It was immediately explained to
me that so long as I sang, the words did not matter in the least,
especially as scarcely anybody would understand me. So I piped up
instantly with a favourite of mine from Sankey’s book, “Through the
Valley of the Shadow I must go.” It was received with shouts of joy,
one man who was especially delighted saying, “Well, —— my eyes,
that’s what I call a —— good song, d’ye know. I could sit and listen
to that kind o’ singin’ all night.”
I humbly apologize for the blanks, but the reader will, I hope, feel as
I did, that the forcible expletives they represent meant nothing to
the speaker, who was only using his ordinary language. I only know
that I went on singing to the exclusion of everybody else, and was
quite hoarse the next day from the unaccustomed vocal exercise, for
we didn’t sing very much in my ship. After all, it was not much to be
wondered at, for the polyglot crowd met with in the forecastle and
half decks of a whaler has usually one gift in common—an intensely
musical ear, although the execution of pleasing music is denied them
in nearly every instance. And for instrumental music they usually
have that truly infernal instrument, the accordion, from which the
most ingenious musician that ever lived can draw nothing but noise.
So that a little real music is received with great joy.
At midnight the cry was heard, “Eliza Adams’ boat’s crew away,” and
C. B. sprang to his post, but not before his new-found friend “Chips”
had handed over to him his choicest treasure, a small parcel of well-
thumbed books, ragged copies of Dickens and Charles Reade, with
one or two others by less known authors, but all to C. B. a
storehouse of wonders, a treasure unlocked. Then with a warm
handshake they parted, C. B. feeling happier than he had done since
leaving home. Never before had he realized how much he had
craved for sympathy and the opportunity to express himself in terms
of love and admiration for his Father in heaven. And when they
presently reached the ship Captain Taber said to him—
“You seem to have had a pretty good time, Christmas. I heard you
singing away and remembered how your folks used to sing. It must
have been quite a treat to you to let loose again.”
C. B. said nothing, for he did not feel that any answer was required
of him, but he longed with greater desire than ever to be able to talk
about the matter that lay nearest his heart. No one who has not
been in a similar position can begin to realize what it means to be
dumb upon the one topic that interests you. To feel that if you
mention it to anybody you will not only not be understood, but your
words will be construed as an insult. But he gave a great sigh and
took the matter quietly to the Lord as was his wont, feeling much
comforted thereby, strengthened to wait and endure as long as he
should be called upon to do so. And all unknown to him relief was at
hand.
Two days after meeting with the Matilda Sayer the crow’s-nest
reported whale in the usual manner. But this time it was a lone
whale of very large size steadily making a passage across the
ground at a leisurely pace. Now a lone whale is always potentially
very dangerous, because his loneliness is due to the fact that he has
been cast out of the society of his kind. A big bull whale only
maintains his position as leader of the school as long as he is able to
beat all aspirants to the dignity. And as the young bulls growing up
are continually striving to attain that position, it will easily be seen
that to keep it the holder must be of exceptional strength and vigour,
while the day will surely come when in the natural order of events
he will have to abdicate, which does not mean that he may take an
inferior position in the school, but that he must leave it altogether
and from henceforth until the end, which may be many years
distant, he must roam solitary.
But this condition of existence for the whale naturally means that he
becomes morose, savage and wary. And if he should in addition
have been the object of attack by whalemen and have got away
from them, he becomes doubly dangerous because of the never-to-
be-forgotten lessons he has learned as to how to act, and also
because it usually happens that he carries with him, imbedded in his
flesh, some rankling fragments of bombs and certainly a galling
harpoon.
Now in consequence of these well-known facts concerning the lone
whale, it is usual to approach him with considerable caution. But
there are many whalemen to whom caution in dealing with their
gigantic quarry is a word of no meaning, they are reckless in the
extreme, and no amount of disaster ever seems sufficient to teach
them. Of such was Mr. Merritt: that strange composed man took fire
within when approaching a whale. He “saw red” as the saying is,
and although handling his boat and using his weapons with
consummate skill, he had not one iota of prudence in his whole
make up.
Now on this momentous occasion, because it was a lone whale,
Captain Taber ordered the chief and fourth officers away, keeping
the other boats in readiness to lower of course should there be any
necessity, but not anticipating that more would be needed. It was a
fine day, but the wind was high and the sea was correspondingly
heavy. According to etiquette Mr. Winsloe was first on the whale,
into which Pepe with his usual skill planted both irons right up to the
hitches. Mr. Merritt lay off a little with his boat, noting with some
surprise that no frantic wallowings and struggling followed the dart.
Assuming, as was most natural, that Pepe had failed to strike the
whale, he pulled up rapidly, having dowsed his own sail, to where
Mr. Winsloe’s men were busy getting their mast down.
When within a couple of boat’s lengths of them all were horrified to
see the huge black head of the whale suddenly rise ghost-wise on
the port bow of the boat, while the gleaming pointed lower jaw
emerged from the water on the starboard side. The view was only
momentary, for as they gazed horror-stricken they saw the great
jaws close, crashing through the flimsy sides of the boat as if she
were of so much paper, and with a yell that rang high above the roar
of wind and sea the crew sprang clear of the wreck for their lives.
But C. B.’s eagle eye noticed on the instant that the harponeer had
disappeared, and in a second he had leapt from the boat into the
vortex caused by the wallowing of the whale, dived and caught at a
black mass far beneath the surface, the body of Pepe entangled by
the whale line. Fortunately at that moment the whale, disdaining to
seek safety in flight, returned to the surface, and consequently there
was little difficulty for such a powerful expert as C. B. to bring his
prize to the surface, free him from the line, and assist him back to
the boat. I say assist, for Pepe, though grievously injured, had never
lost consciousness, and in consequence was able to make some
feeble attempts to help himself.
By the time he had been hauled inboard the rest of the crew had
been rescued and the bight of the line, which C. B. had dropped as
soon as he had cleared it from Pepe’s limbs, was picked up and
taken through the notch in the bows, displacing their own line. Now
Mr. Merritt was in his element, danger and difficulty of any kind
seemed to give the needed stimulus to his otherwise sluggish
nature. Charging the rescued crew to double bank the oars, and
placing the injured man in the bottom of the boat, he changed ends
with C. B. and awaited the onslaught of the whale.
That monster played the usual waiting game, just appearing for an
instant to spout, and then only exposing the point of the snout
where the spiracle or blow-hole is situated. He was waiting his
opportunity to perform the same operation on the second boat as he
had done on the first. But Merritt seemed to have placed himself in
absolute correspondence with the whale’s mind, for each time that
either the great flukes or the ponderous jaws appeared above water
the boat by a quiet order had been driven to a safe distance, and
the threatened blow or bite did not take effect. In fact the queer
yellow man was playing the waiting game also, knowing that the
whale’s exertions were rapidly tiring him out.
For, strange to say, vast as is the strength possessed by these
monsters, they tire very soon when they have to exert themselves
much. And it is only when they are allowed to take things easily, as
sometimes happens through cowardice or unskilfulness on the part
of the whalemen, that they are able to weary out their aggressors
and finally emerge the victors in the long fight. At last Merritt saw
with a chuckle of delight that the whale was going to rush him head
and head as we call it. He had his bomb gun ready to hand, and
laying down his hand lance he put it to his shoulder, crying—
“Now, stern all hard and keep her just as she heads, Christmas.”
With so much power at the oars the boat rushed swiftly astern as
the whale came rushing on, the great head rearing high out of water
and exposing the gleaming white cavern of the throat.
Coolly, as if ashore at some practising ground, Merritt took aim and
pulled the trigger. There was a splash, a report, and an appalling
commotion in the sea ahead of the boat, in the midst of which
another report was heard, the explosion of the bomb within the
whale’s body. “Way ’nough,” shouted Merritt, and the boat stopped a
cable’s length away from the place where the mighty mammal was
tearing up the deep in his Titanic death throes. For a few moments
the scene was appalling, almost akin to a submarine volcanic
eruption, then the uproar suddenly ceased and the magnificent
beast lay dead, listlessly tossing upon the waves which the exuding
oil from his wounds turned into smooth hummocks of water quietly
rising and falling around.
The tumult had hardly subsided when the second boat ranged
alongside with orders to Mr. Merritt to return at once with his
overmanned boat. And he obeyed cheerfully, because nothing is
more annoying than to try and work in a boat where the hands, by
reason of their being too many, get in one another’s way, this being
especially so when, as was now the case, one man grievously hurt
was lying in the bottom of the boat. They soon reached the ship and
climbed on board, Mr. Winsloe hastening to the skipper and
reporting the catastrophe, while all hands rallied on to the falls and
ran the boat up with Pepe’s unconscious body in it. He was tenderly
lifted out and carried aft on to a mattress, where his clothes were
removed, disclosing the severe nature of his injuries. The whale had
evidently nipped him sideways, for the great teeth of the lower jaw
had made eleven ghastly bruises, each four or five inches across,
and in three places the clothing was driven deep into the blackened
flesh. Three of the largest ribs were broken, and the right arm was
horribly lacerated by the whale line being twisted round it under a
great strain.
But owing to the bluntness of the teeth there had been no loss of
blood, except in so far as it had blackened and spread under the
skin, which of course was highly dangerous from the possibility of
mortification and the absence of any but the rudest surgery.
However, all that could be done for the poor wretch by way of
cooling lotions and bandages was done, and he regained
consciousness to fall into a refreshing sleep.
Meanwhile the crew had toiled fiercely under the direction of the
mate to get their prize alongside, finding as it was hauled near that
its dimensions were more imposing than they had imagined.
Measured along the rail it was roughly seventy feet in length, which
is as far as is accurately known about the limit of size for a cachalot,
while as it lay on its side, its jaw parallel to the ship, it looked as
imposing in size as a vessel of two or three hundred tons bottom up.
The fluke chain was passed without difficulty, and all the available
force of harponeers and officers that could get at it attacked it at
once with almost desperate energy, for it was getting late in the day,
the night promised to be very dark, and none relished the prospect
of pursuing that gigantic task without other light save that afforded
by the feeble cressets. To Mr. Merritt and C. B. fell the task of
severing the monstrous head, a labour which it is most difficult to
realize. There is but a slight crease in the place where a neck ought
to be, and here the carcass is nearly twenty feet through—a mass of
muscle and sinew with scarcely any soft parts, and right in the
centre of it the huge ball and socket joint of the vertebrae which is
composed of bones nearly two feet thick. And if those spades
plunging down into the depths of that mass darkly (for it is
impossible to keep the scarph open) should miss the joint, as it is
exceedingly likely they may, the additional work is tremendous. I
have seen this task occupy the labours of the whole of the officers
and harponeers of a ship, relieving one another at frequent intervals,
for a whole day.
But this huge toil is but little greater than that which is being
prosecuted at the same time by the others, all of whom are
balanced upon the precarious plank of the cutting in stage,
suspended far out over the side and springing to every roll of the
ship. There is the junk to be divided from the head, a mass weighing
eight to ten tons cut diagonally from the lower point of the upper
jaw, and there is also the huge oblong mass of the case, or really
half the remainder of the head, to be cut through, where a careless
lunge of the spade may cause the leakage of all the valuable
spermaceti which it holds in a liquid state. In this immense task
strength avails little unless allied to skill, and skill is of small use
without strength and endurance to keep driving the spade in the
right place.
In a small whale, as I have hinted before, these operations are much
simplified, because the head can be cut off and hoisted on deck,
where the work of severing junk and case is quite easy. But as now
the whale was of the largest size and most of the work had to be
done upon the huge masses rolling and tumbling in the unquiet sea
beneath, all the strength, patience, and endurance possessed by the
workers were needed to the very limit. At last the head came off,
and a great groan of relief went up from Merritt and C. B., whose
arms felt as if they would drop off through sheer weariness. But
there was no prospect of rest, the only relief they could hope for
was a change in their movements bringing a different set of muscles
into play. The blubber hook had long been in position affixed to the
eyepiece, and no sooner did the huge mass of the head surge astern
than the high clear voice of the captain rose—
“Heave away there cheerily now, I want to see how quick ye can
skin this whale.”
He was answered by an incessant clattering of the pawls as the
windlass brakes flew up and down, and the first blanket piece of
blubber, a foot thick and nine feet wide, rose majestically into the air.
As soon as the blocks of the tackle came together the windlass
stopped, while the captain, armed with a formidable boarding-knife
like a cutlass blade stuck in a long wooden handle, cut a big circular
hole in the centre of the blanket piece, thrust the strap of the
waiting tackle through it and secured it by a large wooden toggle,
shouting as he slipped it into its place, “Heave on yer whale, my
hearties, heave on yer whale: surge on yer piece!”
“Oh what a jargon,” I think I hear some reader say wearily. I’m
sorry, but it can’t be helped. It only means that the men at the
windlass heave on the second tackle and let the fall of the first slip
round the windlass barrel. Then as soon as the second tackle has
taken the strain “Vast heaving” is called, while the captain with his
boarding-knife cuts through the blanket piece high above the hole
he made for the securing of the second tackle and the mass, now
disengaged, is lowered into the blubber room.
It sounds like a lengthy process but really is not, for in the present
instance the captain’s appeal was answered so well that in twenty-
five minutes the whole of that vast carcass was denuded of its
blubber and had floated away, the centre of a ravening horde of
sharks.
CHAPTER XI
The Story of a Crime
From that eventful evening the friendship between these two most
strangely assorted chums deepened in force until every man in the
ship knew certainly, what he had only suspected before, that
whoever took it in hand to do despite to one of them would surely
have to reckon with the other. And that knowledge had a wholly
quietening and sweetening effect upon all hands. Every one knew by
this time, knew intimately, that C. B.’s principles were of a high and
noble kind, that he would always be on the side of the good and
true, and would be ready to put up with much trouble and
annoyance from anybody rather than assert himself. But they all
knew also that his chum Merritt was of a totally different stamp.
They felt that, given what he considered cause, he would as soon kill
a man as eat an orange, and they were afraid that if they offended
C. B. and Merritt got to know of it, he might suddenly apply his own
method of chastisement to the offender.
And so the Eliza Adams became a most eminently peaceful as well
as hard-working ship. Captain Taber used to gaze admiringly upon
the quiet gangs working here and there, with never a voice upraised
in anger, and say to his mate, “Winsloe, I’ve often said that the day
of miracles was long past, but I ain’t so sure now. You and me
always looked upon the old hooker as a good ship, an’ by jingo, she
was a good ship compared with lots that we’ve known, a perfect
little galley of angels, but they was a good deal of rough house at
times in order to keep her good, now wasn’t they?”
“True ’nough, captain,” sententiously assented Winsloe, “men must
be kep’ in hand.”
“That’s just my point, Winsloe,” eagerly interrupted the skipper.
“Ever since the weltin’ that Merritt gave Pepe she ain’t wanted no
keepin’ in order, she’s been an abode of peace; y’ haven’t had t’
raise yer voice above a whisper to get everything done on the
instant. Whatever is it in this young fellow that makes such a change
in everybody that comes near him? Some fellows hate him like
pizen, others freeze to him like Merritt, an’ yet he doesn’t do or say
anythin’ except his plain duty.”
“I guess I don’t know, sir,” yawned Winsloe as if tired of the subject.
“S’long as a man does his work ’thout giving trouble I ain’t usin’ my
brains on his character. Don’t make no sort o’ difference t’ me.”
“Ah, I see,” murmured the skipper, and turned away, fully convinced
in his own mind that Mr. Winsloe did not view C. B. with any favour,
in fact, was a man of that strange mind calibre, that praise of any
other man, whether affecting him or not, acted upon him like a
personal affront.
Thereafter for a space of three months, during which they continued
to cruise the off-shore ground with fair success, taking altogether
some four hundred barrels of oil, no incident occurred worth making
special mention of here. Only it could not escape the notice of any
unbiassed observer like the skipper, how, with the exception of the
other boat steerers and the three officers above Merritt, all the crew
seemed to worship C. B.; their faces brightened whenever they saw
him. And then there came another explosion with Pepe again, who
seemed to have grown moodier and more sullen, although he was
just as good a whaleman as he had ever been.
It was during the trying out of some oil, just at the change of
watches, that one of C. B’s boat’s crew, coming hurriedly on deck,
charged into Pepe, who stood wiping his hands by the mincer,
having just relinquished the baler to C. B., standing on the try-works
platform. It was a pure accident, due to the quantity of oil on deck.
And besides, the man, a Yankee from Vermont, was not in the best
of health, for he was suffering from a severe outbreak of painful
boils. But Pepe sprang to his feet and seized the unfortunate fellow
by the throat, forcing him against the rail, and had already struck
him a heavy blow in the face, when C. B. leaped from his place on
the platform, and snatching Pepe’s just descending arm cried, “Let
the man alone!”
Pepe turned like a baffled tiger, all teeth and snarl, and grappled C.
B., everything forgotten but his present desire to do harm to the one
who had got in his way.
A serious smile was on C. B.’s face as he easily held the furious man
who, lost to all sense of danger, strove to get at his knife. Seeing or
rather feeling this, C. B. lost his temper and, freeing his right arm,
struck at Pepe’s face once, twice, with crushing force; then as if
maddened beyond endurance he clasped Pepe in his arms and
dashed him against the bulwarks where he lay limp and motionless.
C. B.’s anger passed as rapidly as it had kindled, and falling on his
knees in the oil by the side of the unconscious man he tore open the
breast of his shirt and felt his breast, finding to his immense relief
that his heart was beating, though feebly.
Then rising, he lifted the limp body in his strong arms and bore it aft
out of the way of the oil. He was about to get some restoratives
when a hand was laid on his arm, and turning he saw Merritt who
said—
“Looky here! no more foolin’ with that nigger. He ain’t hurt any
worth speakin’ of, an’ you’re only spoilin’ him. ’Sides, your pot wants
lookin’ after. Get back t’ yer work and leave him t’ learn his lesson.”
C. B. obeyed mechanically, but with a dull feeling of regret at his
heart, for he was afraid of that demon that had so suddenly arisen
within him, remembering keenly as he did the last occasion when it
had done so. And as he went on with his baling, he prayed fervently
to be delivered from what he felt was the awful danger of taking a
fellow-creature’s life in anger.
All the while he was thus accusing himself the rest of the watch,
with the exception of Mr. Spurrell, who was asleep and heard
nothing of the fray, were almost beside themselves with joy at the
thought that the gentle kindly fellow whom they all loved could on
occasion use the great strength they knew he possessed not only in
self-defence but for the defence of others. The man whom he had
rescued, in particular, was from thenceforward his devoted slave; no
one could say a word even remotely disparaging C. B., but he was
upon them like a faithful dog in defence of his master. And strangest
of all, C. B. never heard another word about it from anybody. Pepe
was all right to all appearance at the change of watches, and if the
captain knew he never mentioned it.
Now I fear that there are many good people who will feel that C. B.
was woefully lacking in what they consider should be the first
attribute of the Christian—the ability and grace to submit not only to
any violence offered to themselves, but to witness any shameful
oppression of others with the same meekness of spirit. I verily
believe, I must believe, judging from what I read written by these
people and what I have heard them say, that if they saw the last
extremity of murderous outrage being offered to their nearest and
dearest they would only drop upon their knees and pray that God
would pardon the perpetrators; they would not dare to interfere,
actively, nor if they were able would they allow others to do so. Nay
more, if any person did interfere, and in defence of their children
happened to shed the blood of the aggressors, they would be the
first to call him or them murderers.
It is an attitude of mind which I do not pretend to understand, but
one that is all too common and widespread to ignore. It is far
removed from the spirit of the ancient martyrs, in that its professors
are usually the very first to cry out for protection of their own bodies
and property by the forces of the law. And I can only characterize
such people by the plain old name of coward. More, I do not believe
that God saves a man to make him a coward, but to make him as
brave as was the Gentle Saviour when he scourged the infamous
rabble out of the Temple, alone and unaided. But our curious
weaklings would have reserved their wrath for the scourge wielder,
their pity for the scoundrels. Would! nay do so every day, as the
columns of our newspapers bear witness.
And now the time approaches when C. B. is to endure the heaviest
temptation of all. The season was over on the off-shore ground, and
the good ship was put under all sail for the Sandwich Islands, it
being the captain’s intention to visit Honolulu to refit there and
replenish with wood and water. As soon as the news became known
all hands went nearly wild with delight, for in those days Honolulu
was a place where, in spite of the efforts of the missionaries, scenes
of the wildest licence and debauchery took place upon the arrival of
a whaleship whose captain was kindly disposed enough to give his
crew liberty and money. Reminiscences of former excesses were now
on everybody’s tongue, even the taciturn Merritt became almost
garrulous in describing to his chum what he considered to be the
attractions of Honolulu and its environs.
In his innocence and ignorance C. B. listened greedily to these tales,
and asked many questions, which made Merritt grin and wonder
loudly that any man should be so fresh and green as he put it. And
there was no one to warn, nothing to give any hint as to the
foulness of what was coming. More than that, there was an uneasy
sense in C. B.’s mind of being gradually estranged from the high and
holy thoughts which had always been his precious possession, even
his prayers were becoming perfunctory as the scenes so vividly
depicted by the conversation of his fellows rose before his mental
vision and his curiosity with regard to them grew stronger.
They made a very fine and uneventful passage to the islands,
arriving off Honolulu in the early dawn of a perfect day, and working
into the harbour, where four other whaleships were lying at anchor,
in the usual easy seaman-like fashion of those ships. The vessel was
moored smartly, and the order given to furl all sail, and in carrying
out this order an incident occurred which brings into my story for a
little while a man who has not received any but cursory mention and
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com