Professional Documents
Culture Documents
Download ebook Artificial Intelligence Methods For Optimization Of The Software Testing Process With Practical Examples And Exercises Uncertainty Computational Techniques And Decision Intelligence 1St Edition S online pdf all chapter docx epub
Download ebook Artificial Intelligence Methods For Optimization Of The Software Testing Process With Practical Examples And Exercises Uncertainty Computational Techniques And Decision Intelligence 1St Edition S online pdf all chapter docx epub
https://ebookmeta.com/product/computational-intelligence-based-
optimization-of-manufacturing-process-for-sustainable-
materials-1st-edition-deepak-sinwar/
https://ebookmeta.com/product/data-driven-decision-making-using-
analytics-computational-intelligence-techniques-1st-edition/
https://ebookmeta.com/product/software-engineering-artificial-
intelligence-networking-and-parallel-distributed-computing-
studies-in-computational-intelligence-1012-roger-lee-editor/
https://ebookmeta.com/product/combating-fake-news-with-
computational-intelligence-techniques-studies-in-computational-
intelligence-1001-mohamed-lahby/
Advanced Computational Methods in Mechanical and
Materials Engineering (Computational Intelligence
Techniques) 1st Edition Taylor & Francis Group
https://ebookmeta.com/product/advanced-computational-methods-in-
mechanical-and-materials-engineering-computational-intelligence-
techniques-1st-edition-taylor-francis-group/
https://ebookmeta.com/product/optimization-of-sustainable-
enzymes-production-artificial-intelligence-and-machine-learning-
techniques-1st-edition-j-satya-eswari/
https://ebookmeta.com/product/artificial-intelligence-for-
business-optimization-research-and-applications-1st-edition-
unhelkar-bhuvan/
https://ebookmeta.com/product/illustrated-computational-
intelligence-examples-and-applications-1st-edition-priti-
srinivas-sajja/
https://ebookmeta.com/product/computational-statistical-
methodologies-and-modeling-for-artificial-intelligence-1st-
edition-priyanka-harjule/
ARTIFICIAL
INTELLIGENCE
METHODS FOR
OPTIMIZATION OF THE
SOFTWARE TESTING
PROCESS
Uncertainty, Computational Techniques, and
Decision Intelligence Book Series
Series Editors
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.
Another random document with
no related content on Scribd:
trade for ten days. As many as 20,000 horses are brought there for
sale from Beder, which is 20 kors distant, and besides every
description of goods; and that fair is the best throughout the land of
Hindostan. Everything is sold or bought in memory of Shikhbaludin,
whose fête falls on the Russian festival of the Protection of the Holy
Virgin (1st October).
In that Aland (Aladinand?) there is a bird, gukuk, that flies at night
and cries gukuk, and any roof it lights upon, there the man will die;
and whoever attempts to kill it will see fire flashing from its beak.
Wild cats rove at night and catch fowls; they live in the hills and
among stones. As to monkeys, they live in the woods and have their
monkey knyaz, who is attended by a host of armed followers. When
any of them is caught they complain to their knyaz, and an army is
sent after the missing; and when they come to a town they pull down
the houses and beat the people; and their armies, it is said, are
many. They speak their own tongues and bring forth a great many
children; and when a child is unlike its father or its mother, it is
thrown out on the highroad. Thus they are often caught by the
Hindoos, who teach them every sort of handicraft, or sell them at
night, that they might not find their way home, or teach them
dancing.—From India in the Fifteenth Century, in the Hakluyt Society
Publications, London, 1857.
FOOTNOTES:
If I wrote everything that took place around the city, there would be
a whole book of it. But it is worth mentioning that they used charms
against the Christian army by which they caused a great rainstorm.
From the beginning of the siege, and when the sun just began to
rise, there walked out upon the walls of the city, in our sight, now
their old men, now their women, and they began to howl satanic
words, all the time waving their garments to our army and turning
around in an improper manner. Then there arose a wind, clouds
were formed, however clear the day may have begun, and there
came such a downpour of rain that all the dry places were changed
into bogs and filled with water. And this happened only over our
army, and not elsewhere, so that it did not proceed from the
condition of the atmosphere.
Seeing this, the Tsar was advised to send to Moscow for the wood
from the Saviour’s cross, which is worked into the rood that always
lies near the crown of the Tsar. With God’s aid, they reached
Moscow in a very short time, travelling by water to Nízhni Nóvgorod
in swift Vyátka boats, making the journey in three or four days, and
from Nóvgorod to Moscow by fast relays. When the rood was
brought, into which is worked the wood from the Saviour’s cross on
which our Lord Jesus Christ suffered in the flesh for men, the
presbyters made a procession with Christian ceremonies and
blessed the water according to church use; through the vivifying
power of the cross, the pagan charms disappeared from that very
hour completely....
At the end of the seventh week[115] of the city’s investment, we
were ordered to prepare the next day before daybreak for a general
assault. This was to be the signal: when the powder would explode
and would demolish the wall, which had previously been undermined
and under which forty-eight barrels of powder had been placed.
More than half of the infantry was ordered to the assault, a third of
the army, or a little more, remaining in the field to guard the Tsar. We
were ready early in the morning, as we were ordered, about two
hours before daybreak. I was sent to make the assault at the lower
gate, above the river Kazán, and I had with me twelve thousand
soldiers. At the four sides of the city were placed strong and brave
men, some of them with large detachments.... The Tsar of Kazán
and his senators had been informed about all this, and they were
prepared against us, as we against them....
Then God helped us! My brother was the first to mount upon the
city wall by a ladder, and other brave soldiers were with him. Hacking
and spearing the Mussulmans about them, they climbed through the
windows of the great tower, and from the tower they rushed down to
the large city gate. The Mussulmans turned their backs on the gate
and ran up the high hill to the Tsar’s court, which was strongly
fortified with a high fence, between palaces and stone mosques. We
after them to the Tsar’s palace, even though we were burdened with
our armour and many brave men had wounds on their bodies, and
very few were left to fight against them. Our army which was left
outside of the city, seeing that we were within and that the Tartars
had run away from the walls, rushed into the city,—and the wounded
that were lying on the ground jumped up, and the dead were
resurrected. And not only they, but those in the camp, the cooks and
those that had been left to watch the horses, and others who follow
with merchandise, all ran into the city, not to fight, but to plunder: that
place was indeed full of the richest booty, gold and silver and
precious stones, and it teemed with sable furs and other costly
things.
FOOTNOTES:
[115] The siege of Kazán began on August 23, and the city was
taken October 2, 1552.
Iván the Terrible. (1530-1584.)
Iván the Terrible united the qualities of a great ruler with
those of a most cruel tyrant. In his long epistles to Kúrbski he
develops a strong sarcastic vein and defends himself with
specious arguments, quoting copiously from the Bible and the
Church Fathers. He denies his cruelty, but admits the
execution of traitors, who, in his case, form an enormous
category.
Our God, the Trinity, who has existed since eternity but now as
Father, Son, and Holy Ghost, has neither beginning nor end; through
Him we live and move about, through Him kings rule and the mighty
write laws. By our Lord Jesus Christ the victorious standard of God’s
only Word and the blessed Cross which has never been vanquished
have been given to Emperor Constantine, first in piety, and to all the
orthodox tsars and protectors of orthodoxy and, in so far as the Word
of God has been fulfillen, they, in eagle’s flight, have reached all the
godly servants of God’s Word, until a spark of piety has fallen upon
the Russian realm. The autocracy, by God’s will, had its origin in
Grand Prince Vladímir, who had enlightened all Russia through the
holy baptism, and the great Tsar Vladímir Monomákh, who had
received memorable honours from the Greeks, and the valiant great
Tsar Alexander Névski, who had obtained a great victory over the
godless Germans, and the praiseworthy great Tsar Dmítri, who had
obtained a great victory over the Hagarites beyond the Don, then it
passed to the avenger of wrongs, our ancestor, the great Tsar Iván,
the gatherer of the Russian land from among the ancestral
possessions, and to our father of blessed memory, the great Tsar
Vasíli, until it reached us, the humble sceptre-bearer of the Russian
empire.
But we praise God for the great favour He has shown me in not
permitting my right hand to become stained by the blood of my race:
for we have not snatched the realm from anyone, but by the will of
God and the blessing of our ancestors and parents, were we born in
the realm, were brought up there and enthroned, taking, by the will of
God and the blessing of our ancestors and parents, what belonged
to us, and not seizing that which was not ours. Here follows the
command of the orthodox, truly Christian autocrat, the possessor of
many kingdoms,—our humble, Christian answer to him who was an
orthodox, true Christian and a boyár of our realm, a councillor and a
general, but now is a criminal before the blessed, vivifying cross of
the Lord, a destroyer of Christians, a servant of the enemies of
Christianity, who has departed from the divine worship of the images
and has trodden under foot all sacred commands, destroyed the holy
edifices, vilified and trampled the holy vessels and images, who
unites in one person Leo the Isaurian, Constantine Kopronymos and
Leo of Armenia,—to Prince Andréy Mikháylovich Kúrbski, who
through treachery wanted to become a ruler of Yarosláv.
Wherefore, O Prince, if you regard yourself to have piety, have you
lost your soul? What will you give in its place on the day of the
terrible judgment? Even if you should acquire the whole world, death
will reach you in the end! Why have you sold your soul for your
body’s sake? Is it because you were afraid of death at the false
instigation of your demons and influential friends and counsellors?...
Are you not ashamed before your slave Váska Shibánov, who
preserved his piety and, having attached himself to you with a kiss of
the cross, did not reject you before the Tsar and the whole people,
though standing at the gate of death, but praised you and was all too
ready to die for you? But you did not emulate his devotion: on
account of a single angry word of mine, have you lost not only your
own soul, but the souls of all your ancestors: for, by God’s will, had
they been given as servants to our grandfather, the great Tsar, and
they gave their souls to him and served him up to their death, and
ordered you, their children, to serve the children and grandchildren
of our grandfather. But you have forgotten everything and
traitorously, like a dog, have you transgressed the oath and have
gone over to the enemies of Christianity, and, not considering your
wrath, you utter stupid words, hurling, as it were, stones at the sky....
We have never spilled blood in the churches. As for the victorious,
saintly blood,—there has none appeared in our land, as far as we
know. The thresholds of the churches: as far as our means and
intelligence permit and our subjects are eager to serve us, the
churches of the Lord are resplendent with all kinds of adornments,
and through the gifts which we have offered since your satanic
domination, not only the thresholds and pavements, but even the
antechambers shine with ornaments, so that all the strangers may
see them. We do not stain the thresholds of the churches with any
blood, and there are no martyrs of faith with us now-a-days....
Tortures and persecutions and deaths in many forms we have
devised against no one. As to treasons and magic, it is true, such
dogs everywhere suffer capital punishment....
It had pleased God to take away our mother, the pious Tsarítsa
Helen, from the earthly kingdom to the kingdom of heaven. My
brother George, who now rests in heaven, and I were left orphans
and, as we received no care from any one, we laid our trust in the
Holy Virgin, and in the prayers of all the saints, and in the blessing of
our parents. When I was in my eighth year, our subjects acted
according to their will, for they found the empire without a ruler, and
did not deign to bestow their voluntary attention upon us, their
master, but were bent on acquiring wealth and glory, and were
quarrelling with each other. And what have they not done! How many
boyárs, how many friends of our father and generals they have
killed! And they seized the farms and villages and possessions of our
uncles, and established themselves therein. The treasure of our
mother they trod under foot and pierced with sharp sticks, and
transferred it to the great treasure, but some of it they grabbed
themselves; and that was done by your grandfather Mikháylo
Tuchkóv. The Princes Vasíli and Iván Shúyski took it upon
themselves to have me in their keeping, and those who had been the
chief traitors of our father and mother they let out of prison, and they
made friends with them. Prince Vasíli Shúyski with a Judas crowd fell
in the court belonging to our uncle upon our father confessor Fedór
Mishúrin, and insulted him, and killed him; and they imprisoned
Prince Iván Fedórovich Byélski and many others in various places,
and armed themselves against the realm; they ousted metropolitan
Daniel from the metropolitan see and banished him: and thus they
improved their opportunity, and began to rule themselves.
Me and my brother George, of blessed memory, they brought up
like vagrants and children of the poorest. What have I not suffered
for want of garments and food! And all that against my will and as did
not become my extreme youth. I shall mention just one thing: once in
my childhood we were playing, and Prince Iván Vasílevich Shúyski
was sitting on a bench, leaning with his elbow against our father’s
bed, and even putting his foot upon it; he treated us not as a parent,
but as a master ... who could bear such presumption? How can I
recount all the miseries which I have suffered in my youth? Often did
I dine late, against my will. What had become of the treasure left me
by my father? They had carried everything away, under the cunning
pretext that they had to pay the boyár children from it, but, in reality,
they had kept it back from them, to their own advantage, and had not
paid them off according to their deserts; and they had also held back
an immense treasure of my grandfather and father, and made it into
gold and silver vessels, inscribing thereupon the names of their
parents, as if they had been their inheritance.... It is hardly necessary
to mention what became of the treasure of our uncles: they
appropriated it all to themselves! Then they attacked towns and
villages, tortured the people most cruelly, brought much misery upon
them, and mercilessly pillaged the possessions of the inhabitants....
When we reached the age of fifteen, we, inspired by God,
undertook to rule our own realm and, with the aid of almighty God,
we ruled our realm in peace and undisturbed, according to our will.
But it happened then that, on account of our sins, a fire having
spread, by God’s will, the royal city of Moscow was consumed. Our
boyárs, the traitors whom you call martyrs, whose names I shall
purposely pass over in silence, made use of the favourable
opportunity for their mean treachery, whispered into the ears of a
stupid crowd that the mother of my mother, Princess Anna Glínski,
with all her children and household, was in the habit of extracting
men’s hearts, and that by a similar sorcery she had put Moscow on
fire, and that we knew of her doings. By the instigation of these our
traitors, a mass of insensate people, crying in the manner of the
Jews, came to the apostolic cathedral of the holy martyr Dimítri of
Selún, dragged out of it our boyár Yúri Vasílevich Glínski, pulled him
inhumanly into the cathedral of the Assumption, and killed the
innocent man in the church, opposite the metropolitan’s place; they
stained the floor of the church with his blood, dragged his body
through the front door, and exposed him on the market-place as a
criminal,—everybody knows about this murder in the church. We
were then living in the village of Vorobévo; the same traitors
instigated the populace to kill us under the pretext (and you, dog,
repeat the lie) that we were keeping from them Prince Yúri’s mother,
Princess Anna, and his brother, Prince Mikhaíl. How is one not to
laugh at such stupidity? Why should we be incendiaries in our own
empire?...
You say that your blood has been spilled in wars with foreigners,
and you add, in your foolishness, that it cries to God against us. That
is ridiculous! It has been spilled by one, and it cries out against
another. If it is true that your blood has been spilled by the enemy,
then you have done your duty to your country; if you had not done
so, you would not have been a Christian but a barbarian:—but that is
not our affair. How much more ours, that has been spilled by you,
cries out to the Lord against you! Not with wounds, nor drops of
blood, but with much sweating and toiling have I been burdened by
you unnecessarily and above my strength! Your many meannesses
and persecutions have caused me, instead of blood, to shed many
tears, and to utter sobs and have anguish of my soul....
You say you want to put your letter in your grave: that shows that
you have completely renounced your Christianity! For God has
ordered not to resist evil, but you renounce the final pardon which is
granted to the ignorant; therefore it is not even proper that any mass
shall be sung after you. In our patrimony, in the country of Lifland,
you name the city of Volmir as belonging to our enemy, King
Sigismund: by this you only complete the treachery of a vicious
dog!...
Written in our great Russia, in the famous, royal capital city of
Moscow, on the steps of our imperial threshold, in the year from the
creation of the world 7072, the fifth day of July.
The Domostróy. (XVI. century.)
The Domostróy, i. e., House-government, is an important
document of the sixteenth century, as it throws a light on the
inner life of the Russians in the time of Iván the Terrible. Its
authorship is ascribed in the extant manuscripts to Sylvester,
the adviser of Iván the Terrible, but it is assumed that he was
only the last compiler of various codes of conduct that were
known in Russia before his day. At least, the whole production
bears the stamp of being a composite work. Two distinct
groups are discerned in it: the first has continual references to
the Tsar and the honours due him; the other deals with a
society whose chief interest is purely commercial, and
appeals to the judgment of the people, instead of to that of the
Tsar. From this the inference is drawn that the first had its
origin in Moscow, the second in Nóvgorod. The morality of the
Domostróy is one of external formalism. To preserve
appearances before God and men is, according to this code,
the chief aim in life.
Punish your son in his youth, and he will give you a quiet old age,
and restfulness to your soul. Weaken not beating the boy, for he will
not die from your striking him with the rod, but will be in better health:
for while you strike his body, you save his soul from death. If you
love your son, punish him frequently, that you may rejoice later.
Chide your son in his childhood, and you will be glad in his
manhood, and you will boast among evil persons, and your enemies
will be envious. Bring up your child with much prohibition, and you
will have peace and blessing from him. Do not smile at him, or play
with him, for though that will diminish your grief while he is a child, it
will increase it when he is older, and you will cause much bitterness
to your soul. Give him no power in his youth, but crush his ribs while
he is growing and does not in his wilfulness obey you, lest there be
an aggravation and suffering to your soul, a loss to your house,
destruction to your property, scorn from your neighbours and ridicule
from your enemies, and cost and worriment from the authorities.
HOW CHRISTIANS ARE TO CURE DISEASES AND ALL KINDS
OF AILMENTS
If God send any disease or ailment down upon a person, let him
cure himself through the grace of God, through tears, prayer, fasting,
charity to the poor, and true repentance. Let him thank the Lord and
beg His forgiveness, and show mercy and undisguised charity to
everybody. Have the clergy pray to the Lord for you, and sing the
mass. Sanctify the water with the holy crosses and holy relics and
miracle-working images, and be anointed with the holy oil. Frequent
the miracle-working and holy places, and pray there with a pure
conscience. In that way you will receive from God a cure for all your
ailments. But you must henceforth abstain from sin, and in the future
do no wrong, and keep the commands of the spiritual fathers, and do
penance. Thus you will be purified from sin, and your spiritual and
bodily ailment will be cured, and God will be gracious to you.
In all affairs of every-day life, the wife is to take counsel with her
husband, and to ask him, if she needs anything. Let her be sure that
her husband wants her to keep company with the guests she invites,
or the people she calls upon. Let her put on the best garment, if she
receives a guest, or herself is invited somewhere to dinner. By all
means let her abstain from drinking liquor, for a drunk man is bad
enough, but a drunk woman has no place in the world. A woman
ought to talk with her lady-friends of handwork and housekeeping.
She must pay attention to any good word that is said in her own
house, or in that of her friend: how good women live, how they keep
house, manage their household, instruct their children and servants,
obey their husbands, and ask their advice in everything, and submit
to them. And if there be aught she does not know, let her politely
inquire about it.... It is good to meet such good women, not for the
sake of eating and drinking with them, but for the sake of good
converse and information, for it is profitable to listen to them. Let not
a woman rail at anyone, or gossip about others. If she should be
asked something about a person, let her answer: “I know nothing
about it, and have heard nothing of it; I do not inquire about things
that do not concern me; nor do I sit in judgment over the wives of
princes, boyárs, or my neighbours.”
Enjoin your servants not to talk about other people. If they have
been among strangers, and have noticed anything bad there, let
them not repeat it at home; nor should they bruit about what is going
on at home. A servant must remember what he has been sent for,
and he must not know, nor answer any other questions that are put
to him. The moment he has carried out his commission, he should
return home and report to his master in regard to the matter he has
been sent for; let him not gossip of things he has not been ordered to
report, lest he cause quarrel and coldness between the masters.
If you send your servant, or son, to tell, or do something, or buy a
thing, ask him twice: “What have I ordered you to do? What are you
to say, or do, or buy?” If he repeats to you as you have ordered him,
all is well.... If you send anywhere some eatables or liquids, send full
measures, so that they cannot lie about them. Send your wares after
having measured or weighed them, and count the money, before you
send it out. Best of all, dispatch under seal. Carefully instruct the
servant whether he is to leave the things at the house, if the master
be absent, or if he is to bring them back home....
When a servant is sent to genteel people, let him knock at the
door softly. If anyone should ask him, as he passes through the
courtyard: “What business brings you here?” let him not give him any
satisfaction, but say: “I have not been sent to you; I shall tell to him
to whom I have been sent.” Let him clean his dirty feet before the
ante-chamber, or house, or cell, wipe his nose, clear his throat, and
correctly say his prayer; and if he does not receive an “amen” in
response, he should repeat the prayer in a louder voice, twice or
three times. If he still receives no answer, he must softly knock at the
door. When he is admitted, he should bow before the holy images,
give his master’s respects, and tell his message. While doing so, let
him not put his finger in his nose, nor cough, nor clean his nose, nor
clear his throat, nor spit. If he absolutely must do so, let him step
aside. He must stand straight and not look to either side when
reporting the message; nor should he relate any matter not relevant
to the message. Having done his duty, he should forthwith return
home, to report to his master.
Songs Collected by Richard James. (1619-1620.)
Richard James, a graduate of Oxford, had been sent to
Russia to look after the spiritual welfare of the young
Englishmen who were connected with the Merchant
Company. He arrived in Moscow on January 19, 1619, and
started back by the way of Arkhángelsk on August 20 of the
same year. Having been shipwrecked, he was compelled to
pass the winter in Kholmogóry, from which place he left for
England the next spring. He took with him a copy of six songs
that some Russian had written out for him: they are now
deposited in the Bodleian Library. These songs are interesting
as being the oldest folksongs collected in Russia, and as
having been composed immediately after the events which
they describe.
The Song of the Princess Kséniya Borísovna is given in W.
R. Morfill’s Story of Russia, New York and London, 1890.