diff --git a/.gitattributes b/.gitattributes
index bd92eef841867f97aafdd4bb69777e05ca346124..df1edb9dd7a56f2fa4a188e11325afd5d794adf5 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -73,3 +73,10 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
09[[:space:]]-[[:space:]]Iteration[[:space:]]Statements[[:space:]](Loops)[[:space:]]in[[:space:]]Java/006[[:space:]]Jump[[:space:]]Statements[[:space:]]-[[:space:]]Break[[:space:]]and[[:space:]]Continue.mp4 filter=lfs diff=lfs merge=lfs -text
09[[:space:]]-[[:space:]]Iteration[[:space:]]Statements[[:space:]](Loops)[[:space:]]in[[:space:]]Java/007[[:space:]]Labels[[:space:]]in[[:space:]]Java.mp4 filter=lfs diff=lfs merge=lfs -text
09[[:space:]]-[[:space:]]Iteration[[:space:]]Statements[[:space:]](Loops)[[:space:]]in[[:space:]]Java/011[[:space:]]Homework[[:space:]]review[[:space:]]Iteration[[:space:]]Statements[[:space:]](Loops).mp4 filter=lfs diff=lfs merge=lfs -text
+10[[:space:]]-[[:space:]]Methods[[:space:]]in[[:space:]]Java/001[[:space:]]Methods[[:space:]]in[[:space:]]Java[[:space:]]Overview.mp4 filter=lfs diff=lfs merge=lfs -text
+10[[:space:]]-[[:space:]]Methods[[:space:]]in[[:space:]]Java/003[[:space:]]Recursive[[:space:]]methods.mp4 filter=lfs diff=lfs merge=lfs -text
+10[[:space:]]-[[:space:]]Methods[[:space:]]in[[:space:]]Java/004[[:space:]]Variable[[:space:]]Length[[:space:]]Arguments.mp4 filter=lfs diff=lfs merge=lfs -text
+10[[:space:]]-[[:space:]]Methods[[:space:]]in[[:space:]]Java/002[[:space:]]Parameter[[:space:]]Passing[[:space:]]Mechanism[[:space:]]in[[:space:]]Java.mp4 filter=lfs diff=lfs merge=lfs -text
+10[[:space:]]-[[:space:]]Methods[[:space:]]in[[:space:]]Java/016[[:space:]]Homework[[:space:]]review[[:space:]]Methods.mp4 filter=lfs diff=lfs merge=lfs -text
+101[[:space:]]-[[:space:]]Manage[[:space:]]a[[:space:]]Scrum[[:space:]]Team[[:space:]]with[[:space:]]ChatGPT/001[[:space:]]Managing[[:space:]]Scrum[[:space:]]&[[:space:]]Risk[[:space:]]Management[[:space:]]with[[:space:]]Custom[[:space:]]Bot,[[:space:]]Slack[[:space:]]&[[:space:]]GPT.mp4 filter=lfs diff=lfs merge=lfs -text
+100[[:space:]]-[[:space:]]GPT[[:space:]]+[[:space:]]Slack[[:space:]]+[[:space:]]Jira[[:space:]]+[[:space:]]Gmail[[:space:]]Integration/002[[:space:]]Generate[[:space:]]Tickets[[:space:]]in[[:space:]]Jira[[:space:]]&[[:space:]]Send[[:space:]]Email[[:space:]]from[[:space:]]Slack[[:space:]]via[[:space:]]Chat[[:space:]]Interface.mp4 filter=lfs diff=lfs merge=lfs -text
diff --git a/10 - Methods in Java/001 Methods in Java Overview.mp4 b/10 - Methods in Java/001 Methods in Java Overview.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..818f8d1827d87abacfc5d4ef4bb843c2224a889a
--- /dev/null
+++ b/10 - Methods in Java/001 Methods in Java Overview.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:627a31a23e2811b65840db0629a054ddc13f14f3a877e264d29c67769ffc0d31
+size 38302045
diff --git a/10 - Methods in Java/002 Parameter Passing Mechanism in Java.mp4 b/10 - Methods in Java/002 Parameter Passing Mechanism in Java.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..6588781f9f8429fb0b265d1a0d9cd69eeec4aa23
--- /dev/null
+++ b/10 - Methods in Java/002 Parameter Passing Mechanism in Java.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a317e8b4d649b65e1182aac23e829430c7491bb6d9049972ca8053090548fa1b
+size 61515873
diff --git a/10 - Methods in Java/003 Recursive methods.mp4 b/10 - Methods in Java/003 Recursive methods.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..eef83a8b254a07118e2148125dac85ff88542f40
--- /dev/null
+++ b/10 - Methods in Java/003 Recursive methods.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b79a2d8b1a9611e02b4a2af70a144b03c73ac10daf48b171c447bc13d039a6be
+size 22474004
diff --git a/10 - Methods in Java/004 Variable Length Arguments.mp4 b/10 - Methods in Java/004 Variable Length Arguments.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..b784eaaadb3167c7561699a538bf37f3ad7d6725
--- /dev/null
+++ b/10 - Methods in Java/004 Variable Length Arguments.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:500960247a70e5e1815e9620c00473673fec3ec3e8eb554fce153dc47e34e89f
+size 38829454
diff --git a/10 - Methods in Java/016 Homework review Methods.mp4 b/10 - Methods in Java/016 Homework review Methods.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..3cebad70ca5076010ec65b4b5e5e1e7bb5365650
--- /dev/null
+++ b/10 - Methods in Java/016 Homework review Methods.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2ec3836738219c901096ee674e66f44e2e9f960253bb06daff4d22f79662f2e9
+size 8842296
diff --git a/100 - GPT + Slack + Jira + Gmail Integration/002 Generate Tickets in Jira & Send Email from Slack via Chat Interface.mp4 b/100 - GPT + Slack + Jira + Gmail Integration/002 Generate Tickets in Jira & Send Email from Slack via Chat Interface.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..c2ee0cdac93d93e17c6a0060b10f73886945aee1
--- /dev/null
+++ b/100 - GPT + Slack + Jira + Gmail Integration/002 Generate Tickets in Jira & Send Email from Slack via Chat Interface.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:21ad7a31a0e9fd6236fffe7d2bf533cb8682f6ae66f22b9680c36882ecf26e21
+size 378985718
diff --git a/101 - Manage a Scrum Team with ChatGPT/001 Managing Scrum & Risk Management with Custom Bot, Slack & GPT.mp4 b/101 - Manage a Scrum Team with ChatGPT/001 Managing Scrum & Risk Management with Custom Bot, Slack & GPT.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..a6d8d95fa0a9e5f7450eec2291038b47318b9198
--- /dev/null
+++ b/101 - Manage a Scrum Team with ChatGPT/001 Managing Scrum & Risk Management with Custom Bot, Slack & GPT.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:dbc23537524bf7d13d3b47c5531f3c16825d31cc175e7d2950490ee42919cfcb
+size 114695073
diff --git a/30 - Java Reflection API/001 Source-code-of-example-from-the-lesson.url b/30 - Java Reflection API/001 Source-code-of-example-from-the-lesson.url
new file mode 100644
index 0000000000000000000000000000000000000000..5a9759d11a0bb93b1f903dbec4a7f1e8a1e5eb38
--- /dev/null
+++ b/30 - Java Reflection API/001 Source-code-of-example-from-the-lesson.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/src/com/itbulls/learnit/javacore/reflection/Demo.java
\ No newline at end of file
diff --git a/30 - Java Reflection API/002 Annotations_en.srt b/30 - Java Reflection API/002 Annotations_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..83c1381387443c169cb94177c0105ecd550f537e
--- /dev/null
+++ b/30 - Java Reflection API/002 Annotations_en.srt
@@ -0,0 +1,1072 @@
+1
+00:00:06,000 --> 00:00:06,000
+Hello, Jim.
+
+2
+00:00:06,000 --> 00:00:12,000
+Today we're going to learn with you what annotations are, how to work with them and how to create new
+
+3
+00:00:12,000 --> 00:00:12,000
+ones.
+
+4
+00:00:12,000 --> 00:00:18,000
+Before we start this lesson, I must say that it is critically important you watching previous lesson
+
+5
+00:00:18,000 --> 00:00:20,000
+about Reflection API.
+
+6
+00:00:20,000 --> 00:00:26,000
+If you skip that one, please make sure you watch it, because in this lesson, we are going to use
+
+7
+00:00:26,000 --> 00:00:29,000
+Réflexion API to work with annotations.
+
+8
+00:00:29,000 --> 00:00:35,000
+Basically, there is not so much as a ways for us to take advantage from annotations without knowing
+
+9
+00:00:35,000 --> 00:00:36,000
+the Reflection API.
+
+10
+00:00:37,000 --> 00:00:39,000
+In this lesson, we're going to learn everything.
+
+11
+00:00:39,000 --> 00:00:45,000
+The related to annotations will start from the definition of annotation, make you understand what annotations
+
+12
+00:00:45,000 --> 00:00:47,000
+are on the standard banner.
+
+13
+00:00:47,000 --> 00:00:53,000
+We are going to discuss use cases when annotations may be applied and for what purposes.
+
+14
+00:00:53,000 --> 00:00:57,000
+After that, we will start reviewing of the source code examples.
+
+15
+00:00:57,000 --> 00:01:02,000
+I will explain you what targets annotation is and what retention annotation is.
+
+16
+00:01:02,000 --> 00:01:09,000
+We are going to create our own custom annotation and you are going to understand how to create it and
+
+17
+00:01:09,000 --> 00:01:09,000
+process it.
+
+18
+00:01:10,000 --> 00:01:15,000
+And at the end of the lesson, I will also explain you how to create repeatable annotations.
+
+19
+00:01:15,000 --> 00:01:16,000
+Let's stop.
+
+20
+00:01:17,000 --> 00:01:20,000
+And the first question that we have to answer sounds like this.
+
+21
+00:01:21,000 --> 00:01:22,000
+What is annotation?
+
+22
+00:01:22,000 --> 00:01:27,000
+Annotation as a form of metadata provides data about programs.
+
+23
+00:01:27,000 --> 00:01:30,000
+It is not part of the program itself.
+
+24
+00:01:30,000 --> 00:01:35,000
+Annotations have no direct effect on the operation of the court.
+
+25
+00:01:35,000 --> 00:01:38,000
+They annotate the understands this definition.
+
+26
+00:01:39,000 --> 00:01:40,000
+The know what is metadata.
+
+27
+00:01:41,000 --> 00:01:50,000
+Metadata is a data that provides information about other data or similar data about data in program,
+
+28
+00:01:50,000 --> 00:01:57,000
+and we can annotate types, colossus and interfaces, fields, masses, parameters, constructors,
+
+29
+00:01:57,000 --> 00:02:01,000
+local variables, packages, modules and others.
+
+30
+00:02:01,000 --> 00:02:04,000
+We can even annotate annotation itself.
+
+31
+00:02:05,000 --> 00:02:11,000
+Basically, there might be cases when you need to provide more information about your code and use this
+
+32
+00:02:11,000 --> 00:02:18,000
+information on different stages on the level of the source code during compilation and at this stage
+
+33
+00:02:18,000 --> 00:02:18,000
+of the runtime.
+
+34
+00:02:19,000 --> 00:02:25,000
+Late in the lesson we are going to learn this case are some examples I will show you where notation
+
+35
+00:02:25,000 --> 00:02:29,000
+can be applied and how long it will be retained.
+
+36
+00:02:29,000 --> 00:02:36,000
+You already understood what metadata is and what annotation is, but probably it is still not clear
+
+37
+00:02:36,000 --> 00:02:42,000
+for you how this can be helpful and when we need to use annotations in which cases.
+
+38
+00:02:42,000 --> 00:02:45,000
+The first one is information for the compiler.
+
+39
+00:02:46,000 --> 00:02:53,000
+Annotations can be used by the compiler to detect errors or suppress warnings, for example, such popular
+
+40
+00:02:53,000 --> 00:02:54,000
+annotation as override.
+
+41
+00:02:55,000 --> 00:03:02,000
+I am sure you used it already is on purpose or it just added it instead of you overwrite annotation
+
+42
+00:03:02,000 --> 00:03:05,000
+discarded by the compiler during the compilation.
+
+43
+00:03:05,000 --> 00:03:09,000
+And there is a specific purpose of this net information.
+
+44
+00:03:09,000 --> 00:03:14,000
+As you remember, annotation tells us that this method should override method from parent type.
+
+45
+00:03:15,000 --> 00:03:22,000
+Thus, there are specific requirements to access modify which that matter signature and the list of
+
+46
+00:03:22,000 --> 00:03:23,000
+potential exceptions.
+
+47
+00:03:23,000 --> 00:03:32,000
+There is a logical place in juju that analyzes this matter information basically for all methods marked
+
+48
+00:03:32,000 --> 00:03:34,000
+with overrides, this logic is applied.
+
+49
+00:03:35,000 --> 00:03:37,000
+Compile time and deployment time.
+
+50
+00:03:37,000 --> 00:03:45,000
+Processing software tools can process annotation information to generate code, XML files and so forth.
+
+51
+00:03:45,000 --> 00:03:51,000
+For example, such book in the library and do as number in case you have never worked with.
+
+52
+00:03:51,000 --> 00:03:51,000
+No.
+
+53
+00:03:52,000 --> 00:03:53,000
+I will tell you about it.
+
+54
+00:03:53,000 --> 00:03:59,000
+It generates getters and setters for you and also helps you with generating other things.
+
+55
+00:04:00,000 --> 00:04:05,000
+This mechanism also built on top of annotations and reflection API.
+
+56
+00:04:05,000 --> 00:04:12,000
+Basically, you can annotate type was information about methods if you need to be generated, for example.
+
+57
+00:04:12,000 --> 00:04:19,000
+And when you compile your application and upload classes into Java, those masses that you want it to
+
+58
+00:04:19,000 --> 00:04:21,000
+be generated are there on place.
+
+59
+00:04:22,000 --> 00:04:23,000
+Is that clear?
+
+60
+00:04:24,000 --> 00:04:27,000
+And that's a use case of using annotations is runtime processing.
+
+61
+00:04:28,000 --> 00:04:31,000
+Some annotations are available to be excellent at runtime.
+
+62
+00:04:32,000 --> 00:04:35,000
+You can set configuration to retain annotations.
+
+63
+00:04:35,000 --> 00:04:39,000
+Zero zero runtime I will show you is this an example?
+
+64
+00:04:39,000 --> 00:04:41,000
+But let's understand why do we need this?
+
+65
+00:04:42,000 --> 00:04:48,000
+You may need to keep annotations during the runtime to build some logic around this meta information.
+
+66
+00:04:48,000 --> 00:04:50,000
+You're in the program execution.
+
+67
+00:04:50,000 --> 00:04:53,000
+Your homework will be related to this case.
+
+68
+00:04:53,000 --> 00:04:58,000
+I believe that we have learned enough basics to start review and examples.
+
+69
+00:04:58,000 --> 00:05:02,000
+Anyway, I will explain examples as we go and the true.
+
+70
+00:05:02,000 --> 00:05:08,000
+Who believes that understanding of this topic will be easier with source code and the real good examples,
+
+71
+00:05:08,000 --> 00:05:14,000
+rather than with slides for the sake of the demo and this lesson, I created a separate package and
+
+72
+00:05:14,000 --> 00:05:15,000
+separate them a file.
+
+73
+00:05:16,000 --> 00:05:19,000
+You can find them a file in annotations package.
+
+74
+00:05:20,000 --> 00:05:21,000
+Let's start from basics.
+
+75
+00:05:22,000 --> 00:05:24,000
+Let's discuss annotation format.
+
+76
+00:05:24,000 --> 00:05:29,000
+Each annotation is started with at sign, followed by some meaningful name.
+
+77
+00:05:30,000 --> 00:05:36,000
+Z Sign character indicates as a compiler that what follows is an annotation.
+
+78
+00:05:36,000 --> 00:05:41,000
+The annotation can include elements which can be named and zem values.
+
+79
+00:05:41,000 --> 00:05:48,000
+For those elements, elements may contain additional information like in this case, you can see that
+
+80
+00:05:48,000 --> 00:05:50,000
+are used to suppress warnings.
+
+81
+00:05:50,000 --> 00:05:54,000
+Annotation and element value has value types.
+
+82
+00:05:54,000 --> 00:06:01,000
+This is basically for compiler to remove warnings for parameterized, at least in case I would Corman's
+
+83
+00:06:01,000 --> 00:06:02,000
+this annotation.
+
+84
+00:06:02,000 --> 00:06:08,000
+There will be warnings you as a compilation that I am using parameter types without parameter Ryzens.
+
+85
+00:06:09,000 --> 00:06:17,000
+You see this OK and other possible syntax of the similar annotation in case there is only one element
+
+86
+00:06:17,000 --> 00:06:19,000
+is declared inside the annotation.
+
+87
+00:06:20,000 --> 00:06:25,000
+You can omit element key and just put value like in this example.
+
+88
+00:06:25,000 --> 00:06:32,000
+It is also possible to use multiple annotations at once and from Java version eight zero even supports
+
+89
+00:06:32,000 --> 00:06:34,000
+of repeatable annotations.
+
+90
+00:06:34,000 --> 00:06:40,000
+As you can see in this example, a little bit later in our lesson, one will comp the creation of our
+
+91
+00:06:40,000 --> 00:06:41,000
+custom annotations.
+
+92
+00:06:41,000 --> 00:06:44,000
+I will explain you how to create repeatable annotations.
+
+93
+00:06:45,000 --> 00:06:47,000
+Let's open the source code of any annotation.
+
+94
+00:06:48,000 --> 00:06:51,000
+For example, let's look at suppress warnings annotation.
+
+95
+00:06:52,000 --> 00:06:55,000
+As you can see, there is no end in logic and code here.
+
+96
+00:06:56,000 --> 00:07:00,000
+There is no any algorithm or data processing or anything else.
+
+97
+00:07:01,000 --> 00:07:10,000
+Some students ask me then how annotations work, how overwrite annotation works, and all this basically
+
+98
+00:07:10,000 --> 00:07:15,000
+annotations are nothing more than just an information and what you can do.
+
+99
+00:07:15,000 --> 00:07:16,000
+Learn this information.
+
+100
+00:07:17,000 --> 00:07:21,000
+This is up to you, and this logic is programmed in a separate place.
+
+101
+00:07:21,000 --> 00:07:24,000
+OK, that was annotations basics.
+
+102
+00:07:24,000 --> 00:07:29,000
+Now, you know, at least on the high level, what annotations are us?
+
+103
+00:07:29,000 --> 00:07:33,000
+Know known annotations deeper and to learn them better?
+
+104
+00:07:34,000 --> 00:07:36,000
+Let's create our own annotation.
+
+105
+00:07:36,000 --> 00:07:44,000
+If you are already familiar with G-Unit will implement our own kind of test annotation if you are not
+
+106
+00:07:44,000 --> 00:07:45,000
+familiar with your units yet.
+
+107
+00:07:45,000 --> 00:07:46,000
+Just a few words.
+
+108
+00:07:47,000 --> 00:07:49,000
+G-Unit is a framework for unit testing.
+
+109
+00:07:50,000 --> 00:07:56,000
+It provides a lot of different features and the Mournes impossibility to run specific methods separately
+
+110
+00:07:57,000 --> 00:07:59,000
+to execute separate test cases.
+
+111
+00:07:59,000 --> 00:08:06,000
+The purpose of that massive is to reproduce the state of the system as a specific moment of time, and
+
+112
+00:08:06,000 --> 00:08:08,000
+the Cert is expected to be here.
+
+113
+00:08:09,000 --> 00:08:15,000
+All examples will be stored under this package, so you will easily found them in attachments to this
+
+114
+00:08:15,000 --> 00:08:17,000
+lesson in case you want to run examples on your computer.
+
+115
+00:08:18,000 --> 00:08:19,000
+Let's start.
+
+116
+00:08:19,000 --> 00:08:21,000
+I create test annotations.
+
+117
+00:08:21,000 --> 00:08:28,000
+First, I declare annotation in a separate file, and you can see in this example that the use interface
+
+118
+00:08:28,000 --> 00:08:30,000
+here was at sign.
+
+119
+00:08:31,000 --> 00:08:38,000
+The second important step is to add matter annotations to specify the scope and the target of our custom
+
+120
+00:08:38,000 --> 00:08:38,000
+annotation.
+
+121
+00:08:39,000 --> 00:08:43,000
+I'm talking about annotations, zero retention and target.
+
+122
+00:08:44,000 --> 00:08:44,000
+Let's run.
+
+123
+00:08:44,000 --> 00:08:45,000
+What are they?
+
+124
+00:08:46,000 --> 00:08:48,000
+So what do we need to target annotation for?
+
+125
+00:08:49,000 --> 00:08:54,000
+This annotation indicates a context in which an annotation type is applicable.
+
+126
+00:08:55,000 --> 00:09:02,000
+In simple words, where you can use the sanitation target, annotation can take array of any values
+
+127
+00:09:02,000 --> 00:09:04,000
+of element type enum.
+
+128
+00:09:05,000 --> 00:09:08,000
+So even in case you forgot where you can use annotations.
+
+129
+00:09:09,000 --> 00:09:16,000
+Just open element type in them and you would find enum for each possible placement of your annotation.
+
+130
+00:09:16,000 --> 00:09:24,000
+Even despite the fact is, a on annotation may take array of elements in our specific example, we would
+
+131
+00:09:24,000 --> 00:09:33,000
+use only one in a message because in our specific business context, we don't want to allow our client
+
+132
+00:09:33,000 --> 00:09:37,000
+use it in other places is an exhortation is retention.
+
+133
+00:09:38,000 --> 00:09:43,000
+This information indicates how long annotations was annotated.
+
+134
+00:09:43,000 --> 00:09:45,000
+Time are to be retained.
+
+135
+00:09:45,000 --> 00:09:49,000
+That is exactly what we have discussed at the beginning of our lesson.
+
+136
+00:09:49,000 --> 00:09:56,000
+When I explained that annotation may be used during Zabeel time by the compiler and discarded from the
+
+137
+00:09:56,000 --> 00:10:02,000
+class on the glass level but discarded during the anthem, one class is uploaded in.
+
+138
+00:10:03,000 --> 00:10:11,000
+And during runtime, this annotation can take any value of retention policy in them, even in case you
+
+139
+00:10:11,000 --> 00:10:17,000
+forgot what's retention levels for annotations are, you always can open the source code of this in
+
+140
+00:10:17,000 --> 00:10:19,000
+them and explore this.
+
+141
+00:10:19,000 --> 00:10:22,000
+As I said, there's three possible options here.
+
+142
+00:10:22,000 --> 00:10:31,000
+They are source Closs, and one time in our case, we use runtime retention policy because we need this
+
+143
+00:10:31,000 --> 00:10:33,000
+annotation to be retained.
+
+144
+00:10:33,000 --> 00:10:34,000
+That's a runtime.
+
+145
+00:10:34,000 --> 00:10:41,000
+Now, at this time, to add custom elements, imagine that you want to specify expected exception in
+
+146
+00:10:41,000 --> 00:10:47,000
+order we can test negative scenarios, for example, in case we expect exception to be thrown.
+
+147
+00:10:47,000 --> 00:10:49,000
+But there was no any exception.
+
+148
+00:10:49,000 --> 00:10:58,000
+Drone zones This particular test should be considered as field and the stanzas declare an element in
+
+149
+00:10:58,000 --> 00:10:58,000
+annotation.
+
+150
+00:10:58,000 --> 00:11:02,000
+We have to declare mass was the name of the element itself.
+
+151
+00:11:03,000 --> 00:11:06,000
+Return type will be the type of the element.
+
+152
+00:11:06,000 --> 00:11:12,000
+For example, in this specific case, we would like to specify loss of the expected exception.
+
+153
+00:11:12,000 --> 00:11:18,000
+Thus, returns type for this message will be close when we declare this matter.
+
+154
+00:11:18,000 --> 00:11:24,000
+We should remember important things, since this massive can throw an exception.
+
+155
+00:11:24,000 --> 00:11:27,000
+There is a restriction on the return types.
+
+156
+00:11:28,000 --> 00:11:35,000
+Basically, you can return on your primitives string class in them, annotations and arrays of these
+
+157
+00:11:35,000 --> 00:11:36,000
+types.
+
+158
+00:11:36,000 --> 00:11:39,000
+Also, this must has default value.
+
+159
+00:11:40,000 --> 00:11:46,000
+For example, in this particular case, default exception, to be certain is of non plus.
+
+160
+00:11:46,000 --> 00:11:51,000
+This is our custom clause that extends Roble and that basically is empty.
+
+161
+00:11:52,000 --> 00:11:56,000
+This is needed because I can't have default no values.
+
+162
+00:11:56,000 --> 00:12:03,000
+But in case I wouldn't specify, a default value client will be forced to parse the value for this element.
+
+163
+00:12:03,000 --> 00:12:07,000
+But what clients should Boston in case there is no expected exception?
+
+164
+00:12:07,000 --> 00:12:10,000
+That's why I have default non clause here.
+
+165
+00:12:11,000 --> 00:12:14,000
+Similar example of default value in our other element.
+
+166
+00:12:15,000 --> 00:12:19,000
+Each test can be named and default name is empty string.
+
+167
+00:12:19,000 --> 00:12:23,000
+But the client of this code can pass any custom name.
+
+168
+00:12:23,000 --> 00:12:26,000
+One of the restriction was regards the default value.
+
+169
+00:12:26,000 --> 00:12:27,000
+It can't be null.
+
+170
+00:12:28,000 --> 00:12:29,000
+Is that clear?
+
+171
+00:12:29,000 --> 00:12:32,000
+We are done with annotation creation.
+
+172
+00:12:32,000 --> 00:12:34,000
+Let's now understand how to use it.
+
+173
+00:12:35,000 --> 00:12:39,000
+As you can notice, there is no logic defined in the annotation.
+
+174
+00:12:39,000 --> 00:12:46,000
+That means that I should have some place where logic for annotation process is described in this particular
+
+175
+00:12:46,000 --> 00:12:47,000
+example.
+
+176
+00:12:47,000 --> 00:12:53,000
+It can be some tests around the class similar to the G unit, where we have separate runners that can
+
+177
+00:12:53,000 --> 00:12:55,000
+execute my tests.
+
+178
+00:12:56,000 --> 00:12:58,000
+I open tests around the class.
+
+179
+00:12:58,000 --> 00:13:01,000
+It has run tests massive that takes class.
+
+180
+00:13:01,000 --> 00:13:05,000
+It contains tests to run as mass argument.
+
+181
+00:13:05,000 --> 00:13:11,000
+I use this reference to a class object to get the array of all masses.
+
+182
+00:13:11,000 --> 00:13:18,000
+After that, I feel the masses to keep in-stream only masses that have test annotation.
+
+183
+00:13:18,000 --> 00:13:24,000
+After that, I filter all static masses to keep only non static masses in the stream.
+
+184
+00:13:24,000 --> 00:13:28,000
+And now I need to call test my asset on the object.
+
+185
+00:13:28,000 --> 00:13:31,000
+I create new instance using test class.
+
+186
+00:13:32,000 --> 00:13:39,000
+After that, I need to speak logic for annotations that have expected exception and those who don't.
+
+187
+00:13:39,000 --> 00:13:42,000
+You remember that annotations results?
+
+188
+00:13:42,000 --> 00:13:47,000
+Bits of fired by client exception still has exception was not by default.
+
+189
+00:13:48,000 --> 00:13:55,000
+I use this information during implementation of my logic because in case I expect any exceptions specified
+
+190
+00:13:55,000 --> 00:14:02,000
+by client other than default, I need to check that the expected exception has been thrown come back
+
+191
+00:14:02,000 --> 00:14:04,000
+losses of exceptions thrown.
+
+192
+00:14:04,000 --> 00:14:06,000
+Here is the logic for that.
+
+193
+00:14:07,000 --> 00:14:15,000
+By the way, in a reflection API in case exception has been thrown on the invoked received in the invocation
+
+194
+00:14:15,000 --> 00:14:20,000
+target exception that serves as a wrapper for a regional exception.
+
+195
+00:14:21,000 --> 00:14:29,000
+That's why I need to get course massive here to get the reference to the exception that caused invocation
+
+196
+00:14:29,000 --> 00:14:34,000
+target exception in case I don't expect exception to this rule.
+
+197
+00:14:34,000 --> 00:14:41,000
+Massad just should be executed successfully, and I just invoke mass differently.
+
+198
+00:14:41,000 --> 00:14:47,000
+This is not the full replica of test annotation from G-Unit, but we have a goal in this lesson not
+
+199
+00:14:47,000 --> 00:14:53,000
+to run G-Unit, but to understand how to work with annotations and process zap.
+
+200
+00:14:54,000 --> 00:14:57,000
+Now let me show you class with tests.
+
+201
+00:14:57,000 --> 00:15:00,000
+I open the glass, such as code test samples.
+
+202
+00:15:01,000 --> 00:15:02,000
+This class contains.
+
+203
+00:15:02,000 --> 00:15:05,000
+Is different mascots that are marked with test annotation.
+
+204
+00:15:06,000 --> 00:15:09,000
+Each test has name for the sake of the current demo.
+
+205
+00:15:09,000 --> 00:15:17,000
+I have two test cases here mascots that is executed without exception and massive that throws exception
+
+206
+00:15:17,000 --> 00:15:18,000
+of expected type.
+
+207
+00:15:19,000 --> 00:15:20,000
+Nothing complex here.
+
+208
+00:15:21,000 --> 00:15:27,000
+And now let's write a code that will use my test runner to run these test cases.
+
+209
+00:15:28,000 --> 00:15:32,000
+I open another clause at the so-called test annotation demo.
+
+210
+00:15:33,000 --> 00:15:34,000
+I read instance of test runner.
+
+211
+00:15:35,000 --> 00:15:44,000
+I could run test method and the person's glass that contains my test cases that so let's run this program
+
+212
+00:15:44,000 --> 00:15:45,000
+and console.
+
+213
+00:15:45,000 --> 00:15:53,000
+You can see that test without exception has been passed because we received exception that we expect
+
+214
+00:15:53,000 --> 00:16:01,000
+and test without exception also has been passed because it was executed without any exception.
+
+215
+00:16:02,000 --> 00:16:06,000
+I recommend you to look through the source code that I left in attachments to the lesson.
+
+216
+00:16:06,000 --> 00:16:11,000
+Run it on your local computer to understand better how it works.
+
+217
+00:16:12,000 --> 00:16:16,000
+And the last thing for the desert I'd like to share with you is repeatable annotations.
+
+218
+00:16:17,000 --> 00:16:23,000
+To be honest, in my opinion, this is a very rare case because in case you need to pass multiple values,
+
+219
+00:16:24,000 --> 00:16:30,000
+you always can define additional elements in the original annotation or declare array of values for
+
+220
+00:16:30,000 --> 00:16:31,000
+some element.
+
+221
+00:16:32,000 --> 00:16:39,000
+Anyway, it was hard for me to come up with real life example in this case, but I just want to demonstrate
+
+222
+00:16:39,000 --> 00:16:42,000
+use a feature that was added in Java version eight.
+
+223
+00:16:42,000 --> 00:16:44,000
+Let me open our demo example.
+
+224
+00:16:45,000 --> 00:16:48,000
+Can they see that I have Orser annotation here duplicated?
+
+225
+00:16:49,000 --> 00:16:56,000
+Normally it is not accepted, and to be able to use the same annotation twice for the same element,
+
+226
+00:16:56,000 --> 00:16:59,000
+you need to perform additional actions.
+
+227
+00:17:00,000 --> 00:17:07,000
+The first thing to do is to add annotation, repeatable annotation definition, like I did for Orser
+
+228
+00:17:07,000 --> 00:17:08,000
+annotation.
+
+229
+00:17:08,000 --> 00:17:15,000
+The second thing to do is to create container for repeatable annotations for compatibility reasons.
+
+230
+00:17:15,000 --> 00:17:19,000
+Repeating annotations are stored in a container annotation.
+
+231
+00:17:20,000 --> 00:17:25,000
+In order for the compiler to do this, two declarations are required in your code.
+
+232
+00:17:25,000 --> 00:17:30,000
+That's why another annotation that we need to create is here.
+
+233
+00:17:30,000 --> 00:17:39,000
+I call it Auster's container annotation must have element value that returns array with objects of repeatable
+
+234
+00:17:39,000 --> 00:17:42,000
+annotation type that we want to repeat.
+
+235
+00:17:42,000 --> 00:17:47,000
+In this case, value element will contain array of Orser annotations.
+
+236
+00:17:47,000 --> 00:17:48,000
+Is that clear?
+
+237
+00:17:49,000 --> 00:17:52,000
+Basically, that's all what I wanted to share with you.
+
+238
+00:17:53,000 --> 00:17:55,000
+Let's review what we have learned in this lesson.
+
+239
+00:17:56,000 --> 00:18:03,000
+In this lesson, we have learned what annotation is also explained to you, why we might need an addition
+
+240
+00:18:03,000 --> 00:18:05,000
+and when we can use it.
+
+241
+00:18:05,000 --> 00:18:08,000
+Now, you know where annotations may be applied.
+
+242
+00:18:09,000 --> 00:18:13,000
+You know why we need targeted annotation and you know what element type in them is.
+
+243
+00:18:14,000 --> 00:18:19,000
+Also, you learned what retention annotation is and what retention policy in them is.
+
+244
+00:18:20,000 --> 00:18:21,000
+In the lesson.
+
+245
+00:18:21,000 --> 00:18:27,000
+We created our custom annotation, and at the end of the lesson, I explained to you how to create repeatable
+
+246
+00:18:27,000 --> 00:18:28,000
+annotations.
+
+247
+00:18:29,000 --> 00:18:32,000
+Basically, that's a summary of all what we have learned today.
+
+248
+00:18:32,000 --> 00:18:37,000
+I have a homework for you in order you can practice in creation of annotations.
+
+249
+00:18:37,000 --> 00:18:41,000
+You also can find a link to the whole in attachment to the lesson.
+
+250
+00:18:41,000 --> 00:18:44,000
+Let's understand what you need to do in this task.
+
+251
+00:18:45,000 --> 00:18:49,000
+You need to create to do annotation that will allow us to track the progress of note.
+
+252
+00:18:49,000 --> 00:18:50,000
+Implement that message.
+
+253
+00:18:51,000 --> 00:18:57,000
+To do annotation has different elements such as author, priority and stages.
+
+254
+00:18:57,000 --> 00:19:05,000
+Some of them have default values and also Element doesn't have annotation can be applied only to masses
+
+255
+00:19:05,000 --> 00:19:07,000
+and should be available under on that.
+
+256
+00:19:07,000 --> 00:19:14,000
+We'll see to create separate classes at the school to do analyzer in that class, we should have massive
+
+257
+00:19:14,000 --> 00:19:22,000
+three chance string value that is generated to do report pay attention that in order your homework would
+
+258
+00:19:22,000 --> 00:19:23,000
+be considered to be done.
+
+259
+00:19:24,000 --> 00:19:28,000
+You need to follow specific partners for each method analysis.
+
+260
+00:19:28,000 --> 00:19:30,000
+One is described here.
+
+261
+00:19:30,000 --> 00:19:35,000
+You should specify method name or search priority on stages.
+
+262
+00:19:35,000 --> 00:19:42,000
+Is it clear any way you will be able to find my solution also in attachments does assessment, but try
+
+263
+00:19:42,000 --> 00:19:49,000
+to solve this task without any help and by yourself first and only in case solution is not on this for
+
+264
+00:19:49,000 --> 00:19:49,000
+you.
+
+265
+00:19:49,000 --> 00:19:56,000
+Use my solution as a reference and as always, in case you have any questions, feel free to add your
+
+266
+00:19:56,000 --> 00:19:58,000
+questions in comments on this video.
+
+267
+00:19:59,000 --> 00:20:01,000
+Thanks a lot you for your attention.
+
+268
+00:20:01,000 --> 00:20:04,000
+Have a great day and see in the next lesson.
+
diff --git a/30 - Java Reflection API/002 Homework-Solution.url b/30 - Java Reflection API/002 Homework-Solution.url
new file mode 100644
index 0000000000000000000000000000000000000000..b830cd8f12d4ab11028a8d66171c2f627ca212d4
--- /dev/null
+++ b/30 - Java Reflection API/002 Homework-Solution.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/annotations/hw
\ No newline at end of file
diff --git a/30 - Java Reflection API/002 Homework.url b/30 - Java Reflection API/002 Homework.url
new file mode 100644
index 0000000000000000000000000000000000000000..8c2409d1f881828b7544f79a5cd33cc9465df0b5
--- /dev/null
+++ b/30 - Java Reflection API/002 Homework.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://docs.google.com/document/d/1SFPh7rGW3vyQnOdSLgMg4v-WE_CTEpgVYyWXJkwfCic/edit?usp=sharing
\ No newline at end of file
diff --git a/30 - Java Reflection API/002 Source-code-of-examples-from-the-lesson.url b/30 - Java Reflection API/002 Source-code-of-examples-from-the-lesson.url
new file mode 100644
index 0000000000000000000000000000000000000000..1d2a83caebbec532fe159336acac0ad82f6b77c9
--- /dev/null
+++ b/30 - Java Reflection API/002 Source-code-of-examples-from-the-lesson.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/annotations
\ No newline at end of file
diff --git a/30 - Java Reflection API/external-links.txt b/30 - Java Reflection API/external-links.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a10c49e5b4a8bdf2c2bdde75917f610a6db98d43
--- /dev/null
+++ b/30 - Java Reflection API/external-links.txt
@@ -0,0 +1,12 @@
+
+001 Source-code-of-example-from-the-lesson
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/src/com/itbulls/learnit/javacore/reflection/Demo.java
+
+002 Source-code-of-examples-from-the-lesson
+https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/annotations
+
+002 Homework
+https://docs.google.com/document/d/1SFPh7rGW3vyQnOdSLgMg4v-WE_CTEpgVYyWXJkwfCic/edit?usp=sharing
+
+002 Homework-Solution
+https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/annotations/hw
diff --git a/31 - JDK API/001 Source-code-from-the-lesson.url b/31 - JDK API/001 Source-code-from-the-lesson.url
new file mode 100644
index 0000000000000000000000000000000000000000..068cdb16b07405df53409d557d3a0f9e1ccbc14d
--- /dev/null
+++ b/31 - JDK API/001 Source-code-from-the-lesson.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/string/stringbuilder
\ No newline at end of file
diff --git a/31 - JDK API/001 StringBuilder & StringBuffer_en.srt b/31 - JDK API/001 StringBuilder & StringBuffer_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..791206da3f27088fcc4868d3c9955213c9d52b91
--- /dev/null
+++ b/31 - JDK API/001 StringBuilder & StringBuffer_en.srt
@@ -0,0 +1,760 @@
+1
+00:00:05,000 --> 00:00:06,000
+Hello, Jim.
+
+2
+00:00:06,000 --> 00:00:10,000
+In this lesson, we are going to learn how to work with swing builder and string buffer classes.
+
+3
+00:00:11,000 --> 00:00:14,000
+Also, I'm going to explain why we might need them.
+
+4
+00:00:14,000 --> 00:00:21,000
+We're going to start from understanding what these classes are and why do we need them and want to understand
+
+5
+00:00:21,000 --> 00:00:23,000
+the problems that these classes are supposed to solve.
+
+6
+00:00:24,000 --> 00:00:29,000
+We're going to have practical example where I will explain in detail why you should never forget about
+
+7
+00:00:29,000 --> 00:00:33,000
+string builder and string the buffer in this lesson.
+
+8
+00:00:33,000 --> 00:00:38,000
+I'm going to explain the difference between these two classes and what is even more important.
+
+9
+00:00:38,000 --> 00:00:42,000
+I will teach you when to use these classes and how to use them.
+
+10
+00:00:42,000 --> 00:00:50,000
+I will show you example of string builder and string the bar for usage and also will char sequence interface.
+
+11
+00:00:50,000 --> 00:00:57,000
+Let's start let's try to understand first what a string builder class in the documentation.
+
+12
+00:00:57,000 --> 00:01:02,000
+This class is described as mutable sequence of characters by this moment.
+
+13
+00:01:02,000 --> 00:01:07,000
+Now, of course, you already know that objects of string class are immutable.
+
+14
+00:01:07,000 --> 00:01:13,000
+In short, there's a class designed in the way that you can't change the state of a regional object
+
+15
+00:01:13,000 --> 00:01:15,000
+after it was instantiated.
+
+16
+00:01:16,000 --> 00:01:21,000
+All assets don't modify state of the original string or objects that we created.
+
+17
+00:01:22,000 --> 00:01:28,000
+The class itself is final and you can't override it to change the logic of methods.
+
+18
+00:01:28,000 --> 00:01:35,000
+That means that each time you modify string in your program, you actually create a new object of the
+
+19
+00:01:35,000 --> 00:01:35,000
+string.
+
+20
+00:01:36,000 --> 00:01:42,000
+Yes, you might lose the reference to the string object in case new string object is assigned to the
+
+21
+00:01:42,000 --> 00:01:43,000
+regional variable.
+
+22
+00:01:43,000 --> 00:01:49,000
+And yes, in the case there is no strong references to the object, garbage collector will clean it
+
+23
+00:01:49,000 --> 00:01:49,000
+up.
+
+24
+00:01:50,000 --> 00:01:53,000
+I'm going to show this case in the example later today.
+
+25
+00:01:53,000 --> 00:01:57,000
+But the only question that I want to ask you sounds like this.
+
+26
+00:01:58,000 --> 00:02:02,000
+Do we need to rely on garbage collector and make it work?
+
+27
+00:02:02,000 --> 00:02:07,000
+The answer is no one garbage collector starts its work.
+
+28
+00:02:07,000 --> 00:02:12,000
+It is also some computation time that potentially might be used by US operations.
+
+29
+00:02:12,000 --> 00:02:16,000
+Instead of cleaning up objects without strong references.
+
+30
+00:02:16,000 --> 00:02:22,000
+And by the way, it is important for you to know and remember the difference between different types
+
+31
+00:02:22,000 --> 00:02:23,000
+of references.
+
+32
+00:02:23,000 --> 00:02:29,000
+In case you want to learn more about this topic, make sure you watched my lesson about references where
+
+33
+00:02:29,000 --> 00:02:36,000
+I explained different types of references, but still how to solve a problem of constant creation of
+
+34
+00:02:36,000 --> 00:02:37,000
+string object.
+
+35
+00:02:37,000 --> 00:02:44,000
+If I'm modifying string so the situation might be completely different is a process a lot of strings
+
+36
+00:02:44,000 --> 00:02:50,000
+and you need all of them in one string or you prepare string before writing it to the file.
+
+37
+00:02:51,000 --> 00:02:52,000
+It doesn't matter.
+
+38
+00:02:52,000 --> 00:02:59,000
+But in some hypothetical case, instead of creation, millions of string objects and heap memory, it
+
+39
+00:02:59,000 --> 00:03:04,000
+is recommended to create one object of string, build it up and use it.
+
+40
+00:03:04,000 --> 00:03:09,000
+Does it make sense to understand the motivation of using an object of this type?
+
+41
+00:03:10,000 --> 00:03:10,000
+Great.
+
+42
+00:03:11,000 --> 00:03:14,000
+Let's now understand what a string buffer class is.
+
+43
+00:03:14,000 --> 00:03:21,000
+It would be easy to explain what is this class about because it is almost the same as string builder
+
+44
+00:03:21,000 --> 00:03:21,000
+class.
+
+45
+00:03:22,000 --> 00:03:24,000
+They have similar methods, similar constructors.
+
+46
+00:03:25,000 --> 00:03:27,000
+Literally almost everything is similar.
+
+47
+00:03:27,000 --> 00:03:35,000
+The only difference is that string, the buffer is a safe class and objects of this type might be used
+
+48
+00:03:35,000 --> 00:03:39,000
+in an execution without impact on data consistency.
+
+49
+00:03:39,000 --> 00:03:43,000
+What a lot of training is discussed in the separate section of the course.
+
+50
+00:03:44,000 --> 00:03:51,000
+But still, I would like to remind to all students about multithreaded one more time in in case of Perou
+
+51
+00:03:51,000 --> 00:03:53,000
+execution of multiple threads.
+
+52
+00:03:54,000 --> 00:04:00,000
+When different threads update the state of the string buffer simultaneously or read its data, only
+
+53
+00:04:00,000 --> 00:04:07,000
+one thread is allowed to execute these operations with potential mistakes that may happen because of
+
+54
+00:04:08,000 --> 00:04:09,000
+an axis.
+
+55
+00:04:09,000 --> 00:04:15,000
+That's why everything what I'm going to share with you about String Builder is absolutely applicable
+
+56
+00:04:15,000 --> 00:04:17,000
+to the string buffer in Montessori environment.
+
+57
+00:04:18,000 --> 00:04:24,000
+The rule of thumb is to use three builder whenever is possible because it has better performance.
+
+58
+00:04:25,000 --> 00:04:31,000
+This is just consequences of not having synchronization from multiple threads inside string builder,
+
+59
+00:04:31,000 --> 00:04:38,000
+whereas all mascot's in string buffer are synchronized and this takes additional overhead during the
+
+60
+00:04:38,000 --> 00:04:39,000
+execution.
+
+61
+00:04:39,000 --> 00:04:41,000
+You should be all right with String Builder.
+
+62
+00:04:41,000 --> 00:04:47,000
+In most cases, I believe that you already understood on the high level why we need these classes.
+
+63
+00:04:47,000 --> 00:04:53,000
+It is time to dive deeper in details and understand how to work with objects of this type.
+
+64
+00:04:54,000 --> 00:04:57,000
+And let's start from explaining the hypothetical problem.
+
+65
+00:04:58,000 --> 00:04:59,000
+I have file with stacks.
+
+66
+00:05:00,000 --> 00:05:03,000
+This is lyrics of the song that I listened while.
+
+67
+00:05:03,000 --> 00:05:09,000
+Thinking about the structure of the lesson, the song is called Never Coming Home By Staying Pretty
+
+68
+00:05:10,000 --> 00:05:11,000
+Cool one, by the way.
+
+69
+00:05:11,000 --> 00:05:18,000
+And according to business logic, I need to be able to read text from files and after that work with
+
+70
+00:05:18,000 --> 00:05:20,000
+the content of the file as a whole.
+
+71
+00:05:20,000 --> 00:05:24,000
+For example, text analysis or text statistics is needed.
+
+72
+00:05:25,000 --> 00:05:29,000
+Probably you want to implement programs that would analyze thousands of songs in order.
+
+73
+00:05:29,000 --> 00:05:36,000
+You could find the best rhymes any way you can be in any of other situations that would make it to collect
+
+74
+00:05:36,000 --> 00:05:39,000
+all streams in one string object.
+
+75
+00:05:39,000 --> 00:05:47,000
+I open my example now that is called string build a demo I have mastered that reads all lines from file
+
+76
+00:05:47,000 --> 00:05:52,000
+into one string object and after that I bring the strings to console.
+
+77
+00:05:52,000 --> 00:05:54,000
+Let's review this method.
+
+78
+00:05:54,000 --> 00:06:00,000
+I create the reference of the same time as it is pointing out to the object that is stored in St. Paul.
+
+79
+00:06:01,000 --> 00:06:07,000
+If you don't remember what a string will please refer to as a lesson about string objects and string
+
+80
+00:06:07,000 --> 00:06:09,000
+CPU in my Java course.
+
+81
+00:06:09,000 --> 00:06:14,000
+In the next line I read all lines from file into the list of strings.
+
+82
+00:06:14,000 --> 00:06:20,000
+In case you're interested how I did this, please refer to the section about input output streams in
+
+83
+00:06:20,000 --> 00:06:21,000
+my Java course.
+
+84
+00:06:21,000 --> 00:06:29,000
+After that I iterate and over each line and I concatenate each line with my result string and adding
+
+85
+00:06:29,000 --> 00:06:31,000
+new one character at the end of each line.
+
+86
+00:06:32,000 --> 00:06:34,000
+What is actually happening here?
+
+87
+00:06:34,000 --> 00:06:41,000
+I create a new string object after each concatenation and this string reference pointing out to the
+
+88
+00:06:41,000 --> 00:06:42,000
+new object in memory.
+
+89
+00:06:42,000 --> 00:06:48,000
+Each time after concatenation you are going to have the object that contains the first line.
+
+90
+00:06:48,000 --> 00:06:52,000
+Only the second object would be the first line.
+
+91
+00:06:52,000 --> 00:06:59,000
+And Newline character is a shared object, would be the first line newline character and the second
+
+92
+00:06:59,000 --> 00:07:00,000
+line and so on.
+
+93
+00:07:01,000 --> 00:07:05,000
+Why do you need so many duplication and so many string objects?
+
+94
+00:07:05,000 --> 00:07:09,000
+And that is not a big harm in process in one song.
+
+95
+00:07:09,000 --> 00:07:15,000
+But believe me, you are going to work with files much bigger than we have in our example today.
+
+96
+00:07:15,000 --> 00:07:17,000
+And this is going to become a problem.
+
+97
+00:07:18,000 --> 00:07:19,000
+What would be the solution here?
+
+98
+00:07:19,000 --> 00:07:22,000
+The solution here is to use string build object.
+
+99
+00:07:23,000 --> 00:07:29,000
+Let's look at another method that also read all lines from the file, but do it with help of string
+
+100
+00:07:29,000 --> 00:07:30,000
+builder object.
+
+101
+00:07:30,000 --> 00:07:34,000
+I create object of string, build a type with the default constructor.
+
+102
+00:07:35,000 --> 00:07:37,000
+After that I am doing the same thing.
+
+103
+00:07:37,000 --> 00:07:39,000
+I'm bringing the lines into the list.
+
+104
+00:07:39,000 --> 00:07:41,000
+Object in foreach loop.
+
+105
+00:07:41,000 --> 00:07:45,000
+I call append massata patterns new line and newline character.
+
+106
+00:07:46,000 --> 00:07:51,000
+I need to return a string object from the method so I call to string methods.
+
+107
+00:07:51,000 --> 00:07:54,000
+It creates string object based on my string builder.
+
+108
+00:07:55,000 --> 00:07:55,000
+That's it.
+
+109
+00:07:56,000 --> 00:08:02,000
+To prove you that concatenation of strings with string builder is more efficient, I evaluate the time
+
+110
+00:08:02,000 --> 00:08:04,000
+for both of these separations.
+
+111
+00:08:04,000 --> 00:08:11,000
+I just take amount of milliseconds before the first method invocation and after that I calculate Delta
+
+112
+00:08:11,000 --> 00:08:19,000
+in milliseconds by the doctors the time that I already have from current time after method execution.
+
+113
+00:08:19,000 --> 00:08:24,000
+Following this approach, I can estimate how long does it take to execute code?
+
+114
+00:08:24,000 --> 00:08:26,000
+That is between two points.
+
+115
+00:08:26,000 --> 00:08:30,000
+And I did similar measurement in the second example for String Builder.
+
+116
+00:08:31,000 --> 00:08:37,000
+After that I bring two values to console in order we could have a chance to compare these two values.
+
+117
+00:08:37,000 --> 00:08:45,000
+Let's run the program so you can see the difference in performance with one song of string is approximately
+
+118
+00:08:45,000 --> 00:08:47,000
+ten times more restrained.
+
+119
+00:08:47,000 --> 00:08:49,000
+Object concatenation.
+
+120
+00:08:49,000 --> 00:08:52,000
+Imagine what the difference would be was a gigabyte files.
+
+121
+00:08:53,000 --> 00:08:54,000
+It is crazy.
+
+122
+00:08:54,000 --> 00:08:59,000
+That's why it is important to use string builder during the processing of big number of strings.
+
+123
+00:09:00,000 --> 00:09:06,000
+Basically, we have just removed probably the most popular example of string builder and string bar
+
+124
+00:09:06,000 --> 00:09:07,000
+for usage.
+
+125
+00:09:07,000 --> 00:09:12,000
+But let me also share with you a little bit more details about class structure and other methods.
+
+126
+00:09:13,000 --> 00:09:15,000
+I open the source code of string builder class.
+
+127
+00:09:16,000 --> 00:09:21,000
+And just to remind you, what we are going to review now is absolutely similar in string.
+
+128
+00:09:21,000 --> 00:09:23,000
+The buffer clause was only one exception.
+
+129
+00:09:23,000 --> 00:09:25,000
+Synchronized methods.
+
+130
+00:09:25,000 --> 00:09:28,000
+This is the full constructor calls, constructor of super class.
+
+131
+00:09:29,000 --> 00:09:35,000
+That is abstract string the builder specifying the original capacity of the characters array.
+
+132
+00:09:35,000 --> 00:09:37,000
+By default it is 610.
+
+133
+00:09:38,000 --> 00:09:41,000
+Do not find any Secrett logic behind this number.
+
+134
+00:09:41,000 --> 00:09:42,000
+It is just 16.
+
+135
+00:09:43,000 --> 00:09:48,000
+There is also a string builder within parameter to specify any custom default capacity.
+
+136
+00:09:49,000 --> 00:09:51,000
+One you should use this version of constructor.
+
+137
+00:09:52,000 --> 00:09:55,000
+I believe that you already know how arrays work in Java.
+
+138
+00:09:55,000 --> 00:09:59,000
+You can text extend array that was created already.
+
+139
+00:10:00,000 --> 00:10:02,000
+So to extent existing array you need.
+
+140
+00:10:03,000 --> 00:10:09,000
+To create a bigger array and copy old values in that this is time consuming operation.
+
+141
+00:10:10,000 --> 00:10:16,000
+That's why in case you know that you're going to process a big amount of data, you can set initial
+
+142
+00:10:16,000 --> 00:10:23,000
+capacity in order to avoid concentration of new array objects, to have enough space for all characters.
+
+143
+00:10:23,000 --> 00:10:30,000
+Also, we can create string builder and initialize it with the content of the string object or any char
+
+144
+00:10:30,000 --> 00:10:30,000
+sequence.
+
+145
+00:10:31,000 --> 00:10:37,000
+Short sequence is an interface that is implemented by many different classes in Java, for example,
+
+146
+00:10:37,000 --> 00:10:42,000
+string swing builder, string buffer, abstract string builder and others.
+
+147
+00:10:42,000 --> 00:10:45,000
+All of them implements char sequence interface.
+
+148
+00:10:46,000 --> 00:10:53,000
+This interface declares contract for such mascot's as Lancs to return total number of characters in
+
+149
+00:10:53,000 --> 00:11:01,000
+char sequence char at Richmondshire as a specified index is empty default masset the checks with the
+
+150
+00:11:01,000 --> 00:11:03,000
+Lancs equal to zero returns.
+
+151
+00:11:03,000 --> 00:11:10,000
+True, if character sequence is empty and false, otherwise Subsequence Masset will return char sequence
+
+152
+00:11:10,000 --> 00:11:14,000
+from indexing collusively to indexed exclusively.
+
+153
+00:11:14,000 --> 00:11:16,000
+And you know what the string method does.
+
+154
+00:11:17,000 --> 00:11:22,000
+Also, we are a few more default methods and one Zem Chass returns in stream.
+
+155
+00:11:23,000 --> 00:11:31,000
+Just to remind you that Char easily may be converted to end Y because integer variable specifies sequence
+
+156
+00:11:31,000 --> 00:11:40,000
+number of the character and the Unicode table code points returns in stream where each end will represent
+
+157
+00:11:40,000 --> 00:11:42,000
+characters sequence number in the Unicode table.
+
+158
+00:11:43,000 --> 00:11:49,000
+I will be honest with you, I have never used this method, but at least it is good just to know that
+
+159
+00:11:49,000 --> 00:11:56,000
+such as it exists in learning purposes and static methods that may be used to combat two character sequences.
+
+160
+00:11:57,000 --> 00:12:02,000
+Let's get back to the implementation of a sequence that we are running today.
+
+161
+00:12:02,000 --> 00:12:04,000
+I open string builder class.
+
+162
+00:12:04,000 --> 00:12:10,000
+As you can see in outline here, there are a lot of versions of append method.
+
+163
+00:12:11,000 --> 00:12:16,000
+This method is overloaded to be able to accept parameter of different types.
+
+164
+00:12:16,000 --> 00:12:23,000
+Also, we can delete from char to char, from string builder onto the teacher at the specified index.
+
+165
+00:12:23,000 --> 00:12:28,000
+And again, it is hard for me to come up with an example where you would use this massas on a daily
+
+166
+00:12:28,000 --> 00:12:35,000
+basis, replace Masset from index to index and be replaced with the string.
+
+167
+00:12:36,000 --> 00:12:39,000
+Another method that is overloaded in this class is insert.
+
+168
+00:12:40,000 --> 00:12:44,000
+It is used to insert the specified value at the specified position.
+
+169
+00:12:44,000 --> 00:12:45,000
+It is overloaded.
+
+170
+00:12:45,000 --> 00:12:53,000
+The Different Parameters Index of Masset returns the index within this string of the first occurrence
+
+171
+00:12:53,000 --> 00:12:58,000
+of the specified substring last index of returns.
+
+172
+00:12:58,000 --> 00:13:03,000
+The index within this string of the last occurrence of the specified substring.
+
+173
+00:13:03,000 --> 00:13:10,000
+The last two methods also have overloaded version that additionally it takes one more parameter of time.
+
+174
+00:13:11,000 --> 00:13:15,000
+This is the index from which to start the search reverse.
+
+175
+00:13:15,000 --> 00:13:21,000
+Massata causes this character sequence to be replaced by the reverse of the sequence.
+
+176
+00:13:21,000 --> 00:13:24,000
+That's all methods of string builder class.
+
+177
+00:13:24,000 --> 00:13:30,000
+What I would recommend you open the source code of string builder string, buffer and abstract string
+
+178
+00:13:30,000 --> 00:13:36,000
+to build the class leukocoria through the code and try to play with matches.
+
+179
+00:13:36,000 --> 00:13:41,000
+We have discussed the most important ones and the masses that have chance to be used in production.
+
+180
+00:13:42,000 --> 00:13:48,000
+But in case you would find any other method that you are interested in and you would like to talk more
+
+181
+00:13:48,000 --> 00:13:51,000
+about it, do not hesitate to ask questions below this video.
+
+182
+00:13:51,000 --> 00:13:57,000
+I will be happy to answer all of your questions, but I truly believe that we have learned just enough
+
+183
+00:13:57,000 --> 00:14:02,000
+things in order to be able to start using string builder and string four classes.
+
+184
+00:14:03,000 --> 00:14:06,000
+Now, let's recap what we have learned in this lesson.
+
+185
+00:14:06,000 --> 00:14:10,000
+After this lesson, we know what string builder and string buffer classes are.
+
+186
+00:14:11,000 --> 00:14:17,000
+I believe that you understood the purpose of these classes and use cases when to use them.
+
+187
+00:14:17,000 --> 00:14:20,000
+Also review the char sequence interface today.
+
+188
+00:14:20,000 --> 00:14:22,000
+That's it for this lesson.
+
+189
+00:14:22,000 --> 00:14:24,000
+Thanks a lot for your attention.
+
+190
+00:14:24,000 --> 00:14:27,000
+Have a great day and see you in the next lesson.
+
diff --git a/31 - JDK API/002 Source-code-examples-from-the-lesson.url b/31 - JDK API/002 Source-code-examples-from-the-lesson.url
new file mode 100644
index 0000000000000000000000000000000000000000..d987a5c3315316f728989c089ca3656e9725a8a7
--- /dev/null
+++ b/31 - JDK API/002 Source-code-examples-from-the-lesson.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/optional
\ No newline at end of file
diff --git a/31 - JDK API/002 java.util.Optional - Optional in Java_en.srt b/31 - JDK API/002 java.util.Optional - Optional in Java_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..7cd41494dcad3f84c51a528e2f04015955b81d61
--- /dev/null
+++ b/31 - JDK API/002 java.util.Optional - Optional in Java_en.srt
@@ -0,0 +1,1476 @@
+1
+00:00:06,000 --> 00:00:06,000
+Hello, Jim.
+
+2
+00:00:06,000 --> 00:00:09,000
+In this lesson, we're going to learn optional class API.
+
+3
+00:00:10,000 --> 00:00:16,000
+We're going to start a lesson from the definition of optional class is understanding of the goal and
+
+4
+00:00:16,000 --> 00:00:24,000
+purpose of this class will help you to understand that better known this will be an optional class API.
+
+5
+00:00:24,000 --> 00:00:31,000
+And on real Covid examples I'm going to show you how to work was methods from optional class, and then
+
+6
+00:00:31,000 --> 00:00:33,000
+to the lesson of explaining when to use optional.
+
+7
+00:00:33,000 --> 00:00:40,000
+And you will understand in which cases use of optional will be efficient and will not bring more harm
+
+8
+00:00:40,000 --> 00:00:41,000
+than good.
+
+9
+00:00:41,000 --> 00:00:48,000
+Besides that, I will answer to the question what alternative techniques might be used instead of optional?
+
+10
+00:00:48,000 --> 00:00:49,000
+Let's stop.
+
+11
+00:00:50,000 --> 00:00:53,000
+And let me start from explanation of what optional class is.
+
+12
+00:00:53,000 --> 00:00:54,000
+And why do we need it?
+
+13
+00:00:55,000 --> 00:00:56,000
+Do you know what?
+
+14
+00:00:56,000 --> 00:00:58,000
+No point or exception is?
+
+15
+00:00:58,000 --> 00:00:59,000
+Probably.
+
+16
+00:00:59,000 --> 00:01:04,000
+This is one of the most popular exceptions that interrupts our program execution.
+
+17
+00:01:04,000 --> 00:01:09,000
+Just a reminder to all students that no point or exception is an exception.
+
+18
+00:01:09,000 --> 00:01:10,000
+That's a strong one.
+
+19
+00:01:10,000 --> 00:01:13,000
+We try to invoke some Masset on the reference.
+
+20
+00:01:13,000 --> 00:01:15,000
+It is not initialized.
+
+21
+00:01:15,000 --> 00:01:17,000
+In other words, we have variables.
+
+22
+00:01:17,000 --> 00:01:21,000
+It doesn't store reference to any of objects in the heap memory.
+
+23
+00:01:22,000 --> 00:01:26,000
+And when we call some Massart on the variable, we received no pointer exception.
+
+24
+00:01:26,000 --> 00:01:32,000
+That tells us that we actually can't invoke any Massart on the nothing.
+
+25
+00:01:32,000 --> 00:01:33,000
+Is that clear?
+
+26
+00:01:33,000 --> 00:01:40,000
+And to avoid cases like this, we should never forget to perform no check before any Massart invocation.
+
+27
+00:01:41,000 --> 00:01:47,000
+The new clause that has been introduced in Java eight is supposed to alleviate some problems.
+
+28
+00:01:47,000 --> 00:01:53,000
+In my opinion, the introduction of this class is controversial from one side.
+
+29
+00:01:53,000 --> 00:02:00,000
+It is grades that geoengineers has two legs, this one to indicate places where we may have no potentially.
+
+30
+00:02:00,000 --> 00:02:07,000
+But from the other side, in my opinion, optional class, often used by developers inappropriately
+
+31
+00:02:07,000 --> 00:02:11,000
+and brings into the code more complexity and harm than good.
+
+32
+00:02:11,000 --> 00:02:16,000
+But in this lesson, I will share with you my tips and other you use optional class efficiently.
+
+33
+00:02:17,000 --> 00:02:23,000
+Generally speaking written and no reference from any massata considered to be a bad practice.
+
+34
+00:02:23,000 --> 00:02:30,000
+For example, you call getta on the object that doesn't have all fields initialized yet, and you receive
+
+35
+00:02:30,000 --> 00:02:31,000
+no reference.
+
+36
+00:02:31,000 --> 00:02:32,000
+Indeed.
+
+37
+00:02:32,000 --> 00:02:35,000
+What else you should receive if there is nothing yet?
+
+38
+00:02:36,000 --> 00:02:41,000
+What if a field is really empty and doesn't initialized with any reference yet?
+
+39
+00:02:41,000 --> 00:02:42,000
+Thorney ha.
+
+40
+00:02:43,000 --> 00:02:48,000
+One of the giants of computer science wrote I call it my billion dollar mistake.
+
+41
+00:02:49,000 --> 00:02:53,000
+It was the invention of the no reference in nineteen sixty five.
+
+42
+00:02:53,000 --> 00:03:00,000
+I couldn't resist the temptation to put in a no reference simply because it was so easy to implement.
+
+43
+00:03:01,000 --> 00:03:05,000
+I can add to that it wasn't just so easy to implement.
+
+44
+00:03:05,000 --> 00:03:08,000
+It was also so logical to implement.
+
+45
+00:03:09,000 --> 00:03:13,000
+Let me start sharing my screen to explain the problems that we have today.
+
+46
+00:03:13,000 --> 00:03:14,000
+Is it optional?
+
+47
+00:03:14,000 --> 00:03:21,000
+Closs is intended to solve I open class problem statement from optional package of my little project.
+
+48
+00:03:21,000 --> 00:03:24,000
+In this example, imagine that we have instance of the computer.
+
+49
+00:03:25,000 --> 00:03:32,000
+We have some computer and USB drive, potentially USB drive, maybe plugged in or may not.
+
+50
+00:03:33,000 --> 00:03:40,000
+I can call yet USB drive Massart on my computer object to get the reference to the USB drive in case
+
+51
+00:03:40,000 --> 00:03:42,000
+Nassan is plugged in.
+
+52
+00:03:42,000 --> 00:03:44,000
+I receive no correct.
+
+53
+00:03:44,000 --> 00:03:51,000
+But in case there is a USB drive, I can get access to the right contacts switch to check it state.
+
+54
+00:03:52,000 --> 00:03:55,000
+In this case, I need to perform no check again.
+
+55
+00:03:55,000 --> 00:03:57,000
+Can you see how my code looks like?
+
+56
+00:03:58,000 --> 00:04:03,000
+And the good thing about all this is that I am smart enough to perform such checks.
+
+57
+00:04:03,000 --> 00:04:07,000
+It would be worse in case such checks wouldn't exist at all.
+
+58
+00:04:08,000 --> 00:04:10,000
+And to my program would just fail.
+
+59
+00:04:10,000 --> 00:04:17,000
+Units execution that understands the point, in addition, is just annoying that these checks get in
+
+60
+00:04:17,000 --> 00:04:19,000
+the way of the business logic.
+
+61
+00:04:20,000 --> 00:04:24,000
+In fact, Zedek reasons that overall are the beauty of our program.
+
+62
+00:04:25,000 --> 00:04:27,000
+What would be better than this?
+
+63
+00:04:27,000 --> 00:04:33,000
+It will be better to build data structure that would indicate presence or absence of the value.
+
+64
+00:04:34,000 --> 00:04:35,000
+That's what we need.
+
+65
+00:04:35,000 --> 00:04:36,000
+Optional Class four.
+
+66
+00:04:37,000 --> 00:04:44,000
+So we agreed that we need a mechanism that allows a massive developer to explicitly denote there's a
+
+67
+00:04:44,000 --> 00:04:51,000
+return value for a massive may or may not be present optional class acts as a prop for an object that
+
+68
+00:04:51,000 --> 00:04:53,000
+may not be present.
+
+69
+00:04:53,000 --> 00:04:59,000
+Therefore, if we know that our get USB drive mass, it may not return a desert object.
+
+70
+00:05:00,000 --> 00:05:02,000
+We can change message, return type.
+
+71
+00:05:02,000 --> 00:05:10,000
+Let me open solution class now in this class, you can see is that get USB drive message from my computer
+
+72
+00:05:10,000 --> 00:05:12,000
+class, has the friends or Chen typed now?
+
+73
+00:05:13,000 --> 00:05:16,000
+It is optional parametrized by the USB drive.
+
+74
+00:05:17,000 --> 00:05:18,000
+And then my USB drive.
+
+75
+00:05:18,000 --> 00:05:20,000
+I have also updated through Chintan.
+
+76
+00:05:21,000 --> 00:05:28,000
+Now, is this is optional that this parametrized by rights protects, which did not pay a lot of attention
+
+77
+00:05:28,000 --> 00:05:35,000
+to the details at this moment, namely how we create objects of optional type, why I use this method
+
+78
+00:05:35,000 --> 00:05:36,000
+and didn't use another one.
+
+79
+00:05:36,000 --> 00:05:41,000
+We're going to learn optional gloss in a minute was detailed examples.
+
+80
+00:05:41,000 --> 00:05:46,000
+Now, I'd like you to understand the idea of problem and our solution.
+
+81
+00:05:46,000 --> 00:05:53,000
+In my main mass, you can see that I use features of optional class and they check whether some value
+
+82
+00:05:53,000 --> 00:05:55,000
+is present in my USB drive wrapper.
+
+83
+00:05:56,000 --> 00:06:01,000
+And this present I execute functions that takes USB drive as my argument.
+
+84
+00:06:02,000 --> 00:06:06,000
+Namely, I'm getting access to the switch, which is also optional.
+
+85
+00:06:06,000 --> 00:06:11,000
+And in case it is present, I just print switches state to console.
+
+86
+00:06:12,000 --> 00:06:14,000
+And if no, then nothing.
+
+87
+00:06:14,000 --> 00:06:20,000
+And in case there is no USB drive object inside the wrapper, I execute another function.
+
+88
+00:06:20,000 --> 00:06:22,000
+I just print to console.
+
+89
+00:06:22,000 --> 00:06:24,000
+That USB drive wasn't found.
+
+90
+00:06:24,000 --> 00:06:30,000
+As you can see on this example, optional is a similar to the wrapper that may or may not contains the
+
+91
+00:06:30,000 --> 00:06:33,000
+actual value inside itself.
+
+92
+00:06:33,000 --> 00:06:40,000
+In simple words, you can view optional as a single value container that is a contains a value of doesn't.
+
+93
+00:06:41,000 --> 00:06:44,000
+It isn't set to be empty fullerenes.
+
+94
+00:06:44,000 --> 00:06:49,000
+This construction, you make clients responsible to handle messy value.
+
+95
+00:06:49,000 --> 00:06:51,000
+You're just walking.
+
+96
+00:06:51,000 --> 00:06:56,000
+That value here may not be present and you decide what you want to do.
+
+97
+00:06:56,000 --> 00:07:04,000
+In this case, this client's responsible approach means that creators and Massart is not in the position
+
+98
+00:07:04,000 --> 00:07:07,000
+to define what should be done in case of missing value.
+
+99
+00:07:08,000 --> 00:07:12,000
+Is a sink is to throw exception Maseru an exception?
+
+100
+00:07:12,000 --> 00:07:17,000
+Probably not always the best case and proper behavior according to the business logic in the case of
+
+101
+00:07:17,000 --> 00:07:18,000
+missing value.
+
+102
+00:07:19,000 --> 00:07:23,000
+Now, I wonder, you look at this example with fresh eyes.
+
+103
+00:07:23,000 --> 00:07:29,000
+If Java community and software engineers would like to call this more readable code and simple if URL
+
+104
+00:07:29,000 --> 00:07:32,000
+statement, I am happy to accept it.
+
+105
+00:07:32,000 --> 00:07:36,000
+Really, guys, I just want to we don't lie to ourselves.
+
+106
+00:07:36,000 --> 00:07:43,000
+What we have, instead of if as blogs with a few lambda expressions that are also located inside each
+
+107
+00:07:43,000 --> 00:07:43,000
+other.
+
+108
+00:07:43,000 --> 00:07:50,000
+And moreover, all our mass is written optional now, and we can't just take value and work with it
+
+109
+00:07:50,000 --> 00:07:50,000
+in order.
+
+110
+00:07:50,000 --> 00:07:52,000
+We could avoid no point exception.
+
+111
+00:07:52,000 --> 00:07:56,000
+Well, definitely optional is a very powerful tool.
+
+112
+00:07:56,000 --> 00:08:00,000
+But guys, I can't see what we have want in this case.
+
+113
+00:08:01,000 --> 00:08:06,000
+There are multiple other features in optional that breena's amazing flexibility.
+
+114
+00:08:06,000 --> 00:08:11,000
+And let us write less lines of code with optional than without it.
+
+115
+00:08:12,000 --> 00:08:12,000
+That is true.
+
+116
+00:08:13,000 --> 00:08:20,000
+But again, it should be also a special case to apply those features of optional is a true story from
+
+117
+00:08:20,000 --> 00:08:26,000
+my life is one developer from my team created few classes, was all massive rechanneled, optional type
+
+118
+00:08:26,000 --> 00:08:28,000
+parameterized by other types.
+
+119
+00:08:28,000 --> 00:08:31,000
+I asked him, why would you do that?
+
+120
+00:08:31,000 --> 00:08:37,000
+And he replied, because we need to use optional everywhere where we may receive no.
+
+121
+00:08:37,000 --> 00:08:39,000
+Well, guess not everywhere.
+
+122
+00:08:39,000 --> 00:08:41,000
+And then again, use an optional everywhere.
+
+123
+00:08:42,000 --> 00:08:46,000
+Wouldn't agree with us for the better with the abilities that we are so struggling for.
+
+124
+00:08:46,000 --> 00:08:54,000
+So let's not API optional to better understand its power and understand, jaysus, when and where this
+
+125
+00:08:54,000 --> 00:08:54,000
+might be applicable.
+
+126
+00:08:55,000 --> 00:08:59,000
+I open optional demo class with a lot of examples here.
+
+127
+00:08:59,000 --> 00:09:01,000
+Let me walk you through each example.
+
+128
+00:09:01,000 --> 00:09:09,000
+Seeing the first ones that we are going to review is how to create an object of optional type in most
+
+129
+00:09:09,000 --> 00:09:15,000
+of the cases to create object of type optional when it is static, factor in masses, optional class.
+
+130
+00:09:16,000 --> 00:09:19,000
+The first way to create optional is to call static mass of empty.
+
+131
+00:09:20,000 --> 00:09:22,000
+This is our chance imta optional.
+
+132
+00:09:22,000 --> 00:09:28,000
+The empty mass is often used when it is known apro or is at no value exists.
+
+133
+00:09:28,000 --> 00:09:35,000
+If you have some value and you need to create optional call, static method of attention, you need
+
+134
+00:09:35,000 --> 00:09:42,000
+to have that object behind's a reference that you are going to use to create optional object was of
+
+135
+00:09:42,000 --> 00:09:49,000
+mass, because in case you pass no value to the of method, you will get no point exception.
+
+136
+00:09:49,000 --> 00:09:55,000
+In the case, you know its value behind the reference, Megan, now or may not be now, use another
+
+137
+00:09:55,000 --> 00:09:57,000
+method of nullable.
+
+138
+00:09:58,000 --> 00:10:02,000
+This will create optional object based on the no and no not.
+
+139
+00:10:02,000 --> 00:10:09,000
+Various for example, in previous example, in solution, I used of nullable factor in mass because
+
+140
+00:10:09,000 --> 00:10:14,000
+I knew that I may need to create optional object based on value.
+
+141
+00:10:15,000 --> 00:10:22,000
+Now let's review methods that allow us to check if value is present or absent, that the masses that
+
+142
+00:10:22,000 --> 00:10:27,000
+allow us to check the value inside the optional is present and is empty.
+
+143
+00:10:28,000 --> 00:10:31,000
+Obviously, these masses are controversial.
+
+144
+00:10:31,000 --> 00:10:37,000
+One is present, returns true, is empty, returns false, and vice versa.
+
+145
+00:10:37,000 --> 00:10:38,000
+Here's an example.
+
+146
+00:10:38,000 --> 00:10:46,000
+You can see that I have destry quail and check was an optional is empty or has value and is a similar
+
+147
+00:10:46,000 --> 00:10:48,000
+test for optional that contains Nassan.
+
+148
+00:10:49,000 --> 00:10:53,000
+As a result of method execution, you confront and conceal output.
+
+149
+00:10:54,000 --> 00:10:56,000
+Now let's review example of conditional masses.
+
+150
+00:10:57,000 --> 00:11:03,000
+I call these methods conditional because based on the specific condition, API allows us to perform
+
+151
+00:11:03,000 --> 00:11:05,000
+one or another action.
+
+152
+00:11:06,000 --> 00:11:12,000
+The first method in this example, if present you already you saw me using this method in the example
+
+153
+00:11:12,000 --> 00:11:18,000
+in solution was use B drive F presence method takes consumer as method argument.
+
+154
+00:11:19,000 --> 00:11:25,000
+If you're not familiar with lambda expressions and such function interfaces as consumer, I recommend
+
+155
+00:11:25,000 --> 00:11:26,000
+you to pass my course.
+
+156
+00:11:26,000 --> 00:11:29,000
+Guanciale programming for Giwa Engineers.
+
+157
+00:11:29,000 --> 00:11:32,000
+I explained these topics in detail zere.
+
+158
+00:11:32,000 --> 00:11:37,000
+Just to remind you, consumer takes some argument and returns nothing.
+
+159
+00:11:37,000 --> 00:11:41,000
+So basically, if the value is present, we pass it.
+
+160
+00:11:41,000 --> 00:11:44,000
+Does it function and perform any action?
+
+161
+00:11:44,000 --> 00:11:44,000
+Was it.
+
+162
+00:11:44,000 --> 00:11:47,000
+What we need in this particular example.
+
+163
+00:11:47,000 --> 00:11:51,000
+I just printed to console in case there is no value in optional.
+
+164
+00:11:51,000 --> 00:11:55,000
+We just ignore this function and just do nothing.
+
+165
+00:11:55,000 --> 00:11:59,000
+Another conditional Massart is if present or else.
+
+166
+00:11:59,000 --> 00:12:03,000
+I also use this one in solution of the examples that I have already showed.
+
+167
+00:12:03,000 --> 00:12:09,000
+I believe that from the massive name, it is already clear for you what is this method for.
+
+168
+00:12:09,000 --> 00:12:14,000
+So in case value is present, will use consumer and will work with the value.
+
+169
+00:12:15,000 --> 00:12:22,000
+In the case, value is absent, will execute some random that contains lines of code to be executed.
+
+170
+00:12:22,000 --> 00:12:24,000
+In case there is no value.
+
+171
+00:12:24,000 --> 00:12:28,000
+The next example is simple and regular gets massive.
+
+172
+00:12:28,000 --> 00:12:34,000
+You can extract value from optional Bikel and get mass, but be attentive.
+
+173
+00:12:34,000 --> 00:12:38,000
+In case there is no value, you will get no such element.
+
+174
+00:12:38,000 --> 00:12:38,000
+The exception.
+
+175
+00:12:39,000 --> 00:12:43,000
+And here, in example, you can see this just in case optional is empty.
+
+176
+00:12:43,000 --> 00:12:45,000
+We are catching exception.
+
+177
+00:12:45,000 --> 00:12:49,000
+In practice, it is recommended to use is present.
+
+178
+00:12:49,000 --> 00:12:53,000
+Massett, that guarantees that there is a value inside optional.
+
+179
+00:12:53,000 --> 00:12:55,000
+So just remember this.
+
+180
+00:12:56,000 --> 00:12:58,000
+Let's imagine that we are using is present Massart.
+
+181
+00:12:58,000 --> 00:12:59,000
+OK.
+
+182
+00:12:59,000 --> 00:13:01,000
+Just look at this example.
+
+183
+00:13:01,000 --> 00:13:09,000
+How far it is from no check from our problem statement was if we again have the similar Evelio.
+
+184
+00:13:09,000 --> 00:13:16,000
+That's why in most cases we intentionally award to use the get Masset and use one of the other methods.
+
+185
+00:13:16,000 --> 00:13:17,000
+Such as.
+
+186
+00:13:17,000 --> 00:13:23,000
+Or else or else through top things of value associated with a populated, optional.
+
+187
+00:13:24,000 --> 00:13:25,000
+Or perform another action.
+
+188
+00:13:25,000 --> 00:13:30,000
+Let me show you this in the next example, you can see how to use or else mass.
+
+189
+00:13:31,000 --> 00:13:36,000
+Basically, it returns a value if at this present and in case it does not.
+
+190
+00:13:36,000 --> 00:13:39,000
+It returns the values that they passed as a message.
+
+191
+00:13:39,000 --> 00:13:41,000
+Also, we have or else get method.
+
+192
+00:13:42,000 --> 00:13:45,000
+What is the difference between orals and this?
+
+193
+00:13:45,000 --> 00:13:48,000
+Massively different parameters oils.
+
+194
+00:13:48,000 --> 00:13:51,000
+Yet they supply as methods argument.
+
+195
+00:13:51,000 --> 00:13:54,000
+Supply is a function that produce something.
+
+196
+00:13:54,000 --> 00:13:57,000
+It takes nothing and returns some value.
+
+197
+00:13:57,000 --> 00:13:59,000
+And what does it give us?
+
+198
+00:14:00,000 --> 00:14:03,000
+Well, probably it is not obvious in this particular example.
+
+199
+00:14:04,000 --> 00:14:06,000
+But let's look at the next lines.
+
+200
+00:14:07,000 --> 00:14:14,000
+Imagine that you have some massive that performs a lot of work and calculations and as a result, recharges
+
+201
+00:14:14,000 --> 00:14:19,000
+your reference to string value and then use your call or else Massett.
+
+202
+00:14:19,000 --> 00:14:26,000
+And you would like to parse the string returned by these massive PZM Massett is actually involved.
+
+203
+00:14:27,000 --> 00:14:31,000
+And you spent some time to wait until the mass of the got finished.
+
+204
+00:14:32,000 --> 00:14:35,000
+But is it the same with or else get method?
+
+205
+00:14:35,000 --> 00:14:36,000
+No.
+
+206
+00:14:36,000 --> 00:14:45,000
+Lukins this line you're actually not invoking is a massive you just Parsons's reference to the function
+
+207
+00:14:45,000 --> 00:14:48,000
+that knows how to get the value for you.
+
+208
+00:14:48,000 --> 00:14:50,000
+In case this is needed.
+
+209
+00:14:51,000 --> 00:14:52,000
+This is the main difference.
+
+210
+00:14:53,000 --> 00:15:00,000
+Lasing insolate Zeeshan in the first case we're invoking Massart no matter was an optional has a value
+
+211
+00:15:00,000 --> 00:15:00,000
+on.
+
+212
+00:15:00,000 --> 00:15:00,000
+No.
+
+213
+00:15:01,000 --> 00:15:01,000
+And in.
+
+214
+00:15:01,000 --> 00:15:08,000
+The second case would just use functions that knows how to provide us with value only when it is needed,
+
+215
+00:15:09,000 --> 00:15:11,000
+only when optional has no value.
+
+216
+00:15:12,000 --> 00:15:18,000
+Does it make sense now in case the value is absent and you want to throw an exception.
+
+217
+00:15:18,000 --> 00:15:20,000
+You can use or else throw massive.
+
+218
+00:15:21,000 --> 00:15:23,000
+This method is overloaded.
+
+219
+00:15:23,000 --> 00:15:26,000
+The version without arguments will throw no such element.
+
+220
+00:15:26,000 --> 00:15:28,000
+The exception by default.
+
+221
+00:15:28,000 --> 00:15:35,000
+Or you can post supplier as Mussert argument to generate object of the exception that you would like
+
+222
+00:15:35,000 --> 00:15:35,000
+to throw.
+
+223
+00:15:36,000 --> 00:15:38,000
+Now let's somehow filter Massart works.
+
+224
+00:15:39,000 --> 00:15:45,000
+In case you have the reference to the optional object, you can check it first to understand whether
+
+225
+00:15:45,000 --> 00:15:46,000
+it is much your predicate.
+
+226
+00:15:47,000 --> 00:15:52,000
+And in case verification this past, you receive optional was that value.
+
+227
+00:15:52,000 --> 00:15:55,000
+Otherwise, you receive empty optional.
+
+228
+00:15:55,000 --> 00:15:57,000
+Let me explain this example.
+
+229
+00:15:57,000 --> 00:16:01,000
+Imagine that I have optional that contains my full name.
+
+230
+00:16:01,000 --> 00:16:07,000
+After that, I can call Filton Masset on the optional object and pass predicate.
+
+231
+00:16:07,000 --> 00:16:10,000
+Let me quickly remind you what Prickett is.
+
+232
+00:16:11,000 --> 00:16:14,000
+CreditCard is a functional interface that declares one.
+
+233
+00:16:14,000 --> 00:16:15,000
+Massart is.
+
+234
+00:16:15,000 --> 00:16:19,000
+It takes one argument and the returns is a true or false.
+
+235
+00:16:19,000 --> 00:16:21,000
+So here is my function.
+
+236
+00:16:21,000 --> 00:16:25,000
+I pass full name and I check whether it contains Andry.
+
+237
+00:16:25,000 --> 00:16:33,000
+If yes, then I receive optional with this name when I call, or else I get the reference to my whole
+
+238
+00:16:33,000 --> 00:16:36,000
+name and bring that to console in a similar example.
+
+239
+00:16:36,000 --> 00:16:39,000
+But with a different name, I will get give empty optional.
+
+240
+00:16:40,000 --> 00:16:46,000
+And you can charge this by console output in the second case paren to console the false string that
+
+241
+00:16:46,000 --> 00:16:48,000
+they used in or else methods.
+
+242
+00:16:48,000 --> 00:16:56,000
+Do you understand why we may need to field the method that is normally used to reject wrapt values based
+
+243
+00:16:56,000 --> 00:16:57,000
+on the predefined tool?
+
+244
+00:16:58,000 --> 00:17:04,000
+Imagine now in another case we have a user object, and we need to make sure that the users that we
+
+245
+00:17:04,000 --> 00:17:11,000
+received from database or from another method has Mercier's less than one number than the more than
+
+246
+00:17:11,000 --> 00:17:12,000
+another number.
+
+247
+00:17:13,000 --> 00:17:14,000
+How to do that?
+
+248
+00:17:14,000 --> 00:17:22,000
+We can use map mass simply to convert the rabbit value to another type, Zimet, Mass, that allows
+
+249
+00:17:22,000 --> 00:17:26,000
+us to convert the value from one object to another.
+
+250
+00:17:26,000 --> 00:17:33,000
+If an optional is populated, this method can be thought of as a pipeline method, whereas the rabbit
+
+251
+00:17:33,000 --> 00:17:37,000
+value is passed along the pipeline and transform.
+
+252
+00:17:37,000 --> 00:17:41,000
+Can you value the remember how Stream API works?
+
+253
+00:17:42,000 --> 00:17:43,000
+This similar concept is here.
+
+254
+00:17:44,000 --> 00:17:50,000
+This method works by accepting the function object as it is applied to the rabbit value to produce the
+
+255
+00:17:50,000 --> 00:17:51,000
+mapped value.
+
+256
+00:17:52,000 --> 00:17:58,000
+Even the optional is empty, is a function object is never called, and an empty optional is returned
+
+257
+00:17:58,000 --> 00:18:00,000
+from the map massively.
+
+258
+00:18:00,000 --> 00:18:02,000
+Let me explain your own example.
+
+259
+00:18:02,000 --> 00:18:05,000
+I have optional parametrized by type user.
+
+260
+00:18:05,000 --> 00:18:07,000
+I have arrived here.
+
+261
+00:18:07,000 --> 00:18:08,000
+User object.
+
+262
+00:18:08,000 --> 00:18:14,000
+This user has named Igor and his universe is 1990s.
+
+263
+00:18:14,000 --> 00:18:21,000
+I call map Massart on my optional object to convert data in the pipeline from user to an end.
+
+264
+00:18:22,000 --> 00:18:27,000
+I need to pass functions that knows how to transform the current type thing.
+
+265
+00:18:28,000 --> 00:18:35,000
+And when I have int value in pipeline, I can use filter mass to check was a year of birth of the current
+
+266
+00:18:35,000 --> 00:18:38,000
+user is within the expected range.
+
+267
+00:18:38,000 --> 00:18:44,000
+In this case, my user matches the current filters and optional was very is returned.
+
+268
+00:18:45,000 --> 00:18:49,000
+That's why I can print the user's Berthier tokens.
+
+269
+00:18:49,000 --> 00:18:55,000
+So what does this example please let me know in case you have any questions in case something is still
+
+270
+00:18:55,000 --> 00:18:56,000
+unclear.
+
+271
+00:18:56,000 --> 00:18:57,000
+Please.
+
+272
+00:18:57,000 --> 00:18:59,000
+What's your question below this video?
+
+273
+00:18:59,000 --> 00:19:02,000
+And there will be happy to answer it.
+
+274
+00:19:02,000 --> 00:19:06,000
+Let's review another method that is similar to those in Map Mass.
+
+275
+00:19:06,000 --> 00:19:11,000
+Let's have the flat map Masset as an alternative for values transformation.
+
+276
+00:19:12,000 --> 00:19:15,000
+There is one main difference between these two masses.
+
+277
+00:19:15,000 --> 00:19:21,000
+The difference is that map transforms values only when Xe unwrap.
+
+278
+00:19:21,000 --> 00:19:27,000
+Whereas flat map takes a wrapped value and unwraps it before transforming it.
+
+279
+00:19:28,000 --> 00:19:32,000
+Let's make sure that you understood this following Z example.
+
+280
+00:19:32,000 --> 00:19:41,000
+So imagine that we keep working with the same user, but interested in sync in a mass returns, optional
+
+281
+00:19:41,000 --> 00:19:45,000
+to, for example, get name Massart, which is optional.
+
+282
+00:19:45,000 --> 00:19:47,000
+It is parametrized by string.
+
+283
+00:19:48,000 --> 00:19:48,000
+No.
+
+284
+00:19:48,000 --> 00:19:54,000
+And all what we know that's extracted from the optional parameterized by type user.
+
+285
+00:19:55,000 --> 00:20:00,000
+The first thing that I do, I want to convert optional of user to the just name.
+
+286
+00:20:00,000 --> 00:20:01,000
+What I got instead.
+
+287
+00:20:02,000 --> 00:20:07,000
+Instead, I got optional parameterized by optional the disbursements surprised by string.
+
+288
+00:20:07,000 --> 00:20:11,000
+That is because my get name Masset returns optional.
+
+289
+00:20:11,000 --> 00:20:16,000
+Having this wrapper, I can extract optional parameterized by a string.
+
+290
+00:20:17,000 --> 00:20:22,000
+It should contain the name of the user, and only after that I can extract user.
+
+291
+00:20:23,000 --> 00:20:30,000
+Don't you think that they added a lot of redundant steps similar to the Stream API from Jaedicke?
+
+292
+00:20:30,000 --> 00:20:35,000
+So that map doesn't rabs the value was additional optional.
+
+293
+00:20:35,000 --> 00:20:42,000
+So to achieve the same goal in a little bit simpler way is to call threads, map and parse the references
+
+294
+00:20:42,000 --> 00:20:43,000
+to get name message.
+
+295
+00:20:44,000 --> 00:20:49,000
+And now I can apply Ozz masses to extract value like or message.
+
+296
+00:20:50,000 --> 00:20:54,000
+And in console, you can see that the results are the same.
+
+297
+00:20:54,000 --> 00:20:59,000
+But the second option, Dukas, less lines of code to achieve is the same result.
+
+298
+00:20:59,000 --> 00:21:00,000
+Does it make sense?
+
+299
+00:21:01,000 --> 00:21:08,000
+In my opinion, we have removed all the most important masses from optional API that might come in handy.
+
+300
+00:21:08,000 --> 00:21:15,000
+But any way opens a source code of GMU to optional class by yourself and investigated.
+
+301
+00:21:15,000 --> 00:21:21,000
+Now let's discuss when and how to use optional to make sure it is not dangerous and you don't bring
+
+302
+00:21:21,000 --> 00:21:23,000
+more harm than good.
+
+303
+00:21:24,000 --> 00:21:27,000
+Let's review different parts of our program and different use cases.
+
+304
+00:21:28,000 --> 00:21:30,000
+And I will give you my advice.
+
+305
+00:21:30,000 --> 00:21:31,000
+Return values.
+
+306
+00:21:32,000 --> 00:21:35,000
+Often optionals are well suited for a chance values.
+
+307
+00:21:36,000 --> 00:21:43,000
+Originally, this was intended to be zem main use case in documentation that we can find.
+
+308
+00:21:43,000 --> 00:21:44,000
+Is it optional?
+
+309
+00:21:44,000 --> 00:21:52,000
+Type is primarily intended for use as a message, Chantae, where there is a growing need to represent
+
+310
+00:21:52,000 --> 00:21:53,000
+no result.
+
+311
+00:21:53,000 --> 00:21:57,000
+And we're using now is likely to cause errors.
+
+312
+00:21:57,000 --> 00:22:04,000
+And here I'd like to pay you extra attention in order you wouldn't follow code style of colleague of
+
+313
+00:22:04,000 --> 00:22:08,000
+mine who has all methods developed this optional type return.
+
+314
+00:22:09,000 --> 00:22:16,000
+You should return optional as of this set where there is a clear need to represent no result.
+
+315
+00:22:17,000 --> 00:22:22,000
+And we're using now is likely to cause errors, not everywhere.
+
+316
+00:22:23,000 --> 00:22:27,000
+But still, this recommendation leaves error for interpretations.
+
+317
+00:22:27,000 --> 00:22:30,000
+I would also add one more important thing to consider.
+
+318
+00:22:31,000 --> 00:22:38,000
+Use optional only in cases when you want to make client of your code responsible for handling of absent
+
+319
+00:22:38,000 --> 00:22:39,000
+value.
+
+320
+00:22:39,000 --> 00:22:43,000
+And this is really a good reason not to put optional the chandab everywhere.
+
+321
+00:22:44,000 --> 00:22:44,000
+Why?
+
+322
+00:22:45,000 --> 00:22:52,000
+Because in most cases, we need to provide ready to use API, but not make our clients seeing about
+
+323
+00:22:52,000 --> 00:22:58,000
+each return value, what to do in case value wasn't returned regarding the fields.
+
+324
+00:22:59,000 --> 00:23:00,000
+Let me put it simple.
+
+325
+00:23:00,000 --> 00:23:04,000
+You can create fields of optional type, but you shouldn't.
+
+326
+00:23:04,000 --> 00:23:05,000
+Why?
+
+327
+00:23:05,000 --> 00:23:08,000
+For me, it is a sign of a bad architecture.
+
+328
+00:23:08,000 --> 00:23:13,000
+You have fields known from the beginning that they may not be initialized.
+
+329
+00:23:13,000 --> 00:23:20,000
+But in this case, you have met Iraqui and that or the architecture was not implemented.
+
+330
+00:23:20,000 --> 00:23:21,000
+Solid principles.
+
+331
+00:23:21,000 --> 00:23:27,000
+Probably there are some classes that don't need all these fields, and it is just a matter of building
+
+332
+00:23:27,000 --> 00:23:29,000
+of proper Iraqui.
+
+333
+00:23:29,000 --> 00:23:30,000
+A lot of questions.
+
+334
+00:23:30,000 --> 00:23:36,000
+So I'll put it simple, the not to use optionals in fields parameters.
+
+335
+00:23:36,000 --> 00:23:39,000
+You can use optional methods, parameters.
+
+336
+00:23:39,000 --> 00:23:42,000
+But again, it is not recommended to do that.
+
+337
+00:23:42,000 --> 00:23:45,000
+It is recommended instead to have law that.
+
+338
+00:23:46,000 --> 00:23:53,000
+If you know that, you might need to invoke this method with no parameter or this empty optional, in
+
+339
+00:23:53,000 --> 00:23:53,000
+other words.
+
+340
+00:23:54,000 --> 00:23:57,000
+So just with mass, that takes no parameter.
+
+341
+00:23:58,000 --> 00:24:04,000
+But you also can have our law that was the same name, but which takes parameter.
+
+342
+00:24:04,000 --> 00:24:05,000
+Is that clear?
+
+343
+00:24:05,000 --> 00:24:09,000
+Some students ask me what is alternative to use an optional.
+
+344
+00:24:10,000 --> 00:24:15,000
+Well, the simplest alternative is to leave like our ancestors left.
+
+345
+00:24:15,000 --> 00:24:19,000
+Just use no value and do not forget, put no checks.
+
+346
+00:24:20,000 --> 00:24:23,000
+This is still the case in a lot of programs nowadays.
+
+347
+00:24:23,000 --> 00:24:30,000
+Another alternative might be a sort of an exception if absence of the value really brigg's the way of
+
+348
+00:24:30,000 --> 00:24:31,000
+your program execution.
+
+349
+00:24:32,000 --> 00:24:37,000
+Then you need to be prepared to handle specific exception and to handle it properly.
+
+350
+00:24:37,000 --> 00:24:42,000
+During the handling of this exception, you specify 70 fractions.
+
+351
+00:24:42,000 --> 00:24:45,000
+What is needed to be done in case the value is absent?
+
+352
+00:24:46,000 --> 00:24:48,000
+Almost a similar way you do with optional.
+
+353
+00:24:49,000 --> 00:24:51,000
+And another alternative is no objects.
+
+354
+00:24:51,000 --> 00:24:58,000
+You can create a time that has the same API, but it is empty inside and all my are error safe.
+
+355
+00:24:59,000 --> 00:25:01,000
+And when it is seen, you just create.
+
+356
+00:25:01,000 --> 00:25:07,000
+Instance of the empty object or just parcels, a reference to that empty constantly, for example,
+
+357
+00:25:07,000 --> 00:25:10,000
+in collections, glossaries, empty, list constant.
+
+358
+00:25:11,000 --> 00:25:14,000
+And instead of returning, no one least is expected.
+
+359
+00:25:15,000 --> 00:25:16,000
+You can just return empty.
+
+360
+00:25:16,000 --> 00:25:22,000
+These constant that will save you from no point exception remembers use of devices.
+
+361
+00:25:23,000 --> 00:25:27,000
+They're years of experience and millions of dollars behind these advices.
+
+362
+00:25:28,000 --> 00:25:31,000
+Let's recap what we have learned in this lesson.
+
+363
+00:25:31,000 --> 00:25:32,000
+In this lesson we learned.
+
+364
+00:25:33,000 --> 00:25:35,000
+Optional class API and its methods.
+
+365
+00:25:36,000 --> 00:25:39,000
+It knows the purpose of the optional and when to use it.
+
+366
+00:25:39,000 --> 00:25:46,000
+And at the end of the lesson, I also explained few alternative techniques to use instead of optional.
+
+367
+00:25:46,000 --> 00:25:48,000
+That's all for this lesson.
+
+368
+00:25:48,000 --> 00:25:49,000
+Thanks a lot for your attention.
+
+369
+00:25:50,000 --> 00:25:52,000
+Have a great day and see you in the next lesson.
+
diff --git a/31 - JDK API/003 Reactive Programming in Java Flow API, Reactive Streams_en.srt b/31 - JDK API/003 Reactive Programming in Java Flow API, Reactive Streams_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..6d54b26ce5f1189f38c08a337b130e6ed1d7ff2c
--- /dev/null
+++ b/31 - JDK API/003 Reactive Programming in Java Flow API, Reactive Streams_en.srt
@@ -0,0 +1,996 @@
+1
+00:00:05,000 --> 00:00:11,000
+Hello dear students, in this lesson we are going to learn what reactive programming is and how we can
+
+2
+00:00:11,000 --> 00:00:16,000
+apply reactive programming practices using Java via flow API.
+
+3
+00:00:16,000 --> 00:00:20,000
+We are going to start the lesson from learning general concepts.
+
+4
+00:00:20,000 --> 00:00:23,000
+We'll learn what reactive programming approach is.
+
+5
+00:00:23,000 --> 00:00:29,000
+We'll discuss what the most popular libraries for reactive programming in Java are.
+
+6
+00:00:29,000 --> 00:00:36,000
+But in scope of this lesson, we will focus our attention on the flow API that is available in JDK for
+
+7
+00:00:36,000 --> 00:00:38,000
+reactive programming.
+
+8
+00:00:38,000 --> 00:00:39,000
+As we will go.
+
+9
+00:00:39,000 --> 00:00:45,000
+We'll learn different terms like for example Backpressure aware concept.
+
+10
+00:00:45,000 --> 00:00:49,000
+We'll learn key interfaces from flow API.
+
+11
+00:00:49,000 --> 00:00:51,000
+Then we'll talk about use cases.
+
+12
+00:00:51,000 --> 00:00:57,000
+And I will try to answer the question when it is recommended to use reactive programming approach.
+
+13
+00:00:57,000 --> 00:01:04,000
+And at the end of the lesson we are going to review code examples in order to understand how reactive
+
+14
+00:01:04,000 --> 00:01:06,000
+streams work on practice.
+
+15
+00:01:06,000 --> 00:01:08,000
+Let's start our lesson.
+
+16
+00:01:09,000 --> 00:01:12,000
+Let's start from learning of what reactive programming is.
+
+17
+00:01:13,000 --> 00:01:20,000
+Reactive programming is a programming paradigm focused on handling asynchronous data streams and the
+
+18
+00:01:20,000 --> 00:01:22,000
+propagation of changes.
+
+19
+00:01:22,000 --> 00:01:29,000
+It provides a set of principles, patterns, and libraries that enable developers to build responsive
+
+20
+00:01:29,000 --> 00:01:36,000
+and scalable systems, especially in the context of handling events, input output operations, and
+
+21
+00:01:36,000 --> 00:01:37,000
+real time data.
+
+22
+00:01:38,000 --> 00:01:41,000
+Let's review key characteristics of reactive programming.
+
+23
+00:01:41,000 --> 00:01:45,000
+They include asynchronous and non-blocking.
+
+24
+00:01:46,000 --> 00:01:51,000
+Reactive programming emphasizes asynchronous and non-blocking operations.
+
+25
+00:01:51,000 --> 00:01:58,000
+It allows components to continue processing other tasks while waiting for asynchronous operations to
+
+26
+00:01:58,000 --> 00:02:02,000
+complete, leading to more efficient resource utilization.
+
+27
+00:02:03,000 --> 00:02:04,000
+Data streams.
+
+28
+00:02:04,000 --> 00:02:09,000
+At the core of reactive programming is the concept of data streams.
+
+29
+00:02:09,000 --> 00:02:13,000
+Sequences of events or values that occur over time.
+
+30
+00:02:13,000 --> 00:02:21,000
+These streams can represent various types of data such as user inputs, sensor readings, or messages
+
+31
+00:02:21,000 --> 00:02:22,000
+from a server.
+
+32
+00:02:23,000 --> 00:02:30,000
+Event-driven reactive systems are often event driven, meaning they respond to events or changes in
+
+33
+00:02:30,000 --> 00:02:31,000
+the system.
+
+34
+00:02:31,000 --> 00:02:37,000
+Events can trigger reactions and the system adapts dynamically to these changes.
+
+35
+00:02:38,000 --> 00:02:39,000
+Back pressure.
+
+36
+00:02:40,000 --> 00:02:43,000
+Back pressure is a key concept in reactive programming.
+
+37
+00:02:43,000 --> 00:02:51,000
+It refers to the ability of downstream component to signal its capacity to handle data to an upstream
+
+38
+00:02:51,000 --> 00:02:52,000
+component.
+
+39
+00:02:52,000 --> 00:02:59,000
+This helps prevent overwhelming the system with more data than it can process efficiently.
+
+40
+00:03:00,000 --> 00:03:02,000
+Responsive and scalable.
+
+41
+00:03:02,000 --> 00:03:09,000
+Reactive programming aims to create responsive applications that can handle varied workloads.
+
+42
+00:03:09,000 --> 00:03:17,000
+By embracing asynchrony and scalability, reactive systems can efficiently adapt to changes in demand.
+
+43
+00:03:18,000 --> 00:03:20,000
+Functional programming.
+
+44
+00:03:20,000 --> 00:03:25,000
+Reactive programming often aligns with functional programming principles.
+
+45
+00:03:25,000 --> 00:03:33,000
+It emphasizes immutability, pure functions, and the use of higher order functions, enabling developers
+
+46
+00:03:33,000 --> 00:03:36,000
+to write more concise and maintainable code.
+
+47
+00:03:37,000 --> 00:03:39,000
+Reactive extensions.
+
+48
+00:03:39,000 --> 00:03:47,000
+Reactive extensions, often referred to as RCS, is a set of libraries that provide a uniform way to
+
+49
+00:03:47,000 --> 00:03:52,000
+work with reactive programming concepts across multiple programming languages.
+
+50
+00:03:53,000 --> 00:03:58,000
+RCS libraries exist for languages like Java, JavaScript, C, sharp, and more.
+
+51
+00:03:59,000 --> 00:04:05,000
+Reactive programming has become popular in building modern applications, especially those that involve
+
+52
+00:04:05,000 --> 00:04:10,000
+real time data, user interfaces, and distributed systems.
+
+53
+00:04:10,000 --> 00:04:18,000
+Frameworks and libraries like Project Reactor, Erik's Java provide tools and abstractions to implement
+
+54
+00:04:18,000 --> 00:04:21,000
+reactive programming in various programming languages.
+
+55
+00:04:22,000 --> 00:04:29,000
+These tools simplify the handling of asynchronous and streaming data, making it easier for developers
+
+56
+00:04:29,000 --> 00:04:32,000
+to build responsive and scalable applications.
+
+57
+00:04:33,000 --> 00:04:40,000
+In Java, reactive programming approach may be implemented with different libraries, for example a
+
+58
+00:04:40,000 --> 00:04:42,000
+Java reactor core.
+
+59
+00:04:42,000 --> 00:04:52,000
+Reactive streams are socket martini reactor, but starting from Java version nine, you can use JDK
+
+60
+00:04:52,000 --> 00:04:55,000
+to implement reactive programming approach.
+
+61
+00:04:55,000 --> 00:04:59,000
+Flow API is available starting from Java nine.
+
+62
+00:04:59,000 --> 00:05:02,000
+In this lesson we will focus on flow API.
+
+63
+00:05:03,000 --> 00:05:05,000
+So let's learn what a flow API is.
+
+64
+00:05:06,000 --> 00:05:14,000
+The flow API, also known as Reactive Streams, was introduced in Java nine to address challenges associated
+
+65
+00:05:14,000 --> 00:05:21,000
+with asynchronous programming and handling streams of data in a more efficient and scalable way.
+
+66
+00:05:21,000 --> 00:05:28,000
+Reactive streams provide a standard for asynchronous stream processing with non-blocking back pressure,
+
+67
+00:05:28,000 --> 00:05:33,000
+enabling better control over the flow of data between components.
+
+68
+00:05:33,000 --> 00:05:40,000
+Reactive streams define a set of interfaces, classes, and masses that standardize the exchange of
+
+69
+00:05:40,000 --> 00:05:46,000
+asynchronous data streams between components in a non-blocking, back pressure aware manner.
+
+70
+00:05:47,000 --> 00:05:51,000
+Now let me share with you key interfaces in the flow API.
+
+71
+00:05:51,000 --> 00:05:58,000
+So the main interfaces include publisher, subscriber, subscription and processor.
+
+72
+00:05:58,000 --> 00:06:05,000
+I will make just a brief overview of them and we will learn more during the review of real life example.
+
+73
+00:06:06,000 --> 00:06:13,000
+Publisher amidst a potentially unbounded sequence of elements to one or more subscribers.
+
+74
+00:06:14,000 --> 00:06:22,000
+Subscriber consumes elements from a publisher and signals when it can handle more elements.
+
+75
+00:06:22,000 --> 00:06:30,000
+Subscription represents the link between a subscriber and a publisher, allowing the subscriber to request
+
+76
+00:06:30,000 --> 00:06:31,000
+and cancel elements.
+
+77
+00:06:32,000 --> 00:06:33,000
+Processor.
+
+78
+00:06:34,000 --> 00:06:43,000
+The processor interface in the Reactive Streams API serves as a dual role component, acting both as
+
+79
+00:06:43,000 --> 00:06:49,000
+a subscriber and a publisher, enabling custom data processing within a reactive stream.
+
+80
+00:06:50,000 --> 00:06:55,000
+So let's try to answer the question why flow API is needed?
+
+81
+00:06:55,000 --> 00:07:02,000
+Traditional stream processing in Java lacked a standardized way to handle asynchronous data streams,
+
+82
+00:07:02,000 --> 00:07:09,000
+which could lead to issues like buffer overflow or excessive resource consumption.
+
+83
+00:07:09,000 --> 00:07:16,000
+Reactive streams address these problems by introducing Backpressure, allowing subscribers to signal
+
+84
+00:07:16,000 --> 00:07:22,000
+when they are ready to receive more data, preventing overwhelming downstream components.
+
+85
+00:07:22,000 --> 00:07:26,000
+And in which cases it is recommended to use flow API.
+
+86
+00:07:27,000 --> 00:07:29,000
+Asynchronous processing.
+
+87
+00:07:29,000 --> 00:07:36,000
+Reactive streams are beneficial in scenarios where asynchronous processing is required, such as handling
+
+88
+00:07:36,000 --> 00:07:40,000
+events, input output operations, or real time data.
+
+89
+00:07:41,000 --> 00:07:48,000
+Backpressure handling when dealing with data streams, where the rate of data production is different
+
+90
+00:07:48,000 --> 00:07:50,000
+from the rate of data consumption.
+
+91
+00:07:50,000 --> 00:07:56,000
+Reactive streams help manage backpressure, preventing overwhelming downstream components.
+
+92
+00:07:57,000 --> 00:08:00,000
+Scalable and responsive applications.
+
+93
+00:08:01,000 --> 00:08:02,000
+Reactive programming was.
+
+94
+00:08:02,000 --> 00:08:09,000
+Reactive Streams is well suited for building responsive and scalable applications, especially in scenarios
+
+95
+00:08:09,000 --> 00:08:13,000
+like web services, where responsiveness is crucial.
+
+96
+00:08:14,000 --> 00:08:16,000
+Use reactive streams when you need to.
+
+97
+00:08:17,000 --> 00:08:20,000
+Handle asynchronous data streams.
+
+98
+00:08:20,000 --> 00:08:26,000
+Implement Backpressure to control the flow of data and prevent resource exhaustion.
+
+99
+00:08:26,000 --> 00:08:34,000
+Build scalable and responsive applications with non-blocking input output operations.
+
+100
+00:08:35,000 --> 00:08:41,000
+Reactive streams have gained popularity in modern Java development and are widely used in frameworks
+
+101
+00:08:41,000 --> 00:08:46,000
+like Project Reactor to build reactive and resilient systems.
+
+102
+00:08:46,000 --> 00:08:52,000
+I believe we learned enough theory, and now we are ready to review examples that I prepared especially
+
+103
+00:08:52,000 --> 00:08:53,000
+for this lesson.
+
+104
+00:08:54,000 --> 00:09:00,000
+You can find the source code of examples that I am going to share with you in attachments to the lesson.
+
+105
+00:09:00,000 --> 00:09:06,000
+Remember, Tim, that you are always welcome to ask questions in case something is not clear.
+
+106
+00:09:06,000 --> 00:09:11,000
+Just post your question below the video and I will be happy to answer.
+
+107
+00:09:11,000 --> 00:09:17,000
+As you can see, examples related to reactive streams are in flow API package.
+
+108
+00:09:18,000 --> 00:09:22,000
+We're going to start review from the flow API example class.
+
+109
+00:09:22,000 --> 00:09:26,000
+This is a class where I put client code and main method.
+
+110
+00:09:27,000 --> 00:09:30,000
+So we will go together with the flow of execution.
+
+111
+00:09:30,000 --> 00:09:34,000
+And I will explain you what is happening here line by line.
+
+112
+00:09:34,000 --> 00:09:39,000
+Let me also run this file in order to have all console output printed.
+
+113
+00:09:39,000 --> 00:09:43,000
+And you will be able to see the sequence of events that is happening here.
+
+114
+00:09:44,000 --> 00:09:51,000
+Pay attention that today we will review types that are stored on the Java.util.concurrent package inside
+
+115
+00:09:51,000 --> 00:09:53,000
+final class flow.
+
+116
+00:09:53,000 --> 00:10:00,000
+There are such important interfaces as publisher, subscriber, subscription and processor.
+
+117
+00:10:00,000 --> 00:10:03,000
+These are types that we are going to use today.
+
+118
+00:10:04,000 --> 00:10:07,000
+I start example from creation of the submission publisher.
+
+119
+00:10:08,000 --> 00:10:15,000
+The submission publisher is a built in implementation of the publisher interface in Java Flow API.
+
+120
+00:10:15,000 --> 00:10:23,000
+It emits a potentially unbounded sequence of elements, in this case integers to one or more subscribers.
+
+121
+00:10:24,000 --> 00:10:29,000
+The next thing I create instance of my subscriber.
+
+122
+00:10:29,000 --> 00:10:36,000
+It is parametrized by integer type because in this example I plan to receive integer elements.
+
+123
+00:10:36,000 --> 00:10:42,000
+To implement subscriber interface, you need to give implementation to all following methods.
+
+124
+00:10:42,000 --> 00:10:45,000
+Let's review each of them one by one.
+
+125
+00:10:46,000 --> 00:10:48,000
+Unsubscribe method.
+
+126
+00:10:48,000 --> 00:10:56,000
+This method signals about the subscription sets the subscription object, and requests the first item
+
+127
+00:10:56,000 --> 00:10:59,000
+to initialize the data flow with the provided subscription.
+
+128
+00:11:00,000 --> 00:11:07,000
+Basically, with the request method, you create demand for elements that subscriber can process depending
+
+129
+00:11:07,000 --> 00:11:13,000
+on the amount of requested elements, the same amount of times on next method will be invoked.
+
+130
+00:11:14,000 --> 00:11:16,000
+On next method.
+
+131
+00:11:16,000 --> 00:11:21,000
+This method processes in common integer items.
+
+132
+00:11:21,000 --> 00:11:28,000
+In our example, I just double all in common integers and transform them to string just for the sake
+
+133
+00:11:28,000 --> 00:11:34,000
+of example, because theoretically we can implement processor interface that I am going to explain a
+
+134
+00:11:34,000 --> 00:11:42,000
+little bit later, and you can supply process data downstream in such way you can build processing chain
+
+135
+00:11:42,000 --> 00:11:43,000
+and data flow.
+
+136
+00:11:44,000 --> 00:11:48,000
+That's why I created submit method just for the sake of example.
+
+137
+00:11:48,000 --> 00:11:55,000
+And just to show you that in submit method, you can put the logic of processed item submission downstream
+
+138
+00:11:55,000 --> 00:11:56,000
+in simple words.
+
+139
+00:11:56,000 --> 00:12:03,000
+Send processed item further down the processing chain depending on your business logic.
+
+140
+00:12:04,000 --> 00:12:12,000
+Onerror method handles errors during processing by printing an error message, allowing the processor
+
+141
+00:12:12,000 --> 00:12:15,000
+to respond appropriately to error conditions.
+
+142
+00:12:16,000 --> 00:12:20,000
+On complete signals, the completion of processing.
+
+143
+00:12:20,000 --> 00:12:24,000
+Printing a message to indicate the end of the data stream.
+
+144
+00:12:24,000 --> 00:12:31,000
+If you build a longer processing chain, this is the method where you can notify downstream components
+
+145
+00:12:31,000 --> 00:12:36,000
+that processing is completed, and in this method I cancel subscription.
+
+146
+00:12:37,000 --> 00:12:40,000
+Let's get back to flow API example class.
+
+147
+00:12:41,000 --> 00:12:49,000
+The next thing that I do here I subscribe my subscriber to publisher in the context of the Reactive
+
+148
+00:12:49,000 --> 00:12:50,000
+Streams API.
+
+149
+00:12:50,000 --> 00:12:57,000
+The relationship between a publisher and a subscriber is established through the subscribe method.
+
+150
+00:12:57,000 --> 00:13:04,000
+However, it is important to note that it is the publisher who initiates the subscription process by
+
+151
+00:13:04,000 --> 00:13:08,000
+calling the subscribe method on the publisher object.
+
+152
+00:13:08,000 --> 00:13:11,000
+Now there will be a connection between them.
+
+153
+00:13:12,000 --> 00:13:19,000
+Publisher will be aware about subscriber and when this will happen, then unsubscribe method will be
+
+154
+00:13:19,000 --> 00:13:24,000
+triggered and I will initialize my subscription property inside.
+
+155
+00:13:25,000 --> 00:13:28,000
+But wait, something should be wrong here.
+
+156
+00:13:28,000 --> 00:13:34,000
+Where missing subscription object because we have publisher, we have subscriber.
+
+157
+00:13:34,000 --> 00:13:36,000
+But where is subscription object?
+
+158
+00:13:36,000 --> 00:13:41,000
+You can implement it by yourself by implementing subscription interface.
+
+159
+00:13:41,000 --> 00:13:43,000
+But what is happening in this case?
+
+160
+00:13:44,000 --> 00:13:50,000
+You can see that I decided to print subscription object to console in order to understand the type of
+
+161
+00:13:50,000 --> 00:13:51,000
+this object.
+
+162
+00:13:52,000 --> 00:13:54,000
+And we can see that we received here.
+
+163
+00:13:54,000 --> 00:13:56,000
+Object of type buffered subscription.
+
+164
+00:13:57,000 --> 00:14:01,000
+This is nested class inside submission publisher class.
+
+165
+00:14:01,000 --> 00:14:03,000
+But who created this object?
+
+166
+00:14:03,000 --> 00:14:10,000
+And when a buffered subscription is created when a subscriber subscribes to a submission publisher,
+
+167
+00:14:11,000 --> 00:14:17,000
+this subscription object manages the communication between the publisher and the subscriber, facilitating
+
+168
+00:14:17,000 --> 00:14:19,000
+the flow of data.
+
+169
+00:14:19,000 --> 00:14:21,000
+The charm buffer.
+
+170
+00:14:21,000 --> 00:14:28,000
+It suggests that this subscription might have some internal buffer to store items when the subscriber
+
+171
+00:14:28,000 --> 00:14:31,000
+can't keep up with the rate of data production.
+
+172
+00:14:32,000 --> 00:14:36,000
+Here is a breakdown of what happens during the subscription process.
+
+173
+00:14:37,000 --> 00:14:42,000
+Publisher calls subscribe method and subscribe subscriber object.
+
+174
+00:14:42,000 --> 00:14:47,000
+Submission publisher creates a buffered subscription object internally.
+
+175
+00:14:48,000 --> 00:14:51,000
+This is happening inside subscribe method.
+
+176
+00:14:51,000 --> 00:14:57,000
+If we would open the source code of subscribe method, we will see how instance of buffered subscription
+
+177
+00:14:57,000 --> 00:14:58,000
+is created.
+
+178
+00:14:59,000 --> 00:15:05,000
+Unsubscribe method is called on the subscriber with created buffered subscription.
+
+179
+00:15:05,000 --> 00:15:12,000
+The unsubscribe method is then invoked on the subscriber, passing the buffered subscription as an argument.
+
+180
+00:15:12,000 --> 00:15:17,000
+This allows the subscriber to request items and manage backpressure.
+
+181
+00:15:17,000 --> 00:15:24,000
+The buffered aspect of the subscription typically comes into play when the subscriber is unable to keep
+
+182
+00:15:24,000 --> 00:15:27,000
+up with the rate of data production.
+
+183
+00:15:27,000 --> 00:15:35,000
+In such cases, the buffered subscription may buffer items until the subscriber signals that it can
+
+184
+00:15:35,000 --> 00:15:38,000
+process more data by calling the request method.
+
+185
+00:15:39,000 --> 00:15:44,000
+So after subscription is happened, then I set the timeout.
+
+186
+00:15:45,000 --> 00:15:49,000
+We need this time out to make sure that subscription is created.
+
+187
+00:15:49,000 --> 00:15:56,000
+But using timeout is very primitive way that I decided to use for the sake of example.
+
+188
+00:15:56,000 --> 00:16:03,000
+In reality, ensuring that everyone is successfully subscribed in a reactive system can be a complicated
+
+189
+00:16:03,000 --> 00:16:09,000
+task, and the approach might depend on the specific requirements of your application.
+
+190
+00:16:10,000 --> 00:16:14,000
+Some points to consider using of countdown Lodge.
+
+191
+00:16:15,000 --> 00:16:17,000
+Using of completablefuture.
+
+192
+00:16:17,000 --> 00:16:22,000
+Using of timeout mechanism, including using it with completablefuture.
+
+193
+00:16:23,000 --> 00:16:26,000
+In my course Java from zero to first job.
+
+194
+00:16:26,000 --> 00:16:33,000
+I have multi-threading section where I explained in details API of countdown, Lodge, Completablefuture
+
+195
+00:16:33,000 --> 00:16:35,000
+and other things.
+
+196
+00:16:35,000 --> 00:16:38,000
+That's why I wouldn't stop too much on this right now.
+
+197
+00:16:39,000 --> 00:16:43,000
+In console you can see subscriber subscribed.
+
+198
+00:16:44,000 --> 00:16:52,000
+After the timeout, I declare a for loop with counter and I submit five integers using publisher object.
+
+199
+00:16:52,000 --> 00:17:00,000
+I submit them one by one, and in console you can see that publisher submits one element and subscriber
+
+200
+00:17:00,000 --> 00:17:01,000
+receives it.
+
+201
+00:17:01,000 --> 00:17:08,000
+Taking into account that println method is synchronized, text and console not necessarily represents
+
+202
+00:17:08,000 --> 00:17:15,000
+the exact sequence of events, but at least it can give us an understanding of what is going on.
+
+203
+00:17:15,000 --> 00:17:23,000
+Subscriber after receiving integers, doubles, received elements and prints them to console two and
+
+204
+00:17:23,000 --> 00:17:30,000
+when publisher is closed, subscriber got notified two and Oncomplete method is triggered.
+
+205
+00:17:31,000 --> 00:17:32,000
+And that's it.
+
+206
+00:17:32,000 --> 00:17:39,000
+Knowing this, you can build more complex data flows with multiple subscribers, different publishers.
+
+207
+00:17:39,000 --> 00:17:44,000
+You can connect them between each other as your business logic would require.
+
+208
+00:17:45,000 --> 00:17:51,000
+And the last but not the least thing that I would like to show you for today is processor interface.
+
+209
+00:17:52,000 --> 00:17:58,000
+You can create processor class that would implement processor interface if you want to make it acting
+
+210
+00:17:58,000 --> 00:18:02,000
+as both a publisher and a subscriber.
+
+211
+00:18:02,000 --> 00:18:06,000
+This can be helpful when you want to build a processing chain.
+
+212
+00:18:06,000 --> 00:18:13,000
+For example, you can receive some data from publisher, process it, and pass it further to the next
+
+213
+00:18:13,000 --> 00:18:14,000
+subscriber.
+
+214
+00:18:15,000 --> 00:18:15,000
+And like this.
+
+215
+00:18:15,000 --> 00:18:18,000
+You can build complex data flows.
+
+216
+00:18:18,000 --> 00:18:26,000
+So the processor interface in the Reactive Streams API is used when you need to create a component that
+
+217
+00:18:26,000 --> 00:18:29,000
+acts as a both a publisher and a subscriber.
+
+218
+00:18:29,000 --> 00:18:36,000
+It is particularly useful in scenarios where you want to transform or process the data flowing through
+
+219
+00:18:36,000 --> 00:18:40,000
+a reactive stream before it reaches the downstream subscribers.
+
+220
+00:18:41,000 --> 00:18:46,000
+Here are some situations where you might consider using the processor interface.
+
+221
+00:18:47,000 --> 00:18:50,000
+Transforming or processing data.
+
+222
+00:18:50,000 --> 00:18:57,000
+If you need to apply transformations, filtering or any other processing logic to the data before it
+
+223
+00:18:57,000 --> 00:19:03,000
+is delivered to subscribers, the processor interface allows you to implement this logic.
+
+224
+00:19:04,000 --> 00:19:07,000
+Connecting different parts of a reactive pipeline.
+
+225
+00:19:07,000 --> 00:19:13,000
+When you have a reactive pipeline with multiple stages, and you want to connect these stages with a
+
+226
+00:19:13,000 --> 00:19:20,000
+component that can both consume data from the upstream and emit processed data to the downstream.
+
+227
+00:19:21,000 --> 00:19:24,000
+Implementing a custom flow control mechanism.
+
+228
+00:19:24,000 --> 00:19:31,000
+If you need to implement a custom flow control mechanism between the publisher and subscribers, the
+
+229
+00:19:31,000 --> 00:19:38,000
+processor allows you to manage backpressure and control the rate at which data is consumed.
+
+230
+00:19:38,000 --> 00:19:41,000
+Aggregating or combining data streams.
+
+231
+00:19:41,000 --> 00:19:47,000
+When you want to combine or aggregate data from multiple publishers before delivering it to downstream
+
+232
+00:19:47,000 --> 00:19:49,000
+subscribers.
+
+233
+00:19:49,000 --> 00:19:52,000
+A processor can be used to implement the necessary logic.
+
+234
+00:19:53,000 --> 00:20:00,000
+If you check the source code of processor interface, then you will find that processor is a static
+
+235
+00:20:00,000 --> 00:20:05,000
+interface that extends subscriber and publisher at the same time.
+
+236
+00:20:05,000 --> 00:20:10,000
+In Java, an interface can extend multiple other interfaces.
+
+237
+00:20:10,000 --> 00:20:17,000
+This feature allows an interface to inherit abstract masses from multiple parent interfaces, providing
+
+238
+00:20:17,000 --> 00:20:22,000
+a way to express multiple types of behavior in a single interface.
+
+239
+00:20:22,000 --> 00:20:30,000
+So feel free to use processor interface implementations when it will be needed in your business cases.
+
+240
+00:20:30,000 --> 00:20:34,000
+That's all what I wanted to share with you today in this lesson.
+
+241
+00:20:34,000 --> 00:20:37,000
+Let's recap what we have learned in the video.
+
+242
+00:20:38,000 --> 00:20:41,000
+We learned reactive programming approach.
+
+243
+00:20:41,000 --> 00:20:45,000
+Now you know the most popular libraries for reactive programming in Java.
+
+244
+00:20:46,000 --> 00:20:54,000
+I explained you what flow API in JDK is, and we learned key interfaces and types in flow API.
+
+245
+00:20:54,000 --> 00:21:01,000
+I explained when and in which cases it is recommended to use Reactive Programming, Reactive Streams
+
+246
+00:21:01,000 --> 00:21:08,000
+flow API, and at the end of the lesson we reviewed code example in order to understand how it works
+
+247
+00:21:08,000 --> 00:21:09,000
+in practice.
+
+248
+00:21:09,000 --> 00:21:12,000
+That's all what I wanted to share with you today.
+
+249
+00:21:12,000 --> 00:21:15,000
+Have a great day and see you in the next lesson.
+
diff --git a/31 - JDK API/003 Source-code-examples-from-the-lesson.url b/31 - JDK API/003 Source-code-examples-from-the-lesson.url
new file mode 100644
index 0000000000000000000000000000000000000000..2e3f0ed7a02cf7d13c2ed23368b059778bb96e10
--- /dev/null
+++ b/31 - JDK API/003 Source-code-examples-from-the-lesson.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/commit/d62a11591550fc4c8455d610c8ddbcf31c194b71
\ No newline at end of file
diff --git a/31 - JDK API/004 Quiz JDK API - Check yourself.html b/31 - JDK API/004 Quiz JDK API - Check yourself.html
new file mode 100644
index 0000000000000000000000000000000000000000..3deebf3c2911bbb8ef8899ce59466a0b2bd760a7
--- /dev/null
+++ b/31 - JDK API/004 Quiz JDK API - Check yourself.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+ Quiz JDK API - Check yourself
+
+
+
+
+
+
+
Quiz JDK API - Check yourself
+
Quiz Link: https://forms.gle/LBnM5Sc5PXE71h6w6
The quiz doesn’t require you to log in or submit any personal information. Your data privacy is my priority.
The Quiz covers content from the following lessons:
StringBuilder & StringBuffer
java.util.Optional - Optional in Java
Reactive Programming in Java: Flow API, Reactive Streams
Quiz Instructions:
This quiz is designed to help you check your understanding of the content from the previous lessons. All questions are based only on material covered in the lessons you've already watched, so there’s no need to worry about unfamiliar topics.
Each question has one correct answer. Select the best answer and click "Submit" when you're ready.
After submitting, you'll see your score. For each question, you earn 1 point.
Click "View Results" to see the explanations for each correct answer. Reviewing these explanations can help reinforce your understanding.
If you score below 70%, I recommend revisiting the previous lessons. However, if the explanations make sense and you’re confident in your understanding, feel free to move on.
If any explanations are unclear, please don’t hesitate to post questions in the Q&A section—I’m here to help!
+
+
+
+
diff --git a/31 - JDK API/external-links.txt b/31 - JDK API/external-links.txt
new file mode 100644
index 0000000000000000000000000000000000000000..9c90b469d65a5aa0299b2970bfd05942fa1bb21c
--- /dev/null
+++ b/31 - JDK API/external-links.txt
@@ -0,0 +1,9 @@
+
+001 Source-code-from-the-lesson
+https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/string/stringbuilder
+
+002 Source-code-examples-from-the-lesson
+https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/optional
+
+003 Source-code-examples-from-the-lesson
+https://github.com/AndriiPiatakha/learnit_java_core/commit/d62a11591550fc4c8455d610c8ddbcf31c194b71
diff --git a/32 - Java Platform Module System Modules in Java & Migration of Java Apps/001 Modules in Java Modular Application Example_en.srt b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/001 Modules in Java Modular Application Example_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..17df93f750c6d36295a4a97b51ab27b0a09835ba
--- /dev/null
+++ b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/001 Modules in Java Modular Application Example_en.srt
@@ -0,0 +1,1576 @@
+1
+00:00:06,000 --> 00:00:11,000
+Hello, the students in this lesson, we're going to learn more about features it was added in Java
+
+2
+00:00:11,000 --> 00:00:12,000
+version nine.
+
+3
+00:00:12,000 --> 00:00:14,000
+I'm talking about modules in Java.
+
+4
+00:00:14,000 --> 00:00:21,000
+There we have really a lot of new things to learn modules, really powerful features that exist in Java
+
+5
+00:00:21,000 --> 00:00:22,000
+platform.
+
+6
+00:00:22,000 --> 00:00:28,000
+And if you want to become Java software engineer or get one of Oracle certifications, you have to be
+
+7
+00:00:28,000 --> 00:00:29,000
+familiar with it.
+
+8
+00:00:29,000 --> 00:00:38,000
+We'll start lesson from simple and general topics such as what models are and just talking about why
+
+9
+00:00:38,000 --> 00:00:42,000
+we might need them to help you understand modules better.
+
+10
+00:00:42,000 --> 00:00:49,000
+I will explain what goals we are trying to achieve by using them and what benefits we expect to get.
+
+11
+00:00:50,000 --> 00:00:52,000
+We'll review different module types.
+
+12
+00:00:53,000 --> 00:01:00,000
+After that, we'll learn module directives that we use in the module descriptor and common line options
+
+13
+00:01:00,000 --> 00:01:05,000
+that might come in handy when you will work with multiple modules from Consult.
+
+14
+00:01:05,000 --> 00:01:12,000
+And at the end of the lesson, we're going to create modular Hello World application, and I will show
+
+15
+00:01:12,000 --> 00:01:18,000
+you how to configure it leaves and either you can work with this modular application from Eclipse.
+
+16
+00:01:19,000 --> 00:01:22,000
+As you can see, we have really a lot of things to do.
+
+17
+00:01:22,000 --> 00:01:24,000
+Let's start our lesson.
+
+18
+00:01:25,000 --> 00:01:28,000
+Let's understand first what modules are.
+
+19
+00:01:28,000 --> 00:01:37,000
+Module is a Nicklin named reusable group of related packages, as well as resources such as images and
+
+20
+00:01:37,000 --> 00:01:39,000
+Xolo files and module.
+
+21
+00:01:39,000 --> 00:01:44,000
+The specifying the modules name Xen Modules dependencies.
+
+22
+00:01:44,000 --> 00:01:46,000
+These are the other modules.
+
+23
+00:01:46,000 --> 00:01:49,000
+This module depends on zip packages.
+
+24
+00:01:49,000 --> 00:01:52,000
+It explicitly makes available to other modules.
+
+25
+00:01:53,000 --> 00:02:00,000
+All other packages in the module I implicitly unavailable to other modules, just services it offers,
+
+26
+00:02:01,000 --> 00:02:06,000
+the services it consumes, but what other modules it allows?
+
+27
+00:02:06,000 --> 00:02:12,000
+Reflection and General Module is a packaging mechanism that enables you to package a Java application
+
+28
+00:02:13,000 --> 00:02:21,000
+or Java API as a separate Java module and general module is packaged as Modular Jar File and Java module
+
+29
+00:02:21,000 --> 00:02:24,000
+can specify which of Java packages it contains.
+
+30
+00:02:24,000 --> 00:02:28,000
+That should be visible to OSR Java modules, which he uses.
+
+31
+00:02:28,000 --> 00:02:36,000
+This module and you have a module must also specify which OSI Jumo modules are required to do its job.
+
+32
+00:02:37,000 --> 00:02:45,000
+In most single words, Java module is a package for packages that is super simplified, but hope this
+
+33
+00:02:45,000 --> 00:02:48,000
+will help you to understand this concept.
+
+34
+00:02:48,000 --> 00:02:55,000
+You can group packages into modules and to ensure encapsulation, you may control access to different
+
+35
+00:02:55,000 --> 00:02:57,000
+packages within the module.
+
+36
+00:02:57,000 --> 00:03:02,000
+Modularity as higher level of a nation above packages is a clear.
+
+37
+00:03:03,000 --> 00:03:06,000
+Java Modules is a new feature in Java nine.
+
+38
+00:03:07,000 --> 00:03:15,000
+We as a Java Platform Module System Z Java Platform Module System is also sometimes referred to as Java,
+
+39
+00:03:15,000 --> 00:03:20,000
+Jigsaw or Project Jigsaw, depending on where you read.
+
+40
+00:03:20,000 --> 00:03:25,000
+Jigsaw was internally used project name during development.
+
+41
+00:03:25,000 --> 00:03:29,000
+Later, Jigsaw changed the name to Java Platform Module system.
+
+42
+00:03:30,000 --> 00:03:37,000
+There is a juicer 376 Juicer stands for Java specification request.
+
+43
+00:03:37,000 --> 00:03:45,000
+This is an actual description of proposed and final specification for the Java platform at any one time.
+
+44
+00:03:45,000 --> 00:03:49,000
+There are numerous juicers movies with a review and approval process.
+
+45
+00:03:50,000 --> 00:03:55,000
+In the Juicer 376, we can find list of goals of modular.
+
+46
+00:03:55,000 --> 00:04:02,000
+Ryzen is a Java Sea platform, and one them such goals as a reliable configuration.
+
+47
+00:04:03,000 --> 00:04:10,000
+Modularity provides mechanisms for explicitly declaring dependencies between modules in a manner that's
+
+48
+00:04:10,000 --> 00:04:14,000
+recognized both at compile time and execution time.
+
+49
+00:04:15,000 --> 00:04:16,000
+The system can work.
+
+50
+00:04:16,000 --> 00:04:24,000
+Suzy's Dependencies commands a subset of all modules required to support your app from Gemini nine and
+
+51
+00:04:24,000 --> 00:04:33,000
+forward Java applications must be packaged as Java Modules two zero four and application modules specifies
+
+52
+00:04:33,000 --> 00:04:38,000
+what OSM modules Java API modules supporting modules.
+
+53
+00:04:38,000 --> 00:04:47,000
+It uses zero for the Java virtual machine can check the whole module dependency graph from application
+
+54
+00:04:47,000 --> 00:04:52,000
+module and four one one zero virtual machine starts up.
+
+55
+00:04:52,000 --> 00:05:00,000
+If any required models are not found at startup, the Java Virtual Machine reports is a missing module
+
+56
+00:05:00,000 --> 00:05:03,000
+and shuts down before Java nine Mason class.
+
+57
+00:05:04,000 --> 00:05:11,000
+Just from a Mason Jar file, for example, would not be detected until the application actually tried
+
+58
+00:05:11,000 --> 00:05:12,000
+to use Zoom Mason class.
+
+59
+00:05:13,000 --> 00:05:20,000
+This would happen sometime at runtime dependent on one's application tried to use the missing class.
+
+60
+00:05:20,000 --> 00:05:28,000
+Having missing modules reported at application startup time is a big advantage compared to its runtime
+
+61
+00:05:28,000 --> 00:05:37,000
+when trying to use Zoom's Mojo Jar plus strong encapsulation zip packages in the module are accessible
+
+62
+00:05:37,000 --> 00:05:41,000
+to OSM modules only use the module explicitly exports them.
+
+63
+00:05:42,000 --> 00:05:51,000
+Even then, another module can't use those packages unless it explicitly states that it requires as
+
+64
+00:05:51,000 --> 00:05:53,000
+other modules capabilities.
+
+65
+00:05:53,000 --> 00:05:59,000
+This improves platform security because fewer classes accessible to potential attackers.
+
+66
+00:06:00,000 --> 00:06:06,000
+You may find that considering modularity helps you come up with cleaner, more logical designs.
+
+67
+00:06:07,000 --> 00:06:15,000
+Scalable Java Platform Robust is a Java platform was a monolith consisting of a massive number of packages,
+
+68
+00:06:16,000 --> 00:06:20,000
+making it challenging to develop, maintain and evolve.
+
+69
+00:06:20,000 --> 00:06:22,000
+It couldn't be easily subset.
+
+70
+00:06:23,000 --> 00:06:27,000
+The platform is now one of the rise into ninety five modules.
+
+71
+00:06:28,000 --> 00:06:30,000
+This number might change as Java evolves.
+
+72
+00:06:31,000 --> 00:06:38,000
+You can create custom rom coms consisting of only modules you need for your apps was devices you are
+
+73
+00:06:38,000 --> 00:06:39,000
+targeting.
+
+74
+00:06:39,000 --> 00:06:46,000
+For example, if a device doesn't support graphical user interfaces, you could create a runtime that
+
+75
+00:06:46,000 --> 00:06:47,000
+doesn't include xG.
+
+76
+00:06:47,000 --> 00:06:56,000
+UI modules significantly reduces your runtime size before Java nine and the Java Platform Module system.
+
+77
+00:06:56,000 --> 00:07:03,000
+You would have had to package all of the Java platform APIs with your job application because there
+
+78
+00:07:03,000 --> 00:07:06,000
+was no official way of reliable checking.
+
+79
+00:07:06,000 --> 00:07:09,000
+What crosses your Java application use?
+
+80
+00:07:10,000 --> 00:07:16,000
+Since the job platform API eyes have grown quite large over the years, your application will get the
+
+81
+00:07:16,000 --> 00:07:23,000
+large amount of Java classes included in its distribution, many of which your application would probably
+
+82
+00:07:23,000 --> 00:07:24,000
+not be using.
+
+83
+00:07:25,000 --> 00:07:32,000
+Greater platform integrity Before Java Non, it was possible to use many classes in the platform as
+
+84
+00:07:32,000 --> 00:07:35,000
+it were not meant for use by and apps.
+
+85
+00:07:35,000 --> 00:07:43,000
+Classes with strong encapsulation zones and channel API are truly encapsulated and hidden from apps
+
+86
+00:07:43,000 --> 00:07:45,000
+using the platform.
+
+87
+00:07:45,000 --> 00:07:51,000
+This can make migrating legacy code the Modularized Java non problematic.
+
+88
+00:07:51,000 --> 00:07:59,000
+If your code depends on internal APIs, then use glossies make up the key from distributable big, then
+
+89
+00:07:59,000 --> 00:08:00,000
+it needs to be.
+
+90
+00:08:01,000 --> 00:08:08,000
+This can be a problem on small devices like mobile phones, Raspberry Pi, etc. was a Java platform
+
+91
+00:08:08,000 --> 00:08:09,000
+modular system.
+
+92
+00:08:10,000 --> 00:08:16,000
+You can now package your application was always a module of the Java Platform API that your application
+
+93
+00:08:16,000 --> 00:08:18,000
+is actually using.
+
+94
+00:08:18,000 --> 00:08:21,000
+This will result in small application distribution.
+
+95
+00:08:21,000 --> 00:08:24,000
+Both improve performance.
+
+96
+00:08:25,000 --> 00:08:29,000
+Gem uses various optimization techniques to improve application performance.
+
+97
+00:08:30,000 --> 00:08:38,000
+GSR 376 indicates that these techniques are more effective when it's known in advance.
+
+98
+00:08:39,000 --> 00:08:46,000
+Word types are located only in specific modules, and this was a great improvement for Java as a platform.
+
+99
+00:08:47,000 --> 00:08:53,000
+Nowadays, questions about modules among many questions during different Oracle certifications.
+
+100
+00:08:54,000 --> 00:08:57,000
+Let's talk now about different modules types.
+
+101
+00:08:57,000 --> 00:09:03,000
+There are four types of modules in the new model system system modules.
+
+102
+00:09:03,000 --> 00:09:07,000
+These other modules listed when we run Java.
+
+103
+00:09:07,000 --> 00:09:14,000
+These modules Command Z, includes a Java Sea and JDK modules application modules.
+
+104
+00:09:15,000 --> 00:09:22,000
+These models are what we usually want to build when we decide to use modules z unnamed and defined as
+
+105
+00:09:22,000 --> 00:09:28,000
+a compile module info class file included in the assembled jar.
+
+106
+00:09:28,000 --> 00:09:37,000
+Today, we are going to create our own module info file and see all examples automatic modules.
+
+107
+00:09:37,000 --> 00:09:43,000
+We can include unofficial modules by an existing jar files to the module pass.
+
+108
+00:09:43,000 --> 00:09:47,000
+The name of the module will be derived from the name of the jar.
+
+109
+00:09:48,000 --> 00:09:58,000
+Automatic modules will have full access to every OSM module loaded by pass name tomorrow when a class
+
+110
+00:09:58,000 --> 00:10:01,000
+or jar is loaded into the class bus.
+
+111
+00:10:01,000 --> 00:10:03,000
+But no, the module bus.
+
+112
+00:10:03,000 --> 00:10:06,000
+It's automatically added to the unnamed model.
+
+113
+00:10:07,000 --> 00:10:14,000
+It's a catch all model to maintain backwards compatibility with previously written Java code.
+
+114
+00:10:14,000 --> 00:10:19,000
+The unnamed, more new concept is similar to the default package.
+
+115
+00:10:19,000 --> 00:10:26,000
+Therefore, it is not considered a real model but can be viewed as a default module.
+
+116
+00:10:26,000 --> 00:10:33,000
+We can create multi-modal projects comprised of a main application and several library modules.
+
+117
+00:10:33,000 --> 00:10:39,000
+We have to be careful, though, because we can only have one module per jar file.
+
+118
+00:10:40,000 --> 00:10:46,000
+Let's see now what module descriptor is and what are the different directives that might be used in
+
+119
+00:10:46,000 --> 00:10:53,000
+the module if a Java file, as we have discussed already, a module must provide a module descriptor
+
+120
+00:10:53,000 --> 00:11:00,000
+metadata that specifies the modules, dependencies, zip packages the model makes available to other
+
+121
+00:11:00,000 --> 00:11:07,000
+modules and more, and module descriptor is a compiled version of the module declaration that's defined
+
+122
+00:11:07,000 --> 00:11:09,000
+in the file name module.
+
+123
+00:11:09,000 --> 00:11:16,000
+Info jowar and the first scene that we need to do is to create a file was named Module Info and with
+
+124
+00:11:16,000 --> 00:11:17,000
+Java extension.
+
+125
+00:11:18,000 --> 00:11:22,000
+This file should be located in the source code directory.
+
+126
+00:11:23,000 --> 00:11:31,000
+Each module declaration begins with the keyword module, followed by a unique module name and the module
+
+127
+00:11:31,000 --> 00:11:35,000
+body enclosed in races like you see in that example.
+
+128
+00:11:35,000 --> 00:11:40,000
+In general, module name follows the same naming rules as Java packages.
+
+129
+00:11:41,000 --> 00:11:48,000
+However, you should not use underscores any module names or package names, class and these massive
+
+130
+00:11:48,000 --> 00:11:56,000
+names, variable names, etc. from Gemini and Forward because Java wants to use underscore as reserved
+
+131
+00:11:56,000 --> 00:11:58,000
+and easy to in the future.
+
+132
+00:11:58,000 --> 00:12:05,000
+It is recommended to name a Java module is the same as the name of the root Java package contained in
+
+133
+00:12:05,000 --> 00:12:06,000
+the module.
+
+134
+00:12:06,000 --> 00:12:14,000
+If that is possible, because some of this might contain multiple packages is a module declarations,
+
+135
+00:12:14,000 --> 00:12:22,000
+but it can be empty or may contain various module directives, including the requis experts provide
+
+136
+00:12:22,000 --> 00:12:27,000
+space, etc. We are going to discuss each of these in a few minutes.
+
+137
+00:12:27,000 --> 00:12:35,000
+As you'll see later, components and module declaration create is a model descriptor, which is stored
+
+138
+00:12:35,000 --> 00:12:40,000
+in the file named Module Info, plus the Modules folder.
+
+139
+00:12:40,000 --> 00:12:48,000
+On this slide, I will briefly introduce each module directive Zacchaeus only in module declarations
+
+140
+00:12:48,000 --> 00:12:53,000
+and may be used as identifiers anywhere else in your code.
+
+141
+00:12:53,000 --> 00:12:56,000
+Let's learn now directives.
+
+142
+00:12:56,000 --> 00:13:00,000
+The first directives that we are given to them is requires.
+
+143
+00:13:00,000 --> 00:13:06,000
+This module directive allows us to declare module dependencies, for example.
+
+144
+00:13:06,000 --> 00:13:13,000
+In this case, my module has both a runtime and the compile time dependency on some module that you
+
+145
+00:13:13,000 --> 00:13:15,000
+should refer by module name.
+
+146
+00:13:16,000 --> 00:13:20,000
+Each module must explicitly state its dependencies.
+
+147
+00:13:20,000 --> 00:13:30,000
+When Module eight requires Model B, Module A is set to read Module B and Module B is spread by Module
+
+148
+00:13:30,000 --> 00:13:37,000
+A, the specified dependency on another module user requires and all public Typekit.
+
+149
+00:13:37,000 --> 00:13:43,000
+Experts from a dependency are accessible by our module when we use this directive.
+
+150
+00:13:43,000 --> 00:13:50,000
+Another important mention here is that it is not allowed to have separate dependencies between modules.
+
+151
+00:13:50,000 --> 00:14:00,000
+In other words, if Module eight requires Module B, Module B can also require module a z module dependency
+
+152
+00:14:00,000 --> 00:14:06,000
+graph must be an acyclic graph and thus a directive is a quasi static.
+
+153
+00:14:06,000 --> 00:14:09,000
+We might write a lot of functions that pretty.
+
+154
+00:14:10,000 --> 00:14:18,000
+Our internal state one another to log in module is present, but not every consumer of our level will
+
+155
+00:14:18,000 --> 00:14:24,000
+want this functionality, and they don't want to include an extra log in library.
+
+156
+00:14:24,000 --> 00:14:28,000
+In this case, we want to use an optional dependency.
+
+157
+00:14:29,000 --> 00:14:35,000
+By using the request setting directive, we create a compile time only dependency.
+
+158
+00:14:35,000 --> 00:14:38,000
+Now let's learn transitive directive.
+
+159
+00:14:39,000 --> 00:14:45,000
+Imagine that we want to use third party library, and that library in turn has other dependencies.
+
+160
+00:14:46,000 --> 00:14:54,000
+How we can make sure that any module that we are dependent on will bring its own dependencies to work
+
+161
+00:14:54,000 --> 00:14:54,000
+properly.
+
+162
+00:14:55,000 --> 00:15:03,000
+We can force any downstream consumers also to read our required dependencies, which requires transitive.
+
+163
+00:15:03,000 --> 00:15:11,000
+Attractive, let's review exports DirecTV Now, as you already could understand, is a strong encapsulation
+
+164
+00:15:11,000 --> 00:15:18,000
+was one of the main goal when Java Platform Module System has been introduced by default, and Model
+
+165
+00:15:18,000 --> 00:15:22,000
+doesn't expose any of its API to other modules.
+
+166
+00:15:23,000 --> 00:15:31,000
+Our code is significantly more secure if we don't expose our API to external users.
+
+167
+00:15:31,000 --> 00:15:38,000
+But what if we created API that it should be used by different modules and we need to explicitly make
+
+168
+00:15:38,000 --> 00:15:40,000
+it available for everyone?
+
+169
+00:15:40,000 --> 00:15:46,000
+We use the experts directive to expose all public members of the named package.
+
+170
+00:15:47,000 --> 00:15:55,000
+Please note that only the least the package itself is experts now support packages of the experts package
+
+171
+00:15:56,000 --> 00:15:56,000
+experts.
+
+172
+00:15:57,000 --> 00:16:06,000
+That means that even this package, in my example, contains a package named You Zens Akombe.
+
+173
+00:16:06,000 --> 00:16:11,000
+My package name util package is not exported.
+
+174
+00:16:11,000 --> 00:16:16,000
+Just because of parent package is to export the SAP package.
+
+175
+00:16:16,000 --> 00:16:24,000
+Also, we must declare it explicitly in the module descriptor, and the one module is a singular package
+
+176
+00:16:24,000 --> 00:16:29,000
+can only be exported by a single Java module at one time.
+
+177
+00:16:29,000 --> 00:16:37,000
+In other words, you can't have two or more and more and use that export the same package in use at
+
+178
+00:16:37,000 --> 00:16:38,000
+the same time.
+
+179
+00:16:39,000 --> 00:16:46,000
+The Java Virtual Machine will come clean startup if you do having two modules export.
+
+180
+00:16:46,000 --> 00:16:55,000
+The same package is also sometimes referred to as a split package by split package is meant that the
+
+181
+00:16:55,000 --> 00:17:01,000
+total content classes of the package is split between the multiple modules.
+
+182
+00:17:02,000 --> 00:17:03,000
+This is not allowed.
+
+183
+00:17:04,000 --> 00:17:13,000
+In case we want to limit access to our API and expose it only to some packages XL, we have to use experts
+
+184
+00:17:13,000 --> 00:17:17,000
+to direct it similar to the experts directive.
+
+185
+00:17:17,000 --> 00:17:25,000
+We declare a package as experts, but we also list which models we are allowing to import this package
+
+186
+00:17:25,000 --> 00:17:26,000
+as it requires.
+
+187
+00:17:27,000 --> 00:17:36,000
+And here's how it looks like the next directive is users now use this Model Directive Force, a service
+
+188
+00:17:36,000 --> 00:17:44,000
+used by this module, making the model a service consumer, a service services, an object of loss that
+
+189
+00:17:44,000 --> 00:17:45,000
+implements the interface.
+
+190
+00:17:45,000 --> 00:17:49,000
+So extensive apps are specified in the users directive.
+
+191
+00:17:50,000 --> 00:17:55,000
+With this in mind, the services our model consumes with a users directive.
+
+192
+00:17:56,000 --> 00:17:58,000
+No, just the last name we use.
+
+193
+00:17:58,000 --> 00:18:06,000
+This is the interface for apps, loss of the service, the on the implementation class, because service
+
+194
+00:18:06,000 --> 00:18:12,000
+in this context means and implementation of a specific interface or apps a gloss that can be consumed
+
+195
+00:18:12,000 --> 00:18:14,000
+by OSI classes.
+
+196
+00:18:14,000 --> 00:18:21,000
+But what is the difference between uses and requires the wrappers we might require and more uses?
+
+197
+00:18:21,000 --> 00:18:29,000
+It provides a service we want to consume, but that service implements an interface from one of its
+
+198
+00:18:29,000 --> 00:18:36,000
+transitive dependencies instead of forcing our module to require all transitive dependencies.
+
+199
+00:18:36,000 --> 00:18:43,000
+Just in case we use the uses, Directive two adds the required interface to the module.
+
+200
+00:18:43,000 --> 00:18:44,000
+POS is a career.
+
+201
+00:18:45,000 --> 00:18:52,000
+We have discussed directives that consumes the services, but this also means that we have modules that
+
+202
+00:18:52,000 --> 00:19:00,000
+provides services so a module can also be a service providers that other modules can consume, and we
+
+203
+00:19:00,000 --> 00:19:04,000
+can ensure this voice provides with direction.
+
+204
+00:19:05,000 --> 00:19:12,000
+We should write provides key words first and specifies the interface or abstract class name of our service
+
+205
+00:19:13,000 --> 00:19:14,000
+is Let's see.
+
+206
+00:19:14,000 --> 00:19:21,000
+What we have to do is to specify what specific implementation of our service we are going to provide
+
+207
+00:19:22,000 --> 00:19:24,000
+was a help with directing.
+
+208
+00:19:25,000 --> 00:19:29,000
+You provide the implementation class name that isn't implements.
+
+209
+00:19:29,000 --> 00:19:33,000
+The interface or extents is an abstract class.
+
+210
+00:19:34,000 --> 00:19:40,000
+The next important declarations that I'd like to show you opens and opens to.
+
+211
+00:19:41,000 --> 00:19:44,000
+Let's learn this before December nine.
+
+212
+00:19:44,000 --> 00:19:53,000
+Reflection could be used to learn about all types in the package and all members of it time even its
+
+213
+00:19:53,000 --> 00:19:58,000
+private members, was the one that allows this capability on not.
+
+214
+00:19:59,000 --> 00:20:04,000
+Thus, nothing was truly encapsulated like we have discussed already.
+
+215
+00:20:05,000 --> 00:20:12,000
+The key motivation of the module system is strong, and cancellation by default and died in the module
+
+216
+00:20:12,000 --> 00:20:19,000
+is not accessible to OSM modules unless it's a public type and you export its package.
+
+217
+00:20:20,000 --> 00:20:26,000
+You expose all the packages you want to expose with Gemini.
+
+218
+00:20:26,000 --> 00:20:28,000
+This also applies to reflection.
+
+219
+00:20:29,000 --> 00:20:36,000
+For example, we can allow runtime only access to a package, so directive opened.
+
+220
+00:20:36,000 --> 00:20:44,000
+Some package indicates that a specific package is public types and then nested public and protected
+
+221
+00:20:44,000 --> 00:20:49,000
+types accessible to code in other modules at runtime only.
+
+222
+00:20:49,000 --> 00:20:59,000
+Also, all the types in the specified package and all of the types members are accessible via reflection.
+
+223
+00:20:59,000 --> 00:21:08,000
+Another example We can allow runtime only access the package by specific modules and opens to Model
+
+224
+00:21:08,000 --> 00:21:08,000
+Directive.
+
+225
+00:21:09,000 --> 00:21:18,000
+Like, for example, open package name to some list of modules indicates that specific packages, public
+
+226
+00:21:18,000 --> 00:21:26,000
+types and then nascent public and protected types are accessible to code in the list of modules at runtime
+
+227
+00:21:26,000 --> 00:21:27,000
+only.
+
+228
+00:21:27,000 --> 00:21:35,000
+All of the types in the specified package and all of the types members are accessible via reflection
+
+229
+00:21:35,000 --> 00:21:37,000
+to court in the specified modules.
+
+230
+00:21:38,000 --> 00:21:45,000
+We have discussed already that one of the main goals of modules is strong encapsulation, and I believe
+
+231
+00:21:45,000 --> 00:21:50,000
+that you watched the previous lesson and you're pretty familiar with reflection by this moment already.
+
+232
+00:21:51,000 --> 00:21:58,000
+So you can understand that before June nine, it was possible to use a reflection to examine every type
+
+233
+00:21:59,000 --> 00:22:02,000
+and the member in the package, even the private ones.
+
+234
+00:22:03,000 --> 00:22:04,000
+Was through.
+
+235
+00:22:04,000 --> 00:22:11,000
+Really encapsulated, which can open up all kinds of problems for developers of the libraries because
+
+236
+00:22:11,000 --> 00:22:13,000
+Java nine enforce a strong encapsulation.
+
+237
+00:22:14,000 --> 00:22:21,000
+We have to explicitly grant permission for OSM modules to reflect on our classes if we want to continue
+
+238
+00:22:21,000 --> 00:22:28,000
+to allow full reflection as older versions of Java did, we can simply opens entire modules by using
+
+239
+00:22:28,000 --> 00:22:32,000
+open direct before module name like you see on the slide.
+
+240
+00:22:33,000 --> 00:22:35,000
+Does it make sense so far?
+
+241
+00:22:35,000 --> 00:22:42,000
+And please always remember these in case you have any questions, please post them below this video
+
+242
+00:22:42,000 --> 00:22:45,000
+and I will be happy to answer those.
+
+243
+00:22:45,000 --> 00:22:51,000
+We have just learned directives that we can use in our modules in profile.
+
+244
+00:22:51,000 --> 00:22:55,000
+The next step would be to learn how to build our modules.
+
+245
+00:22:56,000 --> 00:22:59,000
+And before I show you examples of how to do that.
+
+246
+00:23:00,000 --> 00:23:01,000
+Let me explain.
+
+247
+00:23:01,000 --> 00:23:08,000
+Different command line options that we can use when we build Java modules, even despite the fact that
+
+248
+00:23:08,000 --> 00:23:15,000
+later in our course, we are going to learn such views as Randall and May one and zero when you have
+
+249
+00:23:15,000 --> 00:23:18,000
+support for building modules in Java.
+
+250
+00:23:18,000 --> 00:23:22,000
+It's still valuable to know how to use modules.
+
+251
+00:23:22,000 --> 00:23:28,000
+System forms a common plan will be used as a common line for our full example.
+
+252
+00:23:28,000 --> 00:23:36,000
+I'm going to show you in a few minutes to help solidify how the entire system works in our minds.
+
+253
+00:23:37,000 --> 00:23:38,000
+Module Pass.
+
+254
+00:23:38,000 --> 00:23:42,000
+We use a module pass option to specify the module for us.
+
+255
+00:23:42,000 --> 00:23:49,000
+This is a list of one on one directories that contain our modules athletes.
+
+256
+00:23:49,000 --> 00:23:57,000
+Instead of relying on the module declaration file, we can use the command line equivalent of the requires
+
+257
+00:23:57,000 --> 00:23:59,000
+directors and experts.
+
+258
+00:24:00,000 --> 00:24:09,000
+Common Line replacement for the X Plus DirecTV and Opens replaces the open clause in the module declaration
+
+259
+00:24:09,000 --> 00:24:16,000
+file adds modules adds is a list of modules into the default set of modules.
+
+260
+00:24:16,000 --> 00:24:24,000
+These modules creates a list of all modules and their version strings by each module.
+
+261
+00:24:24,000 --> 00:24:27,000
+Add or overwrite classes in modules.
+
+262
+00:24:28,000 --> 00:24:38,000
+Illegal acts was values is permit over or do not use a relaxed encapsulation by showing a single global
+
+263
+00:24:38,000 --> 00:24:43,000
+warning shows rewarding or fails with errors.
+
+264
+00:24:43,000 --> 00:24:45,000
+The default is permit.
+
+265
+00:24:46,000 --> 00:24:49,000
+Finally, we are done with the mini series piece.
+
+266
+00:24:49,000 --> 00:24:53,000
+Let's continue learning modules with examples now.
+
+267
+00:24:53,000 --> 00:24:57,000
+This would be our Hello World modular application.
+
+268
+00:24:57,000 --> 00:25:04,000
+Thus, it would all be super complicated because the main goal right now is to make you understand key
+
+269
+00:25:04,000 --> 00:25:07,000
+principles of modular application.
+
+270
+00:25:08,000 --> 00:25:15,000
+The rest of the synths will be super easy to understand if you learned how everything works on the hood.
+
+271
+00:25:15,000 --> 00:25:23,000
+So first of all, I want to say that for the sake of the demo, I created separate multi module project.
+
+272
+00:25:23,000 --> 00:25:27,000
+I will share with you a link to it in attachments to this lesson.
+
+273
+00:25:28,000 --> 00:25:32,000
+I have Food Project folder and I created the Modules folder.
+
+274
+00:25:33,000 --> 00:25:38,000
+Apparently, this folder will contain different modules of my app.
+
+275
+00:25:38,000 --> 00:25:43,000
+It is full of some main modules as a root source package.
+
+276
+00:25:43,000 --> 00:25:49,000
+For example, it was a top level package of the module is compatibles greetings.
+
+277
+00:25:49,000 --> 00:25:52,000
+Then I named the module in the same way.
+
+278
+00:25:53,000 --> 00:25:55,000
+Note this is a full stops.
+
+279
+00:25:55,000 --> 00:25:57,000
+These are modular root directory name.
+
+280
+00:25:58,000 --> 00:26:07,000
+Z's full stops need to be easier because part of the module name Zen not to be interpreted as subdirectory
+
+281
+00:26:07,000 --> 00:26:08,000
+POS dividers.
+
+282
+00:26:09,000 --> 00:26:09,000
+Is it the.
+
+283
+00:26:10,000 --> 00:26:13,000
+As you can see, I have two models here.
+
+284
+00:26:13,000 --> 00:26:16,000
+Let me start from greeting Swan.
+
+285
+00:26:16,000 --> 00:26:24,000
+It contains loss was named greetings and static mass insight that brings hello world to console.
+
+286
+00:26:25,000 --> 00:26:28,000
+Each model should have Model E for file.
+
+287
+00:26:29,000 --> 00:26:32,000
+Let's look at the model descriptor of this model.
+
+288
+00:26:32,000 --> 00:26:34,000
+On the top, you can see model name.
+
+289
+00:26:35,000 --> 00:26:42,000
+Basically, model name and name of the model for this should match and be expert package from this model.
+
+290
+00:26:42,000 --> 00:26:46,000
+Experts directive is used was package name.
+
+291
+00:26:47,000 --> 00:26:53,000
+Now creates a second model is the name of my second module is Compatibles App.
+
+292
+00:26:53,000 --> 00:26:56,000
+This is the main module that uses greetings module.
+
+293
+00:26:57,000 --> 00:27:04,000
+It has only one class was the main message where we use greetings class to invoke say hello mass pay
+
+294
+00:27:04,000 --> 00:27:05,000
+attention.
+
+295
+00:27:05,000 --> 00:27:11,000
+We also have the import statement here to import greetings class from another package.
+
+296
+00:27:11,000 --> 00:27:14,000
+This module also has module descriptor.
+
+297
+00:27:15,000 --> 00:27:16,000
+Let's look at it.
+
+298
+00:27:16,000 --> 00:27:24,000
+Here we can see that this module requires my greetings module, and this is all of this agree because
+
+299
+00:27:24,000 --> 00:27:27,000
+we are using class from greetings module in this one.
+
+300
+00:27:28,000 --> 00:27:36,000
+Then the stand dependencies between these two modules, if he isn't great, if no, please press pause
+
+301
+00:27:36,000 --> 00:27:40,000
+for a minute and think about it one more time.
+
+302
+00:27:40,000 --> 00:27:48,000
+The next step that we need to do this to compile our models specially for that, I create a script that
+
+303
+00:27:48,000 --> 00:27:50,000
+will compile all sources.
+
+304
+00:27:50,000 --> 00:28:00,000
+It is located in the root directory and it is called Build this sage I use Linux shall come here, so
+
+305
+00:28:00,000 --> 00:28:07,000
+pay attention to your transit script, either on Linux platforms or from Bosch on your Windows machine
+
+306
+00:28:07,000 --> 00:28:12,000
+and do not use Windows Common Line to run this script.
+
+307
+00:28:12,000 --> 00:28:14,000
+You know what Java commands?
+
+308
+00:28:15,000 --> 00:28:16,000
+This is our Java compiler.
+
+309
+00:28:17,000 --> 00:28:24,000
+After that, I pass the name of the output directly to specify where I want to put the compiled classes.
+
+310
+00:28:25,000 --> 00:28:29,000
+The next thing I do, I need to pass module source plus option.
+
+311
+00:28:30,000 --> 00:28:33,000
+This is different from the one I shared before.
+
+312
+00:28:33,000 --> 00:28:40,000
+If you remember the interview module courses on a separate slot, there is a difference between module
+
+313
+00:28:40,000 --> 00:28:43,000
+costs and module source boss.
+
+314
+00:28:43,000 --> 00:28:51,000
+The component needs a distinction between the code it used to compile in module source, boss and location
+
+315
+00:28:51,000 --> 00:28:55,000
+of compiled dependencies and libraries.
+
+316
+00:28:55,000 --> 00:28:58,000
+Module boss does it make more sense now?
+
+317
+00:28:59,000 --> 00:29:02,000
+I was here name of my folder with modules.
+
+318
+00:29:03,000 --> 00:29:09,000
+After that, I used Show Command to find old files with Java Extension in Modules folder.
+
+319
+00:29:10,000 --> 00:29:13,000
+Once my modular app is compiled, I can run it.
+
+320
+00:29:14,000 --> 00:29:16,000
+I have another script for this.
+
+321
+00:29:16,000 --> 00:29:18,000
+Is it a school run app or sage?
+
+322
+00:29:19,000 --> 00:29:21,000
+Let's look at it in this script.
+
+323
+00:29:21,000 --> 00:29:25,000
+You also see program that is familiar to you, Java.
+
+324
+00:29:26,000 --> 00:29:28,000
+I am going to start Java Virtual Machine.
+
+325
+00:29:29,000 --> 00:29:37,000
+I use option module POS to puzzle the reference to the compiled modules and after completion, all of
+
+326
+00:29:37,000 --> 00:29:41,000
+them are stored in target output directory.
+
+327
+00:29:41,000 --> 00:29:49,000
+You can see that all files here have class extension and even module info file is compiled into class
+
+328
+00:29:49,000 --> 00:29:49,000
+file.
+
+329
+00:29:50,000 --> 00:29:58,000
+Zen I specifies that most of the class it contains main message zip past consists of module name and
+
+330
+00:29:58,000 --> 00:29:59,000
+full class name.
+
+331
+00:30:00,000 --> 00:30:08,000
+So in this particular example, Compatibles Rules app is the model name and call it Bus App.
+
+332
+00:30:08,000 --> 00:30:11,000
+App is a full class name.
+
+333
+00:30:11,000 --> 00:30:12,000
+Is this clear?
+
+334
+00:30:13,000 --> 00:30:17,000
+For the sake of the demo, I opened it March inside eclipse.
+
+335
+00:30:17,000 --> 00:30:27,000
+I run build S.H. script first, and after that I run run apps, script and hindcast so we can see Hello
+
+336
+00:30:27,000 --> 00:30:29,000
+World from the application.
+
+337
+00:30:29,000 --> 00:30:30,000
+Can you see this?
+
+338
+00:30:30,000 --> 00:30:34,000
+Congratulations to you with your first modular application.
+
+339
+00:30:35,000 --> 00:30:40,000
+One more small comment here was the moment of recording this video.
+
+340
+00:30:40,000 --> 00:30:45,000
+There is no single and proper way of using Eclipse to run multi-modal application.
+
+341
+00:30:46,000 --> 00:30:51,000
+There might be some additional steps to configure multimodal application in eclipse.
+
+342
+00:30:52,000 --> 00:30:59,000
+That's why, even on your work, most likely you would use common client to build and to run your complex
+
+343
+00:30:59,000 --> 00:31:02,000
+enterprise application for the sake of convenience.
+
+344
+00:31:03,000 --> 00:31:10,000
+You still can work in eclipse, but do you need to be prepared that sometimes you will see more errors?
+
+345
+00:31:10,000 --> 00:31:17,000
+Is unusual because sometimes it is hard to conceive of all dependencies, not in the app, but in the
+
+346
+00:31:17,000 --> 00:31:25,000
+creep's itself in order Eclipse would understand the clearly dependencies between all modules.
+
+347
+00:31:25,000 --> 00:31:33,000
+Here's an example you can import two modules as separate projects and work in Java editor was Java files.
+
+348
+00:31:34,000 --> 00:31:42,000
+But in app module, you may see error because Eclipse can't see dependency on another module.
+
+349
+00:31:42,000 --> 00:31:49,000
+Since technically fruit loops, this is a separate project, and the groups allows only one module info
+
+350
+00:31:49,000 --> 00:31:51,000
+file per project.
+
+351
+00:31:51,000 --> 00:31:53,000
+In order to remove the error.
+
+352
+00:31:53,000 --> 00:31:57,000
+Sometimes you may need to configure dependencies manually.
+
+353
+00:31:57,000 --> 00:32:04,000
+If Eclipse didn't manage to configure everything automatically, for example, in my app module, I
+
+354
+00:32:04,000 --> 00:32:11,000
+open built up submenu, configure builds bus and here on library staff.
+
+355
+00:32:12,000 --> 00:32:16,000
+On the Module POS, I select Add Class Folder.
+
+356
+00:32:16,000 --> 00:32:24,000
+Here I put checkbox next to the modules that they need in this one, namely Reding's module and press,
+
+357
+00:32:24,000 --> 00:32:24,000
+OK.
+
+358
+00:32:25,000 --> 00:32:32,000
+Now you wouldn't see any errors in the clips, but in case you have multiple modules and not all of
+
+359
+00:32:32,000 --> 00:32:34,000
+them, I configure it automatically.
+
+360
+00:32:34,000 --> 00:32:41,000
+This might take time during the configuration of your project very first time after these configuration
+
+361
+00:32:41,000 --> 00:32:42,000
+steps.
+
+362
+00:32:42,000 --> 00:32:44,000
+You may run even from Eclipse.
+
+363
+00:32:45,000 --> 00:32:51,000
+Can you see this great since you have near Z simple syncs already?
+
+364
+00:32:51,000 --> 00:32:56,000
+Let me show you how to add the service to our modular application.
+
+365
+00:32:56,000 --> 00:33:04,000
+In my Goulding's module, I declare an interface was name service status log that contains only one
+
+366
+00:33:04,000 --> 00:33:07,000
+massive print service that is slow.
+
+367
+00:33:07,000 --> 00:33:10,000
+I have implementation of this interface.
+
+368
+00:33:10,000 --> 00:33:17,000
+Is it the school default service status slogan for the sake of our demo and just brings text to console?
+
+369
+00:33:18,000 --> 00:33:26,000
+Now, in my model info file, I need to declare that this module provides such service was a complete
+
+370
+00:33:26,000 --> 00:33:27,000
+implementation.
+
+371
+00:33:27,000 --> 00:33:30,000
+I use provides service directive for.
+
+372
+00:33:30,000 --> 00:33:37,000
+This is the next logical step would be to consumes this service in my app module.
+
+373
+00:33:37,000 --> 00:33:44,000
+I use uses directly for that and specify full class name of the interface.
+
+374
+00:33:45,000 --> 00:33:52,000
+After that, in App G+ with the help of Service Loader from January to package I can load my service.
+
+375
+00:33:52,000 --> 00:33:57,000
+I use load mass and quasi loss of the services that I need.
+
+376
+00:33:57,000 --> 00:34:00,000
+Service loader is a terrible time.
+
+377
+00:34:01,000 --> 00:34:07,000
+That's why it has iterate mass app that allows me to get a reference to the first service load.
+
+378
+00:34:07,000 --> 00:34:12,000
+The object in the sequence handles a reference to the object.
+
+379
+00:34:12,000 --> 00:34:15,000
+I can call print service that is massive.
+
+380
+00:34:16,000 --> 00:34:24,000
+Let's now use our new brush to compile new sources one more time and run our app in so you can see that
+
+381
+00:34:24,000 --> 00:34:27,000
+we successfully managed to invoke service message.
+
+382
+00:34:28,000 --> 00:34:31,000
+That's all what I wanted to share with you in this lesson.
+
+383
+00:34:32,000 --> 00:34:35,000
+Let's recap what we have learned in this lesson.
+
+384
+00:34:36,000 --> 00:34:40,000
+In the lesson we have learned what general models are all seeing.
+
+385
+00:34:40,000 --> 00:34:45,000
+Those are goals that we want to achieve and that that captures images.
+
+386
+00:34:45,000 --> 00:34:47,000
+376.
+
+387
+00:34:47,000 --> 00:34:53,000
+We have learned different more of those types of after that revealed details.
+
+388
+00:34:53,000 --> 00:35:01,000
+Different command line options to work was more use and on real example, you saw how to create, build
+
+389
+00:35:01,000 --> 00:35:03,000
+and run modular application.
+
+390
+00:35:04,000 --> 00:35:06,000
+Together, we can simulate eclipse.
+
+391
+00:35:06,000 --> 00:35:13,000
+The work was modular application form I.D. and the zenith of the lesson I explained to you how to provide
+
+392
+00:35:13,000 --> 00:35:16,000
+and consume service in different modules.
+
+393
+00:35:17,000 --> 00:35:19,000
+Thanks a lot for your attention.
+
+394
+00:35:19,000 --> 00:35:22,000
+Have a great day and see you in the next lesson.
+
diff --git a/32 - Java Platform Module System Modules in Java & Migration of Java Apps/001 Source-code-examples-from-the-lesson-Modular-Project.url b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/001 Source-code-examples-from-the-lesson-Modular-Project.url
new file mode 100644
index 0000000000000000000000000000000000000000..63d2979d30e45cb5541ef5a1800ec67004f08652
--- /dev/null
+++ b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/001 Source-code-examples-from-the-lesson-Modular-Project.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/java-modules
\ No newline at end of file
diff --git a/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 -Example-Migration-Guide-by-Oracle.url b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 -Example-Migration-Guide-by-Oracle.url
new file mode 100644
index 0000000000000000000000000000000000000000..27ff3cd40f205982d08626f78f6fa7f7950ba5af
--- /dev/null
+++ b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 -Example-Migration-Guide-by-Oracle.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://docs.oracle.com/en/java/javase/12/migrate/index.html#JSMIG-GUID-C25E2B1D-6C24-4403-8540-CFEA875B994A
\ No newline at end of file
diff --git a/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 Migration of Java Apps Example of migration to a modular application_en.srt b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 Migration of Java Apps Example of migration to a modular application_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..584ff656137dfdfe23e9e2ed97f0dd49d55bc26d
--- /dev/null
+++ b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 Migration of Java Apps Example of migration to a modular application_en.srt
@@ -0,0 +1,1524 @@
+1
+00:00:06,000 --> 00:00:11,000
+Hello, distance in Prius lesson, we have learned what modules are in decay?
+
+2
+00:00:11,000 --> 00:00:14,000
+We also created our first modular application.
+
+3
+00:00:14,000 --> 00:00:21,000
+In case you skipped the previous lesson, please make sure you watched it because in this lesson, we'll
+
+4
+00:00:21,000 --> 00:00:23,000
+keep talking about modules.
+
+5
+00:00:24,000 --> 00:00:28,000
+But this time will not create our module application from scratch.
+
+6
+00:00:28,000 --> 00:00:35,000
+But instead, we'll focus our attention on the questions of migration of Nano Modular Java application
+
+7
+00:00:35,000 --> 00:00:37,000
+to modular Java application.
+
+8
+00:00:37,000 --> 00:00:44,000
+Also, this lesson will be interesting for architects who are in charge of Java migration and responsible
+
+9
+00:00:44,000 --> 00:00:47,000
+for making decisions and planning next migration steps.
+
+10
+00:00:48,000 --> 00:00:53,000
+You need to be aware about issues and solutions that we are going to discuss in this lesson.
+
+11
+00:00:54,000 --> 00:01:00,000
+This is a super important topic, especially if your organization made a decision to migrate from Java
+
+12
+00:01:00,000 --> 00:01:07,000
+eight to NAS, a long term support version like Java Plans that includes support of modules.
+
+13
+00:01:07,000 --> 00:01:14,000
+And also, this is super important in case you decide to pass Oracle Java certifications, because some
+
+14
+00:01:14,000 --> 00:01:22,000
+of the Oracle certifications include questions about migration to modular application, including top
+
+15
+00:01:22,000 --> 00:01:29,000
+down and bottom up migration, and Split Ajala Agile Associates application into modules for migration.
+
+16
+00:01:30,000 --> 00:01:36,000
+We'll start our lesson from learning and understanding of general algorithm for migration of our court
+
+17
+00:01:36,000 --> 00:01:41,000
+to the new environment, including migration to the new version of Dedicate.
+
+18
+00:01:41,000 --> 00:01:47,000
+Special focus today will be the migration of application to modular architecture.
+
+19
+00:01:47,000 --> 00:01:54,000
+I will explain in one Java Class Dependency Analyzer tool is and what Java deprecated API is.
+
+20
+00:01:54,000 --> 00:01:57,000
+Current tool is also we're going to learn today.
+
+21
+00:01:57,000 --> 00:02:04,000
+Different migration strategies will review Bottom-Up and top-down migration strategies that start our
+
+22
+00:02:04,000 --> 00:02:05,000
+lesson.
+
+23
+00:02:06,000 --> 00:02:13,000
+And before I start diving in details, let's come up with steps and migration algorithm first, the
+
+24
+00:02:13,000 --> 00:02:15,000
+step number zero and super important one.
+
+25
+00:02:16,000 --> 00:02:21,000
+If you great internet, not sure that you would find this advice anywhere, but exactly as you said,
+
+26
+00:02:21,000 --> 00:02:23,000
+was help make them a great deal.
+
+27
+00:02:23,000 --> 00:02:29,000
+Worse software products two different versions and environments before any movements were scored that
+
+28
+00:02:29,000 --> 00:02:36,000
+potentially may impact the way our program works, no matter whether this is refactoring or migrating
+
+29
+00:02:36,000 --> 00:02:41,000
+and in what may impact or change code and the way how it is executed.
+
+30
+00:02:42,000 --> 00:02:45,000
+Make sure that you have for libel suit of tests on different levels.
+
+31
+00:02:46,000 --> 00:02:51,000
+The general recommendation here would be to automate as much as possible.
+
+32
+00:02:51,000 --> 00:02:57,000
+Some of my clients say to me that this automation is a huge investments and they have dedicated manual
+
+33
+00:02:57,000 --> 00:03:04,000
+regression time and cost wise, easy to understand the point you were talking about short periods of
+
+34
+00:03:04,000 --> 00:03:07,000
+time and a not complex project.
+
+35
+00:03:07,000 --> 00:03:11,000
+But I also saw projects where regression takes months.
+
+36
+00:03:11,000 --> 00:03:13,000
+Nowadays, probably it is crazy.
+
+37
+00:03:13,000 --> 00:03:19,000
+Amount of times it will add this software product to survive in the current environment, where your
+
+38
+00:03:19,000 --> 00:03:26,000
+competitors are releasing new features each week or two weeks and your product only has regression for
+
+39
+00:03:26,000 --> 00:03:26,000
+one months.
+
+40
+00:03:27,000 --> 00:03:27,000
+Definitely.
+
+41
+00:03:27,000 --> 00:03:30,000
+Is there a different areas and domains?
+
+42
+00:03:30,000 --> 00:03:31,000
+Some of them more competitive?
+
+43
+00:03:32,000 --> 00:03:33,000
+Some of them less.
+
+44
+00:03:33,000 --> 00:03:35,000
+But I am sure you understood my point.
+
+45
+00:03:36,000 --> 00:03:42,000
+So when my clients send me about not having enough resources on the creation of automation test and
+
+46
+00:03:42,000 --> 00:03:48,000
+framework that includes small tests, use regression tests, etc., I'm asking a simple question.
+
+47
+00:03:49,000 --> 00:03:55,000
+I am sure that in this case, you have enough resources and needs to halt any migrations.
+
+48
+00:03:56,000 --> 00:04:02,000
+Probably it is better to put resources into product development, marketing to the market, find investments
+
+49
+00:04:02,000 --> 00:04:09,000
+and come to the point where we have enough resources to scale and grow because otherwise we are not
+
+50
+00:04:09,000 --> 00:04:12,000
+doing any migration just to do migration.
+
+51
+00:04:12,000 --> 00:04:20,000
+We need to identify purposes of the migration and be sure that our migration brings some value and it
+
+52
+00:04:20,000 --> 00:04:21,000
+is needed.
+
+53
+00:04:21,000 --> 00:04:27,000
+And if it is needed, we're happy to accept all imports and provide everything what is necessary to
+
+54
+00:04:27,000 --> 00:04:28,000
+make this happen.
+
+55
+00:04:29,000 --> 00:04:31,000
+Here's where the first principle comes from.
+
+56
+00:04:32,000 --> 00:04:39,000
+We need to identify goals of our migration and measures to stay specific and objective.
+
+57
+00:04:39,000 --> 00:04:46,000
+What we are trying to achieve by performance, better security, better code design in order to be able
+
+58
+00:04:46,000 --> 00:04:48,000
+to scale application faster.
+
+59
+00:04:49,000 --> 00:04:53,000
+This is super important and once goal is defined.
+
+60
+00:04:53,000 --> 00:04:56,000
+Make measurements of the current system.
+
+61
+00:04:56,000 --> 00:04:58,000
+You need to have something and other.
+
+62
+00:04:58,000 --> 00:05:00,000
+You can say communication has been successful.
+
+63
+00:05:00,000 --> 00:05:06,000
+Often, migration trends are the goals were achieved because at the end of the day, we never the a
+
+64
+00:05:06,000 --> 00:05:09,000
+factor on migration just for fun.
+
+65
+00:05:09,000 --> 00:05:12,000
+We do it to get advantage of measurable benefits.
+
+66
+00:05:13,000 --> 00:05:14,000
+Never forget about this.
+
+67
+00:05:15,000 --> 00:05:21,000
+Let's agree it's within the scope of this particular demo will hold migration to another long term support
+
+68
+00:05:21,000 --> 00:05:28,000
+Java release in order to achieve better structure in order to simplify introducing of new features,
+
+69
+00:05:29,000 --> 00:05:35,000
+improving court architecture to make each release predictable and reduce impact of introducing new changes
+
+70
+00:05:35,000 --> 00:05:37,000
+on already released codes.
+
+71
+00:05:38,000 --> 00:05:39,000
+Improved security.
+
+72
+00:05:39,000 --> 00:05:46,000
+We are achieving better encapsulation of components, greater platform integrity, improved performance.
+
+73
+00:05:47,000 --> 00:05:52,000
+These are goals of Java platform Model S system and in case you missed the previous lesson.
+
+74
+00:05:52,000 --> 00:06:00,000
+Please watch it because we discussed goals and benefits of modules in detail in previous lesson, and
+
+75
+00:06:00,000 --> 00:06:03,000
+we agreed to migrate our app to the modular architecture.
+
+76
+00:06:04,000 --> 00:06:06,000
+Let's review the following steps for this.
+
+77
+00:06:07,000 --> 00:06:14,000
+The next thing that we need to do is to download the updated JDK version Java Platform Modular System
+
+78
+00:06:14,000 --> 00:06:17,000
+finally was introduced in Java version nine.
+
+79
+00:06:18,000 --> 00:06:25,000
+But as we discussed in the first lesson about JDK, I would recommend you to use long term support Java
+
+80
+00:06:25,000 --> 00:06:25,000
+versions.
+
+81
+00:06:26,000 --> 00:06:28,000
+Nowadays, we have two long term support versions.
+
+82
+00:06:29,000 --> 00:06:35,000
+They are eight and 11 considering that we want to migrate our app to have modular application.
+
+83
+00:06:36,000 --> 00:06:39,000
+Most likely, we would opt for Java version 11.
+
+84
+00:06:39,000 --> 00:06:43,000
+But you also can opt for Java version nine if you wish.
+
+85
+00:06:44,000 --> 00:06:46,000
+Wrong application was near adjudicate.
+
+86
+00:06:46,000 --> 00:06:48,000
+This is also important step.
+
+87
+00:06:48,000 --> 00:06:54,000
+Java ensures backwards compatibility, but still, there might be some changes.
+
+88
+00:06:55,000 --> 00:07:02,000
+For example, if you used some options for garbage collector, pay attention that, for example, indicate,
+
+89
+00:07:02,000 --> 00:07:04,000
+well, some of them removed.
+
+90
+00:07:05,000 --> 00:07:11,000
+That's why, even despite Java guarantees backwards compatibility, it is never redundant to compile
+
+91
+00:07:12,000 --> 00:07:14,000
+and run your app with new adjudication.
+
+92
+00:07:15,000 --> 00:07:20,000
+Also, this might be important to ensure compatibility was a by your libraries.
+
+93
+00:07:20,000 --> 00:07:26,000
+So the main goal is to run your app on the use adjudicate mission and to deal with this task.
+
+94
+00:07:26,000 --> 00:07:32,000
+You need to be aware about new features in Japanese that you want to use for immigration.
+
+95
+00:07:32,000 --> 00:07:35,000
+This can be easily found on the official websites.
+
+96
+00:07:36,000 --> 00:07:40,000
+The first step would be to update third party dependencies if needed.
+
+97
+00:07:40,000 --> 00:07:47,000
+So we need to make sure that your app was all external dependencies may be compiled, built and started
+
+98
+00:07:47,000 --> 00:07:51,000
+successfully Ranji DApps against your project.
+
+99
+00:07:52,000 --> 00:07:53,000
+Enthusiasm for familiar with J.
+
+100
+00:07:53,000 --> 00:07:55,000
+DApps and don't know what it is.
+
+101
+00:07:56,000 --> 00:07:57,000
+Let me quickly explain.
+
+102
+00:07:58,000 --> 00:08:05,000
+Basically, this is a tool that is present in JDK to identify dependencies between classes, modules,
+
+103
+00:08:05,000 --> 00:08:07,000
+packages in your app.
+
+104
+00:08:07,000 --> 00:08:12,000
+It is a common line to runs a Java Class Dependency Analyzer tool.
+
+105
+00:08:13,000 --> 00:08:20,000
+It processes Java bytecode, meaning the class files all the jars that contains them and analyzes the
+
+106
+00:08:20,000 --> 00:08:23,000
+statically declared dependencies between the classes.
+
+107
+00:08:23,000 --> 00:08:30,000
+The results can be filtered in various ways and can be aggregated to package or jar level.
+
+108
+00:08:31,000 --> 00:08:34,000
+Knapp's is also fully aware of the module system.
+
+109
+00:08:34,000 --> 00:08:41,000
+This is super important and useful for you to understand before you plan and immigration, and before
+
+110
+00:08:41,000 --> 00:08:47,000
+you make any final decision about your modules and packages structured a little bit later.
+
+111
+00:08:47,000 --> 00:08:54,000
+In this lesson, I am going to show you how to work with Jade DApps program Ramji that are scrum against
+
+112
+00:08:54,000 --> 00:08:55,000
+your project.
+
+113
+00:08:55,000 --> 00:08:59,000
+If you're not familiar with this, though, let me quickly explain what it is.
+
+114
+00:09:00,000 --> 00:09:07,000
+This tool is a static analysis tools its concept jar file or some other aggregation of class files for
+
+115
+00:09:07,000 --> 00:09:10,000
+usages of deprecated API elements.
+
+116
+00:09:10,000 --> 00:09:18,000
+When you upgrade to the new version, you might be interested in this information to to update your
+
+117
+00:09:18,000 --> 00:09:19,000
+code accordingly.
+
+118
+00:09:19,000 --> 00:09:26,000
+Do not accumulate dependencies on deprecated classes and masses a little bit later today on the real
+
+119
+00:09:26,000 --> 00:09:30,000
+example, I'm going to show you how to apply this to now.
+
+120
+00:09:30,000 --> 00:09:36,000
+After all these steps, we're safe to proceed with the next steps on this stage.
+
+121
+00:09:36,000 --> 00:09:43,000
+Having all necessary input information, we are ready to make a decision and plan the duration we need
+
+122
+00:09:43,000 --> 00:09:45,000
+to select the migration strategy.
+
+123
+00:09:45,000 --> 00:09:47,000
+Today, we'll discuss a few of them.
+
+124
+00:09:48,000 --> 00:09:53,000
+Once you select migration strategy and plan migration steps, we're going to proceed with migration
+
+125
+00:09:53,000 --> 00:09:54,000
+execution.
+
+126
+00:09:55,000 --> 00:10:02,000
+Usually, Oracle and community release migration guides for each new version that contains important
+
+127
+00:10:02,000 --> 00:10:06,000
+information that you need to consider during the migration of your app.
+
+128
+00:10:06,000 --> 00:10:10,000
+One of such goods, I will leave in attachments to the lesson.
+
+129
+00:10:10,000 --> 00:10:17,000
+But you can easily find similar guides for other versions, and each migration should be followed by
+
+130
+00:10:17,000 --> 00:10:18,000
+regression testing.
+
+131
+00:10:18,000 --> 00:10:25,000
+We already discussed that even before starting doing steps like this, we need to make sure that we
+
+132
+00:10:25,000 --> 00:10:32,000
+have reliable sort of tests that will allow us to confirm that at least nothing is broken and migration
+
+133
+00:10:32,000 --> 00:10:33,000
+goals are achieved.
+
+134
+00:10:34,000 --> 00:10:39,000
+After that, we are ready to proceed with a step where you can apply measurements that you did before
+
+135
+00:10:39,000 --> 00:10:42,000
+migration to verify region of migration goals.
+
+136
+00:10:43,000 --> 00:10:49,000
+For example, if the goal was to improve performance, measure performance of your app after migration
+
+137
+00:10:49,000 --> 00:10:52,000
+and if performance become even worse.
+
+138
+00:10:52,000 --> 00:10:55,000
+The question is was immigration was successful?
+
+139
+00:10:55,000 --> 00:10:57,000
+I don't think so.
+
+140
+00:10:57,000 --> 00:11:02,000
+That means is that some steps still need to be done and planned.
+
+141
+00:11:02,000 --> 00:11:08,000
+This migration should be adjusted to include additional steps to reach the goal of migration.
+
+142
+00:11:08,000 --> 00:11:09,000
+Does it make sense?
+
+143
+00:11:10,000 --> 00:11:14,000
+So now, like the reviews it, I'll Google one more time.
+
+144
+00:11:15,000 --> 00:11:16,000
+Press pause if needed.
+
+145
+00:11:17,000 --> 00:11:24,000
+And once you are sure about each step and the sequence of actions we are glad to proceed is a step number
+
+146
+00:11:24,000 --> 00:11:25,000
+zero.
+
+147
+00:11:25,000 --> 00:11:26,000
+I have separate course for that.
+
+148
+00:11:27,000 --> 00:11:30,000
+You can check my course got and test during development.
+
+149
+00:11:30,000 --> 00:11:33,000
+I elaborated a lot on this topic.
+
+150
+00:11:33,000 --> 00:11:36,000
+Step number one is up to you and your organization.
+
+151
+00:11:37,000 --> 00:11:42,000
+You should identify goals of migration internally, and I wouldn't be able to help you with that.
+
+152
+00:11:43,000 --> 00:11:45,000
+Do not forget to perform any measurements.
+
+153
+00:11:45,000 --> 00:11:51,000
+How long was a goal to compare these before immigration and after migration?
+
+154
+00:11:52,000 --> 00:11:57,000
+Regarding the loading of the latest duplicate version, I believe if you already watching this lesson,
+
+155
+00:11:58,000 --> 00:12:03,000
+you are smart and mature enough to download Oracle JDK or open JDK.
+
+156
+00:12:04,000 --> 00:12:07,000
+After that, you need to run your project with new JDK.
+
+157
+00:12:07,000 --> 00:12:13,000
+I'm sure you will be able to those that want the same as updates and third party dependencies too,
+
+158
+00:12:14,000 --> 00:12:18,000
+and with the next step, probably let me help you with that one.
+
+159
+00:12:19,000 --> 00:12:26,000
+Let me explain to you more about the app's program, how to use it and show this on live demo.
+
+160
+00:12:27,000 --> 00:12:33,000
+So as we have discussed, GDP is a Java dependency analysis tool, probably the first questions that
+
+161
+00:12:33,000 --> 00:12:39,000
+students ask me is where they can get the depth and the words they should download.
+
+162
+00:12:39,000 --> 00:12:45,000
+I want to say that you don't need to worry about that if you have dedicated, download it on your PC.
+
+163
+00:12:46,000 --> 00:12:47,000
+This program is already is.
+
+164
+00:12:47,000 --> 00:12:55,000
+They're waiting for you in bin folder since Java version eight will work with this tool directly from
+
+165
+00:12:55,000 --> 00:12:56,000
+Command Prompt.
+
+166
+00:12:57,000 --> 00:13:03,000
+So make sure that you JDK pass configure it properly and that Jane Daps Version Command returns your
+
+167
+00:13:04,000 --> 00:13:05,000
+result in command line.
+
+168
+00:13:06,000 --> 00:13:11,000
+Let me show you a quick them in order you could understand how to work with this still.
+
+169
+00:13:12,000 --> 00:13:15,000
+This told me on the last group of classes.
+
+170
+00:13:15,000 --> 00:13:21,000
+Let me show you two examples now in the first example, I will show you how to analyze old fashioned
+
+171
+00:13:21,000 --> 00:13:25,000
+clean Java project as a simple project we are going to use.
+
+172
+00:13:25,000 --> 00:13:32,000
+My Java project was examples, the ones that are used to demonstrate different topics to students of
+
+173
+00:13:32,000 --> 00:13:32,000
+mine.
+
+174
+00:13:33,000 --> 00:13:40,000
+And then the second example will analyze more single modular project that doesn't have too much dependencies
+
+175
+00:13:40,000 --> 00:13:44,000
+between different packages and modules in case you have a general project.
+
+176
+00:13:44,000 --> 00:13:51,000
+The first thing that you need to do is to aggregate all components resources in one folder miserably
+
+177
+00:13:51,000 --> 00:14:01,000
+Jr. Archive in separate lessons were learned such build tools and maven granule, et cetera, that those
+
+178
+00:14:01,000 --> 00:14:08,000
+in charge of building your project, creating some deployable pieces like jars or walls, and now a
+
+179
+00:14:08,000 --> 00:14:14,000
+specific case would need to generate just by our cells in the clips.
+
+180
+00:14:14,000 --> 00:14:21,000
+I can easily do this by mouse, right click on the project, find them experts option and select the
+
+181
+00:14:21,000 --> 00:14:21,000
+jar.
+
+182
+00:14:21,000 --> 00:14:23,000
+File some options here.
+
+183
+00:14:23,000 --> 00:14:32,000
+Now we need to specify jar pots and place where archive will be located and generated zen numerous of
+
+184
+00:14:32,000 --> 00:14:32,000
+other options.
+
+185
+00:14:33,000 --> 00:14:37,000
+Majority of them are so describing I want a stop on those.
+
+186
+00:14:37,000 --> 00:14:44,000
+But even in case you have some questions, let me know in comments below this video and I will be happy
+
+187
+00:14:44,000 --> 00:14:44,000
+to answer.
+
+188
+00:14:45,000 --> 00:14:47,000
+Now one, we have jar file.
+
+189
+00:14:47,000 --> 00:14:49,000
+We are ready to analyze it.
+
+190
+00:14:49,000 --> 00:14:56,000
+I open it bush terminal in this folder and now executes my script in this directory.
+
+191
+00:14:57,000 --> 00:15:02,000
+Commands that I'm going to execute is stored in a common dirt file.
+
+192
+00:15:03,000 --> 00:15:08,000
+I store the script on the Zagat index so that you could investigate it later.
+
+193
+00:15:08,000 --> 00:15:12,000
+Let me open this script and I will explain what is the reason here.
+
+194
+00:15:13,000 --> 00:15:16,000
+This is actually to invoke Java dependency analysis.
+
+195
+00:15:17,000 --> 00:15:25,000
+That output is a command line option to specify a destination directory for the file output, not file
+
+196
+00:15:25,000 --> 00:15:32,000
+content is simple tags that can be copied and pasted into the online editor, for example, or other
+
+197
+00:15:32,000 --> 00:15:39,000
+editors to generate graphs that visualizes dependencies will generate one in the middle.
+
+198
+00:15:40,000 --> 00:15:44,000
+You can see that they use Dot after dot output option.
+
+199
+00:15:44,000 --> 00:15:51,000
+If you are familiar with this character, then you already know that Daughtery first is a current directory.
+
+200
+00:15:52,000 --> 00:15:59,000
+So this means is a dirt file will be generated in the current directory, whereas this command will
+
+201
+00:15:59,000 --> 00:16:00,000
+be executed.
+
+202
+00:16:01,000 --> 00:16:03,000
+The next option is recursive.
+
+203
+00:16:03,000 --> 00:16:11,000
+This option recursive the traverses or runtime dependencies plus force option specifies directory was
+
+204
+00:16:11,000 --> 00:16:19,000
+ClassPass, including external dependencies in our particular cases, with few external dependencies
+
+205
+00:16:19,000 --> 00:16:20,000
+on different lessons.
+
+206
+00:16:20,000 --> 00:16:24,000
+And I don't know that these jurors into my downloads folder.
+
+207
+00:16:25,000 --> 00:16:32,000
+That's why I also included those here, and the last program argument is just to analyze.
+
+208
+00:16:33,000 --> 00:16:35,000
+Basically, that is the ones that we built.
+
+209
+00:16:36,000 --> 00:16:42,000
+It contains all classes from all packages of my training project that's executed the script.
+
+210
+00:16:43,000 --> 00:16:48,000
+I wrote the name of the script to console and press enter.
+
+211
+00:16:49,000 --> 00:16:56,000
+It takes some time to analyze dependencies, but finally, not file is generated in the current directory.
+
+212
+00:16:57,000 --> 00:17:02,000
+Let's open it, and you can see that the content of this file is just text.
+
+213
+00:17:03,000 --> 00:17:05,000
+It contains some specific structure.
+
+214
+00:17:06,000 --> 00:17:13,000
+You can see dependency of each package on another package, probably when you have session load of packages.
+
+215
+00:17:14,000 --> 00:17:21,000
+It is even better to use this text representation to analyze this data and think about structuring new
+
+216
+00:17:21,000 --> 00:17:21,000
+modules.
+
+217
+00:17:22,000 --> 00:17:27,000
+But still, if you want to visualize it, let's use special tools for that.
+
+218
+00:17:27,000 --> 00:17:31,000
+We can find online tools to visualize our dependencies.
+
+219
+00:17:32,000 --> 00:17:36,000
+For example, we can use just one of those I'm talking about.
+
+220
+00:17:36,000 --> 00:17:45,000
+Map Graph is just Scorpion's based content of the file based here and press generate graphs button.
+
+221
+00:17:45,000 --> 00:17:50,000
+That was easy, but you can see how much gross dependencies we are.
+
+222
+00:17:51,000 --> 00:17:51,000
+Definitely.
+
+223
+00:17:51,000 --> 00:17:57,000
+There is a lot of work here, considering this is a project and a lot of different topics.
+
+224
+00:17:57,000 --> 00:18:04,000
+Some of them very often reuses some common glosses or packages, and that's why we have something like
+
+225
+00:18:04,000 --> 00:18:04,000
+this.
+
+226
+00:18:05,000 --> 00:18:08,000
+You can spend time after the lesson and used to get this.
+
+227
+00:18:09,000 --> 00:18:11,000
+I added these files in to get this.
+
+228
+00:18:12,000 --> 00:18:16,000
+So you will be able to find those in the directory of the project.
+
+229
+00:18:17,000 --> 00:18:23,000
+Most likely, if you would, any great all project that doesn't have more destruction, you would see
+
+230
+00:18:23,000 --> 00:18:24,000
+something like this.
+
+231
+00:18:25,000 --> 00:18:26,000
+Or even worse.
+
+232
+00:18:26,000 --> 00:18:29,000
+Well, most likely you will see worse.
+
+233
+00:18:30,000 --> 00:18:31,000
+Sorry, but this is true.
+
+234
+00:18:32,000 --> 00:18:39,000
+OK, let's move on, and now I'd like to show you how to work with this, though, if you would like
+
+235
+00:18:39,000 --> 00:18:41,000
+to analyze modular application.
+
+236
+00:18:41,000 --> 00:18:46,000
+And you remember, is it a previous lesson of the creative modular application?
+
+237
+00:18:46,000 --> 00:18:49,000
+Let's analyze dependencies for that app.
+
+238
+00:18:50,000 --> 00:18:56,000
+The idea is similar, but instead of Java, you can pass a reference to the director with your modules
+
+239
+00:18:56,000 --> 00:18:59,000
+so you already can make a conclusion.
+
+240
+00:18:59,000 --> 00:19:06,000
+ZG Depths Program has separate group of command line options for modular and non modular applications.
+
+241
+00:19:07,000 --> 00:19:12,000
+These are common ones that they want to execute is also stored in shell script.
+
+242
+00:19:12,000 --> 00:19:16,000
+Let me open the file and we'll discuss what is written here.
+
+243
+00:19:17,000 --> 00:19:22,000
+Also to execute shell script in the other directory, I open terminal.
+
+244
+00:19:23,000 --> 00:19:30,000
+As you can see, I use Module First Command Line option and pauses a reference to the directory where
+
+245
+00:19:30,000 --> 00:19:32,000
+all my module is located.
+
+246
+00:19:33,000 --> 00:19:39,000
+Another option is that modules to add modules to zero set for analysis.
+
+247
+00:19:39,000 --> 00:19:46,000
+I use custom to add all modules in the directory as the last option here is the list is pretty familiar
+
+248
+00:19:46,000 --> 00:19:47,000
+to you.
+
+249
+00:19:47,000 --> 00:19:49,000
+This is for the output.
+
+250
+00:19:49,000 --> 00:19:55,000
+Let's execute this script in the terminal and we have generated summary file.
+
+251
+00:19:55,000 --> 00:20:02,000
+Let's copy content from here and let me paste this content on the website to generate the graph.
+
+252
+00:20:03,000 --> 00:20:09,000
+As you can see, code I think moves at depends on coal.
+
+253
+00:20:09,000 --> 00:20:16,000
+I think moves greetings module and Moses and the pass on Java based module.
+
+254
+00:20:16,000 --> 00:20:18,000
+Is it clear for you?
+
+255
+00:20:18,000 --> 00:20:23,000
+Press a pause for a minute and sync one more time about this live demo.
+
+256
+00:20:24,000 --> 00:20:24,000
+Thank you.
+
+257
+00:20:24,000 --> 00:20:26,000
+Samsung is still not clear for you.
+
+258
+00:20:27,000 --> 00:20:32,000
+Please do not hesitate to pose your question below this video, and I will be happy to answer.
+
+259
+00:20:34,000 --> 00:20:40,000
+On the screen, you can find common long options that you may use with great depths on the slide, you
+
+260
+00:20:40,000 --> 00:20:42,000
+can find possible options.
+
+261
+00:20:43,000 --> 00:20:45,000
+Module dependency analysis options.
+
+262
+00:20:46,000 --> 00:20:48,000
+Options to filter dependencies.
+
+263
+00:20:48,000 --> 00:20:51,000
+Options to filter closest to be analyzed.
+
+264
+00:20:51,000 --> 00:20:54,000
+And as you can see, there are a lot of them.
+
+265
+00:20:54,000 --> 00:20:58,000
+Probably it doesn't make any sense to me holding them off each option.
+
+266
+00:20:58,000 --> 00:21:03,000
+I believe you understood the main principle, and so I would demo was few options.
+
+267
+00:21:03,000 --> 00:21:06,000
+You can just play with other options if you want.
+
+268
+00:21:07,000 --> 00:21:11,000
+Feel free to pause the Ouija if you want to read all comments on the slide.
+
+269
+00:21:12,000 --> 00:21:14,000
+OK, let's proceed.
+
+270
+00:21:15,000 --> 00:21:21,000
+The next thing that I am going to demo you is depressed, can't program, you have a deprecated API
+
+271
+00:21:21,000 --> 00:21:25,000
+kind of tool is a common line tool to scan for users.
+
+272
+00:21:25,000 --> 00:21:29,000
+So deprecated API elements of given Java class files.
+
+273
+00:21:29,000 --> 00:21:38,000
+Input glosses can be given as a bosnich to a class file and directory or jar file, the same as G Deps
+
+274
+00:21:38,000 --> 00:21:44,000
+G Deeper Scan also has been included in genica installation since adjudicate.
+
+275
+00:21:44,000 --> 00:21:48,000
+That means you can find that in bin folder of Dedicate.
+
+276
+00:21:48,000 --> 00:21:54,000
+And if you configure Java POS properly, you can access it from command line.
+
+277
+00:21:55,000 --> 00:22:01,000
+I'm going to show you example, Wisconsin, of my learning project, I put Judy Proskauer in Shell script.
+
+278
+00:22:02,000 --> 00:22:08,000
+The simplest way how to use this command is to invoke it and pass journal names that we would like to
+
+279
+00:22:08,000 --> 00:22:09,000
+scan.
+
+280
+00:22:09,000 --> 00:22:12,000
+I want to execute this script and get the bus.
+
+281
+00:22:12,000 --> 00:22:21,000
+And again, it takes some time because Project has a lot of files and it is done on the top.
+
+282
+00:22:21,000 --> 00:22:24,000
+You can see notifications in which classes are used.
+
+283
+00:22:24,000 --> 00:22:32,000
+Deprecated masses Knowing this information, you can just check deprecated masses, usually in documentation
+
+284
+00:22:32,000 --> 00:22:38,000
+is deprecated mass that it is specified which other mass that you should use instead.
+
+285
+00:22:38,000 --> 00:22:39,000
+That is simple.
+
+286
+00:22:40,000 --> 00:22:40,000
+I agree.
+
+287
+00:22:41,000 --> 00:22:45,000
+And this command also has few important command line options.
+
+288
+00:22:45,000 --> 00:22:47,000
+Definitely Zionism's MS engine.
+
+289
+00:22:47,000 --> 00:22:55,000
+That program has but still something for you, at least to be aware of response if you want to explore
+
+290
+00:22:55,000 --> 00:22:56,000
+all these in details.
+
+291
+00:22:57,000 --> 00:22:59,000
+And if you're OK, I will continue.
+
+292
+00:23:00,000 --> 00:23:03,000
+Now, let's review immigration strategies.
+
+293
+00:23:03,000 --> 00:23:09,000
+We will cover case when a regional application is based on gender versions that is less than juvenile
+
+294
+00:23:10,000 --> 00:23:17,000
+or it is Java nine or higher, but the modular approach wasn't originally implemented since the use
+
+295
+00:23:17,000 --> 00:23:19,000
+of this mechanism is fully optional.
+
+296
+00:23:20,000 --> 00:23:26,000
+M. relearned tools and went through the step where we did the line, which modules draft files are present
+
+297
+00:23:26,000 --> 00:23:30,000
+in application and what dependencies exist between them.
+
+298
+00:23:30,000 --> 00:23:37,000
+Also, another way to do that besides such automated tools of static code analysis as DApps is through
+
+299
+00:23:37,000 --> 00:23:42,000
+an Iraqi eagle diagram, whereas these dependencies are represented in their way.
+
+300
+00:23:43,000 --> 00:23:49,000
+This will help give an overview of the components of the application and of each of them, and in which
+
+301
+00:23:49,000 --> 00:23:51,000
+orders it can be migrated.
+
+302
+00:23:51,000 --> 00:23:57,000
+Identifying those who will not be able to adopt temporally or definitively.
+
+303
+00:23:58,000 --> 00:24:04,000
+The later case can be given, for example, insert various libraries that have stopped offering support,
+
+304
+00:24:04,000 --> 00:24:06,000
+and that will hardly become modules.
+
+305
+00:24:07,000 --> 00:24:12,000
+There are two different migration mechanisms that responds to different initial situations.
+
+306
+00:24:13,000 --> 00:24:20,000
+To illustrate the process in each of them, let's imagine the next scenario we plan to migrate an application
+
+307
+00:24:20,000 --> 00:24:25,000
+that consists of three jars representing the different layers of the application.
+
+308
+00:24:26,000 --> 00:24:32,000
+They are application services and utilize the diagrams that you can see on the screen.
+
+309
+00:24:32,000 --> 00:24:35,000
+Now shows the dependencies between these lists.
+
+310
+00:24:36,000 --> 00:24:42,000
+Where application depends on services and the tiers and services depends on the utils only.
+
+311
+00:24:42,000 --> 00:24:45,000
+Let's review Bottom-Up migration first.
+
+312
+00:24:45,000 --> 00:24:52,000
+In this strategy, initially, all jar files that are part of the application will be located at its
+
+313
+00:24:52,000 --> 00:24:53,000
+ClassPass.
+
+314
+00:24:54,000 --> 00:24:56,000
+All of them can be migrated one by one.
+
+315
+00:24:56,000 --> 00:24:58,000
+Does the module POS?
+
+316
+00:24:58,000 --> 00:25:01,000
+To do this, we need to follow describes steps.
+
+317
+00:25:02,000 --> 00:25:08,000
+The first thing that we need to do is to choose a project package or layer was the lowest position in
+
+318
+00:25:08,000 --> 00:25:09,000
+dependencies.
+
+319
+00:25:09,000 --> 00:25:12,000
+Iraqi yet has not yet been migrated to module.
+
+320
+00:25:13,000 --> 00:25:17,000
+That means to select the project that has less dependencies.
+
+321
+00:25:17,000 --> 00:25:20,000
+In our case, this is your deals there.
+
+322
+00:25:20,000 --> 00:25:26,000
+After that and the module info Java file to the project, it will be needed to.
+
+323
+00:25:26,000 --> 00:25:33,000
+Ads are quite explicit statements to make current module packages available to Iraqi Higher Level Modules
+
+324
+00:25:33,000 --> 00:25:41,000
+Moves Integrated Project as a named module from application's class bus to its module bus ensure that
+
+325
+00:25:41,000 --> 00:25:43,000
+all not yet migrated.
+
+326
+00:25:43,000 --> 00:25:48,000
+The modules remain as unnamed modules in application's class bus.
+
+327
+00:25:48,000 --> 00:25:52,000
+What is unnamed modules were discussed in previous lesson.
+
+328
+00:25:52,000 --> 00:26:00,000
+One of the learned modules types please refer to the previous lesson through use that, if needed after
+
+329
+00:26:00,000 --> 00:26:07,000
+we did all this is this seems it remains to do is to repeat this process was the next lowest level packages
+
+330
+00:26:08,000 --> 00:26:10,000
+list of projects in the Iraqi.
+
+331
+00:26:10,000 --> 00:26:15,000
+That is not migrated yet, and we are progressing in the bottom direction.
+
+332
+00:26:15,000 --> 00:26:23,000
+Can you understand now why this strategy is called bottom up when this approach works the best and when
+
+333
+00:26:23,000 --> 00:26:24,000
+we need to apply?
+
+334
+00:26:24,000 --> 00:26:27,000
+The bottom up migration strategy was the best one.
+
+335
+00:26:27,000 --> 00:26:33,000
+We have the ability to modify any jar that has not yet been converted to module.
+
+336
+00:26:33,000 --> 00:26:41,000
+It makes easier as a migration of the project's packages was a whole layers that are at the top of the
+
+337
+00:26:41,000 --> 00:26:47,000
+dependency diagram and encourages care in what is exposed to other modules.
+
+338
+00:26:48,000 --> 00:26:54,000
+The modules of the lower levels of the Iraqi will be found in the module costs without access to the
+
+339
+00:26:54,000 --> 00:26:56,000
+packages of unnamed modules.
+
+340
+00:26:57,000 --> 00:27:03,000
+While these unnamed modules that have not been migrated and allocated in the class, ClassPass will
+
+341
+00:27:03,000 --> 00:27:09,000
+be able to access zip packages located in both class and module bus.
+
+342
+00:27:10,000 --> 00:27:11,000
+Does it make sense so far?
+
+343
+00:27:13,000 --> 00:27:19,000
+And now is immigration strategy would be top down in this strategy, initially, all jar files that
+
+344
+00:27:19,000 --> 00:27:25,000
+are part of the application will be located at its model bus, so all non-immigrant its projects are
+
+345
+00:27:25,000 --> 00:27:27,000
+treated as automatic modules.
+
+346
+00:27:28,000 --> 00:27:31,000
+Greatest lesson I current or what automatic modules are.
+
+347
+00:27:32,000 --> 00:27:36,000
+So please make sure you watch the previous lesson about modules.
+
+348
+00:27:36,000 --> 00:27:44,000
+If you forget, this is example when I didn't use modular approach since it is optional in this case,
+
+349
+00:27:44,000 --> 00:27:47,000
+it is recommended to frozen next steps.
+
+350
+00:27:47,000 --> 00:27:54,000
+The first thing to do is to choose a high level project and the dependencies Iraqi that has not yet
+
+351
+00:27:54,000 --> 00:27:56,000
+been integrated the module.
+
+352
+00:27:56,000 --> 00:28:03,000
+After that, we need to add some module info gel file to the project to transform it from an automatic
+
+353
+00:28:03,000 --> 00:28:05,000
+module to a named module.
+
+354
+00:28:06,000 --> 00:28:12,000
+Also, we shouldn't forget to add necessary expert statements to make current module packages available
+
+355
+00:28:12,000 --> 00:28:20,000
+to other modules and the necessary require statements that makes available OSM modules expose packages
+
+356
+00:28:20,000 --> 00:28:25,000
+to the current one in case of the reference to a module not yet migrated.
+
+357
+00:28:26,000 --> 00:28:29,000
+It should be done through its automatic module name.
+
+358
+00:28:29,000 --> 00:28:36,000
+Once these have been migrated, these references should be changed to Z definitive module names.
+
+359
+00:28:37,000 --> 00:28:41,000
+Repeat this process was the next high level component.
+
+360
+00:28:41,000 --> 00:28:44,000
+Is Iraqi citizens not migrated yet?
+
+361
+00:28:44,000 --> 00:28:49,000
+Then the stunt in which case is top down strategy needs to be applied and robust at best.
+
+362
+00:28:50,000 --> 00:28:55,000
+This strategy is the best when you don't have the possibility of one day on the horizon.
+
+363
+00:28:55,000 --> 00:29:00,000
+All the dependencies of the application was a temporarily or definitively.
+
+364
+00:29:01,000 --> 00:29:06,000
+Also, the lower dependencies of the application have not yet been modularized.
+
+365
+00:29:06,000 --> 00:29:10,000
+The application itself can be converted into morning.
+
+366
+00:29:10,000 --> 00:29:15,000
+Named modules that have already been integrated will be found in the module.
+
+367
+00:29:15,000 --> 00:29:22,000
+Boss was access to the entire code contained in the automatic modules that are also found in module
+
+368
+00:29:22,000 --> 00:29:22,000
+path.
+
+369
+00:29:23,000 --> 00:29:23,000
+Is that clear?
+
+370
+00:29:24,000 --> 00:29:26,000
+And remember another important sync?
+
+371
+00:29:27,000 --> 00:29:31,000
+In all cases, we have to avoid circle of dependencies between modules.
+
+372
+00:29:32,000 --> 00:29:34,000
+That's all what I wanted to share with you in this lesson.
+
+373
+00:29:35,000 --> 00:29:37,000
+Let's recap what we have learned today.
+
+374
+00:29:38,000 --> 00:29:44,000
+After this lesson, you know, general algorithm to follow during the platform, migration to the new
+
+375
+00:29:44,000 --> 00:29:48,000
+environment or in US adjudicate version in particular.
+
+376
+00:29:48,000 --> 00:29:57,000
+I showed you how to use in practice Java Class Dependency Analyzer to also we used how to use Java deprecated
+
+377
+00:29:57,000 --> 00:30:05,000
+API second to review of different migration strategies, namely, we bottom up and top down migration
+
+378
+00:30:05,000 --> 00:30:05,000
+strategies.
+
+379
+00:30:06,000 --> 00:30:11,000
+I hope you'll love this lesson and learned a lot of new useful sinks.
+
+380
+00:30:12,000 --> 00:30:13,000
+Thanks a lot for your attention.
+
+381
+00:30:14,000 --> 00:30:17,000
+Have a great day and see you in the next lesson.
+
diff --git a/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 Modular-application-example-with-bash-scripts.url b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 Modular-application-example-with-bash-scripts.url
new file mode 100644
index 0000000000000000000000000000000000000000..63d2979d30e45cb5541ef5a1800ec67004f08652
--- /dev/null
+++ b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 Modular-application-example-with-bash-scripts.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/java-modules
\ No newline at end of file
diff --git a/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 Non-modular-application-example-with-bash-scripts.url b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 Non-modular-application-example-with-bash-scripts.url
new file mode 100644
index 0000000000000000000000000000000000000000..2b0026c95164b92fcf1e402fbe2be167b2d35c31
--- /dev/null
+++ b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/002 Non-modular-application-example-with-bash-scripts.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core
\ No newline at end of file
diff --git a/32 - Java Platform Module System Modules in Java & Migration of Java Apps/external-links.txt b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/external-links.txt
new file mode 100644
index 0000000000000000000000000000000000000000..150a893159598b71ff314e96eb63efae13a0ed15
--- /dev/null
+++ b/32 - Java Platform Module System Modules in Java & Migration of Java Apps/external-links.txt
@@ -0,0 +1,12 @@
+
+001 Source-code-examples-from-the-lesson-Modular-Project
+https://github.com/AndriiPiatakha/java-modules
+
+002 -Example-Migration-Guide-by-Oracle
+https://docs.oracle.com/en/java/javase/12/migrate/index.html#JSMIG-GUID-C25E2B1D-6C24-4403-8540-CFEA875B994A
+
+002 Non-modular-application-example-with-bash-scripts
+https://github.com/AndriiPiatakha/learnit_java_core
+
+002 Modular-application-example-with-bash-scripts
+https://github.com/AndriiPiatakha/java-modules
diff --git a/33 - Testing for Software Engineers/001 Testing for software engineers Overview_en.srt b/33 - Testing for Software Engineers/001 Testing for software engineers Overview_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..ac91b1dce8e76e942f212b65c544724b62becab0
--- /dev/null
+++ b/33 - Testing for Software Engineers/001 Testing for software engineers Overview_en.srt
@@ -0,0 +1,1308 @@
+1
+00:00:06,000 --> 00:00:06,000
+Hello, dissidents.
+
+2
+00:00:07,000 --> 00:00:10,000
+Today we start an important topic for each software engineer.
+
+3
+00:00:10,000 --> 00:00:15,000
+We are going to learn with your tools and techniques that will help you to make sure that your codes
+
+4
+00:00:15,000 --> 00:00:22,000
+work as expected and to guarantee that each new change didn't break old code already released features.
+
+5
+00:00:22,000 --> 00:00:24,000
+We'll talk about testing today.
+
+6
+00:00:25,000 --> 00:00:28,000
+Don't worry, this is not cause for quality assurance engineers.
+
+7
+00:00:29,000 --> 00:00:31,000
+This is still cause for software developers.
+
+8
+00:00:32,000 --> 00:00:35,000
+You're saying that this is cause for fear automation engineers.
+
+9
+00:00:35,000 --> 00:00:36,000
+You're wrong again.
+
+10
+00:00:37,000 --> 00:00:42,000
+The first thing you have to learn is that software engineers also write tests on regular basis.
+
+11
+00:00:42,000 --> 00:00:47,000
+This is a little bit different kind of tests that usually perform key engineers.
+
+12
+00:00:47,000 --> 00:00:51,000
+And today we're going to learn what testing is after this lesson.
+
+13
+00:00:51,000 --> 00:00:54,000
+You understand why we need to write this.
+
+14
+00:00:54,000 --> 00:00:57,000
+I will elaborate on different functions of testing.
+
+15
+00:00:57,000 --> 00:01:02,000
+You will get a full picture of different types and different levels of testing, and you will understand
+
+16
+00:01:02,000 --> 00:01:04,000
+what testing is.
+
+17
+00:01:04,000 --> 00:01:09,000
+And this lesson will run main principles and rules that should be followed during the testing.
+
+18
+00:01:10,000 --> 00:01:15,000
+By the end of this lesson, you will understand what kind of tests software engineers usually write.
+
+19
+00:01:16,000 --> 00:01:21,000
+Also, you're going to understand the structure of our following lessons and what we will learn first.
+
+20
+00:01:22,000 --> 00:01:26,000
+Let's start and to start with, let's define the goal of testing.
+
+21
+00:01:26,000 --> 00:01:29,000
+How do think why we are so buzzer?
+
+22
+00:01:29,000 --> 00:01:32,000
+It's about testing and what its main goal?
+
+23
+00:01:32,000 --> 00:01:37,000
+Take a second and think to at least a few options and choose the main one, in your opinion.
+
+24
+00:01:38,000 --> 00:01:40,000
+My answer would be the next one.
+
+25
+00:01:40,000 --> 00:01:47,000
+The main goal is to verify that application works as expected, and the key to your success is to make
+
+26
+00:01:47,000 --> 00:01:54,000
+sure that the last part of this sentence, namely, as expected, is defined clearly and the same for
+
+27
+00:01:54,000 --> 00:01:55,000
+you and product owner.
+
+28
+00:01:55,000 --> 00:02:00,000
+In this course, we will learn a few techniques like behavior driven development and acceptance during
+
+29
+00:02:00,000 --> 00:02:06,000
+development that should eliminate the gap in the understanding of the final product between you and
+
+30
+00:02:06,000 --> 00:02:07,000
+product owner.
+
+31
+00:02:08,000 --> 00:02:14,000
+And that is our goal that uses a proper set of tests that will verify various scenarios to make sure
+
+32
+00:02:14,000 --> 00:02:18,000
+that behavior of our application meets expectations of the product owner.
+
+33
+00:02:19,000 --> 00:02:21,000
+In this lesson, I will use product owner.
+
+34
+00:02:21,000 --> 00:02:23,000
+Time to time my senses.
+
+35
+00:02:23,000 --> 00:02:29,000
+I'm a person who is in charge of final acceptance of the software that you and your team will create
+
+36
+00:02:30,000 --> 00:02:30,000
+products on.
+
+37
+00:02:30,000 --> 00:02:35,000
+There can be within your organization or outside of your organization, like it usually happens if you
+
+38
+00:02:35,000 --> 00:02:37,000
+work in outsourcing company.
+
+39
+00:02:37,000 --> 00:02:44,000
+Usually, product owner is closer to the business side in the war, in the commercial side, and how
+
+40
+00:02:44,000 --> 00:02:47,000
+application will satisfy needs of potential customers.
+
+41
+00:02:48,000 --> 00:02:54,000
+Also, product owner worried about features, user experience and all that is related to the application.
+
+42
+00:02:55,000 --> 00:02:57,000
+But Pure is not a technical person.
+
+43
+00:02:58,000 --> 00:03:02,000
+You're going to be able to explain to people that something is not possible because it will require
+
+44
+00:03:02,000 --> 00:03:06,000
+to implement a lot of classes and use a lot of external libraries.
+
+45
+00:03:07,000 --> 00:03:10,000
+Usually you are doesn't care about all technical stuff.
+
+46
+00:03:11,000 --> 00:03:16,000
+He cares only about end product and about meetings of functional and non-functional requirements.
+
+47
+00:03:17,000 --> 00:03:21,000
+Understanding that your work should be accepted by non-technical person is a key.
+
+48
+00:03:22,000 --> 00:03:27,000
+Usually only see you guys can learn how to talk with product owners, but not always, unfortunately.
+
+49
+00:03:28,000 --> 00:03:35,000
+But understanding your PR and preparing a set of tests that verifies expected behavior will help you
+
+50
+00:03:35,000 --> 00:03:37,000
+to reach the expected quality level.
+
+51
+00:03:37,000 --> 00:03:41,000
+We have just said something about quality and reached an expected quality level.
+
+52
+00:03:42,000 --> 00:03:47,000
+But what is actually a quality that different definitions of a quality?
+
+53
+00:03:47,000 --> 00:03:52,000
+But my own you finish that, in my opinion, describes the quality and software engineer is the most
+
+54
+00:03:52,000 --> 00:03:53,000
+accurate way.
+
+55
+00:03:54,000 --> 00:03:58,000
+It sounds like the following quality is a degree of compliance with the requirements.
+
+56
+00:03:59,000 --> 00:04:02,000
+Good quality means complete compliance with requirements.
+
+57
+00:04:03,000 --> 00:04:05,000
+That quality means opposite.
+
+58
+00:04:05,000 --> 00:04:07,000
+Does it make sense homes?
+
+59
+00:04:07,000 --> 00:04:13,000
+Does it use your understanding what quality is and what we as developers will try to pursue?
+
+60
+00:04:13,000 --> 00:04:17,000
+And we need to right this to meet the expected level of quality?
+
+61
+00:04:17,000 --> 00:04:19,000
+What else do we need?
+
+62
+00:04:19,000 --> 00:04:25,000
+The right tests thus have their own users to understand why we have to write this.
+
+63
+00:04:25,000 --> 00:04:30,000
+Let's review functions that are in charge of increasing team productivity.
+
+64
+00:04:30,000 --> 00:04:36,000
+Team productivity is increased with tests because time spent on regression and manual testing is significantly
+
+65
+00:04:36,000 --> 00:04:37,000
+reduced.
+
+66
+00:04:38,000 --> 00:04:44,000
+I believe that you would love to perform some testing after implementation of a new feature or after
+
+67
+00:04:44,000 --> 00:04:45,000
+small changes, don't you?
+
+68
+00:04:46,000 --> 00:04:49,000
+And as your program grew, it will take more time to test average soon.
+
+69
+00:04:50,000 --> 00:04:57,000
+That's why we developers want to put automated tests on place that will help us to perform checks and
+
+70
+00:04:57,000 --> 00:05:01,000
+now multiplies this benefit by each team member with.
+
+71
+00:05:02,000 --> 00:05:10,000
+Each team member would have a possibility to run them and verify state of the app in no time limit need
+
+72
+00:05:10,000 --> 00:05:10,000
+for the bargain.
+
+73
+00:05:11,000 --> 00:05:17,000
+This is super important in case you've found some defect in your program haven't pursued the course.
+
+74
+00:05:17,000 --> 00:05:23,000
+All your application can help you easily identify where defect is in the best case.
+
+75
+00:05:23,000 --> 00:05:29,000
+Some specific test will be failed, and you will find defect instantly without debugging.
+
+76
+00:05:29,000 --> 00:05:32,000
+In case your tests, you didn't intend to find the defect.
+
+77
+00:05:33,000 --> 00:05:39,000
+That means some test case is missed, and the first thing you have to do in this case is write new tests
+
+78
+00:05:39,000 --> 00:05:42,000
+that will cover an error that was missed.
+
+79
+00:05:42,000 --> 00:05:49,000
+Instead of running and fixing this defect as fast as possible, confidence during the refactoring Rifaximin
+
+80
+00:05:49,000 --> 00:05:56,000
+is a process of restructuring existing code without changing its external behavior and joins a refactoring,
+
+81
+00:05:56,000 --> 00:06:00,000
+you have to be sure that you didn't break any existing functionality.
+
+82
+00:06:01,000 --> 00:06:08,000
+For example, you want to remove redundant code duplication or you want to regroup files in one package
+
+83
+00:06:08,000 --> 00:06:14,000
+or something else, and you have to be sure that you didn't accidentally remove code that is needed.
+
+84
+00:06:14,000 --> 00:06:19,000
+Having ensued of tests, you can constantly run them to make sure you didn't break ineson.
+
+85
+00:06:20,000 --> 00:06:25,000
+Clean cut and good architecture design in this course, we will also learn test driven development and
+
+86
+00:06:25,000 --> 00:06:26,000
+how it works.
+
+87
+00:06:26,000 --> 00:06:33,000
+The huge advantage of this approach is that it fosters being caught and the reliable architecture design.
+
+88
+00:06:34,000 --> 00:06:35,000
+In simple words, right?
+
+89
+00:06:35,000 --> 00:06:41,000
+And this make you think what level of abstraction is needed in your application, how you would like
+
+90
+00:06:41,000 --> 00:06:43,000
+to group classes into packages.
+
+91
+00:06:44,000 --> 00:06:47,000
+What access modifiers should be used for fields and masses and so on.
+
+92
+00:06:48,000 --> 00:06:55,000
+And writing does first helps you to create more usable architecture of your application name and task
+
+93
+00:06:56,000 --> 00:06:57,000
+coverage matchweek.
+
+94
+00:06:57,000 --> 00:07:04,000
+This function seems to be not very useful for you, but sometimes it's important for our customers when
+
+95
+00:07:04,000 --> 00:07:09,000
+you work in outsourcing, company managers from customer site would require from you to provide such
+
+96
+00:07:09,000 --> 00:07:15,000
+metric as desk with coverage that will show how much of the code and application are covered with tests.
+
+97
+00:07:16,000 --> 00:07:22,000
+By the end of this course, you will learn that there is no direct dependency between test code coverage,
+
+98
+00:07:22,000 --> 00:07:24,000
+magic and quality of your application.
+
+99
+00:07:24,000 --> 00:07:30,000
+Also, tests could be written in order to just increase desk with coverage metric, but not actually
+
+100
+00:07:30,000 --> 00:07:31,000
+test your code.
+
+101
+00:07:31,000 --> 00:07:37,000
+I'll show you how this can be, and I'll teach you how to write tests that will actually help you to
+
+102
+00:07:37,000 --> 00:07:40,000
+decrease potential number of defects and the last.
+
+103
+00:07:40,000 --> 00:07:46,000
+But in my opinion, one of the most important duties of tests is to serve as a documentation for your
+
+104
+00:07:46,000 --> 00:07:47,000
+application.
+
+105
+00:07:47,000 --> 00:07:51,000
+Very often, engineers don't write tests for their code.
+
+106
+00:07:51,000 --> 00:07:58,000
+But when generation of people who support this project is changed, nobody can understand why they need
+
+107
+00:07:58,000 --> 00:08:04,000
+this class or why they need this private method and how critical it is or why.
+
+108
+00:08:04,000 --> 00:08:07,000
+Before storing the database, some additional request is sent.
+
+109
+00:08:08,000 --> 00:08:12,000
+Is that business requirements or just redundant method invocation?
+
+110
+00:08:12,000 --> 00:08:19,000
+Well, I imagine that you want on board new team member and instead of telling him or her how to initialize
+
+111
+00:08:19,000 --> 00:08:25,000
+some objects or what should happen to calculate discount for specific user, you just provide him with
+
+112
+00:08:25,000 --> 00:08:26,000
+a link to your test.
+
+113
+00:08:26,000 --> 00:08:33,000
+Well, and as described writing tests, it is similar to having the client that is using your code,
+
+114
+00:08:33,000 --> 00:08:36,000
+and everyone can investigate how to use your code.
+
+115
+00:08:37,000 --> 00:08:40,000
+Oh, now you have full and clear picture why we need that.
+
+116
+00:08:41,000 --> 00:08:46,000
+Let me remind you that in case you have any questions regarding materials that I have shared, you can
+
+117
+00:08:46,000 --> 00:08:49,000
+always ask it in the Q&A section of this lesson.
+
+118
+00:08:49,000 --> 00:08:51,000
+Let's move on now.
+
+119
+00:08:51,000 --> 00:08:54,000
+I want to discuss with you different approaches in testing.
+
+120
+00:08:55,000 --> 00:08:58,000
+This will help you to better understand different levels of testing.
+
+121
+00:08:59,000 --> 00:09:04,000
+There are two main methods of testing Ziya black box testing and one box testing.
+
+122
+00:09:04,000 --> 00:09:10,000
+Black box testing is a method of software testing that examines the functionality of an application
+
+123
+00:09:10,000 --> 00:09:14,000
+without peer into its internal structures or workings.
+
+124
+00:09:14,000 --> 00:09:18,000
+There is no need to have all specifics and details of the code structure.
+
+125
+00:09:19,000 --> 00:09:23,000
+Testers should be aware of expected the behavior of the application.
+
+126
+00:09:23,000 --> 00:09:29,000
+In other words, according to black box approach, testers should know what applications should do,
+
+127
+00:09:29,000 --> 00:09:32,000
+but not necessarily how application does this.
+
+128
+00:09:33,000 --> 00:09:39,000
+On the other hand, white box testing that is also known as a glass box test and transparent box testing
+
+129
+00:09:39,000 --> 00:09:46,000
+is a method of software testing that test in general structures or rockets of an application as opposed
+
+130
+00:09:46,000 --> 00:09:49,000
+to its functionality and black box testing.
+
+131
+00:09:50,000 --> 00:09:55,000
+Depending on which level of testing you perform verification activities, you can apply one or another
+
+132
+00:09:55,000 --> 00:09:56,000
+method.
+
+133
+00:09:56,000 --> 00:09:59,000
+Let's hear on what levels of testing exist.
+
+134
+00:09:59,000 --> 00:10:02,000
+There are multiple testing levels in some literature.
+
+135
+00:10:02,000 --> 00:10:08,000
+You might find four levels, zero unit integration system and acceptance testing.
+
+136
+00:10:09,000 --> 00:10:14,000
+Let's review each layer one by one and understand what is the difference between the levels.
+
+137
+00:10:15,000 --> 00:10:17,000
+Each of the level has its own purpose.
+
+138
+00:10:17,000 --> 00:10:22,000
+For example, goal of unit testing is to test the smallest unit.
+
+139
+00:10:22,000 --> 00:10:26,000
+Usually, it is considered to be the completion unit in Jawa.
+
+140
+00:10:26,000 --> 00:10:27,000
+This is one class.
+
+141
+00:10:28,000 --> 00:10:32,000
+Typically, this type of testing is performed by a programmer, but not a tester.
+
+142
+00:10:32,000 --> 00:10:37,000
+And there's an understanding that on this level, you may want to apply white box approach you as a
+
+143
+00:10:37,000 --> 00:10:44,000
+test, and you have to verify that all massive in this unit works as expected and unifies this without
+
+144
+00:10:44,000 --> 00:10:46,000
+any interaction with other components.
+
+145
+00:10:47,000 --> 00:10:50,000
+Just testing of one single unit is elation.
+
+146
+00:10:50,000 --> 00:10:55,000
+The next level of testing is integration testing on this level of testing.
+
+147
+00:10:55,000 --> 00:11:00,000
+Our goal is to make sure that components work together and may interact between each other.
+
+148
+00:11:01,000 --> 00:11:07,000
+For example, you want to test that after user registration, he or she receives welcome email, and
+
+149
+00:11:07,000 --> 00:11:09,000
+this amount is sent by another class.
+
+150
+00:11:09,000 --> 00:11:15,000
+Your test should include scenarios that will verify that after registration, email is sent.
+
+151
+00:11:16,000 --> 00:11:18,000
+That's why it is called integration testing.
+
+152
+00:11:19,000 --> 00:11:25,000
+The next level of testing is a system testing system, testing is performed on a complete integrated
+
+153
+00:11:25,000 --> 00:11:26,000
+system.
+
+154
+00:11:26,000 --> 00:11:30,000
+It allows checking systems compliance as per the requirements.
+
+155
+00:11:30,000 --> 00:11:37,000
+Usually, system testing includes performance security testing, system testing most often the final
+
+156
+00:11:37,000 --> 00:11:44,000
+test to verify that the system is a specification, it verifies both functional and non-functional requirements.
+
+157
+00:11:44,000 --> 00:11:50,000
+And finally, acceptance testing acceptance testing is a test conducted to find if all requirements
+
+158
+00:11:50,000 --> 00:11:50,000
+are met.
+
+159
+00:11:51,000 --> 00:11:54,000
+That's final level of testing before acceptance.
+
+160
+00:11:54,000 --> 00:11:59,000
+Software product unions acceptance testing, we have to give an answer whether product is ready for
+
+161
+00:11:59,000 --> 00:12:00,000
+release.
+
+162
+00:12:00,000 --> 00:12:02,000
+That's it regarding testing levels.
+
+163
+00:12:02,000 --> 00:12:05,000
+I hope this gives you an understanding of the whole test process.
+
+164
+00:12:06,000 --> 00:12:10,000
+Usually, software developers are in charge or writing unit integration.
+
+165
+00:12:10,000 --> 00:12:15,000
+That's sometimes functional tests can be written by key automation engineers.
+
+166
+00:12:15,000 --> 00:12:20,000
+And then the course we're going to learn the tools and techniques that will help you to write tests.
+
+167
+00:12:21,000 --> 00:12:24,000
+Also, I'd like to cover today was your test and concept.
+
+168
+00:12:25,000 --> 00:12:26,000
+What is this?
+
+169
+00:12:26,000 --> 00:12:33,000
+Impairment test impairment is a framework that can help both developers and kids to create high quality
+
+170
+00:12:33,000 --> 00:12:34,000
+software.
+
+171
+00:12:34,000 --> 00:12:41,000
+It reduces the time required for developers to identify if a change they introduce Brexit code.
+
+172
+00:12:41,000 --> 00:12:45,000
+It can also be helpful in building a more reliable tests.
+
+173
+00:12:46,000 --> 00:12:52,000
+Essentially, the testing permit also referred to as test automation pyramid.
+
+174
+00:12:52,000 --> 00:12:59,000
+These are the types of tests that should be included in an automated tests used on different test levels.
+
+175
+00:12:59,000 --> 00:13:03,000
+It also outlines a sequence and frequency of these tests.
+
+176
+00:13:04,000 --> 00:13:11,000
+The whole point is to offer immediate feedback to ensure that the code changes do not disrupt existing
+
+177
+00:13:11,000 --> 00:13:19,000
+features so we can treat this impairment as way of thinking how we can balance different types of tests
+
+178
+00:13:19,000 --> 00:13:26,000
+on different levels and important conclusions that we can make out of the testing pyramid is that we
+
+179
+00:13:26,000 --> 00:13:29,000
+have to have solid layer of unit tests.
+
+180
+00:13:29,000 --> 00:13:35,000
+And on the basis of unit tests, you build your pyramid on ozone levels of testing.
+
+181
+00:13:35,000 --> 00:13:42,000
+This pyramid provides all team was right priorities in case the management team puts significant focus
+
+182
+00:13:42,000 --> 00:13:49,000
+on the tests without paying attention, the unit does the higher chances of missing some critical defect.
+
+183
+00:13:49,000 --> 00:13:54,000
+You must say that in case you will have only internal tests, that means you are completely covered
+
+184
+00:13:54,000 --> 00:13:57,000
+from defects that important customer and product owner.
+
+185
+00:13:57,000 --> 00:13:59,000
+But what about functions of testing?
+
+186
+00:14:00,000 --> 00:14:02,000
+Yet this serves as a documentation.
+
+187
+00:14:02,000 --> 00:14:05,000
+Two unit tests are forced to execute.
+
+188
+00:14:06,000 --> 00:14:13,000
+Usually, internal tests requires all components of application up and running, and this could be not
+
+189
+00:14:13,000 --> 00:14:13,000
+the case.
+
+190
+00:14:13,000 --> 00:14:19,000
+One hundred percent of your work and time because other parts of the system are also in progress of
+
+191
+00:14:19,000 --> 00:14:26,000
+development and the parallel development e.g. develop a test its own human that was written by an after
+
+192
+00:14:26,000 --> 00:14:32,000
+that goes integration tests and after that go system testing and acceptance testing.
+
+193
+00:14:32,000 --> 00:14:38,000
+There is one interesting metric that the so-called defect cost increase the cost of fixing the book
+
+194
+00:14:38,000 --> 00:14:44,000
+or defect is lower if you catch it in the design phase, but higher in later phases of the software
+
+195
+00:14:44,000 --> 00:14:46,000
+development lifecycle.
+
+196
+00:14:46,000 --> 00:14:52,000
+The cost of detecting and fixing defects in software increases exponentially, with time in the software
+
+197
+00:14:52,000 --> 00:15:00,000
+development workflow fixing box and the field is incredibly costly and risky, often by an order of
+
+198
+00:15:00,000 --> 00:15:01,000
+magnitude or two.
+
+199
+00:15:01,000 --> 00:15:07,000
+The cost is not just in the form of time and resources wasted in the present, but also in the form
+
+200
+00:15:07,000 --> 00:15:10,000
+of lost opportunities in the future.
+
+201
+00:15:10,000 --> 00:15:18,000
+For example, imagine that you have a bank that some mobile Mac and one user noticed that when he sends
+
+202
+00:15:18,000 --> 00:15:24,000
+one hundred dollars, he got extra charged for money transfer for ten more dollars.
+
+203
+00:15:24,000 --> 00:15:30,000
+And there were no end in the case about extra charge for money transfer of specific money amount.
+
+204
+00:15:30,000 --> 00:15:31,000
+Do not the banks.
+
+205
+00:15:32,000 --> 00:15:38,000
+And this is a bug because users should have seen this notification not pop up the items.
+
+206
+00:15:39,000 --> 00:15:44,000
+Your team submitted a defect, but how much will it cost to you at the end of the day?
+
+207
+00:15:45,000 --> 00:15:51,000
+Well, you can come up with some other example like user downloaded app to send money, but he can't
+
+208
+00:15:51,000 --> 00:15:53,000
+because app is not working.
+
+209
+00:15:54,000 --> 00:15:56,000
+User just removes app, and that's it.
+
+210
+00:15:57,000 --> 00:16:02,000
+You spend so much money on advertisement domains as client download your app.
+
+211
+00:16:02,000 --> 00:16:08,000
+And now he just left, and he will never install the app one more time again in the future.
+
+212
+00:16:08,000 --> 00:16:15,000
+Moreover, this guide may leave bad feedback on different portals and new clients will doubt in your
+
+213
+00:16:15,000 --> 00:16:16,000
+app.
+
+214
+00:16:16,000 --> 00:16:20,000
+This also, of course, is that you have lost the understands this.
+
+215
+00:16:21,000 --> 00:16:25,000
+Remember that the price of fixing the effect is increasing from an environment environment.
+
+216
+00:16:26,000 --> 00:16:32,000
+The cheapest price you can pay is to figure out the effect on local computer in case the effect was
+
+217
+00:16:32,000 --> 00:16:34,000
+discovered on a service.
+
+218
+00:16:34,000 --> 00:16:40,000
+It requires additional a force to use to gauge in the effort to fix it, to deploy it on key environment,
+
+219
+00:16:41,000 --> 00:16:45,000
+to perform some testing, to make sure that other features are not broken.
+
+220
+00:16:45,000 --> 00:16:51,000
+If the effect was discovered during user acceptance testing, that's completely another procedure.
+
+221
+00:16:51,000 --> 00:16:57,000
+We'll talk another lessons about continuous integration and continuous delivery and deployment, and
+
+222
+00:16:57,000 --> 00:17:02,000
+we'll elaborate more on different environments that we use during the development.
+
+223
+00:17:02,000 --> 00:17:09,000
+But the things that you should remember right now is that you have to be able to identify a potential
+
+224
+00:17:09,000 --> 00:17:16,000
+defect as early as possible and and Pyramid set the right priorities for us while writing our series
+
+225
+00:17:16,000 --> 00:17:17,000
+of tests.
+
+226
+00:17:18,000 --> 00:17:24,000
+Before moving further and learning other classifications related to Destin, I want to understand a
+
+227
+00:17:24,000 --> 00:17:26,000
+few more basic concepts.
+
+228
+00:17:26,000 --> 00:17:31,000
+I want to discuss with you what functional and non-functional requirements are.
+
+229
+00:17:31,000 --> 00:17:33,000
+Let's start from running functional requirements.
+
+230
+00:17:34,000 --> 00:17:37,000
+Functional requirements defines a basic system behavior.
+
+231
+00:17:38,000 --> 00:17:46,000
+Essentially, Zara, what system does or must not do and can be sought often in terms of how the system
+
+232
+00:17:46,000 --> 00:17:47,000
+responds to inputs.
+
+233
+00:17:48,000 --> 00:17:55,000
+Functional requirements user to define exact behaviors and includes calculations, data input and business
+
+234
+00:17:55,000 --> 00:17:56,000
+processes.
+
+235
+00:17:56,000 --> 00:18:03,000
+In other more simple words, we can treat functional requirements as features that allows the system
+
+236
+00:18:03,000 --> 00:18:05,000
+to function as it was intended.
+
+237
+00:18:06,000 --> 00:18:10,000
+Simply said it was the functional requirements are not met.
+
+238
+00:18:10,000 --> 00:18:12,000
+This system will not work.
+
+239
+00:18:12,000 --> 00:18:19,000
+Functional requirements are product features and focus on user requirements, while functional requirements
+
+240
+00:18:19,000 --> 00:18:22,000
+define what the system does or must not do.
+
+241
+00:18:23,000 --> 00:18:27,000
+Non-functional requirements specify how this system should do it.
+
+242
+00:18:27,000 --> 00:18:32,000
+Non-functional requirements do not affect the basic functionality of the system.
+
+243
+00:18:33,000 --> 00:18:38,000
+Hence the name is non-functional requirements even if the non-functional requirements are not met.
+
+244
+00:18:39,000 --> 00:18:42,000
+The system will still perform its basic purpose.
+
+245
+00:18:42,000 --> 00:18:46,000
+If a system will still perform results, meetings is non-functional requirements.
+
+246
+00:18:47,000 --> 00:18:48,000
+Why are they important?
+
+247
+00:18:49,000 --> 00:18:51,000
+The answer is usability.
+
+248
+00:18:51,000 --> 00:18:57,000
+Non-functional requirements define system behaviour, features and general characteristics that affect
+
+249
+00:18:57,000 --> 00:18:58,000
+the user experience.
+
+250
+00:18:59,000 --> 00:19:06,000
+How well known functional requirements are defined and executed determines how easily this system used
+
+251
+00:19:06,000 --> 00:19:09,000
+to use and is used to judge system performance.
+
+252
+00:19:10,000 --> 00:19:16,000
+Non-functional requirements are product properties and focus on user expectations.
+
+253
+00:19:17,000 --> 00:19:18,000
+Great.
+
+254
+00:19:18,000 --> 00:19:22,000
+You know what, functional and non-functional requirements are.
+
+255
+00:19:22,000 --> 00:19:26,000
+Now let's learn what functional and non-functional destiny is.
+
+256
+00:19:26,000 --> 00:19:33,000
+One more important things that we need to understand about testing software testing is broadly categorised
+
+257
+00:19:33,000 --> 00:19:35,000
+into functional and non-functional testing.
+
+258
+00:19:36,000 --> 00:19:38,000
+You already know different testing levels.
+
+259
+00:19:38,000 --> 00:19:43,000
+Also, you know what functional and non-functional requirements are, and I believe it will be easier
+
+260
+00:19:43,000 --> 00:19:48,000
+for you to understand such categories as functional and non-functional testing.
+
+261
+00:19:49,000 --> 00:19:55,000
+Let's discuss in detail about these testing types functional testing because the type of test and which
+
+262
+00:19:55,000 --> 00:20:01,000
+verifies that each function of the software application operates in conformance with the requirements
+
+263
+00:20:01,000 --> 00:20:02,000
+specification.
+
+264
+00:20:03,000 --> 00:20:10,000
+This test mainly involves black box testing, and it is not concerned about the source code of the application.
+
+265
+00:20:11,000 --> 00:20:14,000
+Usually, this is verification of entry and snares.
+
+266
+00:20:15,000 --> 00:20:22,000
+So you test behavior of the system according to the requirements, and to end, every functionality
+
+267
+00:20:22,000 --> 00:20:25,000
+of this system is tested by providing appropriate input.
+
+268
+00:20:25,000 --> 00:20:30,000
+Verifying the output and comparing the actual result was expected to results.
+
+269
+00:20:31,000 --> 00:20:39,000
+This test involves chicken of user interface APIs, database client server applications and functionality
+
+270
+00:20:39,000 --> 00:20:41,000
+of the application on the test.
+
+271
+00:20:42,000 --> 00:20:43,000
+The testing can be done.
+
+272
+00:20:43,000 --> 00:20:45,000
+Is it manually or using automation?
+
+273
+00:20:46,000 --> 00:20:51,000
+Non-functional testing checks all the aspects not covered in functional tests.
+
+274
+00:20:52,000 --> 00:20:56,000
+In other words, not a functional test and covers verification of non-functional requirements.
+
+275
+00:20:57,000 --> 00:21:02,000
+There are some aspects which are complex, such as performance of an application, etc. and this test
+
+276
+00:21:02,000 --> 00:21:05,000
+and check the quality of the software to be tested.
+
+277
+00:21:06,000 --> 00:21:13,000
+Quality majorly depends on time, accuracy, stability, correctness and durability of a product and
+
+278
+00:21:13,000 --> 00:21:17,000
+the various adverse circumstances in software terms.
+
+279
+00:21:17,000 --> 00:21:24,000
+When an application works as per the user expectation, smoothly and efficiently under any condition,
+
+280
+00:21:24,000 --> 00:21:30,000
+then it is stated as a reliable application based on these aspects of quality.
+
+281
+00:21:31,000 --> 00:21:34,000
+It is very critical to test under these parameters.
+
+282
+00:21:34,000 --> 00:21:38,000
+This type of testing is called non-functional testing.
+
+283
+00:21:38,000 --> 00:21:41,000
+It is not feasible to test this type manually.
+
+284
+00:21:41,000 --> 00:21:48,000
+Hence, some special automated tools are used to test it to help you understand the difference between
+
+285
+00:21:48,000 --> 00:21:51,000
+functional and non-functional testing matter.
+
+286
+00:21:51,000 --> 00:21:54,000
+Let me demonstrate its unreal example.
+
+287
+00:21:54,000 --> 00:22:02,000
+Imagine that we are testing system, and here are questions that we will ask ourselves Do you functional
+
+288
+00:22:02,000 --> 00:22:03,000
+and non-functional testing?
+
+289
+00:22:04,000 --> 00:22:11,000
+Thus, this will impact on the way how we approach our testing functional testing questions.
+
+290
+00:22:11,000 --> 00:22:16,000
+Are these a confirmation email sent after the user registers on the website?
+
+291
+00:22:17,000 --> 00:22:19,000
+Does a feedback notification appear?
+
+292
+00:22:19,000 --> 00:22:26,000
+Is a user uploads a larger files and the system asks when the user clicks on the icons that is supposed
+
+293
+00:22:26,000 --> 00:22:27,000
+to be clickable.
+
+294
+00:22:27,000 --> 00:22:29,000
+Does a new page load?
+
+295
+00:22:30,000 --> 00:22:33,000
+As you can see, all questions are behavior oriented.
+
+296
+00:22:34,000 --> 00:22:40,000
+Non-functional testing questions are how much time does it take for the user to receive a registration
+
+297
+00:22:40,000 --> 00:22:42,000
+confirmation email?
+
+298
+00:22:42,000 --> 00:22:47,000
+Does the feedback notification comply with the principles of user friendly push notifications?
+
+299
+00:22:47,000 --> 00:22:50,000
+Design the transparency for the user?
+
+300
+00:22:50,000 --> 00:22:52,000
+Where to click the lower than you page.
+
+301
+00:22:53,000 --> 00:23:00,000
+I believe you noticed that non-functional testing questions are more about how program works rather
+
+302
+00:23:00,000 --> 00:23:01,000
+than what it does.
+
+303
+00:23:02,000 --> 00:23:03,000
+It feels the difference.
+
+304
+00:23:03,000 --> 00:23:06,000
+I believe you do now.
+
+305
+00:23:06,000 --> 00:23:11,000
+When you understand the difference between a functional and non-functional testing, let's group different
+
+306
+00:23:11,000 --> 00:23:14,000
+testing strategies into two categories.
+
+307
+00:23:14,000 --> 00:23:22,000
+Such testing strategies can be added to functional testing group smoke testing, sanity testing, unit
+
+308
+00:23:22,000 --> 00:23:31,000
+testing, integration testing, boundary value testing, API testing, user acceptance testing, regression
+
+309
+00:23:31,000 --> 00:23:38,000
+testing, interoperability, testing and such testing strategies can be considered as non-functional
+
+310
+00:23:38,000 --> 00:23:46,000
+testing activities and reliability testing, performance, testing, compatibility, testing, localization,
+
+311
+00:23:46,000 --> 00:23:54,000
+testing, William testing, scalability, testing, usability testing, reliability testing, security
+
+312
+00:23:54,000 --> 00:24:02,000
+testing, penetration testing, accessibility testing, load testing, endurance testing, compliance
+
+313
+00:24:02,000 --> 00:24:09,000
+testing, stress testing, Menton ability testing, portability testing, disaster recovery testing
+
+314
+00:24:09,000 --> 00:24:12,000
+is everything clear to you anyway.
+
+315
+00:24:12,000 --> 00:24:16,000
+Even in case you still have any questions, do not hesitate to ask me in.
+
+316
+00:24:17,000 --> 00:24:20,000
+Comments on this video, and I will be happy to answer.
+
+317
+00:24:22,000 --> 00:24:22,000
+That's it.
+
+318
+00:24:22,000 --> 00:24:29,000
+Now let's recap what we have learned today to live and learn what testing is and why do we need it now,
+
+319
+00:24:29,000 --> 00:24:36,000
+you know what goes of testing are worthy of testing approaches and testing levels after today's lesson.
+
+320
+00:24:36,000 --> 00:24:40,000
+You know what level of tests are usually written by developers?
+
+321
+00:24:40,000 --> 00:24:43,000
+Besides that, you learned what quality is.
+
+322
+00:24:43,000 --> 00:24:46,000
+We learned what tests impairment is.
+
+323
+00:24:46,000 --> 00:24:50,000
+Also, we discussed the difference between functional and non-functional requirements.
+
+324
+00:24:51,000 --> 00:24:55,000
+And at the end of the lesson, we have learnt what functional and non-functional testing is.
+
+325
+00:24:56,000 --> 00:24:58,000
+That's all for this lesson.
+
+326
+00:24:58,000 --> 00:24:59,000
+Thanks a lot for your attention.
+
+327
+00:25:00,000 --> 00:25:01,000
+See you in the next lesson.
+
diff --git a/34 - Unit Testing & JUnit 5/001 Unit Testing & JUnit Overview_en.srt b/34 - Unit Testing & JUnit 5/001 Unit Testing & JUnit Overview_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..f11ef725b78d963308ddde600551810b96fb5f6e
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/001 Unit Testing & JUnit Overview_en.srt
@@ -0,0 +1,1372 @@
+1
+00:00:06,000 --> 00:00:10,000
+Heard yesterday in this lesson, we learned basics of human testing.
+
+2
+00:00:10,000 --> 00:00:12,000
+We are going to learn today what unit testing is.
+
+3
+00:00:12,000 --> 00:00:16,000
+You understand basic principles of unit testing.
+
+4
+00:00:16,000 --> 00:00:20,000
+And after that, we are going to review libraries for unit testing in Java.
+
+5
+00:00:20,000 --> 00:00:26,000
+We'll focus our attention on the one of the most popular libraries for unit testing and Java G unit.
+
+6
+00:00:26,000 --> 00:00:32,000
+I will explain the basic structure of this library and we'll teach you how that extra libraries to your
+
+7
+00:00:32,000 --> 00:00:34,000
+project in Eclipse by the end of the.
+
+8
+00:00:35,000 --> 00:00:38,000
+And you'll write your first unit test during the lesson.
+
+9
+00:00:38,000 --> 00:00:42,000
+I will share with you tips and best practices of writing unit tests.
+
+10
+00:00:42,000 --> 00:00:46,000
+So be prepared for interesting lecture and learn a lot of new things.
+
+11
+00:00:46,000 --> 00:00:49,000
+Let's start at the beginning of the lesson.
+
+12
+00:00:49,000 --> 00:00:55,000
+We'll talk about Syria of testing to make sure that by the moment we start right, our first test,
+
+13
+00:00:55,000 --> 00:00:59,000
+you understand what we are going to do in the middle of our lesson.
+
+14
+00:00:59,000 --> 00:01:03,000
+We'll learn how to use Genin by refining and testing in Java.
+
+15
+00:01:03,000 --> 00:01:09,000
+And at the end of the lesson, we'll dive deeper into the specifics of new tests from the previous class.
+
+16
+00:01:09,000 --> 00:01:14,000
+And you remember that new testing help us to test each specific unit of completion.
+
+17
+00:01:15,000 --> 00:01:17,000
+That is our classes with unit tests.
+
+18
+00:01:17,000 --> 00:01:23,000
+We have the ability and to to verify that each unit behaves in the way it expects to behave.
+
+19
+00:01:24,000 --> 00:01:26,000
+Does that mean that your program works 100 percent?
+
+20
+00:01:26,000 --> 00:01:26,000
+Correct?
+
+21
+00:01:27,000 --> 00:01:28,000
+Not necessarily.
+
+22
+00:01:28,000 --> 00:01:29,000
+Why?
+
+23
+00:01:29,000 --> 00:01:35,000
+Because each specific unit can work as expected, but together a few classes don't work as expected
+
+24
+00:01:36,000 --> 00:01:42,000
+is a some invalid input or one module works with a specific range of data that is invalid relative to
+
+25
+00:01:42,000 --> 00:01:43,000
+another class.
+
+26
+00:01:43,000 --> 00:01:45,000
+Or we missed some specific test case.
+
+27
+00:01:45,000 --> 00:01:52,000
+And the only reason our unit test passed successfully is that because it's simply absent a test is a
+
+28
+00:01:52,000 --> 00:01:59,000
+piece of good reason by a developer that executes a specific functionality in the code to be tested
+
+29
+00:01:59,000 --> 00:02:02,000
+and asserts a certain behavior or state.
+
+30
+00:02:03,000 --> 00:02:07,000
+Each test contains specific research that will verify specific state.
+
+31
+00:02:08,000 --> 00:02:14,000
+The percentage of code which is tested by unit tests is typically called test coverage will learn tools
+
+32
+00:02:14,000 --> 00:02:17,000
+that help us to verify test got coverage in adolescence.
+
+33
+00:02:18,000 --> 00:02:24,000
+Any tests are not suitable for testing complex user interfaces or component interactions.
+
+34
+00:02:24,000 --> 00:02:27,000
+For this, you should develop integration tests.
+
+35
+00:02:27,000 --> 00:02:31,000
+But unit tests can detect issues as early as possible.
+
+36
+00:02:31,000 --> 00:02:33,000
+They form the base of our test permit.
+
+37
+00:02:34,000 --> 00:02:41,000
+Now let's review basic principles of unit testing, the simple rules that we need to follow to make
+
+38
+00:02:41,000 --> 00:02:43,000
+sure our unit tests efficient.
+
+39
+00:02:43,000 --> 00:02:49,000
+Zaya the first through one assertion per test or single concept by test.
+
+40
+00:02:49,000 --> 00:02:55,000
+That means in case we test discount calculation, we don't have to create one test.
+
+41
+00:02:55,000 --> 00:03:01,000
+The test calculation of this controversial card was one product with total price of hundred bucks and
+
+42
+00:03:01,000 --> 00:03:07,000
+in the same tests verify amount of discount in case of the card with total price one thousand bucks.
+
+43
+00:03:08,000 --> 00:03:13,000
+In other words, one test shouldn't verify different test cases in scope of the same test.
+
+44
+00:03:14,000 --> 00:03:20,000
+There are some exceptions when this single concept by test in this case with this money transferring
+
+45
+00:03:20,000 --> 00:03:25,000
+from one account to another and we have test case that should verify my transaction.
+
+46
+00:03:25,000 --> 00:03:31,000
+In this case, we have to check that on one account amount of money was decreased because we sent them
+
+47
+00:03:31,000 --> 00:03:36,000
+to another account and on that last account, amount of money should be increased.
+
+48
+00:03:37,000 --> 00:03:39,000
+That's called single concept by test.
+
+49
+00:03:40,000 --> 00:03:44,000
+And we have to verifications in scope of the same test.
+
+50
+00:03:44,000 --> 00:03:51,000
+We need to separate test based scenarios to be able to catch error faster and to understand what specific
+
+51
+00:03:51,000 --> 00:03:52,000
+scenario didn't pass.
+
+52
+00:03:53,000 --> 00:03:59,000
+The second rule of human testing is that we have to test one single object at a time in case with some
+
+53
+00:03:59,000 --> 00:04:05,000
+service, for example, or the management service we shouldn't test or the store and service at the
+
+54
+00:04:05,000 --> 00:04:06,000
+same time.
+
+55
+00:04:06,000 --> 00:04:13,000
+Unit testing is about testing one single unit in isolation and without testing simultaneously different
+
+56
+00:04:13,000 --> 00:04:14,000
+units.
+
+57
+00:04:14,000 --> 00:04:20,000
+We have to test each unit separately and independently to make sure that the root cause of the error
+
+58
+00:04:20,000 --> 00:04:22,000
+is in this specific unit.
+
+59
+00:04:22,000 --> 00:04:24,000
+And that's the test case.
+
+60
+00:04:24,000 --> 00:04:26,000
+Failure is not caused by another class.
+
+61
+00:04:27,000 --> 00:04:29,000
+That's why you run the unit testing.
+
+62
+00:04:29,000 --> 00:04:34,000
+You want to isolate units from each other and test only one object at a time.
+
+63
+00:04:35,000 --> 00:04:40,000
+And the surge rule, one of the most important ones, choose meaningful test method names.
+
+64
+00:04:41,000 --> 00:04:42,000
+Why it is so important?
+
+65
+00:04:42,000 --> 00:04:47,000
+Because, as you remember, one of the functions of testing is to serve as a documentation.
+
+66
+00:04:48,000 --> 00:04:52,000
+That's why it is critically important to give meaningful names to each test.
+
+67
+00:04:53,000 --> 00:04:54,000
+Test should be readable.
+
+68
+00:04:54,000 --> 00:04:59,000
+Well, all codes should be readable, but this is critical, especially for tests.
+
+69
+00:05:00,000 --> 00:05:06,000
+That's why it is okay to have extremely long, massive names in unit tests that clearly describes a
+
+70
+00:05:06,000 --> 00:05:06,000
+test case.
+
+71
+00:05:07,000 --> 00:05:10,000
+It is also important to give clear names to all constants.
+
+72
+00:05:11,000 --> 00:05:16,000
+There is also Antipodeans that is called magic numbers, magic numbers and numbers.
+
+73
+00:05:16,000 --> 00:05:18,000
+It is not clear where do they come from?
+
+74
+00:05:18,000 --> 00:05:24,000
+Where does this maximum relative value or minimum value or this is just a random value.
+
+75
+00:05:24,000 --> 00:05:25,000
+What does it mean?
+
+76
+00:05:26,000 --> 00:05:32,000
+That's why each number should be assigned to a specific constant with the relevant name, especially
+
+77
+00:05:32,000 --> 00:05:33,000
+in tests.
+
+78
+00:05:33,000 --> 00:05:37,000
+Now, you know, Maine rules that can be applied to each year union test.
+
+79
+00:05:38,000 --> 00:05:39,000
+Let's proceed.
+
+80
+00:05:39,000 --> 00:05:43,000
+Now, I'd like to discuss with you a few more testing principles.
+
+81
+00:05:43,000 --> 00:05:50,000
+There are a set of principles called First Leavis acronym, composed from the first letters of the principal's
+
+82
+00:05:50,000 --> 00:05:50,000
+name.
+
+83
+00:05:50,000 --> 00:05:56,000
+And the minute you will believe me that this is not just offensive word, but indeed a set of useful
+
+84
+00:05:56,000 --> 00:05:56,000
+principles.
+
+85
+00:05:57,000 --> 00:06:00,000
+Let's start from the first one F stands for first.
+
+86
+00:06:01,000 --> 00:06:06,000
+A developer should not hesitate to run the unit tests because they are very slow and you need to grab
+
+87
+00:06:06,000 --> 00:06:08,000
+a cup of coffee to wake you.
+
+88
+00:06:08,000 --> 00:06:10,000
+All verifications will be done.
+
+89
+00:06:10,000 --> 00:06:18,000
+Nobody should be scared of running a union test because of the time they take the top of each preconditioning
+
+90
+00:06:18,000 --> 00:06:21,000
+test and gear down should execute really fast.
+
+91
+00:06:22,000 --> 00:06:27,000
+I mean, it is a matter of milliseconds because there are thousands of units in one project.
+
+92
+00:06:28,000 --> 00:06:30,000
+The next letter is I.
+
+93
+00:06:30,000 --> 00:06:33,000
+I stands for independent or isolated.
+
+94
+00:06:33,000 --> 00:06:37,000
+Each test should be isolated from external environment.
+
+95
+00:06:37,000 --> 00:06:43,000
+Each test should be independent of anything else, like another test environment for a specific user
+
+96
+00:06:43,000 --> 00:06:51,000
+input and so on, in case you expect from user input simulated for each specific test, because it may
+
+97
+00:06:51,000 --> 00:06:57,000
+be different shows that your code can work with the range of values and the result will be different.
+
+98
+00:06:57,000 --> 00:07:03,000
+We'll talk a little bit later how to make sure that we wrote enough tests to avoid the case.
+
+99
+00:07:03,000 --> 00:07:06,000
+When you write hundreds of tests, the test actually is the same thing.
+
+100
+00:07:07,000 --> 00:07:12,000
+There was a case in my life when a colleague of mine from United Kingdom wrote a test that successfully
+
+101
+00:07:13,000 --> 00:07:18,000
+only in his time zone, in time zone of team members from other countries, it failed.
+
+102
+00:07:19,000 --> 00:07:25,000
+Remember, if you use time in assertion of your test, make sure it doesn't depend from the time zone.
+
+103
+00:07:26,000 --> 00:07:31,000
+JDK contains a lot of classes and tools to work with time and to imitate specific time zone.
+
+104
+00:07:31,000 --> 00:07:35,000
+So make sure your tests are independent.
+
+105
+00:07:35,000 --> 00:07:36,000
+Let's go forward.
+
+106
+00:07:37,000 --> 00:07:39,000
+Are stands for repeatable?
+
+107
+00:07:39,000 --> 00:07:45,000
+That means that multiple execution of tests should provide us with the same result in case nothing was
+
+108
+00:07:45,000 --> 00:07:46,000
+changed in the source code.
+
+109
+00:07:46,000 --> 00:07:53,000
+For example, you wrote test that checks registration process after user sign up information about users
+
+110
+00:07:53,000 --> 00:07:59,000
+should be inserted in database and after you paste that user info in the database and run test one more
+
+111
+00:07:59,000 --> 00:08:05,000
+time, it failed because user research A or email already exist in database.
+
+112
+00:08:05,000 --> 00:08:06,000
+Can you understand this example?
+
+113
+00:08:07,000 --> 00:08:14,000
+That means even if you perform any data manipulations with database in our example, you have to clean
+
+114
+00:08:14,000 --> 00:08:16,000
+up everything after each test is finished.
+
+115
+00:08:16,000 --> 00:08:21,000
+And I believe that you understood that database is just one of examples.
+
+116
+00:08:21,000 --> 00:08:23,000
+The main idea is the following.
+
+117
+00:08:24,000 --> 00:08:29,000
+In case your test in some way changed the environment, you have to clean up everything after test is
+
+118
+00:08:29,000 --> 00:08:30,000
+finished.
+
+119
+00:08:30,000 --> 00:08:33,000
+Result of each test should be deterministic.
+
+120
+00:08:33,000 --> 00:08:36,000
+Developers should take control of everything.
+
+121
+00:08:36,000 --> 00:08:38,000
+What is going on in the test?
+
+122
+00:08:38,000 --> 00:08:40,000
+To reproduce different life cases?
+
+123
+00:08:40,000 --> 00:08:44,000
+Each test should set up its own data and should.
+
+124
+00:08:44,000 --> 00:08:50,000
+Not depend on any external factors to run its test, the next letter is S.
+
+125
+00:08:50,000 --> 00:08:56,000
+S stands for self validating no manual inspection where the test is passed on what is required.
+
+126
+00:08:57,000 --> 00:09:02,000
+The same manual configuration is required to execute test, to run tests.
+
+127
+00:09:02,000 --> 00:09:04,000
+Make sure that database is clear.
+
+128
+00:09:04,000 --> 00:09:06,000
+What run this test.
+
+129
+00:09:06,000 --> 00:09:08,000
+Make sure that resourceful clean.
+
+130
+00:09:08,000 --> 00:09:11,000
+You shouldn't declare any conditions like this.
+
+131
+00:09:11,000 --> 00:09:15,000
+And the last letter is key in different sources of literature.
+
+132
+00:09:15,000 --> 00:09:17,000
+It is explained in a different way.
+
+133
+00:09:18,000 --> 00:09:24,000
+Somebody tells the G stands for Sulloway and somebody tells the T stands for timely.
+
+134
+00:09:24,000 --> 00:09:27,000
+I would say that both of these statements are important.
+
+135
+00:09:28,000 --> 00:09:32,000
+SORU means the next should cover all the happy pass.
+
+136
+00:09:32,000 --> 00:09:37,000
+Try covering all the edge cases where the author would feel the function would fail.
+
+137
+00:09:38,000 --> 00:09:40,000
+Test for legal arguments and variables.
+
+138
+00:09:40,000 --> 00:09:42,000
+Test for security and other issues.
+
+139
+00:09:43,000 --> 00:09:44,000
+Test for launch failures.
+
+140
+00:09:44,000 --> 00:09:51,000
+What would a launch in that program should try to cover every use case scenario and not just aim for
+
+141
+00:09:51,000 --> 00:09:58,000
+one hundred percent test got coverage and timely means that test should be written right on time.
+
+142
+00:09:59,000 --> 00:10:04,000
+That means together with the code creation and even better before code creation.
+
+143
+00:10:05,000 --> 00:10:08,000
+I'm talking about so-called test development.
+
+144
+00:10:08,000 --> 00:10:10,000
+We'll talk about this in a separate lesson.
+
+145
+00:10:11,000 --> 00:10:13,000
+So don't be bothered about it right now.
+
+146
+00:10:13,000 --> 00:10:21,000
+Just remember that the best practice is to write test even before you created code on this slide.
+
+147
+00:10:21,000 --> 00:10:24,000
+I would like to talk with you about each test case structure.
+
+148
+00:10:24,000 --> 00:10:27,000
+I am talking about so-called built separate check partan.
+
+149
+00:10:28,000 --> 00:10:31,000
+Somebody also called this three a pattern.
+
+150
+00:10:31,000 --> 00:10:36,000
+Also, it is similar to even when Zen approach described in vague technique.
+
+151
+00:10:36,000 --> 00:10:41,000
+What all this say about these patterns are about basic test structure.
+
+152
+00:10:42,000 --> 00:10:44,000
+Let's review first built separate check pattern.
+
+153
+00:10:44,000 --> 00:10:46,000
+We build up test data first.
+
+154
+00:10:47,000 --> 00:10:50,000
+That is so-called precondition for each test.
+
+155
+00:10:50,000 --> 00:10:56,000
+We have to reproduce specific state of the system as a specific moment of time to verify how the system
+
+156
+00:10:56,000 --> 00:10:56,000
+behaves.
+
+157
+00:10:57,000 --> 00:11:03,000
+For example, we set amount of products in our virtual car and we associate this card with a specific
+
+158
+00:11:03,000 --> 00:11:07,000
+user and after that we operate on that data.
+
+159
+00:11:07,000 --> 00:11:09,000
+We perform some action.
+
+160
+00:11:09,000 --> 00:11:14,000
+In this part, we call some specific method to change the state of our test object.
+
+161
+00:11:15,000 --> 00:11:17,000
+And in the last part it is called check.
+
+162
+00:11:18,000 --> 00:11:19,000
+We perform validation.
+
+163
+00:11:20,000 --> 00:11:23,000
+Specific assertion should be performed in this part of the test.
+
+164
+00:11:24,000 --> 00:11:31,000
+We verify that actual state of our test object is equal to our expected state to make sure the test
+
+165
+00:11:31,000 --> 00:11:32,000
+passed successfully.
+
+166
+00:11:33,000 --> 00:11:35,000
+The next pardon is called 3A.
+
+167
+00:11:36,000 --> 00:11:44,000
+This is about the same three a stands for a act and asserts in the range part, we prepared data in
+
+168
+00:11:44,000 --> 00:11:47,000
+ACT part, modify that data by calling some assets.
+
+169
+00:11:47,000 --> 00:11:50,000
+And in a certain part, we perform assertion.
+
+170
+00:11:50,000 --> 00:11:53,000
+And bit later in this course, we are going to learn.
+
+171
+00:11:54,000 --> 00:11:59,000
+But already now you can understand that to describe expected behavior, we can use a given Van Zandt
+
+172
+00:11:59,000 --> 00:12:00,000
+pardon.
+
+173
+00:12:00,000 --> 00:12:06,000
+Even part describes what we have at the beginning what a regional state of our system is.
+
+174
+00:12:07,000 --> 00:12:14,000
+One part describes a specific action when something this happened, then it turns out that we have such
+
+175
+00:12:14,000 --> 00:12:15,000
+results.
+
+176
+00:12:15,000 --> 00:12:20,000
+So in Zenker, we have assertion to verify our behavior.
+
+177
+00:12:21,000 --> 00:12:24,000
+Now, you know, basic structure of each test case.
+
+178
+00:12:24,000 --> 00:12:26,000
+Let's get closer to the technical part now.
+
+179
+00:12:27,000 --> 00:12:31,000
+The different libraries exist to write and run unit tests in Java.
+
+180
+00:12:31,000 --> 00:12:38,000
+When I say library, I'm in code that was already written, compiled and packed into the archive.
+
+181
+00:12:39,000 --> 00:12:44,000
+Today, we also are going to learn how to add these archives to our project to use code that wasn't
+
+182
+00:12:44,000 --> 00:12:45,000
+really written.
+
+183
+00:12:45,000 --> 00:12:53,000
+But first, let's review some of the library's J unit, probably the most popular library for unit testing
+
+184
+00:12:53,000 --> 00:12:54,000
+in Java.
+
+185
+00:12:54,000 --> 00:13:01,000
+And as a popular library for you, your testing is test and G Energy stands for new generation.
+
+186
+00:13:01,000 --> 00:13:06,000
+These two libraries are both similar and provides the same list of features.
+
+187
+00:13:06,000 --> 00:13:12,000
+You can make similar configurations, but in a different way in each of these libraries, with the exception
+
+188
+00:13:12,000 --> 00:13:16,000
+that testing over some more features that Gene doesn't have.
+
+189
+00:13:17,000 --> 00:13:20,000
+But in most cases, G unit is more popular for testing.
+
+190
+00:13:20,000 --> 00:13:26,000
+In my opinion, you'll learn some basic principles and we are going to run your unit first.
+
+191
+00:13:26,000 --> 00:13:31,000
+And after that it will be easier for you to apply this knowledge with other frameworks like Test and
+
+192
+00:13:31,000 --> 00:13:31,000
+G.
+
+193
+00:13:32,000 --> 00:13:36,000
+And this course, we're going to learn the latest based on today's version of the unit.
+
+194
+00:13:36,000 --> 00:13:41,000
+I'm talking about the unit version five that's also called Jupiter.
+
+195
+00:13:41,000 --> 00:13:47,000
+In case you use the unit for in your project, or probably a new version of the unit will be released
+
+196
+00:13:47,000 --> 00:13:48,000
+in the near future.
+
+197
+00:13:48,000 --> 00:13:51,000
+I would say that updates are not critical.
+
+198
+00:13:51,000 --> 00:13:56,000
+Moreover, core principles are the same in every framework for unit testing.
+
+199
+00:13:56,000 --> 00:14:02,000
+There might be specifics in the implementation of one or another method, a new version and probably
+
+200
+00:14:02,000 --> 00:14:04,000
+some new annotations or methods.
+
+201
+00:14:04,000 --> 00:14:08,000
+But again, it is not critical for understanding of the whole picture.
+
+202
+00:14:09,000 --> 00:14:12,000
+So don't worry and proceed with learning a unit.
+
+203
+00:14:12,000 --> 00:14:18,000
+On the example of the unit version five eight five consists of different modules.
+
+204
+00:14:18,000 --> 00:14:28,000
+Zaya Unit Platform Jupiter unit will touch the unit platform serves as a foundation for launch and testing
+
+205
+00:14:28,000 --> 00:14:30,000
+frameworks on the job of its own machine.
+
+206
+00:14:31,000 --> 00:14:37,000
+It also defines the Test Engine API for development, a test and framework that runs on the platform.
+
+207
+00:14:38,000 --> 00:14:45,000
+Also, the platform provides a console launcher to launch the platform from the command line Jupiter
+
+208
+00:14:45,000 --> 00:14:51,000
+in the combination of the new programming model and extension model for writing test and extensions.
+
+209
+00:14:51,000 --> 00:14:58,000
+In June five, the Jupiter project provides a test engine for running Jupiter based tests on the platform.
+
+210
+00:14:59,000 --> 00:15:07,000
+G20 provides a test engine for running June three and June four based tests on the platform, the different
+
+211
+00:15:07,000 --> 00:15:09,000
+API in different versions of the unit.
+
+212
+00:15:09,000 --> 00:15:13,000
+And this module enables the compatibility between different APIs.
+
+213
+00:15:14,000 --> 00:15:19,000
+In this course, we are going to learn the features of this powerful library on the real examples.
+
+214
+00:15:19,000 --> 00:15:25,000
+For this course, I'm going to use official documentation in real life, examples I will share with
+
+215
+00:15:25,000 --> 00:15:30,000
+you experience from my projects to help you learn best practices of writing unit tests.
+
+216
+00:15:30,000 --> 00:15:37,000
+Now I suggest jump directly to examples to help you understand technical part of your testing.
+
+217
+00:15:37,000 --> 00:15:40,000
+Let's create first simple class that we are going to test.
+
+218
+00:15:41,000 --> 00:15:45,000
+I created all classes before the lesson, but I will walk you through all of them.
+
+219
+00:15:45,000 --> 00:15:47,000
+Here is simple class calculator.
+
+220
+00:15:48,000 --> 00:15:51,000
+It contains one single method that performs addition.
+
+221
+00:15:51,000 --> 00:15:54,000
+As you can see, nothing special here.
+
+222
+00:15:54,000 --> 00:16:01,000
+Our main goal in this lesson to learn technical side of union task creation, usually for all tests,
+
+223
+00:16:01,000 --> 00:16:03,000
+separate source folder is created.
+
+224
+00:16:03,000 --> 00:16:04,000
+What do we need?
+
+225
+00:16:04,000 --> 00:16:05,000
+Separate source folder.
+
+226
+00:16:06,000 --> 00:16:12,000
+Because at the end of the day, you have to compile all your source code packet in one archive and deployed
+
+227
+00:16:12,000 --> 00:16:16,000
+on the web server or on it separately on the desktop.
+
+228
+00:16:16,000 --> 00:16:19,000
+And you don't need tests to make your code.
+
+229
+00:16:19,000 --> 00:16:24,000
+Now, units usually needed during the development, but not in production.
+
+230
+00:16:24,000 --> 00:16:32,000
+That's why I would love to test in the separate source folder to keep and track them separately when
+
+231
+00:16:32,000 --> 00:16:33,000
+we learn to.
+
+232
+00:16:33,000 --> 00:16:39,000
+And builds groups, you will see that it will be easy to separate source code of our program from the
+
+233
+00:16:39,000 --> 00:16:44,000
+source code of our tests, and we will not include tests in our final program archive.
+
+234
+00:16:45,000 --> 00:16:47,000
+It will help us to save some space and memory.
+
+235
+00:16:48,000 --> 00:16:53,000
+That's why the first thing you have to do on your computer is to create another source folder.
+
+236
+00:16:53,000 --> 00:16:55,000
+How to do this mouse right.
+
+237
+00:16:55,000 --> 00:17:02,000
+Click on your project, then select new and select folder write test here and create this folder by
+
+238
+00:17:02,000 --> 00:17:04,000
+present finish button.
+
+239
+00:17:04,000 --> 00:17:07,000
+I will not create this folder because I already created it.
+
+240
+00:17:08,000 --> 00:17:14,000
+The next thing I have to do is to tell the eclipse that I wanted to treat my new folder as a source
+
+241
+00:17:14,000 --> 00:17:14,000
+folder.
+
+242
+00:17:15,000 --> 00:17:19,000
+A source folder is marked by clips as containing Java sources.
+
+243
+00:17:19,000 --> 00:17:25,000
+Then when you compile your project, Eclipse will look for your source code into all your source folders.
+
+244
+00:17:26,000 --> 00:17:28,000
+You can make any folder become a source folder.
+
+245
+00:17:28,000 --> 00:17:31,000
+I didn't need to see Java build pass zazz.
+
+246
+00:17:31,000 --> 00:17:33,000
+Next time you compile your project.
+
+247
+00:17:33,000 --> 00:17:36,000
+Eclipse will also look for Java classes in that folder.
+
+248
+00:17:37,000 --> 00:17:39,000
+How to do this press mouse right.
+
+249
+00:17:39,000 --> 00:17:41,000
+Click on your test folder.
+
+250
+00:17:41,000 --> 00:17:48,000
+Hover over, build, pass and select use as a source folder and you can see that now this folder is
+
+251
+00:17:48,000 --> 00:17:53,000
+marked as a source folder and all Java sources inside will be compiled.
+
+252
+00:17:53,000 --> 00:17:57,000
+I already have here a lot of tests that test your homework.
+
+253
+00:17:58,000 --> 00:17:59,000
+I will not focus on them today.
+
+254
+00:18:00,000 --> 00:18:04,000
+Instead, we are going to create new test with you for our calculator.
+
+255
+00:18:04,000 --> 00:18:05,000
+I press mouse right.
+
+256
+00:18:05,000 --> 00:18:08,000
+Click on this folder and select new.
+
+257
+00:18:08,000 --> 00:18:10,000
+And here I click on the union test case.
+
+258
+00:18:11,000 --> 00:18:17,000
+The first thing that we have to understand that each test is a separate matter within the test class.
+
+259
+00:18:17,000 --> 00:18:22,000
+So creating a test case, we created a class where we will describe methods.
+
+260
+00:18:23,000 --> 00:18:28,000
+Usually test classes are placed in the same package as class that we want to test.
+
+261
+00:18:28,000 --> 00:18:33,000
+In our particular case, it is a package where we created the calculator class.
+
+262
+00:18:34,000 --> 00:18:40,000
+As you can see on the screen, it is the following package compatibles learning Java Core Jeanneret
+
+263
+00:18:40,000 --> 00:18:41,000
+five.
+
+264
+00:18:41,000 --> 00:18:45,000
+Let's write the package name in the relevant field in our results.
+
+265
+00:18:46,000 --> 00:18:48,000
+Now we have to give our class and name.
+
+266
+00:18:48,000 --> 00:18:54,000
+It is not a critical thing what name we are going to give, but it should be clear what class we are
+
+267
+00:18:54,000 --> 00:18:55,000
+going to test.
+
+268
+00:18:56,000 --> 00:18:58,000
+That's why let's call our new class.
+
+269
+00:18:58,000 --> 00:18:59,000
+Calculate the test.
+
+270
+00:19:00,000 --> 00:19:01,000
+Do not forget to select your unit.
+
+271
+00:19:01,000 --> 00:19:10,000
+Jupiter Test Radio button on the top here, press Finnish button and now you can see another popup eclipse
+
+272
+00:19:10,000 --> 00:19:16,000
+is smart enough to understand that we don't have Jupiter libraries in our class past and it will be
+
+273
+00:19:16,000 --> 00:19:19,000
+impossible to run tests without these libraries.
+
+274
+00:19:19,000 --> 00:19:23,000
+You can add unnecessary dependencies related to G and five.
+
+275
+00:19:23,000 --> 00:19:27,000
+Just keep selected as the last radio button from this list and press a button.
+
+276
+00:19:28,000 --> 00:19:30,000
+And here's our test is created.
+
+277
+00:19:30,000 --> 00:19:32,000
+So what was changed?
+
+278
+00:19:32,000 --> 00:19:34,000
+Let me show you mouse.
+
+279
+00:19:34,000 --> 00:19:34,000
+Right.
+
+280
+00:19:34,000 --> 00:19:40,000
+Click on any file in the project and select build pass configurability pass.
+
+281
+00:19:40,000 --> 00:19:42,000
+Go to library, stop.
+
+282
+00:19:42,000 --> 00:19:47,000
+And here on the class path, you can see all libraries that are added to your project.
+
+283
+00:19:47,000 --> 00:19:48,000
+Right now.
+
+284
+00:19:48,000 --> 00:19:53,000
+You can see that I will say that manually geoint for for some libraries.
+
+285
+00:19:53,000 --> 00:19:56,000
+I will explain in adolescence what do we need it for.
+
+286
+00:19:57,000 --> 00:20:00,000
+And there you can see that Unit five was added.
+
+287
+00:20:00,000 --> 00:20:06,000
+You can see that each file has Zha extension jar stands for Java Archive.
+
+288
+00:20:06,000 --> 00:20:09,000
+That is typical extension for the group of combined classes.
+
+289
+00:20:10,000 --> 00:20:15,000
+In case you would need to add your custom library to a project, you always can do it by present on
+
+290
+00:20:15,000 --> 00:20:22,000
+class first and after that press add external Jerse and here you will be able to specify the path to
+
+291
+00:20:22,000 --> 00:20:24,000
+the jars that you want to add.
+
+292
+00:20:25,000 --> 00:20:26,000
+That is simple.
+
+293
+00:20:26,000 --> 00:20:29,000
+Now let me close all these widgets.
+
+294
+00:20:29,000 --> 00:20:30,000
+Here is our test.
+
+295
+00:20:31,000 --> 00:20:38,000
+By default, if you impose here they are static methods from assertions class and previous version of
+
+296
+00:20:38,000 --> 00:20:45,000
+geo engineering information for there was an asset class with static methods that perform assertions.
+
+297
+00:20:46,000 --> 00:20:49,000
+And our second impulse is a test annotation.
+
+298
+00:20:49,000 --> 00:20:56,000
+This annotation is used to mock each test that should be performed separately as a single test specific
+
+299
+00:20:56,000 --> 00:20:59,000
+class that runs our test and the schools run their class.
+
+300
+00:21:00,000 --> 00:21:04,000
+It verifies all methods that have annotation test to run.
+
+301
+00:21:04,000 --> 00:21:10,000
+All test independently will learn different trainers and how they work in the following lessons.
+
+302
+00:21:11,000 --> 00:21:17,000
+After this annotation method is described in union documentation, you can see that each time they provide
+
+303
+00:21:17,000 --> 00:21:21,000
+a good example, they use default access modifier for methods.
+
+304
+00:21:22,000 --> 00:21:24,000
+Each test should avoid return type.
+
+305
+00:21:25,000 --> 00:21:31,000
+In this particular case, stop method was generated and it calls method from assertions class that fails
+
+306
+00:21:31,000 --> 00:21:32,000
+our test by the.
+
+307
+00:21:33,000 --> 00:21:37,000
+Let's create our test to verify that the Utian works as expected.
+
+308
+00:21:38,000 --> 00:21:43,000
+Let's create instance of our calculator type that is our build because of the test.
+
+309
+00:21:44,000 --> 00:21:48,000
+After that, let's go at MassArt and pass through there.
+
+310
+00:21:49,000 --> 00:21:55,000
+That is our operating path in the terms of build a separate check button will assign the value that
+
+311
+00:21:55,000 --> 00:21:58,000
+is returned from this method to actual end variable.
+
+312
+00:21:59,000 --> 00:22:02,000
+And now the final part of our test.
+
+313
+00:22:02,000 --> 00:22:08,000
+It is chequerboard during the course we are going to run different assertions that will help you to
+
+314
+00:22:08,000 --> 00:22:14,000
+perform verifications, majority of them from assertions class that we imparted on the top of our file.
+
+315
+00:22:15,000 --> 00:22:21,000
+I call a service equals method to compare expected and actual values I expect expected where we first
+
+316
+00:22:22,000 --> 00:22:24,000
+and after that I pass actual value.
+
+317
+00:22:25,000 --> 00:22:26,000
+In the case they will be equal.
+
+318
+00:22:27,000 --> 00:22:30,000
+Test will pass in case they won't be equal.
+
+319
+00:22:30,000 --> 00:22:31,000
+Test will fail.
+
+320
+00:22:32,000 --> 00:22:33,000
+Let's run our tests.
+
+321
+00:22:33,000 --> 00:22:37,000
+I press control and F eleven together to run the tests.
+
+322
+00:22:37,000 --> 00:22:42,000
+And here you can find specific gene to you to check result of our tests.
+
+323
+00:22:42,000 --> 00:22:49,000
+I can see that my tests successfully passed in case expected value won't be equal to actual.
+
+324
+00:22:49,000 --> 00:22:52,000
+The test would fail just for the sake of the demo.
+
+325
+00:22:52,000 --> 00:22:54,000
+Let me change five to six here.
+
+326
+00:22:54,000 --> 00:22:55,000
+As expected.
+
+327
+00:22:55,000 --> 00:23:02,000
+The result I run test again and you can see assertion failed error expected six but was five.
+
+328
+00:23:03,000 --> 00:23:07,000
+That's how you can customize data input to test different cases.
+
+329
+00:23:07,000 --> 00:23:08,000
+Congratulations.
+
+330
+00:23:09,000 --> 00:23:11,000
+We have just written your first union test.
+
+331
+00:23:11,000 --> 00:23:15,000
+We still have a lot of things to learn, but we already wrote our first test.
+
+332
+00:23:16,000 --> 00:23:18,000
+We learned a lot for the day.
+
+333
+00:23:18,000 --> 00:23:24,000
+So I suggest the recap what we have learned in this lesson in pursuit with more information in the next
+
+334
+00:23:24,000 --> 00:23:24,000
+lessons.
+
+335
+00:23:25,000 --> 00:23:29,000
+Today, we learned what union testing is you learned in test rules.
+
+336
+00:23:30,000 --> 00:23:35,000
+Also in this lesson, I explained to you what first principles are now.
+
+337
+00:23:35,000 --> 00:23:41,000
+You know, the basic structure of your test review, such patterns as built operate check three eight.
+
+338
+00:23:41,000 --> 00:23:48,000
+And given that, I hold an overview of two, the most popular libraries for unit testing in Java.
+
+339
+00:23:48,000 --> 00:23:52,000
+After that, we dive into the details of the unit.
+
+340
+00:23:52,000 --> 00:23:58,000
+You learn how to enable JI, you support an eclipse and we roll to your first test.
+
+341
+00:23:59,000 --> 00:24:00,000
+That's all for this lesson.
+
+342
+00:24:00,000 --> 00:24:02,000
+Thanks a lot for your attention.
+
+343
+00:24:02,000 --> 00:24:04,000
+See you in the next lesson.
+
diff --git a/34 - Unit Testing & JUnit 5/002 JUnit 5 examples VS JUnit 4 + Equivalence class partitioning_en.srt b/34 - Unit Testing & JUnit 5/002 JUnit 5 examples VS JUnit 4 + Equivalence class partitioning_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..c15b5a83c579054e953aa3191d48d4ccd5f85961
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/002 JUnit 5 examples VS JUnit 4 + Equivalence class partitioning_en.srt
@@ -0,0 +1,1144 @@
+1
+00:00:06,000 --> 00:00:11,000
+Hello, yes, students in this lesson, we are going to dive into specifics of the unique library and
+
+2
+00:00:11,000 --> 00:00:15,000
+learn the Unit API by this lesson, you already know what unit testing is.
+
+3
+00:00:15,000 --> 00:00:18,000
+You also know basic principles of unit testing.
+
+4
+00:00:18,000 --> 00:00:24,000
+So in this lesson, we'll focus our attention on tools and APIs that is provided by the unit to help
+
+5
+00:00:24,000 --> 00:00:26,000
+us create reliable use of tests.
+
+6
+00:00:27,000 --> 00:00:34,000
+We'll learn specifics of Unit five and compared with Unit four, because even now in G four is very
+
+7
+00:00:34,000 --> 00:00:39,000
+popular and Unit five has modules that helps us to run tests that are written.
+
+8
+00:00:39,000 --> 00:00:40,000
+What do you need for?
+
+9
+00:00:40,000 --> 00:00:46,000
+That's why knowing specifics of both libraries is important, in my opinion, in this class.
+
+10
+00:00:46,000 --> 00:00:51,000
+And we are going to learn how to declare an assets in a unit that will help us to set up environment
+
+11
+00:00:51,000 --> 00:00:57,000
+for execution of each test case and clean up environment after each test case execution during this
+
+12
+00:00:57,000 --> 00:00:58,000
+class.
+
+13
+00:00:58,000 --> 00:01:02,000
+And I'll show your code examples and we'll cover specific code with tests.
+
+14
+00:01:03,000 --> 00:01:10,000
+You will learn how to use test annotation also on equivalence class partitioning technique on real examples.
+
+15
+00:01:10,000 --> 00:01:17,000
+You see how it can help us to save time and write tests that really helps us to test all possible test
+
+16
+00:01:17,000 --> 00:01:17,000
+cases.
+
+17
+00:01:18,000 --> 00:01:23,000
+And at the end of the lesson, I'll show you how to test exceptions, which you we have a lot of things
+
+18
+00:01:23,000 --> 00:01:25,000
+to learn in this lesson.
+
+19
+00:01:25,000 --> 00:01:28,000
+We are going to have a lot of coding examples and live demo.
+
+20
+00:01:28,000 --> 00:01:35,000
+So let's start first of all, I want to highlight you source of information to learn your unit always
+
+21
+00:01:35,000 --> 00:01:38,000
+rely only on official documentation.
+
+22
+00:01:38,000 --> 00:01:44,000
+Information and books may be not relevant information and some tutorials may not contain all the details
+
+23
+00:01:44,000 --> 00:01:45,000
+and specifics.
+
+24
+00:01:45,000 --> 00:01:50,000
+So knowing where official documentation is located is always useful.
+
+25
+00:01:50,000 --> 00:01:52,000
+I will leave this link and attachments to the video.
+
+26
+00:01:53,000 --> 00:01:55,000
+But let me also make a brief overview here.
+
+27
+00:01:55,000 --> 00:01:57,000
+You can see a list of all modules.
+
+28
+00:01:57,000 --> 00:02:01,000
+As we keep learning a unit, you will gradually learn all of these.
+
+29
+00:02:01,000 --> 00:02:04,000
+We can explore each module by clicking on it.
+
+30
+00:02:04,000 --> 00:02:11,000
+If you remember in previous lesson we wrote our first unit test and we used as equals message from assertions
+
+31
+00:02:11,000 --> 00:02:11,000
+class.
+
+32
+00:02:12,000 --> 00:02:15,000
+Let's find this class and learn what other methods allocated there.
+
+33
+00:02:16,000 --> 00:02:23,000
+To find assertions class, just click on org unit Jupiter API module after choose or GIULIAN Jupiter
+
+34
+00:02:23,000 --> 00:02:24,000
+API package.
+
+35
+00:02:24,000 --> 00:02:29,000
+And here you can find a list of interfaces and list of classes from this package.
+
+36
+00:02:30,000 --> 00:02:31,000
+Here is our sessions class.
+
+37
+00:02:32,000 --> 00:02:33,000
+Let's open it.
+
+38
+00:02:33,000 --> 00:02:35,000
+And here is a full list of matches.
+
+39
+00:02:35,000 --> 00:02:39,000
+You can click on any method that is interesting for you to learn documentation.
+
+40
+00:02:40,000 --> 00:02:46,000
+How this example helps you understand how you can find documentation by using module, name, package,
+
+41
+00:02:46,000 --> 00:02:47,000
+name and class name.
+
+42
+00:02:47,000 --> 00:02:51,000
+So and he Sampson will remain clear even after today's lesson.
+
+43
+00:02:51,000 --> 00:02:54,000
+You can always open documentation to read it.
+
+44
+00:02:54,000 --> 00:02:55,000
+Let's proceed.
+
+45
+00:02:55,000 --> 00:02:57,000
+I open Eclipse.
+
+46
+00:02:57,000 --> 00:03:02,000
+I suggest to learn the first two classes that we are going to cover with test today.
+
+47
+00:03:02,000 --> 00:03:05,000
+We have class with name mining transaction service.
+
+48
+00:03:05,000 --> 00:03:07,000
+It has one method to transfer money.
+
+49
+00:03:08,000 --> 00:03:12,000
+This method takes two accounts as arguments they account from.
+
+50
+00:03:13,000 --> 00:03:20,000
+That is from where money should be sent an account to this is where money should be sent and amount
+
+51
+00:03:20,000 --> 00:03:20,000
+of money to send.
+
+52
+00:03:21,000 --> 00:03:23,000
+Let me show you the source code of account.
+
+53
+00:03:23,000 --> 00:03:29,000
+Class account is a separate class that is located in the same package with current example.
+
+54
+00:03:29,000 --> 00:03:32,000
+For the sake of the damos, it contains only one field default.
+
+55
+00:03:32,000 --> 00:03:35,000
+Constructor and constructor was one argument.
+
+56
+00:03:35,000 --> 00:03:38,000
+Additionally, we have getters and setters here.
+
+57
+00:03:38,000 --> 00:03:39,000
+That's it.
+
+58
+00:03:39,000 --> 00:03:44,000
+Let's get back now to mining transaction service here and transfer money.
+
+59
+00:03:44,000 --> 00:03:46,000
+Massata, you can see if few cheques.
+
+60
+00:03:46,000 --> 00:03:52,000
+It is important to understand the logic of the method to be able to write a test for it in case account
+
+61
+00:03:52,000 --> 00:03:59,000
+from our account is now we through legal argument, exception with this message in case money amount
+
+62
+00:03:59,000 --> 00:04:06,000
+is less or equal to zero withdrawal illegal argument exception but with different error message in case
+
+63
+00:04:06,000 --> 00:04:12,000
+account from doesn't have enough money for this transaction, we throw our custom exception, not enough
+
+64
+00:04:12,000 --> 00:04:13,000
+money exception.
+
+65
+00:04:14,000 --> 00:04:18,000
+And only after all these checks we can perform a transaction.
+
+66
+00:04:18,000 --> 00:04:24,000
+We decrease amount of money for our account from and we increase amount of money for account to and
+
+67
+00:04:24,000 --> 00:04:27,000
+we return true in case transaction is successful.
+
+68
+00:04:28,000 --> 00:04:31,000
+The simple example that is really close to real life case.
+
+69
+00:04:31,000 --> 00:04:34,000
+And today we are going to cover this unit with units.
+
+70
+00:04:35,000 --> 00:04:37,000
+Let's start from previous lesson.
+
+71
+00:04:37,000 --> 00:04:41,000
+You already know that it is recommended to create test in the separate source folder.
+
+72
+00:04:42,000 --> 00:04:48,000
+I already created this test before the lesson to save time during the year I called this test class
+
+73
+00:04:48,000 --> 00:04:49,000
+money transaction service test.
+
+74
+00:04:49,000 --> 00:04:52,000
+I will walk you through each line one by one.
+
+75
+00:04:53,000 --> 00:04:56,000
+First of all, I declare a field in my test class.
+
+76
+00:04:56,000 --> 00:05:02,000
+This field has type of unit that we are going to test my transaction service I call variable test.
+
+77
+00:05:02,000 --> 00:05:08,000
+For instance, I have to initialize it, don't pay attention to these concerns right now, you will
+
+78
+00:05:08,000 --> 00:05:11,000
+understand a little bit later in this lesson, why do we need them?
+
+79
+00:05:12,000 --> 00:05:16,000
+Usually we create a special message that will be executed before each test.
+
+80
+00:05:16,000 --> 00:05:18,000
+That's why it is important.
+
+81
+00:05:19,000 --> 00:05:23,000
+You remember first principles, each test should be isolated from another.
+
+82
+00:05:24,000 --> 00:05:26,000
+That's why it is important that you're in each test.
+
+83
+00:05:26,000 --> 00:05:31,000
+I create a new instance of mining transaction service because potentially this object may have some
+
+84
+00:05:31,000 --> 00:05:37,000
+states that will be adjusted by one test and that will impact on the execution of another test.
+
+85
+00:05:38,000 --> 00:05:46,000
+This special method has annotation before each annotations and that information for unit, namely for
+
+86
+00:05:46,000 --> 00:05:53,000
+the class that is going to execute our tests is a group of classes that executes test called runners.
+
+87
+00:05:53,000 --> 00:05:58,000
+The runner will verify what method and class has before each annotation.
+
+88
+00:05:58,000 --> 00:06:06,000
+It will memorize it and will run this method before each test method in for there was a similar notation
+
+89
+00:06:06,000 --> 00:06:06,000
+before.
+
+90
+00:06:07,000 --> 00:06:14,000
+As you can see, there is no big difference between Unit four and five so far in this method, I initialize
+
+91
+00:06:14,000 --> 00:06:17,000
+my test instance usually common configurations.
+
+92
+00:06:17,000 --> 00:06:22,000
+It is important for each test is placed in this method, but we have only one line.
+
+93
+00:06:23,000 --> 00:06:26,000
+Pay attention that this method has what return type?
+
+94
+00:06:26,000 --> 00:06:32,000
+You can name this method as you wish, but I usually name it set up in the unit.
+
+95
+00:06:32,000 --> 00:06:36,000
+We also can configure methods that will be executed after each test.
+
+96
+00:06:36,000 --> 00:06:41,000
+This method has annotation after each injury unit five and after injury unit four.
+
+97
+00:06:42,000 --> 00:06:46,000
+In our particular case, there is no need to perform any actions after each test.
+
+98
+00:06:46,000 --> 00:06:48,000
+But you can clean up something.
+
+99
+00:06:48,000 --> 00:06:53,000
+What was done by your test to stay aligned with repeatable and isolated principles?
+
+100
+00:06:53,000 --> 00:07:00,000
+There are also two specific annotations that allows us to execute specific code before all test methods
+
+101
+00:07:00,000 --> 00:07:06,000
+and after all, test matches we can create Masset and market was before all annotation.
+
+102
+00:07:06,000 --> 00:07:13,000
+This method will be executed before all test methods pay attention to this method has static modifier
+
+103
+00:07:13,000 --> 00:07:17,000
+in case you use it for you can use before class annotation.
+
+104
+00:07:18,000 --> 00:07:21,000
+Similar to this annotation, we have another one.
+
+105
+00:07:21,000 --> 00:07:28,000
+Marcu static method was, after all, annotation and this method will be executed after all test methods
+
+106
+00:07:28,000 --> 00:07:32,000
+in unit four you can use after class annotation instead.
+
+107
+00:07:32,000 --> 00:07:35,000
+To be honest, these cases are very specific.
+
+108
+00:07:35,000 --> 00:07:36,000
+Why?
+
+109
+00:07:36,000 --> 00:07:39,000
+Because you want to isolate each test case from Annisa.
+
+110
+00:07:40,000 --> 00:07:45,000
+That's why performing some specific action before running all test cases and some method only.
+
+111
+00:07:45,000 --> 00:07:50,000
+After all test cases means that all test cases have something in common.
+
+112
+00:07:50,000 --> 00:07:55,000
+While this could be the case, sometimes this is very rare based on my experience.
+
+113
+00:07:56,000 --> 00:08:02,000
+So remember, use annotations and use them when you need, but most likely before each and after each
+
+114
+00:08:02,000 --> 00:08:04,000
+will be enough for you in most cases.
+
+115
+00:08:05,000 --> 00:08:07,000
+Let's move on now.
+
+116
+00:08:07,000 --> 00:08:08,000
+Let's write test.
+
+117
+00:08:08,000 --> 00:08:12,000
+Each test is a separate method that is marked with annotation test.
+
+118
+00:08:13,000 --> 00:08:17,000
+Each test method has void's return type in June five.
+
+119
+00:08:17,000 --> 00:08:22,000
+It is important the test method has any access modifier that is not private in unit four.
+
+120
+00:08:23,000 --> 00:08:27,000
+It is important the test method should have public access modifier.
+
+121
+00:08:27,000 --> 00:08:28,000
+That is model changed.
+
+122
+00:08:28,000 --> 00:08:31,000
+But still this is worse to mention in my opinion.
+
+123
+00:08:32,000 --> 00:08:38,000
+As you remember, it is important to give meaningful names to our tests to make sure that everyone understands
+
+124
+00:08:38,000 --> 00:08:39,000
+what this method is about.
+
+125
+00:08:40,000 --> 00:08:46,000
+Some tutors and tutorials that teach you to test methods also teach you how to make masses in case with
+
+126
+00:08:46,000 --> 00:08:49,000
+test transfer money method we have to write transfer money test.
+
+127
+00:08:50,000 --> 00:08:53,000
+In other words, just a test suffix at the end of the method.
+
+128
+00:08:54,000 --> 00:09:00,000
+But in my opinion, it is more important to not just make sure that you have a test for some specific
+
+129
+00:09:00,000 --> 00:09:00,000
+method.
+
+130
+00:09:00,000 --> 00:09:05,000
+I would rather prefer to make sure that method behaves in the way I expect it behaves.
+
+131
+00:09:06,000 --> 00:09:08,000
+And I want to reflect this in Masaomi.
+
+132
+00:09:09,000 --> 00:09:14,000
+That's why I recommend you to make sure that method names are named after expected behavior.
+
+133
+00:09:15,000 --> 00:09:21,000
+Always remember that your tests are documentation, just telling this documentation what your test unit
+
+134
+00:09:21,000 --> 00:09:27,000
+should be able to do and how it should behave in case how a unit should be able to transfer money.
+
+135
+00:09:27,000 --> 00:09:33,000
+Let's call this method and this way should transfer money from one account to another.
+
+136
+00:09:33,000 --> 00:09:39,000
+That's why one of the ways to name your methods is to start name it from should word and describe what
+
+137
+00:09:39,000 --> 00:09:41,000
+your unit should be able to do.
+
+138
+00:09:41,000 --> 00:09:43,000
+This makes things clearer, don't you think?
+
+139
+00:09:43,000 --> 00:09:46,000
+So now let's explore the test itself.
+
+140
+00:09:47,000 --> 00:09:48,000
+I write test accordingly.
+
+141
+00:09:48,000 --> 00:09:51,000
+Even when then partan we have two accounts.
+
+142
+00:09:52,000 --> 00:09:55,000
+Pay attention that I don't have any magic numbers in my code.
+
+143
+00:09:55,000 --> 00:10:00,000
+Instead, I declare constants that clearly describe what this value for.
+
+144
+00:10:00,000 --> 00:10:02,000
+For example, in my test I have.
+
+145
+00:10:02,000 --> 00:10:08,000
+We have some random value for amount of money, and that's why I called this constant in the same way
+
+146
+00:10:08,000 --> 00:10:13,000
+random money amount in case this is zero, I call it zero my amount.
+
+147
+00:10:14,000 --> 00:10:21,000
+Here's one note samples for static analysis doesn't three zero and one will use as magic numbers because
+
+148
+00:10:21,000 --> 00:10:27,000
+usually it is clear when you use zero and one, it is not so confusing as using another numbers.
+
+149
+00:10:27,000 --> 00:10:34,000
+For example, in case you used zero, it is clear that you use to zero to zero money amount for a count.
+
+150
+00:10:35,000 --> 00:10:42,000
+But in case you use three, it is not clear why you use three, but not five and not 10.
+
+151
+00:10:42,000 --> 00:10:46,000
+Can you understand now what our magic numbers but still in tests?
+
+152
+00:10:47,000 --> 00:10:51,000
+I prefer to give a name even to zero and one values is that's my style.
+
+153
+00:10:52,000 --> 00:10:53,000
+But you can decide and choose.
+
+154
+00:10:53,000 --> 00:10:57,000
+Your next part of the method is my when part.
+
+155
+00:10:58,000 --> 00:11:02,000
+I want to execute method I pass to accounts there and money amount.
+
+156
+00:11:02,000 --> 00:11:08,000
+I know that this money amount is valid money amount because I created the first account with such my
+
+157
+00:11:08,000 --> 00:11:09,000
+amount.
+
+158
+00:11:09,000 --> 00:11:14,000
+So I know that my transaction should be successful and my test should pass.
+
+159
+00:11:14,000 --> 00:11:21,000
+Now I have final part of my test that is a certain part and this is the case when I can perform two
+
+160
+00:11:21,000 --> 00:11:27,000
+assertions in one test because two assertions are connected with a single concept.
+
+161
+00:11:27,000 --> 00:11:33,000
+I have to verify that amount of money is decreased to zero on the first account and the amount of money
+
+162
+00:11:33,000 --> 00:11:35,000
+is increased on the second account.
+
+163
+00:11:35,000 --> 00:11:37,000
+That's why I have these two assertions.
+
+164
+00:11:37,000 --> 00:11:43,000
+In one test case, I use a service equals method and plus expected and actual value to it.
+
+165
+00:11:44,000 --> 00:11:49,000
+You already know this assertion from previous lesson, so nothing special here.
+
+166
+00:11:49,000 --> 00:11:56,000
+Now let me run this test one more time in case you work in Eclipse and you want to execute only one
+
+167
+00:11:56,000 --> 00:11:59,000
+single test, but not all tests from the class.
+
+168
+00:12:00,000 --> 00:12:04,000
+Make sure that your cursor is near the test method name, for example.
+
+169
+00:12:04,000 --> 00:12:05,000
+Here is my cursor.
+
+170
+00:12:05,000 --> 00:12:06,000
+Can I see it?
+
+171
+00:12:06,000 --> 00:12:08,000
+You can run test by pressing the mouse, right?
+
+172
+00:12:08,000 --> 00:12:11,000
+Click and choose and run as a unit test.
+
+173
+00:12:11,000 --> 00:12:15,000
+But I love to use shortcuts and now I press control and f eleven.
+
+174
+00:12:16,000 --> 00:12:23,000
+And here in test results you can see that only one method was executed and it passed in case I have
+
+175
+00:12:23,000 --> 00:12:31,000
+cursor placed in any other place and I press control and then all tests are executed and then test results.
+
+176
+00:12:31,000 --> 00:12:33,000
+Now you can see more than one test.
+
+177
+00:12:33,000 --> 00:12:34,000
+Is that clear?
+
+178
+00:12:35,000 --> 00:12:41,000
+So my test passed as I expected, but in this specific case, I still won't be happy.
+
+179
+00:12:42,000 --> 00:12:49,000
+My experience tells me that I shouldn't believe to the test that I have never seen Rat or in other words,
+
+180
+00:12:49,000 --> 00:12:49,000
+failed.
+
+181
+00:12:50,000 --> 00:12:50,000
+Why?
+
+182
+00:12:51,000 --> 00:12:57,000
+Because there are some cases when you run the test and it is green and you are happy, but when some
+
+183
+00:12:57,000 --> 00:13:03,000
+defect is popped up, you are wondering why unit test was not failed and you learn that your test is
+
+184
+00:13:03,000 --> 00:13:07,000
+never rat, even when you specify wrong expected value.
+
+185
+00:13:08,000 --> 00:13:14,000
+Not delving into the details right now, but it could be that you wrote your test that is always passed
+
+186
+00:13:14,000 --> 00:13:16,000
+because you missed some minor detail.
+
+187
+00:13:16,000 --> 00:13:23,000
+That's why writing test first is good, because you are always sure that you saw this test firing and
+
+188
+00:13:23,000 --> 00:13:24,000
+you saw this test passed.
+
+189
+00:13:25,000 --> 00:13:31,000
+My advices in case you write your test after you already wrote the code, just spent two more seconds
+
+190
+00:13:31,000 --> 00:13:34,000
+to test it with some invalid expected value.
+
+191
+00:13:34,000 --> 00:13:37,000
+For example, here, unexpected value.
+
+192
+00:13:37,000 --> 00:13:40,000
+I would specify some random value and will run the test one more time.
+
+193
+00:13:41,000 --> 00:13:45,000
+Now I see the test has failed and I can be calm and sleep well.
+
+194
+00:13:45,000 --> 00:13:51,000
+My test is useful and it will tell me in case something will go wrong during the transaction, I will
+
+195
+00:13:51,000 --> 00:13:55,000
+return the valid expected value and will proceed with the next test.
+
+196
+00:13:55,000 --> 00:14:01,000
+I want to ask you interesting question that I always ask during the interview when I want to verify
+
+197
+00:14:01,000 --> 00:14:03,000
+whether a person can write test efficiently.
+
+198
+00:14:04,000 --> 00:14:08,000
+The question is how you can be sure that you wrote enough tests.
+
+199
+00:14:09,000 --> 00:14:15,000
+For example, we test my transaction with some random well, you this when the value is equal to the
+
+200
+00:14:15,000 --> 00:14:18,000
+amount of money on the account before money transaction.
+
+201
+00:14:18,000 --> 00:14:22,000
+How many more tests will you write when you arrive now?
+
+202
+00:14:22,000 --> 00:14:25,000
+Test with transferring money was another random value.
+
+203
+00:14:25,000 --> 00:14:30,000
+Or you would said twice as much money on the account and you would transfer only half of the money.
+
+204
+00:14:31,000 --> 00:14:37,000
+Would this test have sense and do you need to write it or no press pause and take a minute to think
+
+205
+00:14:37,000 --> 00:14:38,000
+about this question.
+
+206
+00:14:38,000 --> 00:14:39,000
+How would you answer?
+
+207
+00:14:40,000 --> 00:14:44,000
+I expect to hear that you know what equivalence class position is?
+
+208
+00:14:45,000 --> 00:14:46,000
+What is this?
+
+209
+00:14:46,000 --> 00:14:51,000
+This is software testing technique that divides the input data of a software unit.
+
+210
+00:14:51,000 --> 00:14:57,000
+Interpretations of equivalent data from each test cases can be derived in principle.
+
+211
+00:14:57,000 --> 00:15:02,000
+Test cases are designed to cover each partition at least once this.
+
+212
+00:15:03,000 --> 00:15:10,000
+Tries to define test cases that uncover clusters of errors, thereby reducing the total number of test
+
+213
+00:15:10,000 --> 00:15:16,000
+cases that must be developed, an advantage of this approach is a reduction in the time required for
+
+214
+00:15:16,000 --> 00:15:21,000
+testing software use the less number of test cases, how to apply this knowledge while writing unit
+
+215
+00:15:22,000 --> 00:15:24,000
+tests before writing any sort of test.
+
+216
+00:15:24,000 --> 00:15:28,000
+Sit down and think about all possible inputs to your method.
+
+217
+00:15:29,000 --> 00:15:34,000
+Group these inputs and write test for only one example of data input from each group.
+
+218
+00:15:35,000 --> 00:15:37,000
+How to apply this knowledge in our example.
+
+219
+00:15:37,000 --> 00:15:43,000
+Let me show you, for example, the need to write test the test transaction of another positive money
+
+220
+00:15:43,000 --> 00:15:44,000
+amount.
+
+221
+00:15:44,000 --> 00:15:47,000
+No, because one hundred that is our end.
+
+222
+00:15:47,000 --> 00:15:52,000
+The value is the same as 50, the same as 20, all in the same equivalence class.
+
+223
+00:15:53,000 --> 00:15:58,000
+These are all numbers that are greater than or equal to the amount of money that are currently on the
+
+224
+00:15:58,000 --> 00:15:59,000
+account.
+
+225
+00:15:59,000 --> 00:16:01,000
+Number one, by the way.
+
+226
+00:16:01,000 --> 00:16:03,000
+Let me switch to the implementation class.
+
+227
+00:16:03,000 --> 00:16:04,000
+Can I see this?
+
+228
+00:16:04,000 --> 00:16:11,000
+If class I check was a money amount to transfer is no more than the current amount of money on the account.
+
+229
+00:16:12,000 --> 00:16:15,000
+That means we defined our first equivalence class.
+
+230
+00:16:15,000 --> 00:16:16,000
+Is that clear?
+
+231
+00:16:17,000 --> 00:16:22,000
+And that is how this technique can help us to save time by writing less number of tests.
+
+232
+00:16:22,000 --> 00:16:27,000
+But at the same time, be sure that we have a set of tests that will secure us.
+
+233
+00:16:27,000 --> 00:16:33,000
+Let's now proceed with defining our next set of data for testing based on our source code.
+
+234
+00:16:33,000 --> 00:16:36,000
+We also know that there are different conditions.
+
+235
+00:16:36,000 --> 00:16:39,000
+One exception is thrown our next Test match.
+
+236
+00:16:39,000 --> 00:16:42,000
+It sounds like this should throw exception.
+
+237
+00:16:42,000 --> 00:16:49,000
+If I count from is now my great first account variable that is referencing to now I create the second
+
+238
+00:16:49,000 --> 00:16:53,000
+account and now I call another method from assertions class.
+
+239
+00:16:53,000 --> 00:16:55,000
+The method is called asserts rules.
+
+240
+00:16:56,000 --> 00:17:02,000
+This method verifies that the US exceptions of specific type of identification of some method.
+
+241
+00:17:02,000 --> 00:17:05,000
+The test will pass only in case error of this type.
+
+242
+00:17:05,000 --> 00:17:07,000
+In our case, this is a legal argument.
+
+243
+00:17:07,000 --> 00:17:09,000
+The exception is wrong.
+
+244
+00:17:09,000 --> 00:17:12,000
+In case there were no exception or was the exception of another type.
+
+245
+00:17:13,000 --> 00:17:17,000
+The test will be failed, asserts Rose, takes two arguments.
+
+246
+00:17:17,000 --> 00:17:23,000
+The first argument is a class of expected exception, and the second argument is a function that will
+
+247
+00:17:23,000 --> 00:17:24,000
+execute any MassArt unit.
+
+248
+00:17:25,000 --> 00:17:28,000
+Usually we describe this with the help of lambda expression.
+
+249
+00:17:28,000 --> 00:17:31,000
+As you can see, I call transfer money method from lambda function.
+
+250
+00:17:32,000 --> 00:17:33,000
+Does it make sense?
+
+251
+00:17:33,000 --> 00:17:36,000
+One more interesting thing to note here.
+
+252
+00:17:36,000 --> 00:17:40,000
+Let me open the source code of our class that we are testing, if you remember.
+
+253
+00:17:40,000 --> 00:17:47,000
+And our method was a legal argument, exception in three cases when I count from is now when I count
+
+254
+00:17:47,000 --> 00:17:51,000
+two is now and when the money amount to transfer is less than or equal to zero.
+
+255
+00:17:52,000 --> 00:17:58,000
+How to understand when I get exceptional because of invalid account argument or because of invalid money
+
+256
+00:17:58,000 --> 00:18:03,000
+amount argument, especially for this I used messages in exceptions.
+
+257
+00:18:03,000 --> 00:18:09,000
+Let's get back to our test, asserts Rosmus returns the reference to exception object.
+
+258
+00:18:09,000 --> 00:18:12,000
+I can capture it and assign a variable.
+
+259
+00:18:12,000 --> 00:18:16,000
+The next thing that I will do, I will check that message of exception.
+
+260
+00:18:16,000 --> 00:18:20,000
+Exactly the message that I expect to have now.
+
+261
+00:18:20,000 --> 00:18:23,000
+I can be sure, as it indicates this assertion will pass.
+
+262
+00:18:23,000 --> 00:18:30,000
+That would mean that I received exactly the legal argument exception that I expected that it makes sense
+
+263
+00:18:30,000 --> 00:18:31,000
+in for.
+
+264
+00:18:31,000 --> 00:18:37,000
+You had an opportunity to specify type of expected exception, your test annotation just like this.
+
+265
+00:18:37,000 --> 00:18:43,000
+You write expected words in parentheses and specify class of exception that you expect.
+
+266
+00:18:43,000 --> 00:18:49,000
+You can see that in this case, I use annotation from another package that is used for package.
+
+267
+00:18:50,000 --> 00:18:56,000
+I show that just for the sake of the example, how to test similar case in unit for the next test case
+
+268
+00:18:56,000 --> 00:18:58,000
+is similar to the current one.
+
+269
+00:18:58,000 --> 00:19:01,000
+We just test the same in case account two is now.
+
+270
+00:19:02,000 --> 00:19:03,000
+What are the cases we have?
+
+271
+00:19:04,000 --> 00:19:09,000
+We also thrown out enough money exception in case we want to transfer more monies and we actually have
+
+272
+00:19:10,000 --> 00:19:16,000
+we have test to verify exception in case we try to send negative money amount and the same error in
+
+273
+00:19:16,000 --> 00:19:17,000
+case we want to transfer zero.
+
+274
+00:19:18,000 --> 00:19:21,000
+Now, it looks like we tested all possible cases.
+
+275
+00:19:22,000 --> 00:19:23,000
+We learned a lot for today.
+
+276
+00:19:23,000 --> 00:19:27,000
+Let's recap what we have learned today in this lesson.
+
+277
+00:19:27,000 --> 00:19:31,000
+We learned where to find union documentation and how to use it.
+
+278
+00:19:31,000 --> 00:19:37,000
+We learned annotations that will help us to set up an environment before each test and clean up environment
+
+279
+00:19:37,000 --> 00:19:39,000
+after each test execution.
+
+280
+00:19:39,000 --> 00:19:43,000
+During the lesson, we compared how to do the same things with Unit five.
+
+281
+00:19:43,000 --> 00:19:48,000
+Indeed four, we learned test annotation and you understood how to create a test case.
+
+282
+00:19:49,000 --> 00:19:53,000
+You learned what equivalence test partitioning and how to use this technique.
+
+283
+00:19:53,000 --> 00:19:59,000
+And at the end of the lesson we learned how to test exceptions in and hope this lesson was interesting
+
+284
+00:19:59,000 --> 00:20:00,000
+for you.
+
+285
+00:20:00,000 --> 00:20:02,000
+Thanks a lot for your attention.
+
+286
+00:20:02,000 --> 00:20:04,000
+Have a great day and see you in the next lesson.
+
diff --git a/34 - Unit Testing & JUnit 5/002 JUnit-Documentation.url b/34 - Unit Testing & JUnit 5/002 JUnit-Documentation.url
new file mode 100644
index 0000000000000000000000000000000000000000..1f2c4c71736c586fbd0d8de0c8de1d165c782275
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/002 JUnit-Documentation.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://junit.org/junit5/docs/current/api/
\ No newline at end of file
diff --git a/34 - Unit Testing & JUnit 5/002 Source-code-of-MoneyTransactionService.url b/34 - Unit Testing & JUnit 5/002 Source-code-of-MoneyTransactionService.url
new file mode 100644
index 0000000000000000000000000000000000000000..943c428cf30dca1c073ff5f6ebb872b75dfe1228
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/002 Source-code-of-MoneyTransactionService.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/src/com/itbulls/learnit/javacore/junit5/MoneyTransactionService.java
\ No newline at end of file
diff --git a/34 - Unit Testing & JUnit 5/002 Source-code-of-MoneyTransactionServiceTest.url b/34 - Unit Testing & JUnit 5/002 Source-code-of-MoneyTransactionServiceTest.url
new file mode 100644
index 0000000000000000000000000000000000000000..a60c42b1e1da3f5978b7fb7df8acb07120700e09
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/002 Source-code-of-MoneyTransactionServiceTest.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/junit5/MoneyTransactionServiceTest.java
\ No newline at end of file
diff --git a/34 - Unit Testing & JUnit 5/003 JUnit 5 API (Advanced) & Test Code Coverage_en.srt b/34 - Unit Testing & JUnit 5/003 JUnit 5 API (Advanced) & Test Code Coverage_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..3eb48ef8dded0452d6ad22eaf91ff4f984e53bcd
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/003 JUnit 5 API (Advanced) & Test Code Coverage_en.srt
@@ -0,0 +1,1128 @@
+1
+00:00:05,000 --> 00:00:11,000
+Hello, dear students, in this lesson, we are going to proceed learning API will learn new annotations
+
+2
+00:00:11,000 --> 00:00:13,000
+that will use to configure our tests.
+
+3
+00:00:13,000 --> 00:00:19,000
+Yet I will show you on examples how the display name annotation helps us to make our test reports more
+
+4
+00:00:19,000 --> 00:00:20,000
+readable.
+
+5
+00:00:20,000 --> 00:00:27,000
+Also, we'll learn how to display name generation notation to help us improve our test report automatically
+
+6
+00:00:27,000 --> 00:00:28,000
+during the class.
+
+7
+00:00:28,000 --> 00:00:32,000
+And we'll talk about API that will help us to group assertions together.
+
+8
+00:00:32,000 --> 00:00:39,000
+Besides that, you'll learn how to create dependent assertions in some cases in real life that in case
+
+9
+00:00:39,000 --> 00:00:46,000
+requirements for test conditions are not met, there is no sense to verify other things and will learn
+
+10
+00:00:46,000 --> 00:00:47,000
+how to configure this flow.
+
+11
+00:00:48,000 --> 00:00:53,000
+Also, I will show you to the powerful mechanism of assumptions and how it works.
+
+12
+00:00:53,000 --> 00:00:58,000
+After that, we'll dive deeper and will learn how to create parametrized tests.
+
+13
+00:00:58,000 --> 00:01:03,000
+And at the end of the lesson, I will explain how we can measure test code coverage and what plugin
+
+14
+00:01:03,000 --> 00:01:04,000
+will use for that.
+
+15
+00:01:05,000 --> 00:01:07,000
+Sounds like we have a lot of things to do.
+
+16
+00:01:07,000 --> 00:01:08,000
+Let's start.
+
+17
+00:01:08,000 --> 00:01:12,000
+I really believe that it is better to learn this topic on examples.
+
+18
+00:01:12,000 --> 00:01:13,000
+So let me open Eclipse.
+
+19
+00:01:14,000 --> 00:01:16,000
+This is our test from the previous lesson.
+
+20
+00:01:17,000 --> 00:01:20,000
+In case you missed first lesson, please get back and watch it.
+
+21
+00:01:21,000 --> 00:01:27,000
+Meanwhile, will keep improving our tests here and assessing for visibility and for documentation.
+
+22
+00:01:27,000 --> 00:01:31,000
+Your test properly we can use display name annotation.
+
+23
+00:01:31,000 --> 00:01:32,000
+Let me show you this.
+
+24
+00:01:33,000 --> 00:01:37,000
+You can apply this annotation to the class and specify clear name.
+
+25
+00:01:38,000 --> 00:01:41,000
+Also, we can apply this notation for each specific test match.
+
+26
+00:01:41,000 --> 00:01:48,000
+You can use any characters and even emoji if you wish, that also display name generators.
+
+27
+00:01:48,000 --> 00:01:50,000
+You can use generators on the class level.
+
+28
+00:01:51,000 --> 00:01:55,000
+For example, I use generators that substitutes underscores with spaces.
+
+29
+00:01:55,000 --> 00:02:02,000
+As you can see, I use an annotation displaying the generation inside this annotation I use in a class
+
+30
+00:02:02,000 --> 00:02:10,000
+of display name generator that is called replace underscores this auto display name generator can be
+
+31
+00:02:10,000 --> 00:02:16,000
+helpful because on some project specific way of naming test methods can be used, namely sometimes in
+
+32
+00:02:16,000 --> 00:02:20,000
+tests with name methods, with underscore to increase visibility.
+
+33
+00:02:20,000 --> 00:02:23,000
+Let me run tests to show you the result.
+
+34
+00:02:24,000 --> 00:02:30,000
+Here you can see the display name of our test class is changed, and inside you can see the display
+
+35
+00:02:30,000 --> 00:02:30,000
+method.
+
+36
+00:02:30,000 --> 00:02:35,000
+The first test is different and under scores are removed for the second test.
+
+37
+00:02:36,000 --> 00:02:41,000
+Can you see now that readability is increased in comparison with other methods listed here?
+
+38
+00:02:42,000 --> 00:02:47,000
+Instead of the display name generator, you can use other generators that are available here.
+
+39
+00:02:47,000 --> 00:02:50,000
+Here is a list of other generators that you can use.
+
+40
+00:02:50,000 --> 00:02:51,000
+Hope this is clear.
+
+41
+00:02:52,000 --> 00:02:52,000
+Let's move on.
+
+42
+00:02:53,000 --> 00:03:00,000
+Let's talk about assertions in unit where you saw how we wrote these tests in previous lesson.
+
+43
+00:03:00,000 --> 00:03:04,000
+And you know that we have a lot of research and methods located in assertions class.
+
+44
+00:03:04,000 --> 00:03:09,000
+All methods are static and usually we do static in parts of ascensions class.
+
+45
+00:03:09,000 --> 00:03:12,000
+Let's look at assertions that we didn't talk about yet.
+
+46
+00:03:13,000 --> 00:03:16,000
+I put all new examples at the bottom of this file.
+
+47
+00:03:16,000 --> 00:03:22,000
+I will share with you link to the source code after the lesson so you could find these examples and
+
+48
+00:03:22,000 --> 00:03:23,000
+investigate them separately.
+
+49
+00:03:24,000 --> 00:03:30,000
+For example, you can group your assertions sometimes that is logical and more visible.
+
+50
+00:03:30,000 --> 00:03:36,000
+I believe you remember our first test when we verify transaction here is a similar test.
+
+51
+00:03:36,000 --> 00:03:42,000
+But in the last part I use a search all Masset to group my two assertions.
+
+52
+00:03:42,000 --> 00:03:49,000
+This massive takes head that you will see in case one of the assertions will fail and you pass verbal
+
+53
+00:03:49,000 --> 00:03:51,000
+Lancs argument of type executable.
+
+54
+00:03:52,000 --> 00:03:58,000
+Usually object of this type is described with the help of the expression and you can see that in lambda
+
+55
+00:03:58,000 --> 00:03:58,000
+function.
+
+56
+00:03:58,000 --> 00:04:03,000
+I execute my own assertions in case one of these will be failed.
+
+57
+00:04:03,000 --> 00:04:08,000
+In report you will see that group of assertions with this header is failed.
+
+58
+00:04:08,000 --> 00:04:10,000
+Hope this is clearer with this example.
+
+59
+00:04:11,000 --> 00:04:16,000
+In the next example, I am going to show you how you can write dependent assertions.
+
+60
+00:04:16,000 --> 00:04:18,000
+Hammerson is easy here.
+
+61
+00:04:18,000 --> 00:04:22,000
+We can use nested assertions qaisi example.
+
+62
+00:04:22,000 --> 00:04:31,000
+We test the same money transaction I write asserts all and inside I have Asatru this assertion will
+
+63
+00:04:31,000 --> 00:04:33,000
+check the transfer money returned.
+
+64
+00:04:33,000 --> 00:04:40,000
+True, that would mean the transaction was successful and only after that I will check that amount of
+
+65
+00:04:40,000 --> 00:04:47,000
+money exchanged for account one and the account to and in a all method will be executed only in case.
+
+66
+00:04:47,000 --> 00:04:52,000
+First assertion that the seller Asatru method will pass.
+
+67
+00:04:52,000 --> 00:04:53,000
+Does it make sense.
+
+68
+00:04:54,000 --> 00:04:54,000
+Great.
+
+69
+00:04:55,000 --> 00:04:55,000
+Let's continue.
+
+70
+00:04:56,000 --> 00:05:03,000
+The next assertion will help us to be sure the time spent on execution of our method does not exceed
+
+71
+00:05:03,000 --> 00:05:05,000
+specified by US amount of time.
+
+72
+00:05:05,000 --> 00:05:06,000
+This is needed in the case.
+
+73
+00:05:06,000 --> 00:05:13,000
+We want to be sure that, for example, some complex method with a lot of logic inside that it doesn't
+
+74
+00:05:13,000 --> 00:05:15,000
+take more than one second to execute.
+
+75
+00:05:15,000 --> 00:05:18,000
+In our particular case, I want to test transfer money.
+
+76
+00:05:18,000 --> 00:05:21,000
+MassArt does not take more than one second to execute.
+
+77
+00:05:22,000 --> 00:05:26,000
+I use a certain amount method and pass to arguments to it.
+
+78
+00:05:26,000 --> 00:05:29,000
+The first argument is a duration object.
+
+79
+00:05:29,000 --> 00:05:33,000
+In a separate lesson, we learn with the tools for time management in JDK.
+
+80
+00:05:33,000 --> 00:05:36,000
+Right now you can just use duration class.
+
+81
+00:05:36,000 --> 00:05:39,000
+Don't forget to make an impact from Java Time package.
+
+82
+00:05:39,000 --> 00:05:41,000
+In case you use Eclipse.
+
+83
+00:05:41,000 --> 00:05:45,000
+It will help you with other suggestion and will improve this class instead of you.
+
+84
+00:05:46,000 --> 00:05:53,000
+You can use static methods, for example, of seconds to get duration in seconds of minutes to get duration
+
+85
+00:05:53,000 --> 00:05:55,000
+in milliseconds and so on.
+
+86
+00:05:56,000 --> 00:06:03,000
+I use of seconds method and the second argument similar to our previous examples, I pass lambda function
+
+87
+00:06:03,000 --> 00:06:10,000
+and execute my method and sided test will pass in case this method execution took less than one second
+
+88
+00:06:10,000 --> 00:06:14,000
+and it will fail in case method execution took longer.
+
+89
+00:06:14,000 --> 00:06:21,000
+Talking about timeouts, it is also worth to mention that a certain mouth method returns the result.
+
+90
+00:06:21,000 --> 00:06:27,000
+For example, in this case a certain amount will return the result of my transfer money method.
+
+91
+00:06:28,000 --> 00:06:31,000
+That means that I am able to test time out of method.
+
+92
+00:06:31,000 --> 00:06:35,000
+The execution and the actual result I test.
+
+93
+00:06:35,000 --> 00:06:38,000
+The transaction was successful in a certain method.
+
+94
+00:06:39,000 --> 00:06:42,000
+Also, there is another way to check them out.
+
+95
+00:06:42,000 --> 00:06:49,000
+We can use annotation timeout right above the test method by default time use it and said the annotation
+
+96
+00:06:49,000 --> 00:06:51,000
+is seconds, but it is configurable.
+
+97
+00:06:51,000 --> 00:06:57,000
+And you can see in this command line how you can configure time unit for this annotation.
+
+98
+00:06:57,000 --> 00:07:00,000
+Just your second argument as time unit.
+
+99
+00:07:00,000 --> 00:07:01,000
+Does it make sense?
+
+100
+00:07:02,000 --> 00:07:02,000
+Great.
+
+101
+00:07:03,000 --> 00:07:08,000
+You already learned a lot of tools that will help you in daily activities while writing unit tests.
+
+102
+00:07:09,000 --> 00:07:15,000
+Now I want to tell you about very interesting to injure Unit I talking about mechanism of assumptions.
+
+103
+00:07:15,000 --> 00:07:22,000
+Imagine that you wrote a unit test, but you want to vividly specify what is a valid input for this
+
+104
+00:07:22,000 --> 00:07:23,000
+test in case in.
+
+105
+00:07:24,000 --> 00:07:26,000
+This message was invalid with this death.
+
+106
+00:07:27,000 --> 00:07:31,000
+Don't worry, I will show you an example now and everything will become clear.
+
+107
+00:07:32,000 --> 00:07:38,000
+Imagine that I wrote a test that should be run only on local development environment and another test
+
+108
+00:07:38,000 --> 00:07:41,000
+that should be run on quality assurance environment.
+
+109
+00:07:42,000 --> 00:07:44,000
+These environments use different configurations.
+
+110
+00:07:45,000 --> 00:07:48,000
+While this is not a good practice, it is very common sense.
+
+111
+00:07:49,000 --> 00:07:55,000
+And you want that one specific test would run only on local computers and another test would be run
+
+112
+00:07:55,000 --> 00:07:56,000
+on a server.
+
+113
+00:07:56,000 --> 00:07:57,000
+How to do that?
+
+114
+00:07:57,000 --> 00:08:01,000
+We can assume some statement before running tests.
+
+115
+00:08:01,000 --> 00:08:05,000
+For example, this test will be executed only on my laptop.
+
+116
+00:08:06,000 --> 00:08:12,000
+I write assume true at the beginning and pass statements that should return true or false in history
+
+117
+00:08:12,000 --> 00:08:14,000
+will be returned to you.
+
+118
+00:08:14,000 --> 00:08:18,000
+It will proceed with the test execution and his statement will be false.
+
+119
+00:08:19,000 --> 00:08:23,000
+You will just keep this test and will print the string message in the report.
+
+120
+00:08:24,000 --> 00:08:28,000
+I said environment variable on my computer that is called is an Ripperton laptop.
+
+121
+00:08:29,000 --> 00:08:30,000
+It has true value.
+
+122
+00:08:30,000 --> 00:08:36,000
+In case I will change the statement a bit, I will get false and this test will be skipped.
+
+123
+00:08:36,000 --> 00:08:42,000
+Let me run now all tests to show you how this look like and hand test reports.
+
+124
+00:08:42,000 --> 00:08:47,000
+You can see how much tests were run and the number of tests in parentheses.
+
+125
+00:08:48,000 --> 00:08:51,000
+Let's expand the report and check which test was kept.
+
+126
+00:08:52,000 --> 00:08:58,000
+And here you can see the test on Batalha Workstation is escaped because assumption is failed.
+
+127
+00:08:59,000 --> 00:09:06,000
+So what is the difference between assertion and assumption, you assert is used to test scenarios for
+
+128
+00:09:06,000 --> 00:09:12,000
+our test methods, whereas ASSUME is used to validate favorable conditions for our tests.
+
+129
+00:09:13,000 --> 00:09:17,000
+Here's how you can configure was a test should be executed or skipped.
+
+130
+00:09:18,000 --> 00:09:21,000
+Now I want to show you another key feature of the unit.
+
+131
+00:09:21,000 --> 00:09:23,000
+I am talking about parametrized test.
+
+132
+00:09:24,000 --> 00:09:29,000
+Imagine that you have one test and you want to run it multiple times with different values.
+
+133
+00:09:29,000 --> 00:09:31,000
+You don't have to write different tests.
+
+134
+00:09:31,000 --> 00:09:35,000
+You can just specify that this test will have different inputs.
+
+135
+00:09:35,000 --> 00:09:36,000
+How to do this?
+
+136
+00:09:36,000 --> 00:09:37,000
+Let me show you.
+
+137
+00:09:38,000 --> 00:09:44,000
+First of all, we have to write parametrized, test annotation instead of our regular test annotation.
+
+138
+00:09:44,000 --> 00:09:50,000
+The second thing we have to do is to write value source annotation in parentheses.
+
+139
+00:09:50,000 --> 00:09:57,000
+Next to this annotation, we can specify arrays of different types, namely moulins, bytes, chars
+
+140
+00:09:57,000 --> 00:10:02,000
+classes, double slots in long shorts and strings.
+
+141
+00:10:02,000 --> 00:10:07,000
+Even in case you would forget this, you just use auto suggestion to work.
+
+142
+00:10:07,000 --> 00:10:07,000
+I do.
+
+143
+00:10:08,000 --> 00:10:11,000
+You can press control and space simultaneously to see.
+
+144
+00:10:11,000 --> 00:10:19,000
+Hence, in my particular example, I need INTs and next to end I specify array of in braces.
+
+145
+00:10:19,000 --> 00:10:24,000
+The third thing we have to do is to declare method parameter in our test.
+
+146
+00:10:24,000 --> 00:10:29,000
+This time should be compatible with the one we specified in the values source annotation.
+
+147
+00:10:30,000 --> 00:10:38,000
+I declare parameter of type end and now this test will be executed four times y four because I have
+
+148
+00:10:38,000 --> 00:10:40,000
+four inputs to be specific.
+
+149
+00:10:40,000 --> 00:10:47,000
+In this case, test will be executed four times, but the fourth attempt will be skipped because I have
+
+150
+00:10:47,000 --> 00:10:51,000
+assumption here that money amounts should be strictly more than zero.
+
+151
+00:10:51,000 --> 00:10:54,000
+Let me run this test and show you to report.
+
+152
+00:10:55,000 --> 00:11:00,000
+And here you must see that our parametrized test was executed four times with different arguments.
+
+153
+00:11:01,000 --> 00:11:07,000
+And you also can see that force execution of test with minus Tanavoli was skipped because of assumption
+
+154
+00:11:07,000 --> 00:11:08,000
+failed.
+
+155
+00:11:08,000 --> 00:11:09,000
+Is that clear?
+
+156
+00:11:10,000 --> 00:11:14,000
+To parameterize your test, you can use such annotations.
+
+157
+00:11:14,000 --> 00:11:16,000
+S no source your source?
+
+158
+00:11:17,000 --> 00:11:18,000
+No an empty source.
+
+159
+00:11:19,000 --> 00:11:22,000
+You can use these annotations with parametrized tests.
+
+160
+00:11:22,000 --> 00:11:25,000
+I believe that all these annotations are self-described.
+
+161
+00:11:26,000 --> 00:11:32,000
+No source will just add no value to array of input values and your source will pass empty argument for
+
+162
+00:11:32,000 --> 00:11:41,000
+parameters of the following types like Screenplay's said map, primitive arrays into HRB, etc..
+
+163
+00:11:41,000 --> 00:11:43,000
+Object arrays and integer arrays.
+
+164
+00:11:43,000 --> 00:11:48,000
+Whatever new and empty source is a combination of first two annotations.
+
+165
+00:11:49,000 --> 00:11:55,000
+In case you would run this test, you would see that it will be executed two times with no an empty
+
+166
+00:11:55,000 --> 00:11:56,000
+string argument.
+
+167
+00:11:56,000 --> 00:12:01,000
+And as a annotation for test, parameterization is a method source annotation.
+
+168
+00:12:01,000 --> 00:12:04,000
+You can mark any static method with this annotation.
+
+169
+00:12:04,000 --> 00:12:10,000
+This is so-called factory method that generates stream of arguments that will be submitted to the parametrized
+
+170
+00:12:10,000 --> 00:12:11,000
+method.
+
+171
+00:12:11,000 --> 00:12:13,000
+Let me show you this on the example.
+
+172
+00:12:13,000 --> 00:12:19,000
+I have parametrized test that is marked with method source annotation and name of the method that should
+
+173
+00:12:19,000 --> 00:12:23,000
+be used to generate test inputs and use my static.
+
+174
+00:12:23,000 --> 00:12:29,000
+Method that is used to generate inputs, it returns stream type, but actually it can return any type
+
+175
+00:12:29,000 --> 00:12:31,000
+that can be converted to a string.
+
+176
+00:12:32,000 --> 00:12:37,000
+For example, collection iterator, a terrible extreme double stream and long stream.
+
+177
+00:12:37,000 --> 00:12:44,000
+And when I run test method source, it is executed three times because it generates three with three
+
+178
+00:12:44,000 --> 00:12:44,000
+values.
+
+179
+00:12:44,000 --> 00:12:45,000
+Does it make sense?
+
+180
+00:12:46,000 --> 00:12:52,000
+There's also a possibility to specify multiple data inputs by using Azziz resource annotation.
+
+181
+00:12:52,000 --> 00:12:56,000
+We use comma separated values to parse all arguments.
+
+182
+00:12:56,000 --> 00:12:57,000
+It is pretty intuitive.
+
+183
+00:12:57,000 --> 00:12:59,000
+If you would look at this example.
+
+184
+00:12:59,000 --> 00:13:02,000
+To be honest, I don't use parametrized test.
+
+185
+00:13:03,000 --> 00:13:05,000
+Why do you remember that?
+
+186
+00:13:05,000 --> 00:13:08,000
+In previous lesson I explained you what equivalence class is?
+
+187
+00:13:09,000 --> 00:13:10,000
+That is the answer.
+
+188
+00:13:10,000 --> 00:13:17,000
+I don't need parametrized test because I write test for only one value for a specific equivalence class
+
+189
+00:13:17,000 --> 00:13:19,000
+that is also works just fine.
+
+190
+00:13:19,000 --> 00:13:22,000
+But you can use parametrized test if you wish.
+
+191
+00:13:22,000 --> 00:13:25,000
+At least you should be aware about this feature.
+
+192
+00:13:25,000 --> 00:13:32,000
+Now imagine that you found some defect and this test is failing and take into account that usually development
+
+193
+00:13:32,000 --> 00:13:33,000
+is performed in teams.
+
+194
+00:13:33,000 --> 00:13:37,000
+This test also failed on other computers to not book anyone else.
+
+195
+00:13:37,000 --> 00:13:41,000
+You just disable some unit test until it will be fixed.
+
+196
+00:13:41,000 --> 00:13:44,000
+Hope you can easily imagine this case now.
+
+197
+00:13:44,000 --> 00:13:48,000
+How to disable test into a unit into unit four.
+
+198
+00:13:48,000 --> 00:13:51,000
+We used to ignore annotation in unit five.
+
+199
+00:13:51,000 --> 00:13:53,000
+We use disabled annotation.
+
+200
+00:13:53,000 --> 00:13:57,000
+You can just keep this annotation if you wish, or you can add description.
+
+201
+00:13:57,000 --> 00:14:04,000
+Why exactly this test is disabled and when you run all tests, this one just won't be executed.
+
+202
+00:14:05,000 --> 00:14:06,000
+Great.
+
+203
+00:14:06,000 --> 00:14:08,000
+We have one more quick topic to cover.
+
+204
+00:14:08,000 --> 00:14:10,000
+That is test code coverage.
+
+205
+00:14:10,000 --> 00:14:11,000
+What is this?
+
+206
+00:14:11,000 --> 00:14:17,000
+This is a Madgwick some specific values that shows in percentage how much lines of your code was covered
+
+207
+00:14:17,000 --> 00:14:18,000
+with tests.
+
+208
+00:14:18,000 --> 00:14:21,000
+This is important for us because of your reasons.
+
+209
+00:14:22,000 --> 00:14:27,000
+We want to be sure that all codes that we wrote is covered with tests in case we have codes that is
+
+210
+00:14:27,000 --> 00:14:29,000
+not covered with tests.
+
+211
+00:14:29,000 --> 00:14:31,000
+That means we don't need this code at all.
+
+212
+00:14:32,000 --> 00:14:38,000
+Sometimes we want to provide the metrics for important purposes that our job was done with expected
+
+213
+00:14:38,000 --> 00:14:39,000
+quality level.
+
+214
+00:14:39,000 --> 00:14:44,000
+And sometimes you might be asked to keep the percentage of test code coverage on the specific level.
+
+215
+00:14:45,000 --> 00:14:51,000
+How this code coverage works, that's code coverage shows how much lines and blocks were invoked from
+
+216
+00:14:51,000 --> 00:14:52,000
+your tests.
+
+217
+00:14:52,000 --> 00:14:59,000
+In other words, specific plug and measure how much lines of code were executed when your test is run.
+
+218
+00:15:00,000 --> 00:15:01,000
+That's why that's got coverage.
+
+219
+00:15:01,000 --> 00:15:06,000
+Not necessarily means that your test really verifies things and logic.
+
+220
+00:15:06,000 --> 00:15:13,000
+You can just invoke some method from your test or simulate any other conditions to execute other parts
+
+221
+00:15:13,000 --> 00:15:14,000
+of, if else, statement.
+
+222
+00:15:14,000 --> 00:15:15,000
+And that's it.
+
+223
+00:15:16,000 --> 00:15:19,000
+Such metric as test coverage will be increased.
+
+224
+00:15:19,000 --> 00:15:26,000
+To help you understand how tasket coverage works, let me show you this on example from the code editor
+
+225
+00:15:26,000 --> 00:15:27,000
+Error Mouse.
+
+226
+00:15:27,000 --> 00:15:30,000
+Right click coverage as a test.
+
+227
+00:15:30,000 --> 00:15:37,000
+In case you don't have such option, make sure that you have a grammar plugin installed and clips for
+
+228
+00:15:37,000 --> 00:15:42,000
+Java developers is distributed with this plugin installed by default.
+
+229
+00:15:42,000 --> 00:15:45,000
+Button Kizzire clips version doesn't have such plugin.
+
+230
+00:15:46,000 --> 00:15:47,000
+You can install it manually.
+
+231
+00:15:48,000 --> 00:15:49,000
+Just click help then.
+
+232
+00:15:49,000 --> 00:15:57,000
+Select Eclipse Market Place after Eclipse Marketplace is loaded use search bar to find a clammer.
+
+233
+00:15:57,000 --> 00:16:01,000
+A Clela is a plugin that can calculate Trescott coverage.
+
+234
+00:16:01,000 --> 00:16:06,000
+Inside the clips it is shown that it is already installed for me.
+
+235
+00:16:06,000 --> 00:16:11,000
+I click cancel and now I want to execute my test and check descant coverage.
+
+236
+00:16:12,000 --> 00:16:16,000
+After test is executed, I can find Trescott coverage report.
+
+237
+00:16:17,000 --> 00:16:22,000
+It says that this test covers only such specific parts of all lines in my project.
+
+238
+00:16:22,000 --> 00:16:25,000
+Let me expand folders from this report.
+
+239
+00:16:25,000 --> 00:16:28,000
+You can source all items here by coverage rate.
+
+240
+00:16:29,000 --> 00:16:35,000
+As you can see, my unit test covered on one hundred percent, my money transaction service and account
+
+241
+00:16:35,000 --> 00:16:35,000
+class.
+
+242
+00:16:36,000 --> 00:16:37,000
+That is awesome.
+
+243
+00:16:37,000 --> 00:16:43,000
+You can open each specific class now to see lines and green that are covered with your test.
+
+244
+00:16:43,000 --> 00:16:49,000
+Let me open my transaction service and you can see that all lines and blocks are covered with tests.
+
+245
+00:16:50,000 --> 00:16:51,000
+How to reset this?
+
+246
+00:16:52,000 --> 00:16:58,000
+Just find this cross sign in coverage report to reset all reports and color selection in your source
+
+247
+00:16:58,000 --> 00:16:58,000
+code.
+
+248
+00:16:59,000 --> 00:17:00,000
+What are the other statuses?
+
+249
+00:17:00,000 --> 00:17:06,000
+Could be you'll find your lines in red in case they were not covered by your test and you will find
+
+250
+00:17:06,000 --> 00:17:10,000
+yellow lines in case not all branches of execution are covered with tests.
+
+251
+00:17:11,000 --> 00:17:12,000
+Then we use these cases.
+
+252
+00:17:12,000 --> 00:17:13,000
+I created separate class.
+
+253
+00:17:14,000 --> 00:17:18,000
+It is called Trescott Coverage Damos and it is placed into unit folder.
+
+254
+00:17:19,000 --> 00:17:22,000
+It is really simple class created only for the sake of the example.
+
+255
+00:17:23,000 --> 00:17:30,000
+The matsutake swink argument it has, if else block first if statement contains expressions, that includes
+
+256
+00:17:30,000 --> 00:17:31,000
+or operator.
+
+257
+00:17:31,000 --> 00:17:38,000
+Let me show you the test now I have one single test and WOAK test code coverage method and personal
+
+258
+00:17:38,000 --> 00:17:39,000
+values there.
+
+259
+00:17:40,000 --> 00:17:45,000
+Now let me check this code coverage and run my tests when tests are executed.
+
+260
+00:17:45,000 --> 00:17:47,000
+Let me open the source code of our class.
+
+261
+00:17:48,000 --> 00:17:55,000
+You can see that each statement is yellow y because not all branches of execution are covered with tests.
+
+262
+00:17:56,000 --> 00:18:02,000
+We have two possible options here in case my strong argument is now, I will print this test to council.
+
+263
+00:18:03,000 --> 00:18:09,000
+And the second branch of execution is in case the string argument is not now, but it is empty string
+
+264
+00:18:09,000 --> 00:18:09,000
+object.
+
+265
+00:18:10,000 --> 00:18:13,000
+So that means I have to write one more test.
+
+266
+00:18:13,000 --> 00:18:18,000
+Westwick argument won't be now is red line in in block.
+
+267
+00:18:18,000 --> 00:18:21,000
+That is because it is not covered with test.
+
+268
+00:18:21,000 --> 00:18:26,000
+So you can see that my unit is covered with tests on sixty two and a half percentages.
+
+269
+00:18:27,000 --> 00:18:30,000
+But notice I even didn't test anything.
+
+270
+00:18:30,000 --> 00:18:37,000
+There is no assertion at all in my unit test, but I already increased Ascott coverage metric set as
+
+271
+00:18:37,000 --> 00:18:41,000
+the trigger that you should know about this cost coverage calculation to never use it.
+
+272
+00:18:42,000 --> 00:18:43,000
+We learned a lot today.
+
+273
+00:18:43,000 --> 00:18:46,000
+Let's recap what we have learned today.
+
+274
+00:18:47,000 --> 00:18:48,000
+We learned new annotations.
+
+275
+00:18:49,000 --> 00:18:55,000
+You also learned how to group assertions and how to build dependency between assertions and real examples.
+
+276
+00:18:55,000 --> 00:19:00,000
+You saw how to create unique tests that can be failed because of time out.
+
+277
+00:19:00,000 --> 00:19:03,000
+We learned how to use assumptions in the unit.
+
+278
+00:19:03,000 --> 00:19:10,000
+I explained you different ways to parameterize your test methods to repeat test with different inputs.
+
+279
+00:19:10,000 --> 00:19:14,000
+And at the end of the lesson we learned how to check Descant coverage.
+
+280
+00:19:14,000 --> 00:19:16,000
+Hope you enjoyed the lesson.
+
+281
+00:19:16,000 --> 00:19:18,000
+Thanks a lot for your attention.
+
+282
+00:19:18,000 --> 00:19:20,000
+See you in the next lesson.
+
diff --git a/34 - Unit Testing & JUnit 5/003 Source-code-of-test-1.url b/34 - Unit Testing & JUnit 5/003 Source-code-of-test-1.url
new file mode 100644
index 0000000000000000000000000000000000000000..48311a3fc9a6c3c9e3fee72630f6c26cd61797ef
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/003 Source-code-of-test-1.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/junit5/MoneyTransactionServiceTest2.java
\ No newline at end of file
diff --git a/34 - Unit Testing & JUnit 5/003 Source-code-of-test-2.url b/34 - Unit Testing & JUnit 5/003 Source-code-of-test-2.url
new file mode 100644
index 0000000000000000000000000000000000000000..51b15745491344e2faa400cbe25ab27493eaf555
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/003 Source-code-of-test-2.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/junit5/TestCodeCoverageDemoTest.java
\ No newline at end of file
diff --git a/34 - Unit Testing & JUnit 5/004 JUnit 5 API (Advanced p. 2) & Hamcrest Library_en.srt b/34 - Unit Testing & JUnit 5/004 JUnit 5 API (Advanced p. 2) & Hamcrest Library_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..c408e6624e08922efd82f4aefe7bba64f525fdb4
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/004 JUnit 5 API (Advanced p. 2) & Hamcrest Library_en.srt
@@ -0,0 +1,1124 @@
+1
+00:00:05,000 --> 00:00:06,000
+Hello, Jim.
+
+2
+00:00:06,000 --> 00:00:12,000
+In this lesson, we keep learning Janet API and advanced features, we'll start our lesson from learning
+
+3
+00:00:12,000 --> 00:00:16,000
+what suit is and how to create our own tasseled.
+
+4
+00:00:16,000 --> 00:00:20,000
+After that, I will explain to you what tagine is and how to take your tests.
+
+5
+00:00:21,000 --> 00:00:22,000
+During the lesson.
+
+6
+00:00:22,000 --> 00:00:26,000
+I'll show you a lot of examples that will help you to understand this topic better.
+
+7
+00:00:26,000 --> 00:00:30,000
+You will learn how to configure order of tests execution.
+
+8
+00:00:31,000 --> 00:00:33,000
+Besides that, I am going to show you a really cool feature.
+
+9
+00:00:34,000 --> 00:00:36,000
+It is conditional test execution.
+
+10
+00:00:36,000 --> 00:00:42,000
+You are going to learn how to set specific conditions to enable or disable your test programmatically.
+
+11
+00:00:43,000 --> 00:00:48,000
+Also, I will explain you how to create repeat a test that will be executed specified number of times.
+
+12
+00:00:48,000 --> 00:00:54,000
+I will explain you how temporary directory extension works and why we might need it.
+
+13
+00:00:54,000 --> 00:01:00,000
+I believe you already know how to use the unit assertions, but today I will also show you how to use
+
+14
+00:01:00,000 --> 00:01:03,000
+Honeycrisp Library to increase readability of your tests.
+
+15
+00:01:03,000 --> 00:01:08,000
+And at the end of the lesson, we are going to use the most common and typical mistakes.
+
+16
+00:01:08,000 --> 00:01:12,000
+Hopefully review and mistakes will help you to not repeat those.
+
+17
+00:01:12,000 --> 00:01:17,000
+I believe that the best way to learn this topic is to learn API with examples.
+
+18
+00:01:17,000 --> 00:01:19,000
+So let me open the clips.
+
+19
+00:01:19,000 --> 00:01:25,000
+Imagines a case that you wrote specifics of unit tests that are related to specific feature.
+
+20
+00:01:25,000 --> 00:01:31,000
+For example, all units are related to registration feature and while working on this feature, you
+
+21
+00:01:31,000 --> 00:01:34,000
+don't want to run all possible unit tests.
+
+22
+00:01:34,000 --> 00:01:39,000
+You want to run only those tests that are related to registration feature.
+
+23
+00:01:39,000 --> 00:01:44,000
+There are so-called test kits to help you to run group of tests with one click.
+
+24
+00:01:44,000 --> 00:01:46,000
+Let me show you how to create test.
+
+25
+00:01:47,000 --> 00:01:50,000
+The first thing you have to do is to specific run class.
+
+26
+00:01:51,000 --> 00:01:52,000
+What is Irana?
+
+27
+00:01:52,000 --> 00:01:56,000
+This is a class that is responsible for running unit tests.
+
+28
+00:01:56,000 --> 00:02:01,000
+There is a default unit run when we don't specify any specific granite class.
+
+29
+00:02:01,000 --> 00:02:07,000
+In this particular case, we have to specify and also run a class that is called the unit platform.
+
+30
+00:02:08,000 --> 00:02:14,000
+This class will check all configurations related with running group of tests, our tests.
+
+31
+00:02:15,000 --> 00:02:20,000
+The next thing we have to do is to add one of the notations that will help us to run group of tests.
+
+32
+00:02:21,000 --> 00:02:24,000
+It could be select packages, annotation from its name.
+
+33
+00:02:24,000 --> 00:02:26,000
+I believe that is clear.
+
+34
+00:02:26,000 --> 00:02:29,000
+What we have to pass to this annotation here.
+
+35
+00:02:29,000 --> 00:02:32,000
+I specify a package with unit test that I want to run.
+
+36
+00:02:32,000 --> 00:02:34,000
+Be careful.
+
+37
+00:02:34,000 --> 00:02:40,000
+This notation by default runs on the test that there is a machine with test O ended up with test or
+
+38
+00:02:40,000 --> 00:02:41,000
+test.
+
+39
+00:02:41,000 --> 00:02:47,000
+That's why in case you have some custom name for unit class, it will be not included in the test.
+
+40
+00:02:48,000 --> 00:02:52,000
+A little bit later, I will show you how to add any specific class by name.
+
+41
+00:02:52,000 --> 00:02:55,000
+You can specify multiple packages if you wish.
+
+42
+00:02:55,000 --> 00:03:00,000
+Just pass array of strings to annotation from the syntax standpoint.
+
+43
+00:03:00,000 --> 00:03:03,000
+Just wrap your strings and curly braces like I did here.
+
+44
+00:03:04,000 --> 00:03:05,000
+My default.
+
+45
+00:03:05,000 --> 00:03:10,000
+This notation tells to run tests in this package and all of its packages.
+
+46
+00:03:10,000 --> 00:03:15,000
+But what if I don't want to run all tests and I want to exclude test from specific package?
+
+47
+00:03:16,000 --> 00:03:22,000
+For example, I can specify here that I want to run all tests that exist in my project, excluding tests
+
+48
+00:03:22,000 --> 00:03:24,000
+from the unit package.
+
+49
+00:03:24,000 --> 00:03:31,000
+To do this, I have to use exclude packages annotation in case you want to include specific package
+
+50
+00:03:31,000 --> 00:03:37,000
+you can use include packages, annotation, hope that these annotations are self describing and you
+
+51
+00:03:37,000 --> 00:03:38,000
+can understand these easily.
+
+52
+00:03:39,000 --> 00:03:45,000
+Also, during the development of your tests, you can mark specific tasks with tasks a little bit later
+
+53
+00:03:45,000 --> 00:03:47,000
+in this lesson, I'll show you how to do this.
+
+54
+00:03:48,000 --> 00:03:54,000
+But imagine that there are some specifics in environmental configurations of each server and special
+
+55
+00:03:54,000 --> 00:03:59,000
+set of test should be run on development, environment and special set of tests should be executed on
+
+56
+00:03:59,000 --> 00:04:00,000
+production environment.
+
+57
+00:04:01,000 --> 00:04:07,000
+While these cases are relatively rare, it is still good to know that such a level of configuration
+
+58
+00:04:07,000 --> 00:04:08,000
+exists in the unit.
+
+59
+00:04:09,000 --> 00:04:14,000
+In case you want to run a specific class, you can use select classes, annotation and pass gloss to
+
+60
+00:04:14,000 --> 00:04:14,000
+it.
+
+61
+00:04:15,000 --> 00:04:21,000
+Similar to previous example, we can pass array of classes in case we want to execute multiple classes
+
+62
+00:04:21,000 --> 00:04:22,000
+in scope of this test.
+
+63
+00:04:23,000 --> 00:04:26,000
+It looks like that's we're regarding creation of tests.
+
+64
+00:04:26,000 --> 00:04:28,000
+Let's move on and see what else do we have.
+
+65
+00:04:29,000 --> 00:04:33,000
+You already saw how to include test that attacked with a specific attack.
+
+66
+00:04:34,000 --> 00:04:36,000
+Let's learn now how we can attack our tests.
+
+67
+00:04:37,000 --> 00:04:42,000
+We can use that connotation with classes and masses, the specific rules for tech names.
+
+68
+00:04:42,000 --> 00:04:44,000
+But all of them are pretty intuitive.
+
+69
+00:04:44,000 --> 00:04:51,000
+And in case you don't use any extraordinary name that it started with ampersand or exclamation point,
+
+70
+00:04:51,000 --> 00:04:51,000
+then are good.
+
+71
+00:04:52,000 --> 00:04:58,000
+The next thing that I want to discuss with you today is a test in order by default test, an order is
+
+72
+00:04:58,000 --> 00:05:01,000
+undermined and that is fine.
+
+73
+00:05:01,000 --> 00:05:04,000
+I believe you remember first principles and namely.
+
+74
+00:05:04,000 --> 00:05:08,000
+Is the latest principal, each test should be isolated from each other.
+
+75
+00:05:09,000 --> 00:05:11,000
+That's why it is not a big deal for us.
+
+76
+00:05:11,000 --> 00:05:13,000
+What is the order of test?
+
+77
+00:05:13,000 --> 00:05:19,000
+Execution is, but it provides us with opportunity to specify order of tests, execution.
+
+78
+00:05:20,000 --> 00:05:25,000
+In my opinion, this is extremely rare cases when you have to use this feature, but still you have
+
+79
+00:05:25,000 --> 00:05:28,000
+to know about it to specify order of tests.
+
+80
+00:05:28,000 --> 00:05:29,000
+We have to do a few things.
+
+81
+00:05:30,000 --> 00:05:37,000
+First thing we have to do is to add test methods, order in addition to the class and specify order
+
+82
+00:05:37,000 --> 00:05:42,000
+implementation that we want to use the different implementations that are available for us.
+
+83
+00:05:42,000 --> 00:05:50,000
+They are just plain name to search execution by display, name, method, name to sort of test execution
+
+84
+00:05:50,000 --> 00:05:57,000
+by test method names or the notation to search by order specified in annotation, random orders test
+
+85
+00:05:57,000 --> 00:06:01,000
+methods to the randomly and supports configuration of a custom seat.
+
+86
+00:06:02,000 --> 00:06:05,000
+In my opinion, using ornamentation is very convenient.
+
+87
+00:06:06,000 --> 00:06:07,000
+So let me show you how it works.
+
+88
+00:06:08,000 --> 00:06:12,000
+I specify all the annotation class in my test method order annotation.
+
+89
+00:06:13,000 --> 00:06:19,000
+After this, the only thing that I have to do is to add order annotation to each test method and specify
+
+90
+00:06:19,000 --> 00:06:21,000
+in the order of each.
+
+91
+00:06:21,000 --> 00:06:24,000
+So the test was order one will be executed.
+
+92
+00:06:24,000 --> 00:06:29,000
+First test was ordered to will be executed next and so on.
+
+93
+00:06:29,000 --> 00:06:33,000
+That is how simply we can configure order of execution for our test.
+
+94
+00:06:33,000 --> 00:06:39,000
+But remember, usually each test should not rely on the test or the execution.
+
+95
+00:06:40,000 --> 00:06:45,000
+The next thing I wanted to discuss with you is a conditional test execution gene.
+
+96
+00:06:45,000 --> 00:06:50,000
+It allows us to disable or enable test based on the specific conditions.
+
+97
+00:06:50,000 --> 00:06:55,000
+We are going to learn annotations that will help us to configure specific conditions.
+
+98
+00:06:55,000 --> 00:06:59,000
+Basically, we can group all these annotations in the following groups.
+
+99
+00:06:59,000 --> 00:07:06,000
+Operating system conditions, Java runtime environment conditions, system, property conditions, environment,
+
+100
+00:07:06,000 --> 00:07:09,000
+variable conditions, custom conditions.
+
+101
+00:07:10,000 --> 00:07:11,000
+Let's review all examples.
+
+102
+00:07:11,000 --> 00:07:14,000
+One by one operating system.
+
+103
+00:07:14,000 --> 00:07:20,000
+Conditions allows you to enable or disable test based on the operating system of environment where code
+
+104
+00:07:20,000 --> 00:07:21,000
+is executed.
+
+105
+00:07:21,000 --> 00:07:27,000
+Here you can see examples with enabling test on the operating system, on array of operating systems
+
+106
+00:07:27,000 --> 00:07:31,000
+and similar example with disabling test based on operating system.
+
+107
+00:07:32,000 --> 00:07:37,000
+Pay attention to their predefined constants for major operating systems in this class.
+
+108
+00:07:38,000 --> 00:07:43,000
+I will share the link to the source code of this test so that you could check all the statements that
+
+109
+00:07:43,000 --> 00:07:48,000
+they use to use these classes and annotations just in case it gives us a suggestion.
+
+110
+00:07:48,000 --> 00:07:50,000
+Tool should help you with this.
+
+111
+00:07:51,000 --> 00:07:57,000
+The next group of conditions will help you to enable or disable specific unit tests based on the particular
+
+112
+00:07:57,000 --> 00:07:58,000
+version of Jerry.
+
+113
+00:07:59,000 --> 00:08:05,000
+The specific annotations for NAINGGOLAN test for the specific Jerry enabling test for the arrays or
+
+114
+00:08:05,000 --> 00:08:11,000
+reversions enable for jury rank enabling for range by specifying easy, just minimum or just maximum
+
+115
+00:08:11,000 --> 00:08:13,000
+Jerry version.
+
+116
+00:08:13,000 --> 00:08:20,000
+You can do the similar things for the same tests and here you can find examples how this is clear.
+
+117
+00:08:20,000 --> 00:08:26,000
+Now let me show you annotations that will help you make conditions based on the system properties you
+
+118
+00:08:26,000 --> 00:08:28,000
+can use, enabled or disabled.
+
+119
+00:08:28,000 --> 00:08:35,000
+If property annotations to check if specific properties are equal to the value we pass here, the value
+
+120
+00:08:35,000 --> 00:08:36,000
+is applied.
+
+121
+00:08:36,000 --> 00:08:36,000
+We are much.
+
+122
+00:08:36,000 --> 00:08:39,000
+This attribute will be interpreted as a regular expression.
+
+123
+00:08:40,000 --> 00:08:42,000
+Actually, there is nothing more to add here.
+
+124
+00:08:43,000 --> 00:08:47,000
+Also, we can enable or disable test based on the environment variables.
+
+125
+00:08:47,000 --> 00:08:52,000
+Here you can see examples of these two annotations similar to previous example.
+
+126
+00:08:53,000 --> 00:08:59,000
+Value in matches attribute will be treated as a regular expression and the most interesting, in my
+
+127
+00:08:59,000 --> 00:09:01,000
+opinion, it is a custom condition.
+
+128
+00:09:02,000 --> 00:09:03,000
+Let me explain how it works.
+
+129
+00:09:04,000 --> 00:09:10,000
+We can use is a enable or disable if annotations and pastorate name or the method that we are going
+
+130
+00:09:10,000 --> 00:09:12,000
+to use to define the condition.
+
+131
+00:09:13,000 --> 00:09:19,000
+The method should return is a true or false, and based on this test will be is enabled or disabled.
+
+132
+00:09:20,000 --> 00:09:25,000
+This option gives you a lot of flexibility and definition of your own condition.
+
+133
+00:09:25,000 --> 00:09:27,000
+Does it make sense now?
+
+134
+00:09:27,000 --> 00:09:32,000
+You know all possible ways how to configure conditions to enable or disable your test.
+
+135
+00:09:32,000 --> 00:09:34,000
+Let's move on to the next topic.
+
+136
+00:09:35,000 --> 00:09:41,000
+Do it allows us to create repeat a test that will be repeated, specified number of times to create
+
+137
+00:09:41,000 --> 00:09:41,000
+such test.
+
+138
+00:09:41,000 --> 00:09:48,000
+Just use repeated test annotation, unspecified number of times to repeat it inside annotation.
+
+139
+00:09:48,000 --> 00:09:51,000
+Besides, no, we also can specify the name of the test.
+
+140
+00:09:52,000 --> 00:09:53,000
+Well, define a name.
+
+141
+00:09:53,000 --> 00:09:58,000
+We can use placeholders to display current repetition and total repetitions.
+
+142
+00:09:58,000 --> 00:09:59,000
+That's it.
+
+143
+00:10:00,000 --> 00:10:04,000
+This notation is useful when you want to make sure that even after multi.
+
+144
+00:10:04,000 --> 00:10:11,000
+Execution, tax returns, the same result, the next example I want to show you is about temporary director
+
+145
+00:10:11,000 --> 00:10:18,000
+in Unit four, there was so-called temporary folder rule that helped us to perform operations with file
+
+146
+00:10:18,000 --> 00:10:20,000
+only in scope of our union test.
+
+147
+00:10:20,000 --> 00:10:25,000
+In grade five, we have similar feature, but implemented in more intuitive way.
+
+148
+00:10:25,000 --> 00:10:29,000
+Imagine that your application stores some data to your file system.
+
+149
+00:10:30,000 --> 00:10:36,000
+Imagine that you want to store receipt of all purchases in the online store and you want to test the
+
+150
+00:10:36,000 --> 00:10:40,000
+content of this file instead of fighting the workarounds.
+
+151
+00:10:40,000 --> 00:10:44,000
+How to create files first and after all, test passed.
+
+152
+00:10:44,000 --> 00:10:50,000
+Remove these files and also be bothered about other questions like how to separate test and non test
+
+153
+00:10:50,000 --> 00:10:54,000
+files and so on to avoid answering these questions.
+
+154
+00:10:54,000 --> 00:10:56,000
+There is a temporary folder extension.
+
+155
+00:10:56,000 --> 00:10:58,000
+Let me show you how you can use it.
+
+156
+00:10:59,000 --> 00:11:07,000
+Basically, in any test method we can pass such argument as pass was annotation stampeder after that.
+
+157
+00:11:07,000 --> 00:11:13,000
+Inside the test we can resolve the pass and do this, pass everything we need.
+
+158
+00:11:13,000 --> 00:11:20,000
+For example, in this particular case I wrote some text to a file and after that verified the text and
+
+159
+00:11:20,000 --> 00:11:26,000
+file is the same as I expect after test execution's, this file will be removed.
+
+160
+00:11:26,000 --> 00:11:29,000
+So there is no impact on your local file system.
+
+161
+00:11:30,000 --> 00:11:33,000
+That's how easily you can use temporary directory extension.
+
+162
+00:11:33,000 --> 00:11:34,000
+Is it clear?
+
+163
+00:11:35,000 --> 00:11:35,000
+Awesome.
+
+164
+00:11:36,000 --> 00:11:39,000
+Also today we are going to have one more important topic.
+
+165
+00:11:40,000 --> 00:11:46,000
+I believe you already noticed that a lot of things in our Test MGE library is developed for the one
+
+166
+00:11:46,000 --> 00:11:50,000
+main increase readability of our test.
+
+167
+00:11:50,000 --> 00:11:57,000
+I mean, all these annotations like display neme extra long, massive names, naming mascots with underscore
+
+168
+00:11:57,000 --> 00:11:58,000
+and lots more.
+
+169
+00:11:59,000 --> 00:12:04,000
+And there is also a popular library the Java developers use often it is called Holmquist.
+
+170
+00:12:05,000 --> 00:12:11,000
+Even if you want to use it on a daily basis, you should be at least aware about it because it is very
+
+171
+00:12:11,000 --> 00:12:11,000
+popular.
+
+172
+00:12:12,000 --> 00:12:19,000
+So Ensures Holmquist is a library that allows us to achieve high reliability of our code by using custom
+
+173
+00:12:19,000 --> 00:12:22,000
+assertion methods and matchers as well known examples.
+
+174
+00:12:22,000 --> 00:12:28,000
+You understand what I am talking about and to start working with Holmquist, the first thing we have
+
+175
+00:12:28,000 --> 00:12:31,000
+to do is to add Humphris Library to our claspers.
+
+176
+00:12:32,000 --> 00:12:33,000
+How to do that?
+
+177
+00:12:33,000 --> 00:12:38,000
+I already show the imperiousness and how to add external jar's to our project.
+
+178
+00:12:38,000 --> 00:12:41,000
+But in this lesson we will do everything from the beginning.
+
+179
+00:12:41,000 --> 00:12:46,000
+So the first question, where to get Humphris Library in the Internet?
+
+180
+00:12:47,000 --> 00:12:49,000
+There really a lot of open repositories.
+
+181
+00:12:49,000 --> 00:12:52,000
+One of the biggest repository is Mavin repository.
+
+182
+00:12:53,000 --> 00:12:58,000
+We can type our Google search like this Holmquist Mavin Rappa.
+
+183
+00:12:58,000 --> 00:13:01,000
+Now let's open the first link from the list.
+
+184
+00:13:01,000 --> 00:13:07,000
+These are all libraries from Humphris, but today we need only one Holmquist.
+
+185
+00:13:07,000 --> 00:13:09,000
+Oh, here it is right on the top.
+
+186
+00:13:10,000 --> 00:13:15,000
+The library contains all modules that are needed to work efficiently with Congress.
+
+187
+00:13:15,000 --> 00:13:19,000
+On this page, we can choose a version of our Honkers Library.
+
+188
+00:13:19,000 --> 00:13:22,000
+I select the latest one on this page.
+
+189
+00:13:22,000 --> 00:13:28,000
+We can find instructions how to setup dependency on this library in projects was automated built tools.
+
+190
+00:13:29,000 --> 00:13:31,000
+But we have simple Java project.
+
+191
+00:13:31,000 --> 00:13:36,000
+Don't worry, we'll learn, automate, build tools later, but not in this lesson.
+
+192
+00:13:36,000 --> 00:13:41,000
+Right now we need to find how to download archive with Humphris classes.
+
+193
+00:13:41,000 --> 00:13:48,000
+And here I can download your file of Humphris Library Download File and get back to Eclipse.
+
+194
+00:13:48,000 --> 00:13:52,000
+Hearing the clips we have to adhere to Claspers Mouse right.
+
+195
+00:13:52,000 --> 00:13:58,000
+Click on our project, build POS, configure, build, pass here.
+
+196
+00:13:58,000 --> 00:14:00,000
+Make sure you can navigate at the library.
+
+197
+00:14:00,000 --> 00:14:02,000
+Step press on claspers.
+
+198
+00:14:03,000 --> 00:14:10,000
+Now click on Add External Jar's and here you can find Humphris libraries that we have just downloaded
+
+199
+00:14:10,000 --> 00:14:13,000
+and already have this library added to my claspers.
+
+200
+00:14:13,000 --> 00:14:15,000
+So I will just close this window.
+
+201
+00:14:15,000 --> 00:14:21,000
+When you added Humphris Library to a class pass, we can proceed with our examples, especially for
+
+202
+00:14:21,000 --> 00:14:22,000
+this lesson.
+
+203
+00:14:22,000 --> 00:14:25,000
+I created a separate file with compressed examples.
+
+204
+00:14:25,000 --> 00:14:28,000
+I will leave Lean to the source code attached to the lesson.
+
+205
+00:14:29,000 --> 00:14:31,000
+Let's write our first test with Congress.
+
+206
+00:14:31,000 --> 00:14:33,000
+We have simple test here.
+
+207
+00:14:33,000 --> 00:14:37,000
+Imagine we have two strings no matter how we received that.
+
+208
+00:14:37,000 --> 00:14:43,000
+In this example, I want to put all your focus on the syntax of Honkers instead of regular assertions
+
+209
+00:14:43,000 --> 00:14:45,000
+that you already used to into Unit five.
+
+210
+00:14:46,000 --> 00:14:49,000
+Your special message from Moccia, a search class.
+
+211
+00:14:49,000 --> 00:14:55,000
+This is called Assert that this is overloaded MassArt and one version of it takes three as the first
+
+212
+00:14:55,000 --> 00:14:56,000
+argument.
+
+213
+00:14:56,000 --> 00:15:01,000
+This string is used as an error message to be displayed in case test was failed.
+
+214
+00:15:01,000 --> 00:15:03,000
+Personally, I more often use an.
+
+215
+00:15:03,000 --> 00:15:09,000
+Another version of this massive that takes actual value as a first argument and the march as a second
+
+216
+00:15:09,000 --> 00:15:16,000
+argument, Humphris Marcia is a special type and can help you to identify the march according to the
+
+217
+00:15:16,000 --> 00:15:18,000
+requirements of the test.
+
+218
+00:15:18,000 --> 00:15:21,000
+Usually we use static methods that can return.
+
+219
+00:15:21,000 --> 00:15:27,000
+Matching object in this particular case are used equal to Masset from March 1st class.
+
+220
+00:15:28,000 --> 00:15:33,000
+This static method returns March as it will help us to check equality with the first argument.
+
+221
+00:15:33,000 --> 00:15:40,000
+And if you can notice that we received Stylize sentence, that is easy to read and to understand.
+
+222
+00:15:40,000 --> 00:15:42,000
+Let's look at another example.
+
+223
+00:15:42,000 --> 00:15:47,000
+Imagine that you have at least with values, and during the test you modified the state of the list.
+
+224
+00:15:48,000 --> 00:15:49,000
+Just imagine that.
+
+225
+00:15:49,000 --> 00:15:56,000
+And in a certain part of your test, we have to verify that list contains one of the expected values.
+
+226
+00:15:56,000 --> 00:16:06,000
+Here is a line written with Humphris assert that Liste has item any of equal to a equal to be equal
+
+227
+00:16:06,000 --> 00:16:11,000
+to see you like it is almost like a complete sentence.
+
+228
+00:16:11,000 --> 00:16:16,000
+And you can see that you can use marchers as an input argument to another marcher.
+
+229
+00:16:17,000 --> 00:16:19,000
+And right below we can see that same assertion.
+
+230
+00:16:19,000 --> 00:16:22,000
+But reason with do can't tell me what do you think?
+
+231
+00:16:23,000 --> 00:16:25,000
+What is more readable in your opinion?
+
+232
+00:16:26,000 --> 00:16:32,000
+Some of my students tell me that they still prefer giant assertions of a holmquist and that is completely
+
+233
+00:16:32,000 --> 00:16:33,000
+fine.
+
+234
+00:16:33,000 --> 00:16:36,000
+It is only a matter of coding style and nothing more.
+
+235
+00:16:36,000 --> 00:16:42,000
+I just want you to know about this library since it is popular, essentially.
+
+236
+00:16:42,000 --> 00:16:43,000
+That's it.
+
+237
+00:16:43,000 --> 00:16:49,000
+So the only thing that would be different from test to test is a march that you will choose to perform
+
+238
+00:16:49,000 --> 00:16:55,000
+the validation that different group of marchers I gathered all of them on one slide.
+
+239
+00:16:55,000 --> 00:16:56,000
+Let me show it to you.
+
+240
+00:16:57,000 --> 00:17:05,000
+There are such groups of marchers, core logical object, beanz collections, no text.
+
+241
+00:17:06,000 --> 00:17:09,000
+And on this slide, you can find a description for each of this march.
+
+242
+00:17:10,000 --> 00:17:15,000
+I believe that by name of each march you can understand what does do.
+
+243
+00:17:15,000 --> 00:17:19,000
+That's why I believe there is no need to go over each of these.
+
+244
+00:17:20,000 --> 00:17:24,000
+In the case that after reading of description for each march, you still have questions.
+
+245
+00:17:24,000 --> 00:17:28,000
+Do not hesitate to ask these questions in Q&A section.
+
+246
+00:17:29,000 --> 00:17:35,000
+And the last, but not least for today, I would love to use your typical mistakes that usually junior
+
+247
+00:17:35,000 --> 00:17:36,000
+developers do.
+
+248
+00:17:36,000 --> 00:17:37,000
+Based on my experience.
+
+249
+00:17:38,000 --> 00:17:41,000
+The first typical mistake is testing of Java API.
+
+250
+00:17:42,000 --> 00:17:48,000
+This mistake can have multiple and various forms, but the idea, as it stands behind its example,
+
+251
+00:17:48,000 --> 00:17:48,000
+is simple.
+
+252
+00:17:49,000 --> 00:17:51,000
+You don't have to test how Java works.
+
+253
+00:17:52,000 --> 00:17:58,000
+The second common mistake is to write a test that will never fail on the slide.
+
+254
+00:17:58,000 --> 00:18:04,000
+You can see very simple example to get the point in real life, the source code can be a bit more complicated,
+
+255
+00:18:04,000 --> 00:18:09,000
+but at the end of the day, specific scenario will always return.
+
+256
+00:18:09,000 --> 00:18:16,000
+True, if you remember in previous lesson I gave you one advice spend two more seconds to make sure
+
+257
+00:18:16,000 --> 00:18:18,000
+that you at least once in your life.
+
+258
+00:18:18,000 --> 00:18:24,000
+So each specific test in red status that would help you to avoid this mistake.
+
+259
+00:18:25,000 --> 00:18:28,000
+Huge test, that is our next mistake.
+
+260
+00:18:28,000 --> 00:18:31,000
+Don't try to test everything in one test.
+
+261
+00:18:31,000 --> 00:18:36,000
+Remember one assert per test or single concept for a test.
+
+262
+00:18:36,000 --> 00:18:42,000
+And also remember, do not hardcourt any values in court and avoid of using magic numbers.
+
+263
+00:18:43,000 --> 00:18:49,000
+We kind of discuss this topic and this advice already, but I want to make sure that you remember this.
+
+264
+00:18:49,000 --> 00:18:55,000
+It is better to use constants that are defined in your test class and that have clear name rather than
+
+265
+00:18:55,000 --> 00:18:56,000
+guessing.
+
+266
+00:18:56,000 --> 00:18:57,000
+What does this mean?
+
+267
+00:18:58,000 --> 00:19:01,000
+That was all made mistakes that I wanted to put your attention to.
+
+268
+00:19:02,000 --> 00:19:04,000
+Now let's recap what we have learned today.
+
+269
+00:19:05,000 --> 00:19:10,000
+We started our lesson was learned what test is and how to define the customer test.
+
+270
+00:19:10,000 --> 00:19:14,000
+But after that, we learned a little bit more about tagine.
+
+271
+00:19:14,000 --> 00:19:21,000
+In this lesson, I explained you how to configure order of test execution to make sure that tests are
+
+272
+00:19:21,000 --> 00:19:27,000
+running in predefined sequence uson examples how to create different kinds of conditional statements
+
+273
+00:19:27,000 --> 00:19:31,000
+that will allow you to enable or disable test upon specific condition.
+
+274
+00:19:32,000 --> 00:19:37,000
+Besides that, I also showed you a small example that explains how to create repeated tests.
+
+275
+00:19:37,000 --> 00:19:41,000
+Now you know how to use temporary Fulda Extension.
+
+276
+00:19:41,000 --> 00:19:43,000
+Well, testing input and output streams.
+
+277
+00:19:44,000 --> 00:19:51,000
+Also, I showed you how to use Hahm Christiania unit test and at the end of the lesson we learned typical
+
+278
+00:19:51,000 --> 00:19:52,000
+and most common mistakes.
+
+279
+00:19:53,000 --> 00:19:54,000
+That's it for today.
+
+280
+00:19:54,000 --> 00:19:56,000
+Thanks a lot for your attention.
+
+281
+00:19:56,000 --> 00:19:59,000
+Have a great day and see you in the next lesson.
+
diff --git a/34 - Unit Testing & JUnit 5/004 Source-code-of-Advanced-JUnit-Examples.url b/34 - Unit Testing & JUnit 5/004 Source-code-of-Advanced-JUnit-Examples.url
new file mode 100644
index 0000000000000000000000000000000000000000..ff06247139864ad2ac32a8383d28a0d17a498f44
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/004 Source-code-of-Advanced-JUnit-Examples.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/junit5/JUnitApiAdvancedExamples.java
\ No newline at end of file
diff --git a/34 - Unit Testing & JUnit 5/004 Source-code-of-Hamcrest-Library-Examples.url b/34 - Unit Testing & JUnit 5/004 Source-code-of-Hamcrest-Library-Examples.url
new file mode 100644
index 0000000000000000000000000000000000000000..2bfa9955adaf5c1eb78f193d8feb56f8bf5ed8c6
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/004 Source-code-of-Hamcrest-Library-Examples.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/test/com/itbulls/learnit/javacore/hamcrest
\ No newline at end of file
diff --git a/34 - Unit Testing & JUnit 5/004 Source-code-of-Test-Suites.url b/34 - Unit Testing & JUnit 5/004 Source-code-of-Test-Suites.url
new file mode 100644
index 0000000000000000000000000000000000000000..a1814b370bfad90418cc1896af68088976fe0da9
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/004 Source-code-of-Test-Suites.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/junit5/TestSuiteExample.java
\ No newline at end of file
diff --git a/34 - Unit Testing & JUnit 5/external-links.txt b/34 - Unit Testing & JUnit 5/external-links.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8b270c95afde9563d7f7e423a9d401d0acc8d35e
--- /dev/null
+++ b/34 - Unit Testing & JUnit 5/external-links.txt
@@ -0,0 +1,24 @@
+
+002 JUnit-Documentation
+https://junit.org/junit5/docs/current/api/
+
+002 Source-code-of-MoneyTransactionService
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/src/com/itbulls/learnit/javacore/junit5/MoneyTransactionService.java
+
+002 Source-code-of-MoneyTransactionServiceTest
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/junit5/MoneyTransactionServiceTest.java
+
+003 Source-code-of-test-1
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/junit5/MoneyTransactionServiceTest2.java
+
+003 Source-code-of-test-2
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/junit5/TestCodeCoverageDemoTest.java
+
+004 Source-code-of-Test-Suites
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/junit5/TestSuiteExample.java
+
+004 Source-code-of-Advanced-JUnit-Examples
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/junit5/JUnitApiAdvancedExamples.java
+
+004 Source-code-of-Hamcrest-Library-Examples
+https://github.com/AndriiPiatakha/learnit_java_core/tree/master/test/com/itbulls/learnit/javacore/hamcrest
diff --git a/35 - Integration testing & Mockito/001 Integration Testing in Java_en.srt b/35 - Integration testing & Mockito/001 Integration Testing in Java_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..4bb1dbe90419176d977e9dd6a4eec52529c5d4f2
--- /dev/null
+++ b/35 - Integration testing & Mockito/001 Integration Testing in Java_en.srt
@@ -0,0 +1,700 @@
+1
+00:00:06,000 --> 00:00:06,000
+Hello, Jim.
+
+2
+00:00:07,000 --> 00:00:11,000
+Today was that important section in this course we start learning how to perform integration testing
+
+3
+00:00:11,000 --> 00:00:12,000
+of our app.
+
+4
+00:00:12,000 --> 00:00:16,000
+We'll start from understanding what integration testing is.
+
+5
+00:00:16,000 --> 00:00:20,000
+To help you understand it better, we'll compare integration and unit testing.
+
+6
+00:00:20,000 --> 00:00:26,000
+I will explain what test numbers are and how they help us in testing will understand the advantages
+
+7
+00:00:26,000 --> 00:00:29,000
+of using test doubles in testing process.
+
+8
+00:00:29,000 --> 00:00:34,000
+After that, I'll share with you information about different types of integration testing.
+
+9
+00:00:34,000 --> 00:00:39,000
+And at the end of the lesson, we'll learn what frameworks are used for integration testing in Java.
+
+10
+00:00:40,000 --> 00:00:42,000
+Let's start at the beginning.
+
+11
+00:00:42,000 --> 00:00:45,000
+We have to understand what is integration tests.
+
+12
+00:00:45,000 --> 00:00:52,000
+In simple words, integration testing is a process where individual units are tested together to check
+
+13
+00:00:52,000 --> 00:00:55,000
+whether all the units interact with each other as expected.
+
+14
+00:00:56,000 --> 00:01:03,000
+So in the case of testing, we test only one specific unit in isolation, in integration testing.
+
+15
+00:01:03,000 --> 00:01:07,000
+We want to make sure that different units work together as expected.
+
+16
+00:01:08,000 --> 00:01:13,000
+For example, you want to be sure that when you use mail server to send an email, the message of template
+
+17
+00:01:13,000 --> 00:01:16,000
+engine that prepares content of our email are invoked.
+
+18
+00:01:17,000 --> 00:01:23,000
+Or for example, we want to be sure that in case there was an error in template engine, we didn't invoke
+
+19
+00:01:23,000 --> 00:01:27,000
+stand method of our mail server to send invalid message and so on.
+
+20
+00:01:28,000 --> 00:01:31,000
+Does it make sense during integration testing?
+
+21
+00:01:31,000 --> 00:01:38,000
+All our focus is put into verification of behavior that is happening not inside the one single object,
+
+22
+00:01:38,000 --> 00:01:40,000
+but between different objects.
+
+23
+00:01:41,000 --> 00:01:47,000
+The focus of the integration test and level is to expose the at the time of interaction between integrated
+
+24
+00:01:47,000 --> 00:01:54,000
+components or units to make sure that we are all here on the same page and that we are clearly understands
+
+25
+00:01:54,000 --> 00:01:57,000
+the difference between unit testing and integration testing.
+
+26
+00:01:57,000 --> 00:01:59,000
+Let's look at the next table here.
+
+27
+00:01:59,000 --> 00:02:04,000
+You can see the table where we separated attributes of unit and integration testing.
+
+28
+00:02:05,000 --> 00:02:12,000
+Let's go over each row one by one, and I will give my comments as we go in unit testing, test verifies
+
+29
+00:02:12,000 --> 00:02:20,000
+on the implementation of the code of one single unit, whereas in integration testing test puts main
+
+30
+00:02:20,000 --> 00:02:24,000
+attention on the interconnection behavior when they're used together.
+
+31
+00:02:25,000 --> 00:02:31,000
+The next thing we have to know is that a unit test uses only unit test frameworks like G Unit or testing
+
+32
+00:02:31,000 --> 00:02:32,000
+G and the Morgan framework.
+
+33
+00:02:33,000 --> 00:02:39,000
+Today we'll talk about what more and more can a framework is ensure during the unit testing.
+
+34
+00:02:39,000 --> 00:02:44,000
+Sometimes you need to use test doubles to replace real collaboration's of your unit with other units
+
+35
+00:02:45,000 --> 00:02:48,000
+or even simply to satisfy the requirements of COMPILER.
+
+36
+00:02:48,000 --> 00:02:52,000
+Don't worry, we'll also talk about test Dubbo's a little bit later today.
+
+37
+00:02:53,000 --> 00:02:58,000
+But when we talk about integration tests, we still can use Moken frameworks and test doubles for the
+
+38
+00:02:58,000 --> 00:03:00,000
+waste areas of the system.
+
+39
+00:03:00,000 --> 00:03:06,000
+For example, as I already mentioned, we need to test interaction and behavior between elements like
+
+40
+00:03:06,000 --> 00:03:12,000
+an example when mail server and Wolk's masses of template engine also an integration test.
+
+41
+00:03:12,000 --> 00:03:18,000
+And we can use real containers and real databases and use real components for integration testing.
+
+42
+00:03:18,000 --> 00:03:24,000
+For example, when one might project we had separate environment where automated acceptant testing was
+
+43
+00:03:24,000 --> 00:03:32,000
+executed, we had sort of integration test the test, our API, but still used marked fake components.
+
+44
+00:03:32,000 --> 00:03:39,000
+After running tests on eight environment, we executed our tests on so-called sealed environment system
+
+45
+00:03:39,000 --> 00:03:46,000
+integration testing test on that environment used real competence like real database, real payment
+
+46
+00:03:46,000 --> 00:03:49,000
+services, but just with the test data.
+
+47
+00:03:49,000 --> 00:03:55,000
+So as you can see, level of using fake objects and test doubles during the integration testing can
+
+48
+00:03:55,000 --> 00:04:01,000
+be different and will depend on your application and level of complexity of your system in general.
+
+49
+00:04:01,000 --> 00:04:07,000
+The next thing that is different in unit testing and integration testing is that failure in unit test
+
+50
+00:04:07,000 --> 00:04:09,000
+is always issue with the source code.
+
+51
+00:04:09,000 --> 00:04:11,000
+But failure and integration testing.
+
+52
+00:04:11,000 --> 00:04:17,000
+Besides, the issue with the source code also can mean changes in the environment and in other components.
+
+53
+00:04:18,000 --> 00:04:21,000
+Unit testing is a first layer of test in our testing pyramid.
+
+54
+00:04:22,000 --> 00:04:26,000
+If you don't miss any lessons before, I believe you remember what testing parameter is.
+
+55
+00:04:27,000 --> 00:04:32,000
+And this is important to understand that before starting the implementation of integration tests, we
+
+56
+00:04:32,000 --> 00:04:38,000
+have to be sure that all the years work properly in isolation and once all the components and modules
+
+57
+00:04:38,000 --> 00:04:44,000
+are working independently, then we need to check the data flow between the dependent modules that is
+
+58
+00:04:44,000 --> 00:04:45,000
+known as integration testing.
+
+59
+00:04:46,000 --> 00:04:52,000
+So I believe that is clear that integration testing is a second level of the software testing process
+
+60
+00:04:52,000 --> 00:04:54,000
+that comes after unit testing.
+
+61
+00:04:54,000 --> 00:05:00,000
+Now, I would like to talk about test Dubbo's during the unit test and integration test, and sometimes
+
+62
+00:05:00,000 --> 00:05:02,000
+we depend on the parts of our system.
+
+63
+00:05:03,000 --> 00:05:09,000
+We don't need at the moment or they are not ready to be tested now where it is impossible to reproduce
+
+64
+00:05:09,000 --> 00:05:13,000
+the state of some parts of the system on this particular environment and to write.
+
+65
+00:05:14,000 --> 00:05:20,000
+We have to use counter parts of those elements that would behave like release ready elements.
+
+66
+00:05:20,000 --> 00:05:26,000
+For example, you don't have available third party API that performs fraud verification of your user
+
+67
+00:05:26,000 --> 00:05:32,000
+during the purchase, but you have official documentation and you know how to imitate this API.
+
+68
+00:05:32,000 --> 00:05:36,000
+And now you can build something what behaves like real API.
+
+69
+00:05:37,000 --> 00:05:39,000
+But actually this isn't an actual API.
+
+70
+00:05:40,000 --> 00:05:43,000
+Such kind of units are called test double's.
+
+71
+00:05:43,000 --> 00:05:48,000
+Besides that, that's double simplified testing process and provider's responsibility to reduce the
+
+72
+00:05:48,000 --> 00:05:51,000
+complexity and facilitate testing.
+
+73
+00:05:51,000 --> 00:05:57,000
+That's doable is a generic term that is used to describe objects or procedures that will help us during
+
+74
+00:05:57,000 --> 00:05:59,000
+the testing was the case I described.
+
+75
+00:06:00,000 --> 00:06:06,000
+Test novel has to implement the same interface as real life object and meets the same requirements,
+
+76
+00:06:06,000 --> 00:06:08,000
+the different types of test.
+
+77
+00:06:08,000 --> 00:06:10,000
+Dubbo's let's look at them.
+
+78
+00:06:10,000 --> 00:06:13,000
+The first in our list is a dummy object.
+
+79
+00:06:13,000 --> 00:06:15,000
+What is a dummy object?
+
+80
+00:06:15,000 --> 00:06:20,000
+This is fake argument that is not really used and has no effect on the test.
+
+81
+00:06:20,000 --> 00:06:26,000
+Imagine that you have multiple parameters in the method and you just need to pass at least something
+
+82
+00:06:26,000 --> 00:06:31,000
+as an argument to execute this method, even in case you don't care about this argument at all.
+
+83
+00:06:31,000 --> 00:06:34,000
+The next type of test is a test.
+
+84
+00:06:34,000 --> 00:06:34,000
+Stop.
+
+85
+00:06:35,000 --> 00:06:38,000
+Stop is an object with hardcoded values to be returned.
+
+86
+00:06:38,000 --> 00:06:42,000
+It has no logic in sight and it is state oriented.
+
+87
+00:06:43,000 --> 00:06:48,000
+Steps are used to provide our test with input to imitate different life cases.
+
+88
+00:06:48,000 --> 00:06:55,000
+A fake object has implementation with shortcuts, so it is just a simplified version of the production
+
+89
+00:06:55,000 --> 00:06:55,000
+code.
+
+90
+00:06:56,000 --> 00:07:02,000
+It is usually used in integration testing, for example, to access and in-memory version of the production
+
+91
+00:07:02,000 --> 00:07:03,000
+database.
+
+92
+00:07:04,000 --> 00:07:11,000
+Mock a mock test double is a behavior oriented object used to assert InterAction's, it allows to use
+
+93
+00:07:11,000 --> 00:07:13,000
+methods to verify interactions.
+
+94
+00:07:13,000 --> 00:07:19,000
+For example, I can tell that some specific Masset was invoked with a specific list of parameters.
+
+95
+00:07:19,000 --> 00:07:23,000
+Also, I can calculate a number of times method was invoked.
+
+96
+00:07:23,000 --> 00:07:29,000
+We can also set expectations about Molk behavior before this code is executed.
+
+97
+00:07:29,000 --> 00:07:31,000
+And finally, spy.
+
+98
+00:07:31,000 --> 00:07:33,000
+A spy is similar to a mock.
+
+99
+00:07:33,000 --> 00:07:40,000
+It is also behavior oriented object used to assert interactions, but it is different from the mock
+
+100
+00:07:40,000 --> 00:07:43,000
+as delegates and monitor calls to real objects.
+
+101
+00:07:43,000 --> 00:07:50,000
+So you use real object with real methods and all interactions with spy are substituted with close to
+
+102
+00:07:50,000 --> 00:07:53,000
+real object unless some method was stopped.
+
+103
+00:07:54,000 --> 00:07:58,000
+So I want you to understand that Mock's are something totally different.
+
+104
+00:07:58,000 --> 00:08:06,000
+Until now, all our tests made assertions on a state marks a test double's that make assertions on behavior.
+
+105
+00:08:06,000 --> 00:08:10,000
+To understand the analogy, imagine that Moncks say something like this.
+
+106
+00:08:11,000 --> 00:08:18,000
+I expect that Masset one will be invoked with this string argument and if it is not there, I will throw
+
+107
+00:08:18,000 --> 00:08:19,000
+an error.
+
+108
+00:08:19,000 --> 00:08:25,000
+So Molk verifies behavior that the main goal of creating these kind of testable.
+
+109
+00:08:26,000 --> 00:08:32,000
+Let's now sum it up to understand why we have to use test Dubbo's during the testing and what advantages
+
+110
+00:08:32,000 --> 00:08:34,000
+we get from using that.
+
+111
+00:08:34,000 --> 00:08:38,000
+With the help of test double's, we isolate code that is under test.
+
+112
+00:08:38,000 --> 00:08:45,000
+We can be sure that we control all integration's and isolate specific parts of our system from each
+
+113
+00:08:45,000 --> 00:08:49,000
+other, substituting the real integrations with Test Dumbo's.
+
+114
+00:08:49,000 --> 00:08:56,000
+We can speed up test execution because integration test that uses real components for all kinds of integrations
+
+115
+00:08:56,000 --> 00:08:58,000
+can take hours to complete.
+
+116
+00:08:59,000 --> 00:09:05,000
+That's why very often a lot of parts in our integration test is substituted with test double's using
+
+117
+00:09:05,000 --> 00:09:06,000
+test Dubbo's.
+
+118
+00:09:06,000 --> 00:09:12,000
+We can stop specific behavior of our components and make execution of our test deterministic.
+
+119
+00:09:13,000 --> 00:09:18,000
+At the end of the day, we want to have control over execution of our test from the start to the end
+
+120
+00:09:19,000 --> 00:09:25,000
+test that helps us to reproduce special conditions and produce different states of our system to test
+
+121
+00:09:25,000 --> 00:09:27,000
+different use cases.
+
+122
+00:09:27,000 --> 00:09:28,000
+Does it make sense?
+
+123
+00:09:29,000 --> 00:09:33,000
+Before we move further, I want to explain the different types of integration testing.
+
+124
+00:09:34,000 --> 00:09:41,000
+Integration testing may be classified into two major groups ZAYA incremental integration testing and
+
+125
+00:09:41,000 --> 00:09:43,000
+non incremental integration testing.
+
+126
+00:09:44,000 --> 00:09:51,000
+In the incremental approach, modules are added in the ascending order one by one or according to need.
+
+127
+00:09:51,000 --> 00:09:57,000
+The selected modules must be logically related generally to unmuzzled.
+
+128
+00:09:57,000 --> 00:10:01,000
+Two modules are added and tested to determine the correctness of functions.
+
+129
+00:10:02,000 --> 00:10:08,000
+The process continues until the successful testing of all the modules they are top down and bottom up
+
+130
+00:10:08,000 --> 00:10:14,000
+approach is the top down testing strategy deals with the process in which high level modules are tested
+
+131
+00:10:14,000 --> 00:10:21,000
+with low level modules until the successful completion of testing of all the modules, major design
+
+132
+00:10:21,000 --> 00:10:27,000
+flaws can be detected and fixed early because critical modules tested first in this type of testing
+
+133
+00:10:27,000 --> 00:10:33,000
+will add the modules incrementally or one by one and check the data flow in the same order.
+
+134
+00:10:34,000 --> 00:10:39,000
+The bottom up testing strategy deals with the processes in which low level modules are tested with high
+
+135
+00:10:39,000 --> 00:10:44,000
+level modules and use the successful completion of testing of all the modules.
+
+136
+00:10:44,000 --> 00:10:49,000
+Top level critical modules are tested at last, so it may cause a defect.
+
+137
+00:10:49,000 --> 00:10:54,000
+Or we can say that we will be adding the modules from bottom to the top and checking the data flow in
+
+138
+00:10:54,000 --> 00:10:55,000
+the same order.
+
+139
+00:10:56,000 --> 00:10:59,000
+Let me explain more about non incremental integration testing.
+
+140
+00:11:00,000 --> 00:11:06,000
+We will go for this method when the data flow is very complex and when it is difficult to find who is
+
+141
+00:11:06,000 --> 00:11:13,000
+a parent and who is a child and in such case will create the data in any module and we will test interactions
+
+142
+00:11:13,000 --> 00:11:15,000
+with different modules without any specific logic.
+
+143
+00:11:16,000 --> 00:11:19,000
+That is why this method is also known as big bank Macit.
+
+144
+00:11:20,000 --> 00:11:25,000
+Now, when you know the theory of integration testing, let's learn what frameworks are used for integration
+
+145
+00:11:25,000 --> 00:11:26,000
+testing.
+
+146
+00:11:26,000 --> 00:11:31,000
+Probably the first framework that is used for integration testing is a unit.
+
+147
+00:11:31,000 --> 00:11:37,000
+Even despite developers use the unit primarily for unit testing, we still can use this library for
+
+148
+00:11:37,000 --> 00:11:38,000
+integration testing.
+
+149
+00:11:39,000 --> 00:11:43,000
+Also, probably one of the most popular libraries that we use during integration testing.
+
+150
+00:11:43,000 --> 00:11:45,000
+Is Makita an easy mark?
+
+151
+00:11:45,000 --> 00:11:52,000
+These libraries help us to create mock and spy objects YABE unit libraries that helps us to create test
+
+152
+00:11:52,000 --> 00:11:54,000
+for integration with database.
+
+153
+00:11:54,000 --> 00:12:00,000
+Mauck FCP Server Library provides us with different FCP Implementations FAQ and step.
+
+154
+00:12:00,000 --> 00:12:03,000
+It is just a few libraries in fact.
+
+155
+00:12:03,000 --> 00:12:09,000
+There are much more of them that will be used for defense specific cases, but the principle of working
+
+156
+00:12:09,000 --> 00:12:14,000
+with these libraries as a state, that means in case you would learn at least few libraries for integration
+
+157
+00:12:14,000 --> 00:12:20,000
+testing, it will be like piece of cake to learn other libraries by just reading documentation.
+
+158
+00:12:20,000 --> 00:12:25,000
+In this course, we are going to learn the most popular libraries for integration testing that you will
+
+159
+00:12:25,000 --> 00:12:32,000
+use most often, especially for all my students are prepared examples for each topic and I walk you
+
+160
+00:12:32,000 --> 00:12:33,000
+through all examples as we go.
+
+161
+00:12:34,000 --> 00:12:40,000
+I believe that we learned a lot for today and you already can understand and imagine what integration
+
+162
+00:12:40,000 --> 00:12:40,000
+testing is.
+
+163
+00:12:41,000 --> 00:12:46,000
+The only thing that we still need to do is to learn how to use frameworks that are listed in the lesson.
+
+164
+00:12:47,000 --> 00:12:49,000
+But we will do this in the next lessons.
+
+165
+00:12:49,000 --> 00:12:52,000
+Right now, let's recap what we have learned today.
+
+166
+00:12:53,000 --> 00:12:56,000
+In this lesson, we learned what integration testing is.
+
+167
+00:12:56,000 --> 00:13:01,000
+We made a comparison of unit and integration testing to understand the difference better.
+
+168
+00:13:02,000 --> 00:13:07,000
+After that, we learn the concept of test doubles and what types of test double's exist.
+
+169
+00:13:07,000 --> 00:13:13,000
+We also learned why and when we need to use test numbers and we learn the advantages of working with
+
+170
+00:13:13,000 --> 00:13:13,000
+them.
+
+171
+00:13:14,000 --> 00:13:20,000
+I explain the different types of integration testing and we discussed different approaches during integration
+
+172
+00:13:20,000 --> 00:13:26,000
+testing and at the end of the lesson we reviewed frameworks for Java that will help us to write integration
+
+173
+00:13:26,000 --> 00:13:27,000
+tests.
+
+174
+00:13:27,000 --> 00:13:29,000
+That said, hope you like the lesson.
+
+175
+00:13:30,000 --> 00:13:33,000
+Thanks a lot for your attention and see you in the next lesson.
+
diff --git a/35 - Integration testing & Mockito/002 Byte-Buddy-agent-library.url b/35 - Integration testing & Mockito/002 Byte-Buddy-agent-library.url
new file mode 100644
index 0000000000000000000000000000000000000000..2d50eb765d3def4bc3a64752d37ef571cf5947ac
--- /dev/null
+++ b/35 - Integration testing & Mockito/002 Byte-Buddy-agent-library.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/net.bytebuddy/byte-buddy-agent/1.10.19
\ No newline at end of file
diff --git a/35 - Integration testing & Mockito/002 Byte-Buddy-library.url b/35 - Integration testing & Mockito/002 Byte-Buddy-library.url
new file mode 100644
index 0000000000000000000000000000000000000000..ad7748ada71fc85a413ef8f6856f7391b3b12932
--- /dev/null
+++ b/35 - Integration testing & Mockito/002 Byte-Buddy-library.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/net.bytebuddy/byte-buddy/1.10.19
\ No newline at end of file
diff --git a/35 - Integration testing & Mockito/002 Mockito Part 1_en.srt b/35 - Integration testing & Mockito/002 Mockito Part 1_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..e461184a7692b97a04685e2674a48fad9eeddf9b
--- /dev/null
+++ b/35 - Integration testing & Mockito/002 Mockito Part 1_en.srt
@@ -0,0 +1,1196 @@
+1
+00:00:05,000 --> 00:00:06,000
+Hello, Jim.
+
+2
+00:00:06,000 --> 00:00:11,000
+Glad to see you and this lesson and today we're going to start dive deeper into the details and learn
+
+3
+00:00:11,000 --> 00:00:13,000
+framework for integration testing.
+
+4
+00:00:13,000 --> 00:00:18,000
+Today, we learn McKetta will start from understanding what McKetta library is.
+
+5
+00:00:19,000 --> 00:00:24,000
+After that, we are going to have a lot of real life examples that will help you to understand how to
+
+6
+00:00:24,000 --> 00:00:30,000
+work with Makita API, but to make sure that you can write and run Makita tests will set up your environment
+
+7
+00:00:30,000 --> 00:00:34,000
+first and will add Java libraries to class parts of your project.
+
+8
+00:00:34,000 --> 00:00:40,000
+I will show you how to use Marketo extension for your unit to be able to work with Makita in your unit.
+
+9
+00:00:40,000 --> 00:00:46,000
+Tests will create more books and in real life, examples will verify behavior on our marks.
+
+10
+00:00:46,000 --> 00:00:50,000
+You will learn how much injection works in this lesson.
+
+11
+00:00:50,000 --> 00:00:56,000
+I will show you how you can use argument marchers and what the specifics of using them in Makita tests
+
+12
+00:00:56,000 --> 00:00:57,000
+for specific cases.
+
+13
+00:00:57,000 --> 00:01:03,000
+I will show you how to stop exception when it will be needed and at the end of the lesson will learn
+
+14
+00:01:03,000 --> 00:01:04,000
+how to work with argument.
+
+15
+00:01:04,000 --> 00:01:06,000
+CAPTA, let's start.
+
+16
+00:01:07,000 --> 00:01:11,000
+Makita is a library that is used during unioned and integration testing in Java applications.
+
+17
+00:01:12,000 --> 00:01:15,000
+Makita is used to create Mock's based on the interfaces.
+
+18
+00:01:15,000 --> 00:01:22,000
+With the help of this library, we can stop some great spice and does behavior during integration of
+
+19
+00:01:22,000 --> 00:01:23,000
+different components.
+
+20
+00:01:23,000 --> 00:01:28,000
+Makita has a really nice API that helps us to write nice and readable tasks.
+
+21
+00:01:29,000 --> 00:01:32,000
+And today on real examples, I'm going to show you how to work with McKetta.
+
+22
+00:01:33,000 --> 00:01:36,000
+Let's jump to Eclipse and not Makita on examples.
+
+23
+00:01:36,000 --> 00:01:42,000
+I prepared real life example to help you understand the API before the Makita API.
+
+24
+00:01:43,000 --> 00:01:46,000
+I will give you a context of our classes that we are going to test.
+
+25
+00:01:47,000 --> 00:01:49,000
+Imagine that we have messenger class.
+
+26
+00:01:49,000 --> 00:01:53,000
+This class aggregates template engine and mail server.
+
+27
+00:01:53,000 --> 00:01:59,000
+Template engine is a type that can prepare content for your email message based on the template, and
+
+28
+00:01:59,000 --> 00:02:05,000
+the client will take information from client object and pasted in the template and return ready to send
+
+29
+00:02:05,000 --> 00:02:06,000
+message.
+
+30
+00:02:06,000 --> 00:02:12,000
+You know this kind of emails that contains personalized information like your first and last name,
+
+31
+00:02:12,000 --> 00:02:13,000
+for example.
+
+32
+00:02:13,000 --> 00:02:18,000
+I didn't implement all logic here because for the sake of our market examples, that wouldn't mean a
+
+33
+00:02:18,000 --> 00:02:19,000
+lot.
+
+34
+00:02:19,000 --> 00:02:25,000
+So I'm one of you understand at least high level logic client is a regular object that can be created
+
+35
+00:02:25,000 --> 00:02:29,000
+only with email and can return its email when needed.
+
+36
+00:02:29,000 --> 00:02:32,000
+The next field in messenger type is email server.
+
+37
+00:02:32,000 --> 00:02:35,000
+Object of this type has only one goal.
+
+38
+00:02:35,000 --> 00:02:41,000
+Be able to send the message from specific person to the specific addressee with a personalized message
+
+39
+00:02:41,000 --> 00:02:49,000
+content sent massive takes object of type email to send the message email object in our particular case
+
+40
+00:02:49,000 --> 00:02:51,000
+has a message, content and address.
+
+41
+00:02:52,000 --> 00:02:56,000
+We have getters and setters here for mail server and template engine.
+
+42
+00:02:56,000 --> 00:02:59,000
+And here is our key message and messenger service.
+
+43
+00:02:59,000 --> 00:03:00,000
+It is called Send Message.
+
+44
+00:03:01,000 --> 00:03:04,000
+This method takes client object and template object.
+
+45
+00:03:04,000 --> 00:03:06,000
+At the beginning we create message content.
+
+46
+00:03:06,000 --> 00:03:13,000
+After that we create email object and set content and Andrassy to email and after that we call send
+
+47
+00:03:13,000 --> 00:03:14,000
+with email object.
+
+48
+00:03:15,000 --> 00:03:17,000
+Hope you understand the context.
+
+49
+00:03:17,000 --> 00:03:19,000
+And now let me ask you a few questions.
+
+50
+00:03:19,000 --> 00:03:25,000
+How would you test that when you call, send the message Masset on messenger then send message of mail
+
+51
+00:03:25,000 --> 00:03:30,000
+server is invoked to be sure that integration between messenger and mail server works.
+
+52
+00:03:31,000 --> 00:03:36,000
+How would you test that mail server is invoked with the email object that contains email that we get
+
+53
+00:03:36,000 --> 00:03:38,000
+from the client object.
+
+54
+00:03:38,000 --> 00:03:44,000
+And to be sure that this is not just a random email object, would you like to check when you call,
+
+55
+00:03:44,000 --> 00:03:48,000
+send messages and prepare a message of template engine objects is invoked.
+
+56
+00:03:48,000 --> 00:03:52,000
+Can you take a minute and think of different cases that you would like to test?
+
+57
+00:03:52,000 --> 00:03:58,000
+We have to test interconnection behavior and how components behave in different cases based on different
+
+58
+00:03:58,000 --> 00:04:00,000
+output of connected objects.
+
+59
+00:04:01,000 --> 00:04:07,000
+Now, when we have the context about our system, let's write this with the help of the library and
+
+60
+00:04:07,000 --> 00:04:11,000
+the first thing we have to do is to add external library to our project.
+
+61
+00:04:12,000 --> 00:04:17,000
+If you so lesson about Holmquist, I already showed how to download the library from my own repository
+
+62
+00:04:17,000 --> 00:04:20,000
+and edit as external library to the project.
+
+63
+00:04:20,000 --> 00:04:21,000
+No, you have to do the same.
+
+64
+00:04:21,000 --> 00:04:26,000
+But just download other libraries, find Marketo core and download library.
+
+65
+00:04:27,000 --> 00:04:32,000
+You can download from Mavin Repository, have a live link to this library and the lesson attachments.
+
+66
+00:04:32,000 --> 00:04:38,000
+So don't worry, you just have to download jar of the latest version and add it has external library
+
+67
+00:04:38,000 --> 00:04:38,000
+to our project.
+
+68
+00:04:39,000 --> 00:04:42,000
+Pay attention that this library has dependencies.
+
+69
+00:04:42,000 --> 00:04:45,000
+Click on the compatible version and make sure you download it.
+
+70
+00:04:45,000 --> 00:04:48,000
+Also these libraries and added them to a class.
+
+71
+00:04:49,000 --> 00:04:54,000
+In this particular lesson, we are not using the building tools that will significantly help us with
+
+72
+00:04:54,000 --> 00:04:59,000
+managing dependencies, but we will learn this bill to use a little bit later in our course.
+
+73
+00:04:59,000 --> 00:05:03,000
+Also, besides this libraries, please download my Kitajima.
+
+74
+00:05:03,000 --> 00:05:08,000
+Jupiter Library, all links, you will find interesting attachments, so don't worry about that.
+
+75
+00:05:09,000 --> 00:05:15,000
+I have added all these jurors to the glass parts of my project, and now we can proceed with the examples.
+
+76
+00:05:16,000 --> 00:05:21,000
+Here's our test, you know, where you can see a lot of different annotations, but don't worry, we'll
+
+77
+00:05:21,000 --> 00:05:23,000
+learn all of them gradually as we go.
+
+78
+00:05:24,000 --> 00:05:25,000
+Let's create our first test.
+
+79
+00:05:26,000 --> 00:05:27,000
+We want to test it.
+
+80
+00:05:27,000 --> 00:05:33,000
+Mansehra will actually send email when I will call, send a message message on my messenger object.
+
+81
+00:05:33,000 --> 00:05:34,000
+Let's write this test.
+
+82
+00:05:35,000 --> 00:05:41,000
+For the first test, I have to create concerns for some text message and some random email in my condition.
+
+83
+00:05:41,000 --> 00:05:45,000
+Part of the test I create client object was a random email.
+
+84
+00:05:45,000 --> 00:05:49,000
+Also, I create some template object to use it during the testing.
+
+85
+00:05:50,000 --> 00:05:54,000
+After that, I want to create a stop for this specific test.
+
+86
+00:05:54,000 --> 00:06:00,000
+I want to imitate the next scenario when prepare message will be called on template engine object with
+
+87
+00:06:00,000 --> 00:06:02,000
+a specific template and with my client.
+
+88
+00:06:02,000 --> 00:06:05,000
+Then I will return some random message.
+
+89
+00:06:05,000 --> 00:06:12,000
+Important thing here is to understand that after this line, no matter how much time someone will prepare
+
+90
+00:06:12,000 --> 00:06:17,000
+a message with these objects, I will get these random message for all other arguments.
+
+91
+00:06:17,000 --> 00:06:19,000
+Template engine will return now.
+
+92
+00:06:19,000 --> 00:06:26,000
+In other words, the default value for type that is returned from this method for all reference types.
+
+93
+00:06:26,000 --> 00:06:28,000
+This value is now here.
+
+94
+00:06:28,000 --> 00:06:29,000
+I left a command line.
+
+95
+00:06:29,000 --> 00:06:35,000
+When you get the source code, you can uncommon this line to make sure what is returned after this method
+
+96
+00:06:35,000 --> 00:06:37,000
+and location with new parameters.
+
+97
+00:06:38,000 --> 00:06:40,000
+But let's stop on this line before moving further.
+
+98
+00:06:41,000 --> 00:06:44,000
+Let me explain to you what is happening here.
+
+99
+00:06:44,000 --> 00:06:49,000
+When is a static method from Makita class to stop massas on UniMac?
+
+100
+00:06:49,000 --> 00:06:54,000
+Pay attention that on the top of my file I need a static input of everything.
+
+101
+00:06:54,000 --> 00:06:55,000
+What is inside my class?
+
+102
+00:06:56,000 --> 00:07:00,000
+That's why I can call one method without specifying much the class name.
+
+103
+00:07:00,000 --> 00:07:04,000
+The next thing I have here is a method and location on mock object.
+
+104
+00:07:04,000 --> 00:07:08,000
+Based on this, we need to have AMOC from the previous class.
+
+105
+00:07:08,000 --> 00:07:13,000
+And you already know that Mock allows us to test behavior during the interaction with other components.
+
+106
+00:07:13,000 --> 00:07:20,000
+For example, we will do this in the next lines, but at this very moment we need to stop specific behavior.
+
+107
+00:07:21,000 --> 00:07:25,000
+Why I need to start behavior and why I just can't use real object.
+
+108
+00:07:25,000 --> 00:07:29,000
+Well, there are different reasons why we might want to do like this.
+
+109
+00:07:29,000 --> 00:07:31,000
+The first reason is the simplest one.
+
+110
+00:07:32,000 --> 00:07:37,000
+By the moment you write this test, you don't have any implementation of template engine at all.
+
+111
+00:07:38,000 --> 00:07:42,000
+The only thing what you have is interface of type, template engine.
+
+112
+00:07:43,000 --> 00:07:48,000
+And implementation of this interface is in progress by as a developer from your team, for example,
+
+113
+00:07:48,000 --> 00:07:53,000
+the second reason to stop MassArt on the mark is that you are going to perform a lot of different tasks
+
+114
+00:07:54,000 --> 00:07:59,000
+and you want to reproduce different cases to understand how program behaves based on the different state
+
+115
+00:07:59,000 --> 00:08:02,000
+of other components that it interacting with.
+
+116
+00:08:02,000 --> 00:08:08,000
+It is a good way to test edge values and all classes of equivalent probably have the one question in
+
+117
+00:08:08,000 --> 00:08:11,000
+a hat how to create mock.
+
+118
+00:08:11,000 --> 00:08:13,000
+There are different ways to create more energy.
+
+119
+00:08:13,000 --> 00:08:20,000
+And for Energy Unit five, I wrote and commented all possible ways to create more so you can use this
+
+120
+00:08:20,000 --> 00:08:22,000
+file as a cheat sheet in the future.
+
+121
+00:08:22,000 --> 00:08:28,000
+The first way to create more is to call Mauck method from Makita class and pass the user interface with
+
+122
+00:08:28,000 --> 00:08:30,000
+specific class just like this.
+
+123
+00:08:31,000 --> 00:08:34,000
+The second option is to use more connotation above the field that you want to mock.
+
+124
+00:08:35,000 --> 00:08:40,000
+In this particular case, I have to put more concentration right above my field and now I have to call
+
+125
+00:08:41,000 --> 00:08:44,000
+it Marks Masset from Makita annotations class and pass the reference.
+
+126
+00:08:44,000 --> 00:08:46,000
+The object of this test class.
+
+127
+00:08:47,000 --> 00:08:50,000
+If you would use this method, you would find that it works just perfect.
+
+128
+00:08:51,000 --> 00:08:55,000
+But developers of the library consider this method as deprecated.
+
+129
+00:08:55,000 --> 00:08:57,000
+I would dive into the details.
+
+130
+00:08:57,000 --> 00:08:59,000
+Why exactly they marked it as deprecated?
+
+131
+00:09:00,000 --> 00:09:04,000
+Because probably it wouldn't mean a lot for us right now what they recommend to use.
+
+132
+00:09:04,000 --> 00:09:10,000
+Instead, it is recommended to use open source method, it turns out to closable.
+
+133
+00:09:10,000 --> 00:09:15,000
+I saw this reference in a variable and in after each method I close it.
+
+134
+00:09:15,000 --> 00:09:18,000
+You can use this option if you wish and last.
+
+135
+00:09:18,000 --> 00:09:23,000
+But most convenient option, in my opinion, is to use Makita extension for Unit five.
+
+136
+00:09:24,000 --> 00:09:30,000
+We have to place extant with annotation above our class and pass the class of McKetta extension.
+
+137
+00:09:30,000 --> 00:09:36,000
+Make sure that your implicit all library is to a class pass properly was all necessary dependencies.
+
+138
+00:09:36,000 --> 00:09:41,000
+In case you use this extension, you shouldn't use any static methods that I would just share it with
+
+139
+00:09:41,000 --> 00:09:42,000
+you.
+
+140
+00:09:42,000 --> 00:09:48,000
+This is pretty convenient, in my opinion, in jail for you to use special rounds that is called market.
+
+141
+00:09:48,000 --> 00:09:52,000
+As a unit runner, we would use Macchi through all the options.
+
+142
+00:09:52,000 --> 00:09:53,000
+Works fine.
+
+143
+00:09:53,000 --> 00:09:58,000
+Just on the matter of your current style and specifics of your test, how exactly you would like to
+
+144
+00:09:58,000 --> 00:10:04,000
+initialize mops, but now you know all possible ways to create Mock's, that is for sure.
+
+145
+00:10:05,000 --> 00:10:06,000
+Also, one more thing.
+
+146
+00:10:06,000 --> 00:10:12,000
+It is a rule of thumb to specify that some specific object is a mark by adding more suffix to a variable
+
+147
+00:10:12,000 --> 00:10:13,000
+name like this.
+
+148
+00:10:14,000 --> 00:10:20,000
+So now when you know how to create marks in test with the help of McKetta, let's get back to the place
+
+149
+00:10:20,000 --> 00:10:22,000
+where we stopped here.
+
+150
+00:10:22,000 --> 00:10:28,000
+In one method, I could prepare a message on my mark and pass specific client and specific template.
+
+151
+00:10:29,000 --> 00:10:35,000
+And after that I call Zenovich on MassArt and I pass the value that has compatable.
+
+152
+00:10:35,000 --> 00:10:41,000
+I was returned value of prepared message Massett, this is a value that I expect to be returned by my
+
+153
+00:10:41,000 --> 00:10:45,000
+Molk when I will call prepare a message with this client and this template.
+
+154
+00:10:46,000 --> 00:10:47,000
+Let's perform some action.
+
+155
+00:10:47,000 --> 00:10:50,000
+We call, send a message message on our messenger object.
+
+156
+00:10:50,000 --> 00:10:54,000
+I put the same client and template that I used during Stahmann.
+
+157
+00:10:55,000 --> 00:10:57,000
+Now it is time to perform verifications.
+
+158
+00:10:58,000 --> 00:11:04,000
+The first things that I wanted to test is that after call send message Zapopan message method of template
+
+159
+00:11:04,000 --> 00:11:11,000
+engine is code with the same client and template that I used to send message and location.
+
+160
+00:11:11,000 --> 00:11:18,000
+How to do that I call static Masset verified from McKetta class and I pass mark of template engine that
+
+161
+00:11:19,000 --> 00:11:22,000
+you already saw how I initialized Mauck of template engine.
+
+162
+00:11:23,000 --> 00:11:28,000
+The most interesting part is how to test integration between messenger and template engine.
+
+163
+00:11:29,000 --> 00:11:35,000
+It sounds like a good idea to inject template engine into the messenger object to make sure that it
+
+164
+00:11:35,000 --> 00:11:37,000
+uses exactly smok.
+
+165
+00:11:38,000 --> 00:11:43,000
+This will help me to come up with the right conclusion about integration between these two modules.
+
+166
+00:11:43,000 --> 00:11:48,000
+How to do that with McKetta, would you a field of type messenger?
+
+167
+00:11:48,000 --> 00:11:53,000
+That would be our test instance and I would inject more connotation right above this field.
+
+168
+00:11:54,000 --> 00:11:54,000
+What does it mean?
+
+169
+00:11:55,000 --> 00:12:01,000
+First of all, object of this type will be created and all models that are declared in this test class
+
+170
+00:12:01,000 --> 00:12:07,000
+and that are at the same time compatible with the fields declared in messenger type will be injected
+
+171
+00:12:07,000 --> 00:12:07,000
+there.
+
+172
+00:12:08,000 --> 00:12:11,000
+Let me show you my messenger class has two fields.
+
+173
+00:12:11,000 --> 00:12:16,000
+One field is of type template engine and the second field is of type server.
+
+174
+00:12:17,000 --> 00:12:19,000
+OK, let's get back to our test class.
+
+175
+00:12:19,000 --> 00:12:23,000
+In our test class, I have most of template engine in the mail server.
+
+176
+00:12:24,000 --> 00:12:30,000
+This means that these two marks will be injected in this object market is smart enough to understand
+
+177
+00:12:30,000 --> 00:12:37,000
+this and it takes care about this that tries to perform an action with the help of the setters.
+
+178
+00:12:37,000 --> 00:12:44,000
+But even in case there are no setters, Makita will try to inject it with the constructor and even Zano
+
+179
+00:12:44,000 --> 00:12:46,000
+constructor was all necessary fields.
+
+180
+00:12:46,000 --> 00:12:53,000
+Makita will use mechanism of reflection and inject these marks a bit later in this course will be on
+
+181
+00:12:53,000 --> 00:12:57,000
+reflection mechanism so that you would also be able to create your own McKetta.
+
+182
+00:12:58,000 --> 00:13:04,000
+I believe you understand that these two marks will be injected in our test instance, and I want to
+
+183
+00:13:04,000 --> 00:13:08,000
+verify that repair method was invoked on template and an object.
+
+184
+00:13:08,000 --> 00:13:11,000
+Moakes, allow me to verify the behavior.
+
+185
+00:13:11,000 --> 00:13:17,000
+So in my test, after passing Mark to verify method, I invoke repair method with a specific arguments
+
+186
+00:13:17,000 --> 00:13:24,000
+that I expect to be there, for example, in case I would pass here new object of client, not the one
+
+187
+00:13:24,000 --> 00:13:26,000
+I used during the send message invocation.
+
+188
+00:13:27,000 --> 00:13:30,000
+The test will fail and this is supercool.
+
+189
+00:13:30,000 --> 00:13:34,000
+Can you see how I test interconnection between two classes?
+
+190
+00:13:34,000 --> 00:13:37,000
+I checked after passing arguments to one class.
+
+191
+00:13:37,000 --> 00:13:40,000
+The method of another class was exactly the same.
+
+192
+00:13:40,000 --> 00:13:41,000
+Arguments is invoked.
+
+193
+00:13:42,000 --> 00:13:48,000
+What I can also test here, I can test that same method was invoked on my mind server, mock the same
+
+194
+00:13:48,000 --> 00:13:49,000
+syntax.
+
+195
+00:13:49,000 --> 00:13:55,000
+The only difference here is that I don't know what an object will be here because in my object is created
+
+196
+00:13:55,000 --> 00:13:56,000
+inside the method.
+
+197
+00:13:57,000 --> 00:14:01,000
+For the sake of this particular test, I don't care what object to send there.
+
+198
+00:14:02,000 --> 00:14:08,000
+What I am interested in is to verify that method sent, was invoked, was actually an email.
+
+199
+00:14:09,000 --> 00:14:13,000
+The new things that you can see here is that I called any it what is it.
+
+200
+00:14:14,000 --> 00:14:16,000
+This is so called argument moccia.
+
+201
+00:14:17,000 --> 00:14:20,000
+This is a static method that returns Makita argument moccia.
+
+202
+00:14:20,000 --> 00:14:22,000
+Let me explain how this work.
+
+203
+00:14:23,000 --> 00:14:29,000
+There may be cases when in our test we have to respond to a wider range of values of before and unknown
+
+204
+00:14:29,000 --> 00:14:30,000
+values.
+
+205
+00:14:30,000 --> 00:14:34,000
+Let's review the same test method, but with argument matchers.
+
+206
+00:14:34,000 --> 00:14:41,000
+The first thing you can see that I use any method with other classes I can do this with any reference
+
+207
+00:14:41,000 --> 00:14:45,000
+is Stipe's when I don't care about the actual value that is passed to the masses.
+
+208
+00:14:46,000 --> 00:14:52,000
+There are also different modules that you can use some of them and string any Ayinde and in Dumble,
+
+209
+00:14:52,000 --> 00:14:56,000
+any char, any boolean, at least any set, any map and so on.
+
+210
+00:14:56,000 --> 00:15:00,000
+You can just start typing any and look at the other suggestion.
+
+211
+00:15:00,000 --> 00:15:06,000
+The important thing you have to remember here is that it is impossible to use arguments marchers for
+
+212
+00:15:06,000 --> 00:15:07,000
+only few arguments.
+
+213
+00:15:07,000 --> 00:15:12,000
+If you use arguments much for one argument, then you have to use it for all arguments.
+
+214
+00:15:13,000 --> 00:15:19,000
+For example, in case you want to stop Massett invocation with specifying real client object and argument,
+
+215
+00:15:19,000 --> 00:15:23,000
+much of a template marketable through an exception you can check.
+
+216
+00:15:24,000 --> 00:15:29,000
+But what to do in case you want to use specific first argument and any argument of compatible type for
+
+217
+00:15:29,000 --> 00:15:30,000
+the second argument.
+
+218
+00:15:31,000 --> 00:15:36,000
+In this case, you have to use equal argument moccia in case you execute this statement.
+
+219
+00:15:36,000 --> 00:15:37,000
+It will work as expected.
+
+220
+00:15:38,000 --> 00:15:42,000
+Just pass objects that you want to use for equality verification.
+
+221
+00:15:42,000 --> 00:15:43,000
+And that's it.
+
+222
+00:15:43,000 --> 00:15:44,000
+That was easy.
+
+223
+00:15:44,000 --> 00:15:45,000
+I agree.
+
+224
+00:15:46,000 --> 00:15:51,000
+Also, Makita provides other marchers like is a that takes some classes.
+
+225
+00:15:51,000 --> 00:15:54,000
+An argument is now is not null marches.
+
+226
+00:15:54,000 --> 00:15:57,000
+That takes regular expression as an argument.
+
+227
+00:15:57,000 --> 00:15:58,000
+Is that clear.
+
+228
+00:15:58,000 --> 00:16:04,000
+A lot of marches are self-described Mezquita developers did a great job by providing us with a library
+
+229
+00:16:04,000 --> 00:16:06,000
+that can help us to create readable tests.
+
+230
+00:16:07,000 --> 00:16:13,000
+Are the important things to remember is that you can't use argument marchers as a return on values and
+
+231
+00:16:13,000 --> 00:16:15,000
+exact value is required here.
+
+232
+00:16:15,000 --> 00:16:20,000
+And also you can't use argument much outside of verification or STEINMANN.
+
+233
+00:16:20,000 --> 00:16:25,000
+That is the raftis argument marchers were often in the past.
+
+234
+00:16:25,000 --> 00:16:31,000
+My personal opinion is that in the case you use argument marcha in your test, that means you don't
+
+235
+00:16:31,000 --> 00:16:33,000
+care about arguments for this specific test case.
+
+236
+00:16:34,000 --> 00:16:37,000
+My personal opinion, again, this is ridiculous.
+
+237
+00:16:37,000 --> 00:16:42,000
+In case you don't care about arguments in your test case, then why you should care about this test
+
+238
+00:16:42,000 --> 00:16:43,000
+at all.
+
+239
+00:16:43,000 --> 00:16:44,000
+Just remove it.
+
+240
+00:16:44,000 --> 00:16:45,000
+It doesn't matter.
+
+241
+00:16:45,000 --> 00:16:52,000
+Well, using marchers is so popular across developers, I can't hide my misunderstanding of using them
+
+242
+00:16:52,000 --> 00:16:57,000
+because in the test I want to make sure that I control my test flow from the beginning to the end,
+
+243
+00:16:58,000 --> 00:17:04,000
+including all arguments that my impact on behavior of my unit or on interaction between my units.
+
+244
+00:17:04,000 --> 00:17:09,000
+So it is up to you as a to use argument munchers and my case a test and how often to use them.
+
+245
+00:17:09,000 --> 00:17:14,000
+But you know, my opinion, OK, probably this is time to move to our next test.
+
+246
+00:17:15,000 --> 00:17:20,000
+Now, I want to test it in case for some reason, Template Engine will throw a legal argument exception
+
+247
+00:17:20,000 --> 00:17:23,000
+send message method won't be executed till the end.
+
+248
+00:17:23,000 --> 00:17:24,000
+How to verify this?
+
+249
+00:17:25,000 --> 00:17:29,000
+I already have template engine mock injected into my messenger object.
+
+250
+00:17:29,000 --> 00:17:34,000
+So the only thing I have to do now is to stop, prepare a message and make sure that it was through.
+
+251
+00:17:34,000 --> 00:17:35,000
+And the legal argument exception.
+
+252
+00:17:35,000 --> 00:17:39,000
+When I work, prepare a message, my assertion will test that.
+
+253
+00:17:39,000 --> 00:17:43,000
+The legal argument exception is from when I call prepare a message.
+
+254
+00:17:43,000 --> 00:17:50,000
+This test shows us that in case error happens in template engine, then messenger wouldn't work too.
+
+255
+00:17:50,000 --> 00:17:53,000
+And we can't successfully verify this interaction.
+
+256
+00:17:53,000 --> 00:17:56,000
+Now, one of the most interesting tests.
+
+257
+00:17:56,000 --> 00:17:57,000
+Let's now test and even.
+
+258
+00:17:58,000 --> 00:18:04,000
+It was created instant message Macit, I want to be sure that client's email address is set to email
+
+259
+00:18:04,000 --> 00:18:12,000
+object and underseas is correct, but not just a random one, but how I would tell this if email object
+
+260
+00:18:12,000 --> 00:18:18,000
+is created inside the send message, how to get access to it to provide us with amazing tools, that
+
+261
+00:18:18,000 --> 00:18:19,000
+is called argument.
+
+262
+00:18:19,000 --> 00:18:25,000
+Capturing this tool allows us to capture arguments that was passed during the massive invocation and
+
+263
+00:18:25,000 --> 00:18:27,000
+after that to be able to verify its state.
+
+264
+00:18:28,000 --> 00:18:29,000
+Let me show you how to do this.
+
+265
+00:18:30,000 --> 00:18:34,000
+The first thing we have to do is to declare a field of special type in our test.
+
+266
+00:18:34,000 --> 00:18:37,000
+This type is called argument capture.
+
+267
+00:18:37,000 --> 00:18:41,000
+It is parametrized by the type that we want to capture in the argument.
+
+268
+00:18:42,000 --> 00:18:47,000
+And that's the important thing here, is to use special annotation to tell Makita that this is an object
+
+269
+00:18:47,000 --> 00:18:48,000
+that will capture arguments.
+
+270
+00:18:49,000 --> 00:18:52,000
+And you can see I have capture annotation here.
+
+271
+00:18:52,000 --> 00:18:57,000
+Now we are going to proceed the first part of this test we have already discussed.
+
+272
+00:18:57,000 --> 00:18:59,000
+Let's focus on the assertion part.
+
+273
+00:18:59,000 --> 00:19:06,000
+I also verify that message was invoked and after that I will fight that sent method of mail server object
+
+274
+00:19:06,000 --> 00:19:07,000
+was called.
+
+275
+00:19:07,000 --> 00:19:14,000
+And instead of parsing arguments much easier, I object of my capture and kill capture method so that
+
+276
+00:19:14,000 --> 00:19:19,000
+it could capture arguments that was passed to this method during the runtime.
+
+277
+00:19:19,000 --> 00:19:26,000
+After a captured argument, I can extract the value from my capture my colon, get value Massett and
+
+278
+00:19:26,000 --> 00:19:27,000
+that's it.
+
+279
+00:19:27,000 --> 00:19:33,000
+Now I have reference to email object that was created inside the method and I can get and receive from
+
+280
+00:19:33,000 --> 00:19:39,000
+this object and compare it was expected value and expect its value would be clients.
+
+281
+00:19:39,000 --> 00:19:39,000
+Email.
+
+282
+00:19:40,000 --> 00:19:42,000
+How do you feel the like Makita.
+
+283
+00:19:42,000 --> 00:19:45,000
+I'm glad that we started this topic with you.
+
+284
+00:19:45,000 --> 00:19:51,000
+We still have a lot of things to learn, including advanced McKetta features, but I suggest to call
+
+285
+00:19:51,000 --> 00:19:53,000
+it today and proceed in the next lesson.
+
+286
+00:19:54,000 --> 00:19:57,000
+Right now, let's recap what we have learned today.
+
+287
+00:19:57,000 --> 00:19:58,000
+In this lesson.
+
+288
+00:19:58,000 --> 00:20:04,000
+We learned what Markkula Library is and why we need it and in which cases we can figure it out.
+
+289
+00:20:04,000 --> 00:20:07,000
+Development environment to be able to use Makita.
+
+290
+00:20:07,000 --> 00:20:09,000
+You learned all necessary libraries.
+
+291
+00:20:09,000 --> 00:20:12,000
+You have to add to your project to use Marketo features.
+
+292
+00:20:12,000 --> 00:20:15,000
+Now you know how to use Marketo extension for your unit.
+
+293
+00:20:16,000 --> 00:20:20,000
+I showed you how to create Mok's in your test and verify their behavior.
+
+294
+00:20:20,000 --> 00:20:26,000
+With the help of tutor on real life examples, you saw how to inject more to our test instance.
+
+295
+00:20:26,000 --> 00:20:32,000
+Also, you learned how to use different argument matchers and at the end of the lesson you saw how to
+
+296
+00:20:32,000 --> 00:20:37,000
+use argument capture to capture arguments that are to our marks during the runtime.
+
+297
+00:20:37,000 --> 00:20:38,000
+That's it for today.
+
+298
+00:20:39,000 --> 00:20:40,000
+Thanks a lot for your attention.
+
+299
+00:20:40,000 --> 00:20:43,000
+Have a great day and see you in the next lesson.
+
diff --git a/35 - Integration testing & Mockito/002 Mockito-JUnit-Jupiter.url b/35 - Integration testing & Mockito/002 Mockito-JUnit-Jupiter.url
new file mode 100644
index 0000000000000000000000000000000000000000..a0a573a618be8ec2e9530d26d45ef5d1b45005d0
--- /dev/null
+++ b/35 - Integration testing & Mockito/002 Mockito-JUnit-Jupiter.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter/3.7.7
\ No newline at end of file
diff --git a/35 - Integration testing & Mockito/002 Mockito-core-library.url b/35 - Integration testing & Mockito/002 Mockito-core-library.url
new file mode 100644
index 0000000000000000000000000000000000000000..4090ca2c0ab0ce993073896e17cb3918287c528a
--- /dev/null
+++ b/35 - Integration testing & Mockito/002 Mockito-core-library.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.mockito/mockito-core/3.7.7
\ No newline at end of file
diff --git a/35 - Integration testing & Mockito/002 Objenesis-library.url b/35 - Integration testing & Mockito/002 Objenesis-library.url
new file mode 100644
index 0000000000000000000000000000000000000000..98b215ae352ab7a0548624faa842191bf8506603
--- /dev/null
+++ b/35 - Integration testing & Mockito/002 Objenesis-library.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.objenesis/objenesis/3.1
\ No newline at end of file
diff --git a/35 - Integration testing & Mockito/002 Source-code-of-Mockito-test.url b/35 - Integration testing & Mockito/002 Source-code-of-Mockito-test.url
new file mode 100644
index 0000000000000000000000000000000000000000..e2dcb79f3ec107fc61ac7408e037780e5b8a8027
--- /dev/null
+++ b/35 - Integration testing & Mockito/002 Source-code-of-Mockito-test.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/mockito/MessengerTest.java
\ No newline at end of file
diff --git a/35 - Integration testing & Mockito/002 Source-code-of-original-code.url b/35 - Integration testing & Mockito/002 Source-code-of-original-code.url
new file mode 100644
index 0000000000000000000000000000000000000000..f816175295080c0068c57254a630530b832f5fec
--- /dev/null
+++ b/35 - Integration testing & Mockito/002 Source-code-of-original-code.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/mockito
\ No newline at end of file
diff --git a/35 - Integration testing & Mockito/003 Mockito Part 2_en.srt b/35 - Integration testing & Mockito/003 Mockito Part 2_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..5b5862c3332e166271f93470025e834233486279
--- /dev/null
+++ b/35 - Integration testing & Mockito/003 Mockito Part 2_en.srt
@@ -0,0 +1,1012 @@
+1
+00:00:05,000 --> 00:00:06,000
+Hello.
+
+2
+00:00:06,000 --> 00:00:11,000
+Yes, since the day we learned my in the library, I'm going to show you advanced features of Makita.
+
+3
+00:00:11,000 --> 00:00:15,000
+In this lesson, we'll learn how to verify my asset allocation order.
+
+4
+00:00:15,000 --> 00:00:20,000
+Also, I'll show you how you can check number of Macedonia locations on AMOC.
+
+5
+00:00:20,000 --> 00:00:26,000
+During the lesson, you will see how you can verify that there were no any unverified interactions with
+
+6
+00:00:26,000 --> 00:00:31,000
+your mom and make this part of your verification logic on real examples.
+
+7
+00:00:31,000 --> 00:00:37,000
+I will show you how you can call a real method on the object will review different policies on mock
+
+8
+00:00:37,000 --> 00:00:38,000
+answers.
+
+9
+00:00:38,000 --> 00:00:42,000
+Take into account that in this lesson we already learned market watchers.
+
+10
+00:00:43,000 --> 00:00:46,000
+I will show you additional measures that you can use in your tests.
+
+11
+00:00:46,000 --> 00:00:52,000
+Important things that we are going to learn today is how to verify what methods and methods that don't
+
+12
+00:00:52,000 --> 00:00:57,000
+have any returned value, how we can set behavior for these methods.
+
+13
+00:00:57,000 --> 00:01:01,000
+We will talk about market limitations and what marketers can do.
+
+14
+00:01:01,000 --> 00:01:07,000
+And at the end of the lesson, I will show you how to work with spy objects in McKetta and learn new
+
+15
+00:01:07,000 --> 00:01:08,000
+things.
+
+16
+00:01:08,000 --> 00:01:10,000
+Let's get back to clips to our test.
+
+17
+00:01:11,000 --> 00:01:13,000
+Here is the same test that we used in the past.
+
+18
+00:01:13,000 --> 00:01:18,000
+Number one, I will add additional verifications here to show you additional features of McKetta.
+
+19
+00:01:19,000 --> 00:01:26,000
+Imagine that you want to verify that after I call send message, then prepare a message and send a message
+
+20
+00:01:26,000 --> 00:01:33,000
+that will be invoked only once just to double check that I will not send email twice how to test this
+
+21
+00:01:33,000 --> 00:01:36,000
+inside the verify message we can pass second argument.
+
+22
+00:01:37,000 --> 00:01:42,000
+The second argument will describe a number of invocations that you expect to have on this mock.
+
+23
+00:01:42,000 --> 00:01:46,000
+You can see example here just right times.
+
+24
+00:01:46,000 --> 00:01:52,000
+Macit inside times Massud specify how much times you expect this message to be invoked.
+
+25
+00:01:52,000 --> 00:01:57,000
+Also, you have other methods to specify expected number of methods and locations.
+
+26
+00:01:57,000 --> 00:01:59,000
+You can use method at least once.
+
+27
+00:02:00,000 --> 00:02:06,000
+Actually, this method is more for visibility purposes because in case you would not use this method,
+
+28
+00:02:06,000 --> 00:02:11,000
+your verification would pass only in case method was invoked at least once.
+
+29
+00:02:11,000 --> 00:02:16,000
+So it is up to you whether you want to use this method for increasing visibility.
+
+30
+00:02:16,000 --> 00:02:22,000
+Also, you have Masset at least to specify minimum number of times the method was invoked.
+
+31
+00:02:22,000 --> 00:02:28,000
+Also, you have method at most specify maximum number of times method was invoked.
+
+32
+00:02:29,000 --> 00:02:35,000
+There might be cases when in the test scenario you would like to verify that method was not invoked.
+
+33
+00:02:36,000 --> 00:02:39,000
+To verify this, you can call never method.
+
+34
+00:02:39,000 --> 00:02:44,000
+And this verification will pass only in case this method was not invoked during the test execution.
+
+35
+00:02:45,000 --> 00:02:47,000
+That is not the case that we have here.
+
+36
+00:02:47,000 --> 00:02:51,000
+That is why in this particular case, this verification will fail.
+
+37
+00:02:51,000 --> 00:02:53,000
+But hope you got the point.
+
+38
+00:02:53,000 --> 00:02:54,000
+Is it clear?
+
+39
+00:02:55,000 --> 00:02:56,000
+Let's move on now.
+
+40
+00:02:57,000 --> 00:02:59,000
+I would like to show you how you can test that.
+
+41
+00:02:59,000 --> 00:03:02,000
+Methods were invoked in the exactly the sequence.
+
+42
+00:03:02,000 --> 00:03:04,000
+They should be invoked.
+
+43
+00:03:04,000 --> 00:03:10,000
+Makita provides us with a specific object that can verify methods and location in the specific order
+
+44
+00:03:11,000 --> 00:03:12,000
+using in order method.
+
+45
+00:03:12,000 --> 00:03:14,000
+I can pass marks that I want to verify.
+
+46
+00:03:15,000 --> 00:03:17,000
+I can pass either one or multiple marks.
+
+47
+00:03:18,000 --> 00:03:23,000
+Now, when I told Makita to track these marks, I can call verify method on this object.
+
+48
+00:03:23,000 --> 00:03:31,000
+Here you can see an example I write in order and after that call verify method in case we would call
+
+49
+00:03:31,000 --> 00:03:38,000
+verify method first on May seven mock our test will fail because the sequence of expected execution
+
+50
+00:03:38,000 --> 00:03:40,000
+is not the sequence of actual test execution.
+
+51
+00:03:41,000 --> 00:03:43,000
+To be honest, I really like this feature.
+
+52
+00:03:44,000 --> 00:03:44,000
+Why?
+
+53
+00:03:44,000 --> 00:03:47,000
+Because this test can be turned in.
+
+54
+00:03:47,000 --> 00:03:48,000
+Read much easier.
+
+55
+00:03:49,000 --> 00:03:50,000
+Why is this is good?
+
+56
+00:03:50,000 --> 00:03:58,000
+Because the goal of our tests is to be sure that code that is written exactly in this way produce exactly
+
+57
+00:03:58,000 --> 00:04:05,000
+this result in case if I send a message first and after that prepare an email, the logic is not correct
+
+58
+00:04:05,000 --> 00:04:08,000
+and that is not what I expect my code doing.
+
+59
+00:04:08,000 --> 00:04:14,000
+That is why I believe that order of invocation of my masses is part of the application logic.
+
+60
+00:04:15,000 --> 00:04:22,000
+I think it is not enough just to verify that message was invoked and after that email was sent, in
+
+61
+00:04:22,000 --> 00:04:27,000
+my opinion, it is also useful to verify the sequence of methods invocation.
+
+62
+00:04:27,000 --> 00:04:32,000
+While this example was prepare an email template and send an email is clear and obvious.
+
+63
+00:04:33,000 --> 00:04:35,000
+That would be not always the case.
+
+64
+00:04:35,000 --> 00:04:37,000
+OK, let's continue.
+
+65
+00:04:37,000 --> 00:04:44,000
+Imagine that your mock invoked different methods, but for some reasons you missed that and you didn't
+
+66
+00:04:44,000 --> 00:04:46,000
+verify all mass shooting locations.
+
+67
+00:04:46,000 --> 00:04:52,000
+For example, imagine that you didn't verify all method calls in case we wouldn't come on this line
+
+68
+00:04:52,000 --> 00:04:58,000
+and we'll invoke the method on the mark that we will not verify how great a new method that is called
+
+69
+00:04:58,000 --> 00:04:59,000
+invalid template.
+
+70
+00:04:59,000 --> 00:05:03,000
+Just for the sake of example, I invoked it here and after that we.
+
+71
+00:05:04,000 --> 00:05:05,000
+Verify.
+
+72
+00:05:05,000 --> 00:05:08,000
+No more interactions, Macit, we'll get failer.
+
+73
+00:05:09,000 --> 00:05:15,000
+So this example shows us the main goal of the Macit and in verifying no more interactions Masset the
+
+74
+00:05:15,000 --> 00:05:19,000
+goal is to check if any given Moggs has any and verified interaction.
+
+75
+00:05:20,000 --> 00:05:22,000
+One more interesting thing to know about Mock's.
+
+76
+00:05:23,000 --> 00:05:27,000
+By default, all Morgus returns the default value of the returned type.
+
+77
+00:05:27,000 --> 00:05:32,000
+For example, if Massoud returns drink, then Marcellin location on the mark will return.
+
+78
+00:05:32,000 --> 00:05:37,000
+Not because now is default value for all reference types.
+
+79
+00:05:37,000 --> 00:05:43,000
+That is because smok object is a specific object that has compatible type with the real type.
+
+80
+00:05:43,000 --> 00:05:47,000
+And imagine that you want to stop some, but not all of them.
+
+81
+00:05:47,000 --> 00:05:51,000
+You would like that some methods would work as in the real object.
+
+82
+00:05:51,000 --> 00:05:53,000
+And here's an example.
+
+83
+00:05:53,000 --> 00:05:56,000
+In the first case, will print now to console.
+
+84
+00:05:56,000 --> 00:06:02,000
+And in the next case, I want to say that when I will invoke Mastodon's AMOC object, the real method
+
+85
+00:06:02,000 --> 00:06:04,000
+of that object will be invoked.
+
+86
+00:06:04,000 --> 00:06:10,000
+So in this example, when I will invoke prepare message, some template will be printed to console.
+
+87
+00:06:11,000 --> 00:06:16,000
+That is because implementation of real object returns such string I want you after the lesson would
+
+88
+00:06:16,000 --> 00:06:22,000
+investigate the source code and run this code, including the commanded lines, just uncommon them and
+
+89
+00:06:22,000 --> 00:06:23,000
+executes the code.
+
+90
+00:06:23,000 --> 00:06:26,000
+This will help you to get better understanding of the topic.
+
+91
+00:06:27,000 --> 00:06:33,000
+As usual, I will leave links to the source code in the attachments to the lesson, so hope this approach
+
+92
+00:06:33,000 --> 00:06:35,000
+would help you sometime in the future.
+
+93
+00:06:35,000 --> 00:06:37,000
+Let me show you a few more tricks.
+
+94
+00:06:37,000 --> 00:06:41,000
+Was Kid to understand the next feature of Marquita?
+
+95
+00:06:41,000 --> 00:06:46,000
+Let me explain what improvements I did to our code to show you the next example.
+
+96
+00:06:46,000 --> 00:06:48,000
+Imagine that email server.
+
+97
+00:06:48,000 --> 00:06:51,000
+We have a new field of type data.
+
+98
+00:06:51,000 --> 00:06:57,000
+The goal of this type is to validate email before Cendon and through a legal argument exception in case
+
+99
+00:06:57,000 --> 00:07:01,000
+email is not valid, for example, doesn't contain all necessary fields.
+
+100
+00:07:02,000 --> 00:07:07,000
+Sometimes you just need to pass the result of massive invocation to another method.
+
+101
+00:07:07,000 --> 00:07:14,000
+But in fact, you're not always bothering about all list of arguments, probably in some specific test
+
+102
+00:07:14,000 --> 00:07:20,000
+case you E-Verify only one scenario where other arguments are not critical, but you have to use arguments
+
+103
+00:07:20,000 --> 00:07:22,000
+because compiler wants you to do so.
+
+104
+00:07:22,000 --> 00:07:28,000
+What will happen in case I will get this field in my stop and I will pass it, for example, to another
+
+105
+00:07:28,000 --> 00:07:35,000
+method and it will be used to invoke some methods on this object lowpoint.
+
+106
+00:07:35,000 --> 00:07:39,000
+The exception will be thrown in the line where I call validate method.
+
+107
+00:07:39,000 --> 00:07:46,000
+I created the object of my mock, but I didn't create object of my other data and didn't inject into
+
+108
+00:07:46,000 --> 00:07:49,000
+email server how to avoid this Northpoint exception.
+
+109
+00:07:50,000 --> 00:07:57,000
+Well, the first option is to inject all possible marks inside, but sometimes it might be extremely
+
+110
+00:07:57,000 --> 00:08:03,000
+complicated because you might have multiple fields and those fields in turn also have inner fields and
+
+111
+00:08:03,000 --> 00:08:04,000
+so on and so forth.
+
+112
+00:08:05,000 --> 00:08:12,000
+This can make you declare hundreds of Moncks or just Dommy objects to make sure that test can be executed
+
+113
+00:08:12,000 --> 00:08:13,000
+with one tool.
+
+114
+00:08:13,000 --> 00:08:18,000
+In case we want to simplify things, McKetta allows us to return deep stop.
+
+115
+00:08:18,000 --> 00:08:25,000
+That means that all fields inside our Morgus will be also stopped with dummy objects and will return
+
+116
+00:08:25,000 --> 00:08:26,000
+default values.
+
+117
+00:08:27,000 --> 00:08:31,000
+But at least I will not get nonpoint exception in the line with my other data.
+
+118
+00:08:32,000 --> 00:08:38,000
+To make DB stop, you have to do the next things near the mock annotation and answer key and make it
+
+119
+00:08:38,000 --> 00:08:40,000
+equal to a constant from answers.
+
+120
+00:08:40,000 --> 00:08:44,000
+Enum I used DB stop after this.
+
+121
+00:08:44,000 --> 00:08:51,000
+I can call test method again and I will not get Northpoint exception anymore because every time I will
+
+122
+00:08:51,000 --> 00:08:54,000
+call MassArt on my mark I will get an object in return.
+
+123
+00:08:55,000 --> 00:09:04,000
+There also are the answers Zaya calls real Mazur's returns the false returns marks rechannel self rechannel
+
+124
+00:09:04,000 --> 00:09:04,000
+smart.
+
+125
+00:09:04,000 --> 00:09:10,000
+Nahles I believe that other answers ourselves describing you can use different answers on your mogg
+
+126
+00:09:11,000 --> 00:09:13,000
+based on the specifics of your test.
+
+127
+00:09:13,000 --> 00:09:19,000
+But again, instead of using Orta answer, I would prefer to set behavior to each specific Mogk manually.
+
+128
+00:09:20,000 --> 00:09:26,000
+For example, if I want this object to return valid data, I would rather stab this method and would
+
+129
+00:09:26,000 --> 00:09:32,000
+create another data object here in test because I one of the AFT control over everything what is happening
+
+130
+00:09:32,000 --> 00:09:33,000
+inside the test.
+
+131
+00:09:33,000 --> 00:09:40,000
+And I will not rely only on auto generated answers, but still programming like everything else, is
+
+132
+00:09:40,000 --> 00:09:41,000
+a question of tradeoffs.
+
+133
+00:09:42,000 --> 00:09:48,000
+You can evaluate complexity of certain behavior for all the chain of invocations and stubborn answers
+
+134
+00:09:48,000 --> 00:09:52,000
+with default answers and then decide what works better for your solution.
+
+135
+00:09:53,000 --> 00:09:56,000
+Now, when we learned this, let's proceed.
+
+136
+00:09:56,000 --> 00:10:03,000
+In previous lesson, we learned the core argument matchers, but also another group of marchers where
+
+137
+00:10:03,000 --> 00:10:03,000
+they allocated.
+
+138
+00:10:04,000 --> 00:10:10,000
+They're located in glass additional matchers in our example, I made the static impact from this glass.
+
+139
+00:10:10,000 --> 00:10:17,000
+Imagine that we have more of these type and you can see that I can create more based on the interfaces
+
+140
+00:10:17,000 --> 00:10:18,000
+and I won't stop myself.
+
+141
+00:10:18,000 --> 00:10:26,000
+And said the behavior in this case, in case I will get massaged with index, is equal to one or two.
+
+142
+00:10:26,000 --> 00:10:32,000
+Then I will return more string and in case I will invoke get MassArt with any index that is greater
+
+143
+00:10:32,000 --> 00:10:35,000
+than true, then will throw an exception.
+
+144
+00:10:35,000 --> 00:10:42,000
+That's how easily you can use argument marchers to set a behavior for a range of values in case will
+
+145
+00:10:42,000 --> 00:10:43,000
+print result to consult.
+
+146
+00:10:43,000 --> 00:10:49,000
+We are going to see more in the first two lines and in the third line will get onetime exception.
+
+147
+00:10:50,000 --> 00:10:51,000
+Does it make sense?
+
+148
+00:10:51,000 --> 00:10:53,000
+There are also a lot of other arguments.
+
+149
+00:10:53,000 --> 00:10:55,000
+Marchers from their names.
+
+150
+00:10:55,000 --> 00:11:05,000
+You easily understand what they verify, not less than less than or equal to greater than greater than
+
+151
+00:11:05,000 --> 00:11:07,000
+or equal to find.
+
+152
+00:11:07,000 --> 00:11:13,000
+That takes rejects as an argument you already know, equal much in the additional munchers package.
+
+153
+00:11:13,000 --> 00:11:17,000
+We have equal Monsur for float and double comparable equality.
+
+154
+00:11:17,000 --> 00:11:21,000
+Our equality and and my argument.
+
+155
+00:11:22,000 --> 00:11:24,000
+Feel free to use this matchers whenever you need.
+
+156
+00:11:24,000 --> 00:11:27,000
+Based on the logic of your test, Hobbs's is clear.
+
+157
+00:11:28,000 --> 00:11:30,000
+Let me explain you the next thing.
+
+158
+00:11:30,000 --> 00:11:32,000
+But this moment was said.
+
+159
+00:11:32,000 --> 00:11:35,000
+Be here for the masses that return at least some value.
+
+160
+00:11:36,000 --> 00:11:41,000
+We substitute values that should be returned with the one we want to be returned.
+
+161
+00:11:41,000 --> 00:11:47,000
+But if we need to set behavior of the word masters's returns nassan what to do in this case?
+
+162
+00:11:47,000 --> 00:11:51,000
+Let me show you how to work with what methods in market you can pass.
+
+163
+00:11:51,000 --> 00:11:57,000
+Macit invocation on Mark was one method so this line won't be even compiled.
+
+164
+00:11:58,000 --> 00:12:04,000
+You can't pass Mathemagician on Marqués when method, so this line won't be even compiled.
+
+165
+00:12:05,000 --> 00:12:06,000
+What to do instead.
+
+166
+00:12:07,000 --> 00:12:13,000
+Instead, we are going to use an next construction do throw here will specify type of exceptions that
+
+167
+00:12:13,000 --> 00:12:14,000
+we would like to throw.
+
+168
+00:12:14,000 --> 00:12:17,000
+After that I call one method and pass mark there.
+
+169
+00:12:18,000 --> 00:12:19,000
+But pay attention.
+
+170
+00:12:19,000 --> 00:12:21,000
+This is different when MassArt.
+
+171
+00:12:21,000 --> 00:12:25,000
+This is one method of type sterba that is rechanneled by the throat method.
+
+172
+00:12:26,000 --> 00:12:30,000
+The interesting thing is that I don't call method on lockyear.
+
+173
+00:12:30,000 --> 00:12:34,000
+Instead I call method after this method invocation.
+
+174
+00:12:34,000 --> 00:12:38,000
+So that is constructions that we have by default.
+
+175
+00:12:38,000 --> 00:12:41,000
+What method in marks will do nothing.
+
+176
+00:12:41,000 --> 00:12:46,000
+But in case would like to get your argument that was passed to the mortgage and asset allocation.
+
+177
+00:12:46,000 --> 00:12:54,000
+We can use the next construction, do nothing when possible here and after that call method to his capture.
+
+178
+00:12:54,000 --> 00:12:59,000
+By the way, here you can see one more way of initialization of argument capture.
+
+179
+00:13:00,000 --> 00:13:02,000
+Also, we can override method execution.
+
+180
+00:13:03,000 --> 00:13:09,000
+We can use the answer Massett and pass Lambda expression, the argument will be our message invocation
+
+181
+00:13:10,000 --> 00:13:16,000
+and inside the function I can extract arguments by the indices and inside the mass that you can perform
+
+182
+00:13:16,000 --> 00:13:18,000
+any assertions you would like.
+
+183
+00:13:18,000 --> 00:13:24,000
+In this particular case, I want to show you that when I look at my state was index me and the string,
+
+184
+00:13:24,000 --> 00:13:29,000
+I can extract them from the method and location object and Moines's.
+
+185
+00:13:29,000 --> 00:13:32,000
+You can use the information as you wish, depending on the test.
+
+186
+00:13:32,000 --> 00:13:38,000
+Logic is a clear hopital is any way you can look at the source code.
+
+187
+00:13:38,000 --> 00:13:42,000
+And I always happy to answer your questions in case something is still unclear.
+
+188
+00:13:42,000 --> 00:13:45,000
+Let's continue there a few minutes with Makita.
+
+189
+00:13:45,000 --> 00:13:50,000
+Let me share with you a few but the most interesting limitations of Makita library.
+
+190
+00:13:51,000 --> 00:13:58,000
+We can't monck final classes and we can't set behavior to static masses on this example.
+
+191
+00:13:58,000 --> 00:14:00,000
+You can see how I tried to Moncks during class.
+
+192
+00:14:00,000 --> 00:14:06,000
+If you remember, String is a final class and can be extended or overeaten.
+
+193
+00:14:06,000 --> 00:14:14,000
+Also, you can't set a behavior for static masses no matter how would you try my the library can't do
+
+194
+00:14:14,000 --> 00:14:14,000
+that.
+
+195
+00:14:14,000 --> 00:14:18,000
+Besides that, we can't mock equals and hedgcock methods.
+
+196
+00:14:19,000 --> 00:14:22,000
+These are the most important limitations of market in my opinion.
+
+197
+00:14:23,000 --> 00:14:29,000
+Later this we are going to learn with your power Molk library that will help us to deal with some McKetta
+
+198
+00:14:29,000 --> 00:14:30,000
+limitations.
+
+199
+00:14:30,000 --> 00:14:35,000
+And the last thing for the day that I would like to discuss with you is Spy Objects, How to create
+
+200
+00:14:35,000 --> 00:14:36,000
+spy.
+
+201
+00:14:36,000 --> 00:14:39,000
+Very similar to the way we can create moch.
+
+202
+00:14:39,000 --> 00:14:45,000
+We can declare a field in our test class whispy annotation, and after that we should easier to use
+
+203
+00:14:45,000 --> 00:14:47,000
+Marketo extension.
+
+204
+00:14:47,000 --> 00:14:50,000
+Oh, call it need marks Masset from Makita annotations class.
+
+205
+00:14:50,000 --> 00:14:54,000
+Pay attention that spies I just gropers above real objects.
+
+206
+00:14:54,000 --> 00:15:00,000
+You can create spies only based on the concrete classes but not abstract and interfaces.
+
+207
+00:15:01,000 --> 00:15:03,000
+So I specify concrete class name here.
+
+208
+00:15:04,000 --> 00:15:10,000
+Another way to create spy is to call spy MassArt from McKetta class and pass reference to the object.
+
+209
+00:15:11,000 --> 00:15:16,000
+Here you can see that I could at least object and after that I call Spy Masset and pass the reference
+
+210
+00:15:16,000 --> 00:15:17,000
+to the least object.
+
+211
+00:15:18,000 --> 00:15:22,000
+Now I want to define behavior of that method with zero index.
+
+212
+00:15:23,000 --> 00:15:29,000
+It looks fine to you the first glance, but when I will execute this code, this line will throw out
+
+213
+00:15:29,000 --> 00:15:36,000
+of bounds exception because here I call Masset on real object and our list is empty.
+
+214
+00:15:36,000 --> 00:15:41,000
+That's why it can't extract value from zero index on Macedonia.
+
+215
+00:15:41,000 --> 00:15:47,000
+Occasions on spy objects are delegated to real objects unless you specify it in another way.
+
+216
+00:15:47,000 --> 00:15:50,000
+But how we can set behave that a spy.
+
+217
+00:15:50,000 --> 00:15:52,000
+Then there is another construction.
+
+218
+00:15:52,000 --> 00:15:57,000
+For that I write the return and tell what I would like to be returned.
+
+219
+00:15:57,000 --> 00:16:04,000
+After that I call when method and pass the reference to my spy object and after that I call method that
+
+220
+00:16:04,000 --> 00:16:11,000
+I would call this construction eliminates direct message communication on the spy object you see.
+
+221
+00:16:11,000 --> 00:16:17,000
+And in this case when I will call get method with zero index, I will get the value that I expected
+
+222
+00:16:18,000 --> 00:16:19,000
+the same as it was marks.
+
+223
+00:16:20,000 --> 00:16:26,000
+I can verify my behavior on spy objects, I can verify Masset, and after that I can use all methods,
+
+224
+00:16:26,000 --> 00:16:33,000
+matchers, captures, like we used was Mosse, how to choose, when to use spy and when to use marks.
+
+225
+00:16:33,000 --> 00:16:34,000
+The answer is simple.
+
+226
+00:16:35,000 --> 00:16:39,000
+In case you don't think you need spy, use mock as usual.
+
+227
+00:16:39,000 --> 00:16:42,000
+It is crystal clear when you need spy in your test.
+
+228
+00:16:42,000 --> 00:16:44,000
+So create marked by default.
+
+229
+00:16:44,000 --> 00:16:50,000
+And in case you would need spy object, you will understand that during the testing we would like to
+
+230
+00:16:50,000 --> 00:16:51,000
+create spy object one.
+
+231
+00:16:51,000 --> 00:16:58,000
+We don't want to mock all possible methods and indeed we need some methods to work as are implemented
+
+232
+00:16:58,000 --> 00:16:59,000
+by default.
+
+233
+00:16:59,000 --> 00:17:04,000
+That is some kind of fake object that behaves almost like a regional one.
+
+234
+00:17:04,000 --> 00:17:10,000
+And also you can verify the on spy object, but you can't do this on real object.
+
+235
+00:17:11,000 --> 00:17:12,000
+That's it.
+
+236
+00:17:12,000 --> 00:17:15,000
+That's all what I want to discuss with you in this lesson.
+
+237
+00:17:15,000 --> 00:17:17,000
+Let's recap what we have learned today.
+
+238
+00:17:18,000 --> 00:17:21,000
+In this lesson, we learned how to verify invocation order.
+
+239
+00:17:22,000 --> 00:17:25,000
+Also, we learned advanced Makita features, for example.
+
+240
+00:17:25,000 --> 00:17:27,000
+Now you know how to check.
+
+241
+00:17:27,000 --> 00:17:33,000
+That message was invoked specific number of times, what was never called at all and how you can verify
+
+242
+00:17:33,000 --> 00:17:34,000
+the behavior of what methods.
+
+243
+00:17:34,000 --> 00:17:36,000
+And in case message returns, nothing.
+
+244
+00:17:37,000 --> 00:17:43,000
+We learned different answers, policies, and I showed you how to create deep stops on the most unreal
+
+245
+00:17:43,000 --> 00:17:43,000
+example.
+
+246
+00:17:43,000 --> 00:17:49,000
+I showed you how you can call real Masset on the mark in case you need to call specific method for the
+
+247
+00:17:49,000 --> 00:17:49,000
+sake of the test.
+
+248
+00:17:50,000 --> 00:17:54,000
+Also today, we learned additional matches that you can use in method invocation.
+
+249
+00:17:54,000 --> 00:18:00,000
+During the testing, we talked to much the limitations and you know what Marquita can't do.
+
+250
+00:18:01,000 --> 00:18:02,000
+And at the end of the lesson.
+
+251
+00:18:02,000 --> 00:18:10,000
+We learned how to work with spies and specifics of spy behavior configuration, that's all for today.
+
+252
+00:18:10,000 --> 00:18:11,000
+Thanks a lot for your attention.
+
+253
+00:18:11,000 --> 00:18:13,000
+See you in the next lesson.
+
diff --git a/35 - Integration testing & Mockito/003 Source-code-of-Mockito-test.url b/35 - Integration testing & Mockito/003 Source-code-of-Mockito-test.url
new file mode 100644
index 0000000000000000000000000000000000000000..edb8f36536c71ec2ad8d3b7084412417dd8e529d
--- /dev/null
+++ b/35 - Integration testing & Mockito/003 Source-code-of-Mockito-test.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/mockito/MessengerTest2.java
\ No newline at end of file
diff --git a/35 - Integration testing & Mockito/003 Source-code-of-original-code.url b/35 - Integration testing & Mockito/003 Source-code-of-original-code.url
new file mode 100644
index 0000000000000000000000000000000000000000..f816175295080c0068c57254a630530b832f5fec
--- /dev/null
+++ b/35 - Integration testing & Mockito/003 Source-code-of-original-code.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/mockito
\ No newline at end of file
diff --git a/35 - Integration testing & Mockito/external-links.txt b/35 - Integration testing & Mockito/external-links.txt
new file mode 100644
index 0000000000000000000000000000000000000000..970c6fee41fbcf3aac32937db34e7d5809319e93
--- /dev/null
+++ b/35 - Integration testing & Mockito/external-links.txt
@@ -0,0 +1,27 @@
+
+002 Mockito-core-library
+https://mvnrepository.com/artifact/org.mockito/mockito-core/3.7.7
+
+002 Byte-Buddy-library
+https://mvnrepository.com/artifact/net.bytebuddy/byte-buddy/1.10.19
+
+002 Byte-Buddy-agent-library
+https://mvnrepository.com/artifact/net.bytebuddy/byte-buddy-agent/1.10.19
+
+002 Objenesis-library
+https://mvnrepository.com/artifact/org.objenesis/objenesis/3.1
+
+002 Mockito-JUnit-Jupiter
+https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter/3.7.7
+
+002 Source-code-of-original-code
+https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/mockito
+
+002 Source-code-of-Mockito-test
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/mockito/MessengerTest.java
+
+003 Source-code-of-original-code
+https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/mockito
+
+003 Source-code-of-Mockito-test
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/mockito/MessengerTest2.java
diff --git a/36 - PowerMockito/001 Hamcrest-all-library.url b/36 - PowerMockito/001 Hamcrest-all-library.url
new file mode 100644
index 0000000000000000000000000000000000000000..53ba3fd227ae5e0068a8027d5baddaad1c730ef7
--- /dev/null
+++ b/36 - PowerMockito/001 Hamcrest-all-library.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all/1.3
\ No newline at end of file
diff --git a/36 - PowerMockito/001 Javaassist-library.url b/36 - PowerMockito/001 Javaassist-library.url
new file mode 100644
index 0000000000000000000000000000000000000000..4f21a55831fc455efe92e8437a5bf6ed7b1868c8
--- /dev/null
+++ b/36 - PowerMockito/001 Javaassist-library.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.javassist/javassist/3.27.0-GA
\ No newline at end of file
diff --git a/36 - PowerMockito/001 Junit-4-library.url b/36 - PowerMockito/001 Junit-4-library.url
new file mode 100644
index 0000000000000000000000000000000000000000..281d7cc53918579643074ea8cc99eca0b953b3e6
--- /dev/null
+++ b/36 - PowerMockito/001 Junit-4-library.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/junit/junit/4.12
\ No newline at end of file
diff --git a/36 - PowerMockito/001 PowerMock_en.srt b/36 - PowerMockito/001 PowerMock_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..622faa76c270a19fb95c2ec3dd77ef45212a35de
--- /dev/null
+++ b/36 - PowerMockito/001 PowerMock_en.srt
@@ -0,0 +1,820 @@
+1
+00:00:05,000 --> 00:00:06,000
+Hello.
+
+2
+00:00:06,000 --> 00:00:10,000
+Students, in this lesson, we'll learn how to work with Power Milk Library.
+
+3
+00:00:10,000 --> 00:00:12,000
+We'll start from Library Overview.
+
+4
+00:00:12,000 --> 00:00:15,000
+I will explain to you when we need to use power.
+
+5
+00:00:15,000 --> 00:00:18,000
+After that, I will share with you all necessary dependencies.
+
+6
+00:00:18,000 --> 00:00:22,000
+You have to add to your project to be able to work with the powerful library.
+
+7
+00:00:22,000 --> 00:00:28,000
+And once we will be ready to work with this library will start from the setting up your test class.
+
+8
+00:00:28,000 --> 00:00:33,000
+There are a few steps that you have to do on the class level before starting work with power unions.
+
+9
+00:00:33,000 --> 00:00:39,000
+The lesson I'm going to show you dozens of examples that I prepared for you when real examples.
+
+10
+00:00:39,000 --> 00:00:41,000
+I will show you how you can mock static methods.
+
+11
+00:00:41,000 --> 00:00:45,000
+You will see how you can make final class in case that will be needed.
+
+12
+00:00:45,000 --> 00:00:51,000
+We'll talk how to deal with such marketing limitations as Moken of equals and aggregate masses.
+
+13
+00:00:51,000 --> 00:00:54,000
+I will show you how power more can help us with this.
+
+14
+00:00:54,000 --> 00:01:00,000
+There will be other examples that will help you to understand how to make native masses constructor's,
+
+15
+00:01:00,000 --> 00:01:03,000
+final and even private masses.
+
+16
+00:01:03,000 --> 00:01:07,000
+Also, we are going to learn how to work with spy objects in power.
+
+17
+00:01:07,000 --> 00:01:09,000
+That is our agenda for today.
+
+18
+00:01:09,000 --> 00:01:11,000
+I believe we are ready to start.
+
+19
+00:01:12,000 --> 00:01:14,000
+Let's start from understanding why we need power.
+
+20
+00:01:14,000 --> 00:01:20,000
+More deliberate testing with the help of a modern framework has been recognized as a useful practice
+
+21
+00:01:20,000 --> 00:01:21,000
+for a long time.
+
+22
+00:01:21,000 --> 00:01:25,000
+And Makita was the most popular library on the market over last years.
+
+23
+00:01:25,000 --> 00:01:27,000
+Well, Makita can help us with almost everything.
+
+24
+00:01:27,000 --> 00:01:34,000
+There are some things it can't do, like stabbing or testing, private final or static methods.
+
+25
+00:01:34,000 --> 00:01:40,000
+It needs much more power to write test cases for such matters, which usually causes developers to write
+
+26
+00:01:40,000 --> 00:01:42,000
+cumbersome code for these masses.
+
+27
+00:01:42,000 --> 00:01:45,000
+Here, Power Makita comes to the rescue.
+
+28
+00:01:45,000 --> 00:01:51,000
+Power market is capable of testing private, final static methods as it makes use of Java Reflection
+
+29
+00:01:51,000 --> 00:01:52,000
+API.
+
+30
+00:01:52,000 --> 00:01:55,000
+Let's talk a little bit more about the library itself.
+
+31
+00:01:55,000 --> 00:02:01,000
+Pomoc uses a custom class loader and might code manipulation to enable more kind of static masses,
+
+32
+00:02:01,000 --> 00:02:06,000
+constructors, final classes and methods, private methods and more.
+
+33
+00:02:06,000 --> 00:02:11,000
+In case you are already familiar with any modern framework, it will be like piece of cake for you to
+
+34
+00:02:11,000 --> 00:02:17,000
+understand pomoc developers familiar with the supported Molk Frameworks will find pomoc easy to use
+
+35
+00:02:18,000 --> 00:02:25,000
+since the entire expectation API is the same goes for static methods and constructors pomoc aims to
+
+36
+00:02:25,000 --> 00:02:31,000
+extend the existing APIs with a small number of methods and annotations to enable the extra features.
+
+37
+00:02:32,000 --> 00:02:38,000
+Basically, the only things that are still we have to do is to learn our mock API and understand how
+
+38
+00:02:38,000 --> 00:02:39,000
+we can use it.
+
+39
+00:02:39,000 --> 00:02:44,000
+So let's jump to Eclipse and look at examples that I prepared specially for this lesson.
+
+40
+00:02:45,000 --> 00:02:51,000
+But before that, let's start from the necessary libraries to our project and done them from MAVEN,
+
+41
+00:02:51,000 --> 00:02:51,000
+the repository.
+
+42
+00:02:52,000 --> 00:02:56,000
+The important thing you have to know is that power doesn't work with Unit five.
+
+43
+00:02:56,000 --> 00:03:03,000
+By the moment I create this lesson, power works just perfect for Unit four, but there is no supervision.
+
+44
+00:03:03,000 --> 00:03:10,000
+Five So far I read the developers of Power Mogk are going to create extension for Janiot five and hopefully
+
+45
+00:03:10,000 --> 00:03:11,000
+it will be ready soon.
+
+46
+00:03:12,000 --> 00:03:17,000
+I still recommend you to watch this lesson because I don't think that API will be changed significantly
+
+47
+00:03:17,000 --> 00:03:18,000
+in the near future.
+
+48
+00:03:18,000 --> 00:03:25,000
+That's why you have to be sure that you have all necessary libraries for you unit for it will require
+
+49
+00:03:25,000 --> 00:03:27,000
+from you the landing of different libraries.
+
+50
+00:03:27,000 --> 00:03:29,000
+So what do you need?
+
+51
+00:03:29,000 --> 00:03:37,000
+You need Gyude version for 12 Concours Core Jeanetta Version four requires HANKUS Library, but I recommend
+
+52
+00:03:38,000 --> 00:03:43,000
+it to download Holmquist All Library because our next dependencies will require Holmquist all.
+
+53
+00:03:43,000 --> 00:03:47,000
+But not just Honkers Core Power Molk module for Unit four.
+
+54
+00:03:48,000 --> 00:03:53,000
+It comes with dependencies, namely power moak module Junod for common.
+
+55
+00:03:54,000 --> 00:03:57,000
+This library in turn requires power, moch reflect and power.
+
+56
+00:03:57,000 --> 00:04:04,000
+Macau Power McGirk, West Java Osis Library and libraries that we used for Congress.
+
+57
+00:04:04,000 --> 00:04:08,000
+You just make sure you edit them and you didn't miss the lessons.
+
+58
+00:04:08,000 --> 00:04:10,000
+Pay attention that this library requires.
+
+59
+00:04:10,000 --> 00:04:15,000
+Cristol Power Moch reflect requests by the body libraries.
+
+60
+00:04:16,000 --> 00:04:23,000
+Also, I recommend you to download API Makita, and together with that, also the Cloud Parramore Makita,
+
+61
+00:04:23,000 --> 00:04:25,000
+API Support Library.
+
+62
+00:04:25,000 --> 00:04:28,000
+Finally, that's all dependencies that we need.
+
+63
+00:04:29,000 --> 00:04:32,000
+Make sure you downloaded them and added to the project.
+
+64
+00:04:32,000 --> 00:04:38,000
+Be careful, because a lot of them and then one of you pay as much attention as you can while downloading
+
+65
+00:04:38,000 --> 00:04:41,000
+and ending libraries to a project class claspers.
+
+66
+00:04:41,000 --> 00:04:46,000
+As usual, I will leave link in attachments to this lesson with the library that you have to download.
+
+67
+00:04:47,000 --> 00:04:51,000
+Now, when we have environment configured, let's proceed with our code examples.
+
+68
+00:04:52,000 --> 00:04:58,000
+For the sake of our example, we'll use final clustering and class with static, private and final methods
+
+69
+00:04:58,000 --> 00:05:05,000
+that I created in this Java file to work with no more than a few configurations that we have to do in
+
+70
+00:05:05,000 --> 00:05:08,000
+our test class before running tests take into account.
+
+71
+00:05:08,000 --> 00:05:12,000
+June four doesn't have extension like we have in Unit five.
+
+72
+00:05:12,000 --> 00:05:18,000
+We have to use special Rahner to use power amoc above the test Glasspool put annotation run vs and Prosper
+
+73
+00:05:18,000 --> 00:05:19,000
+McCrann a class.
+
+74
+00:05:20,000 --> 00:05:24,000
+The second thing we have to do is to prepare classes for walking.
+
+75
+00:05:24,000 --> 00:05:30,000
+We have to say to power mock what final and classes with static methods that we are going to mock the
+
+76
+00:05:30,000 --> 00:05:32,000
+different options to census.
+
+77
+00:05:33,000 --> 00:05:39,000
+We have to put prepare for test annotation and we can pass an array of classes that or we can specify
+
+78
+00:05:39,000 --> 00:05:41,000
+package with classes that we want to mock.
+
+79
+00:05:41,000 --> 00:05:44,000
+In this test, most options are fine.
+
+80
+00:05:44,000 --> 00:05:46,000
+You can use the ones that work the best for you.
+
+81
+00:05:47,000 --> 00:05:51,000
+Now we are done with configuration and we are ready to proceed with court examples.
+
+82
+00:05:51,000 --> 00:05:55,000
+In the first example, I will show you how to mock static methods.
+
+83
+00:05:55,000 --> 00:05:58,000
+I use this class name in the prepare for test annotation.
+
+84
+00:05:59,000 --> 00:06:05,000
+In the test way you want to create more, you can use the foreign power mock API, first of all called
+
+85
+00:06:05,000 --> 00:06:08,000
+mock static Masad from power Makita class.
+
+86
+00:06:08,000 --> 00:06:11,000
+Pay attention that here on top I did a static aimbot.
+
+87
+00:06:11,000 --> 00:06:15,000
+This method enables static Morgan for all masses of a class.
+
+88
+00:06:16,000 --> 00:06:18,000
+We have to pass a class to this method.
+
+89
+00:06:19,000 --> 00:06:22,000
+After that you can use APIs that you already used to.
+
+90
+00:06:22,000 --> 00:06:28,000
+We call when Masset from Pamunkey the class call method that we want to mock and after that specify
+
+91
+00:06:28,000 --> 00:06:30,000
+behavior that we wanted to set.
+
+92
+00:06:31,000 --> 00:06:38,000
+API is very close to the Makita API that we learned in previous lessons, so I will not stop on that.
+
+93
+00:06:38,000 --> 00:06:42,000
+In our particular case, I made the mock and said behavior.
+
+94
+00:06:42,000 --> 00:06:49,000
+Forget no method now yet no should return ten in a session part of my test I verified that I really
+
+95
+00:06:49,000 --> 00:06:52,000
+get ten now and test is passed successfully.
+
+96
+00:06:53,000 --> 00:06:59,000
+Taking into account we created Mock as a static analysis of this class returns default value.
+
+97
+00:06:59,000 --> 00:07:06,000
+Here I can see that gets random string returns now, whereas in fact this method returns some random
+
+98
+00:07:06,000 --> 00:07:07,000
+string by default.
+
+99
+00:07:07,000 --> 00:07:11,000
+So we can be sure that we really created a mock object from this class.
+
+100
+00:07:12,000 --> 00:07:17,000
+Also, I can verify not the result, but the behavior itself in the case.
+
+101
+00:07:17,000 --> 00:07:20,000
+We want to verify that some static methods was invoked.
+
+102
+00:07:20,000 --> 00:07:28,000
+We have to call verify static method and pass class that is under the test an expected number of occasions
+
+103
+00:07:28,000 --> 00:07:28,000
+as an argument.
+
+104
+00:07:29,000 --> 00:07:33,000
+And right after that, we have to invoke Masset that we expect to be executed.
+
+105
+00:07:34,000 --> 00:07:37,000
+This is just APIs that we have to remember.
+
+106
+00:07:37,000 --> 00:07:43,000
+The verify static method must be called right before any static method verification for power Makita
+
+107
+00:07:43,000 --> 00:07:48,000
+to know that the successive Masset invocation is what needs to be verified.
+
+108
+00:07:48,000 --> 00:07:50,000
+Pretty simple, don't you think?
+
+109
+00:07:50,000 --> 00:07:51,000
+So let's continue.
+
+110
+00:07:52,000 --> 00:07:56,000
+In case we want to make final class, you have to use Mock Macit.
+
+111
+00:07:56,000 --> 00:08:02,000
+If we compare Molk Masset and mock static method, the first difference is that Malkmus method returns
+
+112
+00:08:02,000 --> 00:08:08,000
+the reference to the mock object, while mock static method is void and returns nothing.
+
+113
+00:08:09,000 --> 00:08:14,000
+Malkmus it creates a mock object that supports Morgaine of final and negative methods.
+
+114
+00:08:15,000 --> 00:08:20,000
+When we have the reference to marked object, let's try to mock some method of string object.
+
+115
+00:08:20,000 --> 00:08:23,000
+For example, let's set behavior for Lancs method.
+
+116
+00:08:24,000 --> 00:08:27,000
+I will get warning in case I would call them smashup.
+
+117
+00:08:27,000 --> 00:08:29,000
+And in a certain part I verify this.
+
+118
+00:08:30,000 --> 00:08:37,000
+Also, as you remember, Makita can't mock equals and hash code masses, but power Mochan the algorithm
+
+119
+00:08:37,000 --> 00:08:42,000
+is similar and here you can see examples McMakin equals and hash code masses.
+
+120
+00:08:43,000 --> 00:08:46,000
+Besides that, power McKetta can more native masses.
+
+121
+00:08:47,000 --> 00:08:52,000
+I believe you remember that hash code message from Object Class is a native MassArt.
+
+122
+00:08:52,000 --> 00:08:55,000
+Everything is the same from the API standpoint.
+
+123
+00:08:55,000 --> 00:09:01,000
+I can mock native Masset and here proofs in the case will execute this test.
+
+124
+00:09:01,000 --> 00:09:03,000
+All verifications will pass.
+
+125
+00:09:03,000 --> 00:09:06,000
+Now let me show you how you can mock constructor.
+
+126
+00:09:06,000 --> 00:09:12,000
+This is also one of limitations in Makita library, but Power Mock will help us to deal with this.
+
+127
+00:09:12,000 --> 00:09:16,000
+I created the object of my custom class and said this.
+
+128
+00:09:16,000 --> 00:09:22,000
+Aid to this object and then warns that when construction of this type will be called, I will get this
+
+129
+00:09:22,000 --> 00:09:27,000
+object by default to configure this, I call when you it and pass my laws.
+
+130
+00:09:28,000 --> 00:09:33,000
+After that, I called with no arguments, Masset, just to tell that I want to stop constructor without
+
+131
+00:09:33,000 --> 00:09:34,000
+parameters.
+
+132
+00:09:34,000 --> 00:09:41,000
+And after that I specify that I want to get the reference to this object in return to prove that I really
+
+133
+00:09:41,000 --> 00:09:43,000
+get previously configured object.
+
+134
+00:09:43,000 --> 00:09:49,000
+I verify this in my assertions by checking the state of new objects, namely that int value is equal
+
+135
+00:09:49,000 --> 00:09:52,000
+to do and string is equal to the string.
+
+136
+00:09:52,000 --> 00:09:56,000
+I said before to verify behavior and that constructor was invoked.
+
+137
+00:09:56,000 --> 00:09:58,000
+You can use very fine new Masset.
+
+138
+00:09:58,000 --> 00:10:04,000
+As you can see, I can use Times method from Makita library to specify expected number of constructor
+
+139
+00:10:04,000 --> 00:10:05,000
+invocations.
+
+140
+00:10:05,000 --> 00:10:11,000
+And similar to this example, I can construct service arguments and verify that constructor with arguments
+
+141
+00:10:11,000 --> 00:10:12,000
+was invoked.
+
+142
+00:10:12,000 --> 00:10:14,000
+Here is an example.
+
+143
+00:10:14,000 --> 00:10:20,000
+The only difference is that I call these arguments method and the argument marchers during the Moken
+
+144
+00:10:20,000 --> 00:10:21,000
+and verification.
+
+145
+00:10:22,000 --> 00:10:26,000
+That's all I would say is that API for Monken constructors is pretty intuitive.
+
+146
+00:10:27,000 --> 00:10:28,000
+Similar to Makita library.
+
+147
+00:10:28,000 --> 00:10:32,000
+I can partially Mogk my classes and make spy objects.
+
+148
+00:10:32,000 --> 00:10:39,000
+In this example, you can see how I create spy and the difference between McKetta and pomoc is that
+
+149
+00:10:39,000 --> 00:10:43,000
+I pass class object instead of the instance of this class.
+
+150
+00:10:43,000 --> 00:10:49,000
+And after that you can see Moken that is already familiar to you to prove you that this is spy, but
+
+151
+00:10:49,000 --> 00:10:50,000
+not Mauck.
+
+152
+00:10:50,000 --> 00:10:57,000
+I call gets random string Macit the remember example at the beginning of our lesson in that case gets
+
+153
+00:10:57,000 --> 00:11:03,000
+random string method returns now because that was Mark and this example proves that we have partial
+
+154
+00:11:03,000 --> 00:11:10,000
+Mochan here because that random string method returns the string as it is implemented in the method.
+
+155
+00:11:10,000 --> 00:11:14,000
+And now I'm going to show you one of the most amazing features of power mock.
+
+156
+00:11:15,000 --> 00:11:19,000
+Now we'll look at examples that shows us how to make final masses.
+
+157
+00:11:19,000 --> 00:11:22,000
+To be able to make final non static methods.
+
+158
+00:11:22,000 --> 00:11:24,000
+We have to create more based on the class.
+
+159
+00:11:25,000 --> 00:11:31,000
+Now we can make our final method and in the assertion we verify that we successfully marked our final
+
+160
+00:11:31,000 --> 00:11:31,000
+MACIT.
+
+161
+00:11:32,000 --> 00:11:38,000
+We can also verify that our final message was invoked with the help of McKetta and the last but not
+
+162
+00:11:38,000 --> 00:11:39,000
+the least for today.
+
+163
+00:11:39,000 --> 00:11:40,000
+McAnuff private methods.
+
+164
+00:11:41,000 --> 00:11:47,000
+Sometimes it might happen that you want to imitate very specific cases, and to do this you have to
+
+165
+00:11:47,000 --> 00:11:48,000
+mock private methods.
+
+166
+00:11:49,000 --> 00:11:53,000
+But this might be complicated sometimes and to be able to test such classes.
+
+167
+00:11:53,000 --> 00:11:58,000
+Sometimes developers change X modifier from private to packaged private.
+
+168
+00:11:58,000 --> 00:12:01,000
+But actually this is not the best way.
+
+169
+00:12:01,000 --> 00:12:07,000
+If some specific method is for internal usage only y you have to make it accessible for all units in
+
+170
+00:12:07,000 --> 00:12:09,000
+the package, just the right test.
+
+171
+00:12:10,000 --> 00:12:15,000
+Here's where power more comes into play and helps us to mock private masses.
+
+172
+00:12:15,000 --> 00:12:18,000
+The only difficulty is that Democrats MassArt.
+
+173
+00:12:18,000 --> 00:12:22,000
+We can't make Macit invocation because they're private.
+
+174
+00:12:22,000 --> 00:12:28,000
+To mock Private Masset, we have to create spy objects based on the instance of our class and pay attention.
+
+175
+00:12:29,000 --> 00:12:33,000
+You won't be able to mock private MassArt based on mock only.
+
+176
+00:12:33,000 --> 00:12:35,000
+You have to create spy object for that.
+
+177
+00:12:36,000 --> 00:12:42,000
+And the difficulty with mocking private methods is in the fact that we can't call private method outside
+
+178
+00:12:42,000 --> 00:12:43,000
+of the original class.
+
+179
+00:12:43,000 --> 00:12:45,000
+That seems to be logical.
+
+180
+00:12:45,000 --> 00:12:46,000
+But what to do in this case?
+
+181
+00:12:47,000 --> 00:12:53,000
+We still use one method will pass the name of our private method and use the mechanism of reflection.
+
+182
+00:12:53,000 --> 00:12:58,000
+Power Mock will mock our private method to verify how private method works.
+
+183
+00:12:58,000 --> 00:13:00,000
+We have to call another method then.
+
+184
+00:13:00,000 --> 00:13:06,000
+It's also logical because usually in real life you don't call private mass on the object.
+
+185
+00:13:06,000 --> 00:13:12,000
+They're invoked somewhere inside your class for the sake of the Dharma and to prove that we successfully
+
+186
+00:13:12,000 --> 00:13:17,000
+marked private mass, I created a separate method that is called call private method.
+
+187
+00:13:17,000 --> 00:13:21,000
+And inside this method average on value of my private method.
+
+188
+00:13:21,000 --> 00:13:27,000
+In real life, logic might be more complicated here, but my goal now is to demonstrate that we managed
+
+189
+00:13:27,000 --> 00:13:32,000
+to mock our private method to verify that private method was really invoked.
+
+190
+00:13:32,000 --> 00:13:37,000
+You have to call special message from government class that is called verify private.
+
+191
+00:13:37,000 --> 00:13:43,000
+You have to pass by object there and invoke method with string that contains private method name.
+
+192
+00:13:43,000 --> 00:13:44,000
+That's it.
+
+193
+00:13:45,000 --> 00:13:46,000
+Now you know how to work with power.
+
+194
+00:13:47,000 --> 00:13:52,000
+OK, let's recap what we have learned today in this lesson we learned.
+
+195
+00:13:52,000 --> 00:13:54,000
+Why do we need power more now?
+
+196
+00:13:54,000 --> 00:13:59,000
+You know how to set up environment and at all necessary dependencies to be able to use power more.
+
+197
+00:14:00,000 --> 00:14:05,000
+You learned how to set up test class and what's wrong you have to use to be able to work with power,
+
+198
+00:14:05,000 --> 00:14:06,000
+Molk.
+
+199
+00:14:06,000 --> 00:14:09,000
+And after that, all our focus was dedicated to power.
+
+200
+00:14:09,000 --> 00:14:14,000
+Molk API, you learned how to move static, final private and native masses.
+
+201
+00:14:15,000 --> 00:14:15,000
+I showed you.
+
+202
+00:14:16,000 --> 00:14:19,000
+You can more constructor's and how to work with spy objects in power.
+
+203
+00:14:20,000 --> 00:14:22,000
+Hope you enjoyed the lesson.
+
+204
+00:14:23,000 --> 00:14:24,000
+Thanks a lot for your attention.
+
+205
+00:14:24,000 --> 00:14:27,000
+Have a great day and see you in the next lesson.
+
diff --git a/36 - PowerMockito/001 PowerMockito-official-documentation.url b/36 - PowerMockito/001 PowerMockito-official-documentation.url
new file mode 100644
index 0000000000000000000000000000000000000000..a1e9aec51af6ad4eddc3cd36afbce5cadda7523a
--- /dev/null
+++ b/36 - PowerMockito/001 PowerMockito-official-documentation.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://www.javadoc.io/doc/org.powermock/powermock-api-mockito/latest/org/powermock/api/mockito/PowerMockito.html
\ No newline at end of file
diff --git a/36 - PowerMockito/001 Powermock-core.url b/36 - PowerMockito/001 Powermock-core.url
new file mode 100644
index 0000000000000000000000000000000000000000..dd15bec4a75c66fde94908081a741b7df74c1004
--- /dev/null
+++ b/36 - PowerMockito/001 Powermock-core.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.powermock/powermock-core/2.0.9
\ No newline at end of file
diff --git a/36 - PowerMockito/001 Powermock-mockito-api-support.url b/36 - PowerMockito/001 Powermock-mockito-api-support.url
new file mode 100644
index 0000000000000000000000000000000000000000..38697935b4e4790464e1ea211dfb4ff384c58858
--- /dev/null
+++ b/36 - PowerMockito/001 Powermock-mockito-api-support.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.powermock/powermock-api-support/2.0.9
\ No newline at end of file
diff --git a/36 - PowerMockito/001 Powermock-mockito-api.url b/36 - PowerMockito/001 Powermock-mockito-api.url
new file mode 100644
index 0000000000000000000000000000000000000000..09d4e7f5b8f580194c0a7156c68a2fc2b5e6fe3c
--- /dev/null
+++ b/36 - PowerMockito/001 Powermock-mockito-api.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.powermock/powermock-api-mockito2/2.0.9
\ No newline at end of file
diff --git a/36 - PowerMockito/001 Powermock-module-for-JUnit-4-common.url b/36 - PowerMockito/001 Powermock-module-for-JUnit-4-common.url
new file mode 100644
index 0000000000000000000000000000000000000000..264fce2c438dd00b507acf9128c7a315ec3eeafe
--- /dev/null
+++ b/36 - PowerMockito/001 Powermock-module-for-JUnit-4-common.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.powermock/powermock-module-junit4-common/2.0.9
\ No newline at end of file
diff --git a/36 - PowerMockito/001 Powermock-module-for-JUnit-4.url b/36 - PowerMockito/001 Powermock-module-for-JUnit-4.url
new file mode 100644
index 0000000000000000000000000000000000000000..dac22f9972afbf3b1416eb61a262b3a7b9daaf6f
--- /dev/null
+++ b/36 - PowerMockito/001 Powermock-module-for-JUnit-4.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.powermock/powermock-module-junit4/2.0.9
\ No newline at end of file
diff --git a/36 - PowerMockito/001 Powermock-reflect-library.url b/36 - PowerMockito/001 Powermock-reflect-library.url
new file mode 100644
index 0000000000000000000000000000000000000000..1549613570eaeb699a4b519afe70f7c32ee818c4
--- /dev/null
+++ b/36 - PowerMockito/001 Powermock-reflect-library.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://mvnrepository.com/artifact/org.powermock/powermock-reflect/2.0.9
\ No newline at end of file
diff --git a/36 - PowerMockito/001 Source-code-of-example-from-lesson.url b/36 - PowerMockito/001 Source-code-of-example-from-lesson.url
new file mode 100644
index 0000000000000000000000000000000000000000..4672db47b9428da727b4416c81c5202091a84e16
--- /dev/null
+++ b/36 - PowerMockito/001 Source-code-of-example-from-lesson.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/powermock/PowerMockExampleSourceTest.java
\ No newline at end of file
diff --git a/36 - PowerMockito/external-links.txt b/36 - PowerMockito/external-links.txt
new file mode 100644
index 0000000000000000000000000000000000000000..bd0b2bafde0b79ab56e5d04087752828b4ab47e4
--- /dev/null
+++ b/36 - PowerMockito/external-links.txt
@@ -0,0 +1,33 @@
+
+001 Junit-4-library
+https://mvnrepository.com/artifact/junit/junit/4.12
+
+001 Hamcrest-all-library
+https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all/1.3
+
+001 Powermock-module-for-JUnit-4
+https://mvnrepository.com/artifact/org.powermock/powermock-module-junit4/2.0.9
+
+001 Powermock-module-for-JUnit-4-common
+https://mvnrepository.com/artifact/org.powermock/powermock-module-junit4-common/2.0.9
+
+001 Powermock-reflect-library
+https://mvnrepository.com/artifact/org.powermock/powermock-reflect/2.0.9
+
+001 Powermock-core
+https://mvnrepository.com/artifact/org.powermock/powermock-core/2.0.9
+
+001 Javaassist-library
+https://mvnrepository.com/artifact/org.javassist/javassist/3.27.0-GA
+
+001 Powermock-mockito-api
+https://mvnrepository.com/artifact/org.powermock/powermock-api-mockito2/2.0.9
+
+001 Powermock-mockito-api-support
+https://mvnrepository.com/artifact/org.powermock/powermock-api-support/2.0.9
+
+001 PowerMockito-official-documentation
+https://www.javadoc.io/doc/org.powermock/powermock-api-mockito/latest/org/powermock/api/mockito/PowerMockito.html
+
+001 Source-code-of-example-from-lesson
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/test/com/itbulls/learnit/javacore/powermock/PowerMockExampleSourceTest.java
diff --git a/37 - TDD, BDD & ATTD/001 Test-driven development Theory_en.srt b/37 - TDD, BDD & ATTD/001 Test-driven development Theory_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..e831edf5fe07776dfae7ff1a5067c140cc4d517f
--- /dev/null
+++ b/37 - TDD, BDD & ATTD/001 Test-driven development Theory_en.srt
@@ -0,0 +1,1276 @@
+1
+00:00:06,000 --> 00:00:11,000
+Oh, yes, students in this class and we start superimportant topic today will learn with you test driven
+
+2
+00:00:11,000 --> 00:00:12,000
+development.
+
+3
+00:00:12,000 --> 00:00:18,000
+We'll start from understanding what is Tatsuru and development and explain what this development technique
+
+4
+00:00:18,000 --> 00:00:21,000
+is about to help you understand it better.
+
+5
+00:00:21,000 --> 00:00:28,000
+I will explain you the basics and we'll talk about the cycle after that will be diving into more difficult
+
+6
+00:00:28,000 --> 00:00:29,000
+concepts.
+
+7
+00:00:29,000 --> 00:00:31,000
+We learn three levels of TTG.
+
+8
+00:00:32,000 --> 00:00:37,000
+Many engineers often confuse test first and test driven development today will tell you what is the
+
+9
+00:00:37,000 --> 00:00:42,000
+difference between these two concepts and previous lessons we have learned.
+
+10
+00:00:42,000 --> 00:00:43,000
+Testing Pyramid.
+
+11
+00:00:43,000 --> 00:00:50,000
+But today we'll discuss how testing Pyramid A.G. is connected while talking about testing and development.
+
+12
+00:00:50,000 --> 00:00:55,000
+I will explain to you what the effect cost increase means and how he helps us to decrease cost of each
+
+13
+00:00:55,000 --> 00:00:56,000
+new defect.
+
+14
+00:00:56,000 --> 00:01:02,000
+And at the end of the lesson, we'll talk about advantages and disadvantages of the approach.
+
+15
+00:01:02,000 --> 00:01:09,000
+And to start with, let's understand first, what to do is to deduce stands for test driven development.
+
+16
+00:01:09,000 --> 00:01:15,000
+This is a software development process that relies on the certain requirements being converted to test
+
+17
+00:01:15,000 --> 00:01:18,000
+cases before software is fully developed.
+
+18
+00:01:18,000 --> 00:01:24,000
+According to the approach, you track all software development through the repeatedly testing software
+
+19
+00:01:24,000 --> 00:01:26,000
+against all test cases.
+
+20
+00:01:26,000 --> 00:01:32,000
+Test driven development is related to test first programming concepts of extreme programming.
+
+21
+00:01:32,000 --> 00:01:39,000
+But supporters of GE put in stress on the difference between test first approach and test driven development.
+
+22
+00:01:39,000 --> 00:01:45,000
+A bit later today, after learning what the IS will compare test first and TEGA approaches, founder
+
+23
+00:01:45,000 --> 00:01:47,000
+of TTG is considered to be Kante.
+
+24
+00:01:47,000 --> 00:01:53,000
+Back now let's learn a little bit more about EEG and understand how it works.
+
+25
+00:01:53,000 --> 00:01:55,000
+Ensure the idea is simple.
+
+26
+00:01:55,000 --> 00:01:59,000
+If you are developing a system, just write a test first.
+
+27
+00:01:59,000 --> 00:02:02,000
+Just create a test that will verify your API.
+
+28
+00:02:02,000 --> 00:02:09,000
+This will help you to understand how you want your API would look like, because by writing the test,
+
+29
+00:02:09,000 --> 00:02:11,000
+you'll really create a client of your code.
+
+30
+00:02:12,000 --> 00:02:17,000
+And after you wrote a test, read just enough code to make this test pass and make it green.
+
+31
+00:02:18,000 --> 00:02:19,000
+There's not enough code.
+
+32
+00:02:19,000 --> 00:02:22,000
+And this is not how your API have to look like.
+
+33
+00:02:23,000 --> 00:02:27,000
+That's fine, but probably you mean some other test cases.
+
+34
+00:02:27,000 --> 00:02:32,000
+Just write the next test and start this iteration one more time.
+
+35
+00:02:32,000 --> 00:02:36,000
+Well, definition of main steps, according to the energy cycle, is very simple.
+
+36
+00:02:37,000 --> 00:02:40,000
+It leaves a lot of space for all interpretations.
+
+37
+00:02:40,000 --> 00:02:45,000
+Therefore, to implementations vary from developer to developer.
+
+38
+00:02:45,000 --> 00:02:49,000
+And unfortunately, those variations are not always cosmetic.
+
+39
+00:02:50,000 --> 00:02:53,000
+There are three main steps on each iteration of TTG cycle.
+
+40
+00:02:53,000 --> 00:02:55,000
+The first step is called read.
+
+41
+00:02:56,000 --> 00:02:58,000
+Write a test and make it fail.
+
+42
+00:02:58,000 --> 00:03:01,000
+At this step, you don't have any implementation.
+
+43
+00:03:02,000 --> 00:03:05,000
+The next step is called green, right?
+
+44
+00:03:05,000 --> 00:03:10,000
+Just enough code to make your test pass and the next step is refactor.
+
+45
+00:03:10,000 --> 00:03:13,000
+Improve your code without changing its behavior.
+
+46
+00:03:13,000 --> 00:03:14,000
+It's optional.
+
+47
+00:03:14,000 --> 00:03:21,000
+Step that you may skip on some iterations, but it can be used that you found some optimization or you
+
+48
+00:03:21,000 --> 00:03:23,000
+just want to remove code duplication.
+
+49
+00:03:23,000 --> 00:03:29,000
+That's what you can do during the refactor step because you already have reliables use of tests that
+
+50
+00:03:29,000 --> 00:03:32,000
+you wrote to verify expected behavior.
+
+51
+00:03:32,000 --> 00:03:34,000
+The three levels of TTG.
+
+52
+00:03:34,000 --> 00:03:37,000
+The first law sounds like this.
+
+53
+00:03:37,000 --> 00:03:41,000
+You may not write production code unless you have written a failing test.
+
+54
+00:03:42,000 --> 00:03:43,000
+This is a simple one.
+
+55
+00:03:43,000 --> 00:03:46,000
+The second law sounds like this.
+
+56
+00:03:46,000 --> 00:03:50,000
+You may not write more of a test than sufficient to fail.
+
+57
+00:03:51,000 --> 00:03:56,000
+This law will help you to clearly separate different test cases and different scenarios.
+
+58
+00:03:56,000 --> 00:03:59,000
+Do not make them up and the cert law stands the following.
+
+59
+00:04:00,000 --> 00:04:03,000
+You may not write more code to make the test GRE.
+
+60
+00:04:04,000 --> 00:04:08,000
+This will help you to avoid writing the code that is not used at all.
+
+61
+00:04:08,000 --> 00:04:14,000
+Moreover, this principle will help you to think through the test cases more thoroughly, because to
+
+62
+00:04:14,000 --> 00:04:19,000
+write some code you will ask yourself first, why do I need to write this code?
+
+63
+00:04:20,000 --> 00:04:22,000
+What test case I'm going to cover with it.
+
+64
+00:04:23,000 --> 00:04:30,000
+Many developers that I taught how to use technology in enterprise applications always asked me how I
+
+65
+00:04:30,000 --> 00:04:35,000
+have to write a test for the thing that I even don't know how it will look like from the implementation
+
+66
+00:04:35,000 --> 00:04:36,000
+standpoint.
+
+67
+00:04:36,000 --> 00:04:43,000
+Well, I ask in return on the one question, how would you write the code and implementation if you
+
+68
+00:04:43,000 --> 00:04:48,000
+can't write the test that contains client code to use your implementation?
+
+69
+00:04:48,000 --> 00:04:54,000
+If you even don't know how to write test scores and how you know what implementation you have to create,
+
+70
+00:04:55,000 --> 00:04:56,000
+that makes sense.
+
+71
+00:04:56,000 --> 00:04:59,000
+And let's also talk about this from another side.
+
+72
+00:04:59,000 --> 00:05:01,000
+It can be that you don't know where to start.
+
+73
+00:05:02,000 --> 00:05:06,000
+Imagine you receive a task and you don't know what are the first things you have to do.
+
+74
+00:05:07,000 --> 00:05:14,000
+But even in case you don't know how this will feature will work, you have to know at least what your
+
+75
+00:05:14,000 --> 00:05:15,000
+code has to do.
+
+76
+00:05:15,000 --> 00:05:22,000
+You may not know all the details of implementation, but he clearly understands the end result, not
+
+77
+00:05:22,000 --> 00:05:23,000
+the expected end result.
+
+78
+00:05:23,000 --> 00:05:26,000
+You have to be able at least to create a test.
+
+79
+00:05:26,000 --> 00:05:27,000
+Agree.
+
+80
+00:05:27,000 --> 00:05:33,000
+And now the questions that you folks like to ask during the interview, what is the difference between
+
+81
+00:05:33,000 --> 00:05:36,000
+test first approach and test driven development?
+
+82
+00:05:36,000 --> 00:05:40,000
+Because test first approach is not a new idea at all.
+
+83
+00:05:40,000 --> 00:05:42,000
+What did you bring to us?
+
+84
+00:05:42,000 --> 00:05:46,000
+I will explain you now, but first I will ask you a question.
+
+85
+00:05:46,000 --> 00:05:52,000
+This you know that around 70 percent of working time is an adding of new features, already existing
+
+86
+00:05:52,000 --> 00:05:53,000
+ones.
+
+87
+00:05:53,000 --> 00:05:59,000
+And in general, only 30 percent of your working time in your career, you have opportunity to build
+
+88
+00:05:59,000 --> 00:06:01,000
+something completely new from scratch.
+
+89
+00:06:02,000 --> 00:06:03,000
+And you know what?
+
+90
+00:06:03,000 --> 00:06:05,000
+Write code from scratch to make it work.
+
+91
+00:06:05,000 --> 00:06:07,000
+It is not difficult at all.
+
+92
+00:06:07,000 --> 00:06:13,000
+A lot of people can do this nowadays, but write code in the way it will be easy to scale.
+
+93
+00:06:13,000 --> 00:06:15,000
+That's hard to do sometimes.
+
+94
+00:06:16,000 --> 00:06:22,000
+And that is exactly why did you feel like that's different development approach following T.G. approach,
+
+95
+00:06:22,000 --> 00:06:30,000
+implementation of each new feature won't lead you to end the spirit of bug fixing in old feature implementation.
+
+96
+00:06:30,000 --> 00:06:37,000
+And adding new functionality will be easy to predict, and it wouldn't take twice as much time to complete
+
+97
+00:06:37,000 --> 00:06:39,000
+a new feature because of unpredicted defects.
+
+98
+00:06:39,000 --> 00:06:40,000
+Why?
+
+99
+00:06:40,000 --> 00:06:48,000
+Because the insurance claim code design and robust architecture and even more digitally allows you to
+
+100
+00:06:48,000 --> 00:06:54,000
+detect errors as soon as it is possible so that you have time to fix errors on the earlier stages instead
+
+101
+00:06:54,000 --> 00:07:02,000
+of building infrastructure around the defect only to find them later can back in his book to do by example,
+
+102
+00:07:02,000 --> 00:07:05,000
+intentionally didn't use test first development term.
+
+103
+00:07:06,000 --> 00:07:13,000
+The idea was to put a stress on the fact that tests engie and not for the purpose of testing itself,
+
+104
+00:07:13,000 --> 00:07:15,000
+but more for the purpose of driving the design.
+
+105
+00:07:16,000 --> 00:07:21,000
+The problem, from my point of view, is that you can practice test first without doing the D.
+
+106
+00:07:22,000 --> 00:07:27,000
+You can have the whole design of your system done, but during the implementation you will write your
+
+107
+00:07:27,000 --> 00:07:28,000
+test first.
+
+108
+00:07:28,000 --> 00:07:32,000
+That is not as and development also the test.
+
+109
+00:07:32,000 --> 00:07:40,000
+First, it adds something more on top of it in your test should drive the design of your system.
+
+110
+00:07:41,000 --> 00:07:45,000
+You was never saying you can't design before you start coding.
+
+111
+00:07:45,000 --> 00:07:51,000
+It merely follows the path of agile practices that you shouldn't spend a lot of time on designing up
+
+112
+00:07:51,000 --> 00:07:57,000
+front because the design is likely to change as you gain better understanding about your domain.
+
+113
+00:07:57,000 --> 00:07:59,000
+That usually happens during coding.
+
+114
+00:07:59,000 --> 00:08:03,000
+As you discover issues with a design that I completely agree with.
+
+115
+00:08:03,000 --> 00:08:11,000
+The statement not completely to the G is just a tool and it always depends who will use this to definitely
+
+116
+00:08:11,000 --> 00:08:13,000
+in case this tool will be used by junior engineer.
+
+117
+00:08:13,000 --> 00:08:20,000
+There is no guarantee that this approach will lead us to good design skills of working with study is
+
+118
+00:08:20,000 --> 00:08:23,000
+one of the obstacles to start working with steadily.
+
+119
+00:08:23,000 --> 00:08:27,000
+A little bit later in this lesson, we'll learn pros and cons of working with digitally.
+
+120
+00:08:28,000 --> 00:08:32,000
+Previously on this course, I share it with your concept of test impairment.
+
+121
+00:08:32,000 --> 00:08:34,000
+I hope you remember what it is.
+
+122
+00:08:34,000 --> 00:08:40,000
+But just to recap, ensured we use test parameter when referring to a group of tests on different test
+
+123
+00:08:40,000 --> 00:08:43,000
+levels and the ratio between each other.
+
+124
+00:08:44,000 --> 00:08:50,000
+The concept of test impairment originally was created by MicroCon and described in his book Succeeding
+
+125
+00:08:50,000 --> 00:08:50,000
+with Agile.
+
+126
+00:08:51,000 --> 00:08:57,000
+In the Perfect World, we would love to completely automate all possible tests on all levels.
+
+127
+00:08:57,000 --> 00:09:03,000
+Definitely that is not what we can afford because they're also not functional requirements that are
+
+128
+00:09:03,000 --> 00:09:09,000
+easier sometimes to test manually rather than spend months to find out how to automate this.
+
+129
+00:09:09,000 --> 00:09:16,000
+By the way, always keep this in mind in case you will be asked what it's worth to automate what doesn't.
+
+130
+00:09:16,000 --> 00:09:22,000
+You can answer that there's always a matter of cost in case, of course, that will be spent.
+
+131
+00:09:22,000 --> 00:09:28,000
+Made some specific qualifications will be higher than verified manually through the whole product lifecycle.
+
+132
+00:09:29,000 --> 00:09:34,000
+You don't have to automate this, but in a perfect world, it is always a dream of any developer to
+
+133
+00:09:34,000 --> 00:09:40,000
+have one button that will help to verify the whole system and make sure that these verifications are
+
+134
+00:09:40,000 --> 00:09:41,000
+all automated.
+
+135
+00:09:42,000 --> 00:09:48,000
+GOOG examples might be sometimes misleading just because not put enough stress on the fact that the
+
+136
+00:09:48,000 --> 00:09:54,000
+approach is not applied only for unit test level of our automated testing pyramid.
+
+137
+00:09:54,000 --> 00:10:00,000
+Usually it is the easiest thing to explain how to work with day on the example of unit tests.
+
+138
+00:10:00,000 --> 00:10:04,000
+But that is not only the place where TTG may be applied.
+
+139
+00:10:04,000 --> 00:10:11,000
+We can also apply to the approach on other levels, for example, integration function and the UI levels.
+
+140
+00:10:12,000 --> 00:10:17,000
+Now we are going to learn one more of the arguments that is used by the followers.
+
+141
+00:10:17,000 --> 00:10:21,000
+I'm going to explain to you what the effect cost increases.
+
+142
+00:10:21,000 --> 00:10:26,000
+The chance that you can see on the slide explains how the cost of fixing the effect is increasing over
+
+143
+00:10:26,000 --> 00:10:33,000
+time passed and based on which stage of development the defect was discovered on the x axis.
+
+144
+00:10:33,000 --> 00:10:38,000
+You can see, as you'll see face as you see stands for software development lifecycle.
+
+145
+00:10:39,000 --> 00:10:46,000
+And on the y axis, you can see relative price value of fixing the defect in case defect was discovered
+
+146
+00:10:46,000 --> 00:10:51,000
+on the stage of requirements, gathering the price will be lower than in case, but will be discarded
+
+147
+00:10:51,000 --> 00:10:55,000
+after deployment of the solution to production during the maintenance phase.
+
+148
+00:10:56,000 --> 00:11:00,000
+Based on this chart, you can make a conclusion about the cost of the defect.
+
+149
+00:11:00,000 --> 00:11:04,000
+The latter defect was discovered the higher cost of fixing a test.
+
+150
+00:11:05,000 --> 00:11:06,000
+But why?
+
+151
+00:11:06,000 --> 00:11:11,000
+That is because fixing defect on board requires involvement of a bigger group of people.
+
+152
+00:11:11,000 --> 00:11:17,000
+That includes a project manager who will coordinate hotfix on the production environment, key engineer
+
+153
+00:11:17,000 --> 00:11:23,000
+who will a regression testing before deploying solution to production of the hotfix developers time
+
+154
+00:11:23,000 --> 00:11:25,000
+to fix a defect and so on.
+
+155
+00:11:25,000 --> 00:11:31,000
+And this is not taking into account losses that the company gets because of the providing the services.
+
+156
+00:11:31,000 --> 00:11:38,000
+For example, the effect on financial applications may cost millions, but is direct cost increase really
+
+157
+00:11:38,000 --> 00:11:39,000
+through nowadays?
+
+158
+00:11:39,000 --> 00:11:42,000
+And if yes, how big an increase in cost is?
+
+159
+00:11:43,000 --> 00:11:49,000
+I wish I could answer this question precisely, but because of the software specifics, each product
+
+160
+00:11:49,000 --> 00:11:50,000
+is unique.
+
+161
+00:11:50,000 --> 00:11:52,000
+Each business demesne is unique.
+
+162
+00:11:52,000 --> 00:11:58,000
+It is almost impossible to calculate exact cost increase because it depends on nuance factors.
+
+163
+00:11:59,000 --> 00:12:02,000
+But let's try to understand whether this metric is relevant today.
+
+164
+00:12:02,000 --> 00:12:08,000
+Defect cost increase is based on the observations that were discovered in big companies that all of
+
+165
+00:12:08,000 --> 00:12:10,000
+us know in late 60s.
+
+166
+00:12:11,000 --> 00:12:16,000
+That was true for that period of time, since the dominant approach in software delivery and the most
+
+167
+00:12:16,000 --> 00:12:19,000
+popular software development lifecycle was Waterfall.
+
+168
+00:12:20,000 --> 00:12:22,000
+In case you don't know what Waterfall is about.
+
+169
+00:12:23,000 --> 00:12:29,000
+Let me briefly explain to ensure the waterfall is a delivery model that clearly separates the stages
+
+170
+00:12:29,000 --> 00:12:35,000
+of the project, starting from the requirements gathering, designing, prototyping to actual development,
+
+171
+00:12:35,000 --> 00:12:36,000
+testing and release.
+
+172
+00:12:37,000 --> 00:12:42,000
+The whole cycle until you get your application released will take from a few months after years.
+
+173
+00:12:42,000 --> 00:12:46,000
+Whereas nowadays agile Scientologists are commonly used.
+
+174
+00:12:47,000 --> 00:12:52,000
+Different agile methodology are focused on the delivery models that allow us to get feedback from end
+
+175
+00:12:52,000 --> 00:12:55,000
+user as soon as possible and make time.
+
+176
+00:12:55,000 --> 00:12:59,000
+That is, time elapsed from order to delivery as short as possible.
+
+177
+00:13:00,000 --> 00:13:06,000
+So in case fixing the effect according to Waterfall requires code to pass through all stages of ELC
+
+178
+00:13:06,000 --> 00:13:12,000
+one more time, including updating of tons of documentation, thus regression testing, architecture
+
+179
+00:13:12,000 --> 00:13:15,000
+review and hundreds of different approvals.
+
+180
+00:13:15,000 --> 00:13:21,000
+This will take more time and more money rather than in agile SDLC, where you have shortly time and
+
+181
+00:13:21,000 --> 00:13:24,000
+it can deliver a fix for your defect in the next week or two.
+
+182
+00:13:25,000 --> 00:13:30,000
+And in case you use iterative, agile models, you can deliver the fix by the next iteration.
+
+183
+00:13:31,000 --> 00:13:38,000
+So in agile world, direct costs increase metric is not applicable for all domains and all kind of software.
+
+184
+00:13:38,000 --> 00:13:44,000
+Definitely defects in health care or financial application may cost millions, but the effect and some
+
+185
+00:13:44,000 --> 00:13:50,000
+entertainment application specific amount of money also take into account your software development
+
+186
+00:13:50,000 --> 00:13:57,000
+lifecycle allows you to fix it in one week while the supporters and opponents of this theory.
+
+187
+00:13:57,000 --> 00:13:59,000
+One thing is clear for sure.
+
+188
+00:13:59,000 --> 00:14:05,000
+And in case of discovered a defect in the monster to the high chances that a lot of code and other logic
+
+189
+00:14:05,000 --> 00:14:07,000
+will be built around it.
+
+190
+00:14:07,000 --> 00:14:11,000
+And in turn this will make fixing of the defect more complicated.
+
+191
+00:14:12,000 --> 00:14:17,000
+Even in the case we would ignore defect cost increase, it is obvious that it is better to find the
+
+192
+00:14:17,000 --> 00:14:21,000
+defect on the local environment of a developer before pushing it to the repository.
+
+193
+00:14:22,000 --> 00:14:28,000
+So now you can remember that it is a good idea to write tests as soon as it is possible and even before
+
+194
+00:14:28,000 --> 00:14:36,000
+writing code to be able to find defects as early as possible as any other development technique has
+
+195
+00:14:36,000 --> 00:14:37,000
+its own pros and cons.
+
+196
+00:14:37,000 --> 00:14:39,000
+Let's review advantages first.
+
+197
+00:14:40,000 --> 00:14:43,000
+That's got coverage by following the procedure.
+
+198
+00:14:43,000 --> 00:14:45,000
+Ensure high trescott coverage rate.
+
+199
+00:14:45,000 --> 00:14:52,000
+This is good for you as a developer, first of all, and also it is good for important purposes to share
+
+200
+00:14:52,000 --> 00:14:54,000
+with your customers the level of TRESCOTT coverage.
+
+201
+00:14:54,000 --> 00:14:58,000
+Mattrick reducing the number of defects in production.
+
+202
+00:14:58,000 --> 00:15:05,000
+Let us through voluntary approach makes you think about code architecture and about implementation itself,
+
+203
+00:15:05,000 --> 00:15:07,000
+what is needed and what is not.
+
+204
+00:15:07,000 --> 00:15:12,000
+Well thought architecture significantly decreased probability of having defects.
+
+205
+00:15:13,000 --> 00:15:14,000
+Improving quality.
+
+206
+00:15:15,000 --> 00:15:21,000
+This is one of the most important reasons to opt for Kijiji because it helps you to drive architecture
+
+207
+00:15:21,000 --> 00:15:23,000
+of your application great interest.
+
+208
+00:15:24,000 --> 00:15:26,000
+That is clines of your code.
+
+209
+00:15:26,000 --> 00:15:31,000
+You think on the level of abstraction that will help you to build a more reliable architecture that
+
+210
+00:15:31,000 --> 00:15:37,000
+is easy to scale and support, to provide you with automated tasks for aggression testing.
+
+211
+00:15:37,000 --> 00:15:43,000
+If you already worked as a developer, you can imagine the case when project manager comes to you and
+
+212
+00:15:43,000 --> 00:15:47,000
+ask you to perform regression testing or some small checks before deploying you released to.
+
+213
+00:15:48,000 --> 00:15:55,000
+One day you understand that you are trying to perform checks before each release and at this moment
+
+214
+00:15:55,000 --> 00:16:00,000
+you decide to create a set of automated tests that will perform regression testing of the whole system.
+
+215
+00:16:01,000 --> 00:16:05,000
+If you are not familiar with the regression testing and can't understand what it is.
+
+216
+00:16:05,000 --> 00:16:06,000
+Let me explain.
+
+217
+00:16:06,000 --> 00:16:13,000
+Regression testing is defined as a type of software testing to confirm that the recent program or change
+
+218
+00:16:13,000 --> 00:16:16,000
+has not adversely affected the existing features.
+
+219
+00:16:17,000 --> 00:16:23,000
+Regression testing is nothing but a full or partial selection of already executed test cases which are
+
+220
+00:16:23,000 --> 00:16:26,000
+executed to ensure existing functionality work fine.
+
+221
+00:16:27,000 --> 00:16:33,000
+This testing is done to make sure that new code changes should not have side effects on the existing
+
+222
+00:16:33,000 --> 00:16:34,000
+functionalities.
+
+223
+00:16:34,000 --> 00:16:40,000
+It ensures that the old code still rocks once the latest code changes are done and working with we,
+
+224
+00:16:40,000 --> 00:16:45,000
+you don't have to be bothered about creating automated regression tests.
+
+225
+00:16:45,000 --> 00:16:50,000
+Youth y Mucosal really created it during the implementation of your application.
+
+226
+00:16:50,000 --> 00:16:51,000
+Isn't that cool?
+
+227
+00:16:52,000 --> 00:16:58,000
+Code documentation, your test document your code better than any other type of documentation.
+
+228
+00:16:59,000 --> 00:17:05,000
+And what is extremely great about it is that you create life documentation that is now outdated.
+
+229
+00:17:06,000 --> 00:17:10,000
+Since you are running your test constantly, you also update them constantly.
+
+230
+00:17:11,000 --> 00:17:13,000
+Makes it easier to refactor.
+
+231
+00:17:13,000 --> 00:17:14,000
+Why?
+
+232
+00:17:14,000 --> 00:17:19,000
+Because before Equifax, when you have to be sure that you have reliable sort of tests to make sure
+
+233
+00:17:19,000 --> 00:17:26,000
+that those scenarios still work and after you've changed, quote, structure and WTG, you have automated
+
+234
+00:17:26,000 --> 00:17:28,000
+tests for all test cases.
+
+235
+00:17:28,000 --> 00:17:34,000
+Now, when we learned advantages, let's keep be fair to each other and discuss these disadvantages
+
+236
+00:17:34,000 --> 00:17:35,000
+of the approach.
+
+237
+00:17:36,000 --> 00:17:38,000
+Let's go over each item from this list.
+
+238
+00:17:39,000 --> 00:17:41,000
+And the first disadvantage is a test.
+
+239
+00:17:41,000 --> 00:17:42,000
+Got coverage.
+
+240
+00:17:42,000 --> 00:17:48,000
+You might be wondering why, because just a few minutes ago, we listed it as an advantage of the.
+
+241
+00:17:49,000 --> 00:17:50,000
+Let me explain.
+
+242
+00:17:50,000 --> 00:17:54,000
+Many managers tend to focus on metrics like test code coverage.
+
+243
+00:17:54,000 --> 00:17:58,000
+Those metrics tell you nothing about the quality of the tests.
+
+244
+00:17:59,000 --> 00:18:04,000
+If you so lessons about unit testing and test scores coverage, most likely you remember how you can
+
+245
+00:18:04,000 --> 00:18:07,000
+test that shows you one hundred percent test scores coverage.
+
+246
+00:18:08,000 --> 00:18:15,000
+But actually test nassan, there are other things that could be is that your test don't test all possible
+
+247
+00:18:15,000 --> 00:18:20,000
+scenarios or you test all possible scenarios, but you didn't test all possible inputs, arguments from
+
+248
+00:18:20,000 --> 00:18:22,000
+different classes of equivalence.
+
+249
+00:18:23,000 --> 00:18:28,000
+Imagine that you are right and calculator and you have to come up with test method that performs adhesion.
+
+250
+00:18:29,000 --> 00:18:33,000
+And imagine that this method takes to integer objects as arguments.
+
+251
+00:18:33,000 --> 00:18:38,000
+How would you define all possible combinations of arguments that you have to test?
+
+252
+00:18:38,000 --> 00:18:41,000
+Just to recap class of equivalence.
+
+253
+00:18:41,000 --> 00:18:45,000
+That is something we discussed in previous lessons and I'm sure you remember it.
+
+254
+00:18:45,000 --> 00:18:46,000
+But let me quickly recap.
+
+255
+00:18:47,000 --> 00:18:54,000
+Loss of equivalence is a sort of testing technique that divides the input data of a software unit into
+
+256
+00:18:54,000 --> 00:18:59,000
+positions of equivalent data from which test cases can be derived in principle.
+
+257
+00:19:00,000 --> 00:19:03,000
+Test cases are designed to cover each partition at least once.
+
+258
+00:19:04,000 --> 00:19:11,000
+This technique tries to define test cases that uncover classes of errors, thereby reducing the total
+
+259
+00:19:11,000 --> 00:19:13,000
+number of test cases that must be developed.
+
+260
+00:19:13,000 --> 00:19:20,000
+An advantage of this approach is a reduction in the time required for testing software, utilize a number
+
+261
+00:19:20,000 --> 00:19:21,000
+of test cases.
+
+262
+00:19:21,000 --> 00:19:27,000
+So in this particular case, when we need to test addition method in our calculator, there are such
+
+263
+00:19:27,000 --> 00:19:35,000
+classes of equivalence as addition of two positive integers, addition of the negative integers, addition
+
+264
+00:19:35,000 --> 00:19:41,000
+of positive integer with negative integer, addition of negative integers, positive integer additional
+
+265
+00:19:41,000 --> 00:19:46,000
+zeros addition in case first argument is now addition.
+
+266
+00:19:46,000 --> 00:19:54,000
+In case the second argument is now addition of max integer value with max integer value, addition of
+
+267
+00:19:54,000 --> 00:19:58,000
+mean integer value with mean integer value as it makes sense.
+
+268
+00:19:59,000 --> 00:20:04,000
+And by defining classes of equivalence, you can be sure that you outlined all major input arguments
+
+269
+00:20:04,000 --> 00:20:05,000
+for testing your.
+
+270
+00:20:07,000 --> 00:20:10,000
+Now let's get back to our original site with disadvantages.
+
+271
+00:20:10,000 --> 00:20:12,000
+So as you can see, the.
+
+272
+00:20:12,000 --> 00:20:16,000
+It has good coverage, can bring you a false sense of security in your court.
+
+273
+00:20:17,000 --> 00:20:24,000
+The disadvantage is that maintenance followers of did you say that right in court, which typically
+
+274
+00:20:24,000 --> 00:20:31,000
+takes in total the same amount of time as and without taking into account all potential bug fixes and
+
+275
+00:20:31,000 --> 00:20:31,000
+so on?
+
+276
+00:20:32,000 --> 00:20:35,000
+I partially agree with them, but not completely.
+
+277
+00:20:36,000 --> 00:20:40,000
+At the end of the day, your automated code base is also code that requires support.
+
+278
+00:20:41,000 --> 00:20:43,000
+You have to update it when needed.
+
+279
+00:20:43,000 --> 00:20:46,000
+You have to investigate issues and it when needed.
+
+280
+00:20:46,000 --> 00:20:53,000
+For example, your integration test may use deprecated driver and it also takes time for investigation,
+
+281
+00:20:53,000 --> 00:20:56,000
+analysis and fixing your tasks.
+
+282
+00:20:56,000 --> 00:21:00,000
+The same code as all other source code of your program.
+
+283
+00:21:00,000 --> 00:21:07,000
+Whatever people would say regarding speed of development with TGT and can say one thing for sure, WTG
+
+284
+00:21:07,000 --> 00:21:14,000
+your code base is much bigger and it is only up to you to decide whether this is good or bad.
+
+285
+00:21:14,000 --> 00:21:19,000
+Obviously it will depend on how much advantages and benefits you will get in return.
+
+286
+00:21:20,000 --> 00:21:24,000
+But this is something that you have to bear in mind before opting for the EU approach.
+
+287
+00:21:25,000 --> 00:21:26,000
+EU requires skills.
+
+288
+00:21:27,000 --> 00:21:33,000
+As we discussed earlier, using TTG by not experienced developers will not bring you good architecture
+
+289
+00:21:33,000 --> 00:21:39,000
+and other benefits that you expect to get from using the issue to be used by all teams.
+
+290
+00:21:40,000 --> 00:21:41,000
+This is a tricky one.
+
+291
+00:21:41,000 --> 00:21:47,000
+It is completely useless in case the EU will be used only by a few developers in the team at its critical
+
+292
+00:21:47,000 --> 00:21:48,000
+question.
+
+293
+00:21:48,000 --> 00:21:54,000
+Whether you also follow the approach or not use it at all, because all achievements that you can get
+
+294
+00:21:54,000 --> 00:21:58,000
+from using of T.G. applies to each line of code in your application.
+
+295
+00:21:59,000 --> 00:22:03,000
+Is why it is critically important to make sure that all developers in the team follows.
+
+296
+00:22:03,000 --> 00:22:07,000
+The approach is a challenge to learn.
+
+297
+00:22:07,000 --> 00:22:14,000
+I used to work as Stagecoach on one of my projects and faced with the challenge of accepting TGT by
+
+298
+00:22:14,000 --> 00:22:20,000
+developers who never worked with it because it is a completely different mindset, you start seeing
+
+299
+00:22:20,000 --> 00:22:23,000
+in a completely different way and this is maybe complicated.
+
+300
+00:22:24,000 --> 00:22:28,000
+That's why I believe that this can be considered as one of these advantages of TTG.
+
+301
+00:22:29,000 --> 00:22:32,000
+It is hard to apply the knowledge to legacy code base.
+
+302
+00:22:33,000 --> 00:22:38,000
+A lot of the times we are not certain projects from scratch, but helps to add additional features and
+
+303
+00:22:38,000 --> 00:22:40,000
+fix defects in already created code.
+
+304
+00:22:41,000 --> 00:22:45,000
+And this might be complicated to apply to the approach to already existing code base.
+
+305
+00:22:46,000 --> 00:22:52,000
+In such case, you have to start from test code coverage of legacy code, refactor it, remove code
+
+306
+00:22:52,000 --> 00:22:55,000
+that is not used and then proceed working with TGT.
+
+307
+00:22:56,000 --> 00:23:02,000
+That said, you have to consider all the pros and cons before starting work with the now, you know,
+
+308
+00:23:02,000 --> 00:23:05,000
+advantages and disadvantages of using test driven development.
+
+309
+00:23:05,000 --> 00:23:09,000
+And you are ready to make a decision whether you want to apply it on your project.
+
+310
+00:23:10,000 --> 00:23:15,000
+G.G is always a matter of tradeoffs between speed of development and quality.
+
+311
+00:23:15,000 --> 00:23:18,000
+Now let's recap what we have learned today.
+
+312
+00:23:18,000 --> 00:23:26,000
+In this lesson we learned what is now is now test driven development cycle looks like and what red green
+
+313
+00:23:26,000 --> 00:23:29,000
+factor actually means during the last.
+
+314
+00:23:29,000 --> 00:23:33,000
+And we review the difference between test first approach and Tatsuru and development.
+
+315
+00:23:34,000 --> 00:23:40,000
+Hope that after this lesson the answer is clear, revealed what the default cost increase is and how
+
+316
+00:23:40,000 --> 00:23:46,000
+to you may help us to reduce cost of the defect and at the end of the lesson learned advantages and
+
+317
+00:23:46,000 --> 00:23:48,000
+disadvantages of TTG.
+
+318
+00:23:49,000 --> 00:23:50,000
+Thank you all for your attention.
+
+319
+00:23:50,000 --> 00:23:52,000
+See you in the next lesson.
+
diff --git a/37 - TDD, BDD & ATTD/002 BDD & ATTD_en.srt b/37 - TDD, BDD & ATTD/002 BDD & ATTD_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..848b70aed326c612885777c0c860057ea91da22a
--- /dev/null
+++ b/37 - TDD, BDD & ATTD/002 BDD & ATTD_en.srt
@@ -0,0 +1,864 @@
+1
+00:00:06,000 --> 00:00:11,000
+Hello, the students in this class and we are going to learn what behavior driven development is, what
+
+2
+00:00:11,000 --> 00:00:14,000
+acceptance test driven development is and how to use them.
+
+3
+00:00:14,000 --> 00:00:18,000
+We'll start from the definition of biology and its history very briefly.
+
+4
+00:00:19,000 --> 00:00:24,000
+And just to give you a context to better understand what is real comparability.
+
+5
+00:00:24,000 --> 00:00:30,000
+And today I will explain you how to create beauty scenarios and how your syntax looks like during the
+
+6
+00:00:30,000 --> 00:00:31,000
+lesson.
+
+7
+00:00:31,000 --> 00:00:37,000
+I will explain how software engineer can apply embedded knowledge on a daily basis, will review advantages
+
+8
+00:00:37,000 --> 00:00:38,000
+and disadvantages of biggity.
+
+9
+00:00:39,000 --> 00:00:44,000
+And at the end of the lesson, I will explain what acceptance test driven development is and how it
+
+10
+00:00:44,000 --> 00:00:45,000
+is different from reality.
+
+11
+00:00:45,000 --> 00:00:48,000
+And today we have a lot of things to learn today.
+
+12
+00:00:48,000 --> 00:00:56,000
+Let's start and start with let's understand first, what is Madidi stands for behavior driven development.
+
+13
+00:00:56,000 --> 00:01:01,000
+There are a lot of different definitions that describes role and responsibility of biggity.
+
+14
+00:01:01,000 --> 00:01:06,000
+Some of them are very high level and most of them are far from the original meaning.
+
+15
+00:01:06,000 --> 00:01:08,000
+Let me share with you my vision.
+
+16
+00:01:08,000 --> 00:01:15,000
+What is, first of all, is a process of requirement, gathering and analysis in the Internet.
+
+17
+00:01:15,000 --> 00:01:21,000
+You can find a lot of definitions that tells you that it is about estimation, that is about integration
+
+18
+00:01:21,000 --> 00:01:27,000
+tests, or even that ability is the same as a lot of articles that are written by developers on the
+
+19
+00:01:27,000 --> 00:01:30,000
+Internet are completely different from the vision of the founders.
+
+20
+00:01:31,000 --> 00:01:37,000
+It is hard to say who was the author of the idea originally, but it is worth to mention names of people
+
+21
+00:01:37,000 --> 00:01:42,000
+who are investigating agile delivery and wrote articles about Beretti.
+
+22
+00:01:42,000 --> 00:01:46,000
+They are Danielle Knauss least care and can back.
+
+23
+00:01:47,000 --> 00:01:53,000
+The second thing to understand about reality is that it use a special domain specific language called
+
+24
+00:01:53,000 --> 00:02:00,000
+Gurkin to describe a test case that is clear to understand for all parts of development process developers,
+
+25
+00:02:00,000 --> 00:02:02,000
+testers and business representatives.
+
+26
+00:02:03,000 --> 00:02:08,000
+But it ensures that all participants of delivery on the same page regarding software requirements and
+
+27
+00:02:08,000 --> 00:02:15,000
+expected system behaviour meet later today on same example will understand what Gurkin is and how it
+
+28
+00:02:15,000 --> 00:02:15,000
+works.
+
+29
+00:02:16,000 --> 00:02:22,000
+The third thing to learn is that emerged from quiddity to address the disadvantages.
+
+30
+00:02:23,000 --> 00:02:30,000
+The main disadvantages of writing code driven by tests are how to know if a specification is matched
+
+31
+00:02:30,000 --> 00:02:32,000
+that they could deliver business value.
+
+32
+00:02:33,000 --> 00:02:39,000
+Overcoming those disadvantages is viability was born immediately emerged from Tiddy.
+
+33
+00:02:39,000 --> 00:02:42,000
+Then what is the difference between the ability?
+
+34
+00:02:42,000 --> 00:02:47,000
+Let's answer this question to better understand what behavior driven development is about.
+
+35
+00:02:48,000 --> 00:02:54,000
+With dignity, we can be sure that all lines of code are covered with tests and that is really great.
+
+36
+00:02:54,000 --> 00:02:55,000
+We have a lot of tests.
+
+37
+00:02:56,000 --> 00:02:57,000
+All of them are automated.
+
+38
+00:02:57,000 --> 00:02:59,000
+We don't have codes that didn't work.
+
+39
+00:02:59,000 --> 00:03:01,000
+This is just perfect.
+
+40
+00:03:01,000 --> 00:03:08,000
+But are we sure that we wrote the correct tests or what did we use as a source of requirements to create
+
+41
+00:03:08,000 --> 00:03:09,000
+our test cases?
+
+42
+00:03:09,000 --> 00:03:14,000
+Are we sure that we really covered all cases that our program has to address or no?
+
+43
+00:03:15,000 --> 00:03:21,000
+And the last question, how we can be sure that we wrote enough of tests to verify our system ability
+
+44
+00:03:21,000 --> 00:03:26,000
+helps us to define the behavior scenarios that will be used as requirements for our system.
+
+45
+00:03:27,000 --> 00:03:33,000
+What our system has to do when a user has enough management approaches, how our system should behave
+
+46
+00:03:33,000 --> 00:03:38,000
+when user doesn't have enough money for purchase, what will happen during the purchase in case during
+
+47
+00:03:38,000 --> 00:03:44,000
+the checkout system found out that there are no more such products at the warehouse because of the concurrent
+
+48
+00:03:44,000 --> 00:03:48,000
+purchase, but it does not give us answer what mattered in our class.
+
+49
+00:03:48,000 --> 00:03:55,000
+I should verify it is not focused on the code itself, but it helps us to understand what tests we have
+
+50
+00:03:55,000 --> 00:03:59,000
+to write before we start implementation with ability.
+
+51
+00:03:59,000 --> 00:04:05,000
+We can be sure that we tested correct scenarios and in this case, expect that the behavior drives our
+
+52
+00:04:05,000 --> 00:04:06,000
+development.
+
+53
+00:04:06,000 --> 00:04:07,000
+Does it make sense?
+
+54
+00:04:08,000 --> 00:04:13,000
+So instead of focusing on testing some specific acceptance criteria, we are focusing on testing user
+
+55
+00:04:13,000 --> 00:04:14,000
+flows.
+
+56
+00:04:14,000 --> 00:04:20,000
+Those are behavior scenarios which helps us to make specific choices while working with strategy to
+
+57
+00:04:20,000 --> 00:04:25,000
+write specific tests by using desired behavior as a definition for each test case.
+
+58
+00:04:25,000 --> 00:04:32,000
+It helps us with the next things where to start the development process from each scenario, what is
+
+59
+00:04:32,000 --> 00:04:35,000
+has to be tested and what is hasn't had a mean test.
+
+60
+00:04:35,000 --> 00:04:38,000
+Do not forget that I tested such case.
+
+61
+00:04:38,000 --> 00:04:41,000
+What is the precondition for each specific test case?
+
+62
+00:04:41,000 --> 00:04:47,000
+I believe now it is clear what ability is, but we still have a lot of questions to answer.
+
+63
+00:04:47,000 --> 00:04:52,000
+And so one of the questions that you probably are thinking about at the moment is how it helps us to
+
+64
+00:04:52,000 --> 00:04:59,000
+define behavior scenarios, what formats we'll use to create specific scenarios to describe this in
+
+65
+00:04:59,000 --> 00:04:59,000
+the.
+
+66
+00:05:00,000 --> 00:05:05,000
+Were you specific, Syntex, called Gurkin Yelchin, is a business rideable language which helps you
+
+67
+00:05:05,000 --> 00:05:09,000
+to describe business behavior without going into details of implementation.
+
+68
+00:05:10,000 --> 00:05:15,000
+It is the main specific language for the final tests in cucumber format for specifications.
+
+69
+00:05:15,000 --> 00:05:21,000
+Cucumber is a very popular libraries and helps to create automated tests that are mapped to human readable
+
+70
+00:05:21,000 --> 00:05:22,000
+text.
+
+71
+00:05:22,000 --> 00:05:29,000
+This index uses plain language to describe use cases and allows users to remove logic details from behavior
+
+72
+00:05:29,000 --> 00:05:32,000
+tests with the help of simple words.
+
+73
+00:05:32,000 --> 00:05:38,000
+Even when when you describe use case that your system has to implement, it will be easier for you to
+
+74
+00:05:38,000 --> 00:05:39,000
+understand this in practice.
+
+75
+00:05:40,000 --> 00:05:41,000
+Let's take simple examples.
+
+76
+00:05:41,000 --> 00:05:43,000
+It is easy to understand for everyone.
+
+77
+00:05:43,000 --> 00:05:47,000
+Imagine you have to implement login functionality in your application.
+
+78
+00:05:47,000 --> 00:05:49,000
+How would you describe this requirement?
+
+79
+00:05:49,000 --> 00:05:52,000
+Was gertten syntax given?
+
+80
+00:05:52,000 --> 00:05:59,000
+I am the user and I'm not locked in when I press login button, then I see a log in pop up.
+
+81
+00:05:59,000 --> 00:06:03,000
+Here is how scenario will look like because you can understand.
+
+82
+00:06:03,000 --> 00:06:08,000
+You can also use and Keever to combine some conditions in the various scenario.
+
+83
+00:06:08,000 --> 00:06:12,000
+You have precondition that the server given part some action.
+
+84
+00:06:12,000 --> 00:06:19,000
+That is our one part and the result that you want to verify that a thousand parts and I know what is
+
+85
+00:06:19,000 --> 00:06:21,000
+the best about this scenario.
+
+86
+00:06:21,000 --> 00:06:25,000
+Everyone in your team can understand what you expect from the system.
+
+87
+00:06:26,000 --> 00:06:28,000
+Non-technical people like product owners.
+
+88
+00:06:28,000 --> 00:06:34,000
+A business analyst can confirm that this is exact behavior that he expects from the app.
+
+89
+00:06:34,000 --> 00:06:41,000
+Tester can easily understand what he is going to test and developer can easily understand what he has
+
+90
+00:06:41,000 --> 00:06:42,000
+to implement.
+
+91
+00:06:43,000 --> 00:06:48,000
+That is the goal of BGT to make sure that everyone understands the requirements in the same way.
+
+92
+00:06:49,000 --> 00:06:53,000
+And believe me, with such approach, you can describe any functional requirement.
+
+93
+00:06:53,000 --> 00:06:59,000
+You can describe generic scenarios, but this is more advanced techniques of writing ability scenarios
+
+94
+00:06:59,000 --> 00:07:04,000
+and we will not stop on them at this moment because for development purposes, you know more than enough
+
+95
+00:07:04,000 --> 00:07:04,000
+now.
+
+96
+00:07:05,000 --> 00:07:11,000
+Now, let's answer the question why we have to useability and what is more interesting is how regular
+
+97
+00:07:11,000 --> 00:07:13,000
+developer can apply that knowledge in practice.
+
+98
+00:07:14,000 --> 00:07:19,000
+This technique will help you to come up with a set of tests to be sure that you've covered all necessary
+
+99
+00:07:19,000 --> 00:07:20,000
+scenarios.
+
+100
+00:07:20,000 --> 00:07:25,000
+And you can apply this technique while working with Steady, as you can see today.
+
+101
+00:07:25,000 --> 00:07:28,000
+And Verity is not the same thing, but can be used together.
+
+102
+00:07:29,000 --> 00:07:34,000
+Also, the rules of using should work at the beginning of the test name also come from the approach.
+
+103
+00:07:35,000 --> 00:07:37,000
+One of the name test starting from should work.
+
+104
+00:07:38,000 --> 00:07:43,000
+We want to tell behaviors that should be followed by our application in our method.
+
+105
+00:07:43,000 --> 00:07:46,000
+Name would tell what our program should do.
+
+106
+00:07:46,000 --> 00:07:50,000
+Also, you know, likeability helps you to understand the requirements.
+
+107
+00:07:51,000 --> 00:07:57,000
+Imagine that you come to an interview and really can't understand what the task is about and what they
+
+108
+00:07:57,000 --> 00:07:59,000
+want from you in such cases.
+
+109
+00:07:59,000 --> 00:08:04,000
+I always recommend to come down and ask interviewer additional questions.
+
+110
+00:08:04,000 --> 00:08:10,000
+You can ask him that you need to know precondition and expect to be here and start describing the requirements
+
+111
+00:08:10,000 --> 00:08:11,000
+in the format.
+
+112
+00:08:12,000 --> 00:08:17,000
+First of all, this will help you to understand the task better and also it will show your knowledge
+
+113
+00:08:17,000 --> 00:08:18,000
+of Bayji technique.
+
+114
+00:08:19,000 --> 00:08:24,000
+So now you can easily answer a question about how much tests you have to write to be sure that you've
+
+115
+00:08:24,000 --> 00:08:26,000
+covered all necessary requirements.
+
+116
+00:08:26,000 --> 00:08:31,000
+Now we have enough knowledge to understand the advantages and disadvantages of BGT.
+
+117
+00:08:31,000 --> 00:08:33,000
+Let's start from advantages first.
+
+118
+00:08:34,000 --> 00:08:35,000
+So first advantage is that ability.
+
+119
+00:08:35,000 --> 00:08:38,000
+Make sure that business gets what expected.
+
+120
+00:08:38,000 --> 00:08:44,000
+And this is really important because we develop software not always just for fun, but to solve some
+
+121
+00:08:44,000 --> 00:08:46,000
+problem and to help people.
+
+122
+00:08:47,000 --> 00:08:53,000
+Very often we communicate with non-technical people, business owners, marketers who can't understand
+
+123
+00:08:53,000 --> 00:08:54,000
+the development process.
+
+124
+00:08:54,000 --> 00:08:59,000
+But BTD is a simple and understandable thing that everyone can understand.
+
+125
+00:09:00,000 --> 00:09:06,000
+That's why using customer can get the product that behaves exactly in the way customer expected.
+
+126
+00:09:07,000 --> 00:09:13,000
+The second advantage is about helping improve communication energy by providing a readable and understandable
+
+127
+00:09:13,000 --> 00:09:20,000
+vocabulary visually helps reach the communication gap between clients, developers and other stakeholders.
+
+128
+00:09:20,000 --> 00:09:27,000
+A shared language ensures everyone, technical or not, has enough understanding of the status of the
+
+129
+00:09:27,000 --> 00:09:27,000
+project.
+
+130
+00:09:28,000 --> 00:09:33,000
+This creates collaborative environments that helps business and technical teams to create software with
+
+131
+00:09:33,000 --> 00:09:33,000
+business value.
+
+132
+00:09:34,000 --> 00:09:37,000
+The advantage is easy to start with.
+
+133
+00:09:37,000 --> 00:09:41,000
+Madidi is not about making complex things even more harder to understand.
+
+134
+00:09:42,000 --> 00:09:46,000
+The goal of mobility is to simplify things, as you already know.
+
+135
+00:09:46,000 --> 00:09:53,000
+And so an example utilizes specific language called Gurkin, which is so easy and readable that even
+
+136
+00:09:53,000 --> 00:09:57,000
+the users can use it to add features or requests for US advantage.
+
+137
+00:09:57,000 --> 00:10:00,000
+The software design follows business value.
+
+138
+00:10:00,000 --> 00:10:04,000
+In fact, mobility puts a great importance on the business value and needs.
+
+139
+00:10:05,000 --> 00:10:11,000
+By setting priorities with the client based on the value it provides, the developers are able to provide
+
+140
+00:10:11,000 --> 00:10:16,000
+a better result because they have a strong understanding of how the client thinks.
+
+141
+00:10:16,000 --> 00:10:22,000
+By focusing on the value now, using less features are built and the fifth advantage.
+
+142
+00:10:22,000 --> 00:10:25,000
+It is something that logically follows from everything.
+
+143
+00:10:25,000 --> 00:10:27,000
+What we have discussed above lower costs.
+
+144
+00:10:28,000 --> 00:10:34,000
+By improving the communication inside the team, we improve quality of the core, and by improving quality,
+
+145
+00:10:34,000 --> 00:10:39,000
+you are basically reducing the costs of maintenance and minimizing the project's risks.
+
+146
+00:10:39,000 --> 00:10:41,000
+Now let's talk about disadvantages.
+
+147
+00:10:42,000 --> 00:10:48,000
+The first disadvantage is that you can't cover a non-functional requirements with ability to be specific.
+
+148
+00:10:48,000 --> 00:10:54,000
+You still have to use UI mockups in case you have specific requirements for user interface.
+
+149
+00:10:54,000 --> 00:11:01,000
+If you have some specific security, durability, localization and internalization accessibility requirements,
+
+150
+00:11:01,000 --> 00:11:04,000
+all this is hard to capture and describe visibility.
+
+151
+00:11:05,000 --> 00:11:11,000
+So you still have to use is a technical node stability scenarist or additional artifacts to cover and
+
+152
+00:11:11,000 --> 00:11:12,000
+on functional requirements.
+
+153
+00:11:12,000 --> 00:11:16,000
+The second disadvantage is need in communication with stakeholders.
+
+154
+00:11:17,000 --> 00:11:23,000
+Well, this can be just perfect from the standpoint that is not always the case in reality, because
+
+155
+00:11:23,000 --> 00:11:28,000
+according to ability process, you interact with product owners and business representatives on a daily
+
+156
+00:11:28,000 --> 00:11:29,000
+basis.
+
+157
+00:11:29,000 --> 00:11:36,000
+Very often key stakeholders are very busy with multiple other tasks and also technical people and non-technical
+
+158
+00:11:36,000 --> 00:11:41,000
+people are forced to talk to each other and even work together closely to articulate features.
+
+159
+00:11:42,000 --> 00:11:46,000
+Some of the things that this is really a disadvantage of the approach.
+
+160
+00:11:46,000 --> 00:11:48,000
+That's why I mentioned it here.
+
+161
+00:11:48,000 --> 00:11:51,000
+But in my opinion, it is only a matter of priority.
+
+162
+00:11:51,000 --> 00:11:57,000
+And how important the end product for the customer in case the product you develop is a top priority,
+
+163
+00:11:57,000 --> 00:12:02,000
+your customer will be interested more than you in daily communication to address open questions.
+
+164
+00:12:02,000 --> 00:12:05,000
+And Blocher's also it is worth to mention.
+
+165
+00:12:05,000 --> 00:12:11,000
+And such a disadvantage as documentation maintenance workers create and often life scenarios that possibly
+
+166
+00:12:11,000 --> 00:12:18,000
+will be automated requires also support of such documentation and ensure that there is no any contradiction
+
+167
+00:12:18,000 --> 00:12:18,000
+in it.
+
+168
+00:12:19,000 --> 00:12:24,000
+Also, we shouldn't forget that this scenario is not a specification for developers.
+
+169
+00:12:24,000 --> 00:12:31,000
+This scenario won't contain details about the API of dependencies all necessary cause you have to make
+
+170
+00:12:31,000 --> 00:12:37,000
+to extract data you need authorization and acidification of requests also won't be described in detail.
+
+171
+00:12:38,000 --> 00:12:45,000
+So we have to admit that only is not enough to deliver a specific scope of work from the beginning to
+
+172
+00:12:45,000 --> 00:12:45,000
+the end.
+
+173
+00:12:45,000 --> 00:12:51,000
+And the disadvantage in our list is to highlight that implementation of ability on the already existing
+
+174
+00:12:51,000 --> 00:12:52,000
+project.
+
+175
+00:12:52,000 --> 00:12:54,000
+It is not the best thing you can do.
+
+176
+00:12:55,000 --> 00:12:59,000
+Feasibility to an existing project can be a time consuming and difficult process.
+
+177
+00:13:00,000 --> 00:13:06,000
+Should invest in creating the feature files and scenarios for legacy features, or should you just focus
+
+178
+00:13:06,000 --> 00:13:07,000
+on what's coming next?
+
+179
+00:13:07,000 --> 00:13:12,000
+This will be an important consideration with any specification and testing approach.
+
+180
+00:13:12,000 --> 00:13:17,000
+So while not a drawback related, specifically turbidity, it is worth keeping in mind.
+
+181
+00:13:18,000 --> 00:13:24,000
+And now when you know to the ability one of you understand one more important concept that will help
+
+182
+00:13:24,000 --> 00:13:25,000
+you during the development.
+
+183
+00:13:25,000 --> 00:13:32,000
+I want to explain to you what 8D is at the distance for acceptance, test driven development acceptance.
+
+184
+00:13:32,000 --> 00:13:40,000
+Test driven development is related to TTD, but the main design driver as the acceptance tests, the
+
+185
+00:13:40,000 --> 00:13:43,000
+tests are more oriented on communication with end users.
+
+186
+00:13:43,000 --> 00:13:48,000
+Ability is used to define scenarios for test cases that will be automated.
+
+187
+00:13:48,000 --> 00:13:53,000
+Melida itself tells nothing about testing or automation melody.
+
+188
+00:13:53,000 --> 00:13:56,000
+Just describe the approach and how to capture requirements.
+
+189
+00:13:56,000 --> 00:14:00,000
+To be sure, the delivery team and business team on the same page.
+
+190
+00:14:00,000 --> 00:14:07,000
+If you want to compare eternity versus ability, it is worth to say that in general this was only a
+
+191
+00:14:07,000 --> 00:14:07,000
+few differences.
+
+192
+00:14:08,000 --> 00:14:13,000
+As we already discussed in BTD, there is no specific requirement to automate tasks.
+
+193
+00:14:13,000 --> 00:14:18,000
+The main idea is around collaboration and communication in test driven development.
+
+194
+00:14:18,000 --> 00:14:24,000
+Test automation is one of the key things because it's very hard to imagine today with manual testing,
+
+195
+00:14:25,000 --> 00:14:29,000
+but it doesn't put enough stress on how to define correct set of tests.
+
+196
+00:14:30,000 --> 00:14:37,000
+So in case we combine to do with ability, we'll get a TDD will get approach with mandatory test.
+
+197
+00:14:37,000 --> 00:14:43,000
+At a nation where test scenarios will be defined according to the approach is it makes sense and they
+
+198
+00:14:43,000 --> 00:14:45,000
+know what I like the most about eternity.
+
+199
+00:14:46,000 --> 00:14:50,000
+In case you would follow a two day process, there are no defects.
+
+200
+00:14:50,000 --> 00:14:54,000
+There are just Miss Tenaris in case something doesn't work.
+
+201
+00:14:54,000 --> 00:15:00,000
+The first thing you do is check whether such an error is in place and whether you are automated in a
+
+202
+00:15:00,000 --> 00:15:01,000
+case or no such an error.
+
+203
+00:15:02,000 --> 00:15:03,000
+This is not a defect.
+
+204
+00:15:03,000 --> 00:15:07,000
+This is just a new scenario that is super simple.
+
+205
+00:15:08,000 --> 00:15:11,000
+Basically, that's all what I plan to share with you in this lesson.
+
+206
+00:15:11,000 --> 00:15:13,000
+Let's recap what we have learned today.
+
+207
+00:15:14,000 --> 00:15:18,000
+In this lesson we learned what we did is and how we did it.
+
+208
+00:15:18,000 --> 00:15:22,000
+Now you can understand the difference between today and today.
+
+209
+00:15:23,000 --> 00:15:26,000
+On the real example, we saw how Gurkin Syntex looks like.
+
+210
+00:15:26,000 --> 00:15:33,000
+I believe now you can imagine how you can create and readability synonomous we advantages and disadvantages
+
+211
+00:15:33,000 --> 00:15:34,000
+of ability.
+
+212
+00:15:34,000 --> 00:15:40,000
+And at the end of the lesson, we reviewed both acceptance Tatsuru and development is and how it is
+
+213
+00:15:40,000 --> 00:15:42,000
+connected with dignity and visite techniques.
+
+214
+00:15:43,000 --> 00:15:44,000
+That's all for this lesson.
+
+215
+00:15:45,000 --> 00:15:47,000
+I believe we learned a lot today.
+
+216
+00:15:47,000 --> 00:15:50,000
+Thanks a lot for your attention and see you in the next lesson.
+
diff --git a/37 - TDD, BDD & ATTD/003 Source-code-examples-from-the-lesson.url b/37 - TDD, BDD & ATTD/003 Source-code-examples-from-the-lesson.url
new file mode 100644
index 0000000000000000000000000000000000000000..6b4076f1ce5c02cc0bc71046d8d755d1aaa9595a
--- /dev/null
+++ b/37 - TDD, BDD & ATTD/003 Source-code-examples-from-the-lesson.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/blob/master/src/com/itbulls/learnit/javacore/tdd/Template.java
\ No newline at end of file
diff --git a/37 - TDD, BDD & ATTD/003 TDD, BDD & ATTD - Practice_en.srt b/37 - TDD, BDD & ATTD/003 TDD, BDD & ATTD - Practice_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..4fd30b7aebea0f7023cb9a5b425bc66a21631962
--- /dev/null
+++ b/37 - TDD, BDD & ATTD/003 TDD, BDD & ATTD - Practice_en.srt
@@ -0,0 +1,824 @@
+1
+00:00:06,000 --> 00:00:06,000
+Hello.
+
+2
+00:00:06,000 --> 00:00:13,000
+Yes, we have learned a lot about the video and 80 dead by this moment, but the most interesting thing
+
+3
+00:00:13,000 --> 00:00:20,000
+is to how put gain knowledge and practice and in this lesson will be mostly focused on the practical
+
+4
+00:00:20,000 --> 00:00:26,000
+side of tragedy and the approach on the simple example, I will show you how we can develop applications
+
+5
+00:00:26,000 --> 00:00:29,000
+from scratch, use an acceptance test driven development.
+
+6
+00:00:29,000 --> 00:00:34,000
+After this lesson, you'll have enough theoretical and practical knowledge to start using tragedy in
+
+7
+00:00:34,000 --> 00:00:35,000
+your everyday development.
+
+8
+00:00:36,000 --> 00:00:40,000
+My goal is to help you understand and feel the rhythm of the development.
+
+9
+00:00:41,000 --> 00:00:47,000
+Writing the test is just in exploring the house in the dark while walking from one room to another,
+
+10
+00:00:47,000 --> 00:00:49,000
+gradually learning everything about the house.
+
+11
+00:00:50,000 --> 00:00:56,000
+Similar to that, we are writing our application by writing one single test at a time and understand
+
+12
+00:00:56,000 --> 00:00:58,000
+how our application will look like today.
+
+13
+00:00:58,000 --> 00:01:04,000
+Will implement application for marketing, Department of Energy Innovation, you know, different online
+
+14
+00:01:04,000 --> 00:01:04,000
+services.
+
+15
+00:01:04,000 --> 00:01:07,000
+It provides the responsibility to create personalized emails.
+
+16
+00:01:08,000 --> 00:01:12,000
+For example, you have email template for every employee for special occasion.
+
+17
+00:01:12,000 --> 00:01:17,000
+Each year, each employee receives email with his name and number of years.
+
+18
+00:01:17,000 --> 00:01:20,000
+He worked in the company, but template is the same.
+
+19
+00:01:20,000 --> 00:01:26,000
+So we have an application that allows the best personalized information into the email template and
+
+20
+00:01:26,000 --> 00:01:27,000
+send it.
+
+21
+00:01:27,000 --> 00:01:33,000
+Or imagine some template about patches where we have the best name of our customer, his order and total
+
+22
+00:01:33,000 --> 00:01:34,000
+price.
+
+23
+00:01:34,000 --> 00:01:39,000
+Can you understand what this application is about to help you understand what application we are going
+
+24
+00:01:39,000 --> 00:01:41,000
+to implement on the slide?
+
+25
+00:01:41,000 --> 00:01:43,000
+You can find some analogs.
+
+26
+00:01:43,000 --> 00:01:47,000
+You can Google this in case you are interested in this specific example.
+
+27
+00:01:47,000 --> 00:01:52,000
+And we have never faced with such applications before and we will implement this application with stagy
+
+28
+00:01:52,000 --> 00:01:59,000
+approach will apply our knowledge of ability as we keep progressing with implementation where we have
+
+29
+00:01:59,000 --> 00:02:00,000
+to start.
+
+30
+00:02:00,000 --> 00:02:02,000
+What object shall we create?
+
+31
+00:02:02,000 --> 00:02:04,000
+That is the wrong question.
+
+32
+00:02:04,000 --> 00:02:06,000
+We should start from objects.
+
+33
+00:02:06,000 --> 00:02:08,000
+We have to start from tests.
+
+34
+00:02:08,000 --> 00:02:10,000
+When we start from test.
+
+35
+00:02:10,000 --> 00:02:12,000
+It is similar for us telling a story.
+
+36
+00:02:12,000 --> 00:02:18,000
+We have to watch our application from outside and understand what interfaces, classes and methods we
+
+37
+00:02:18,000 --> 00:02:19,000
+are going to use.
+
+38
+00:02:20,000 --> 00:02:25,000
+But before start writing a test, we have to come up with a final list of scenarios that we are going
+
+39
+00:02:25,000 --> 00:02:26,000
+to test to do this.
+
+40
+00:02:26,000 --> 00:02:33,000
+Let decompose our requirements first will try to think about expected to be here and apply the knowledge.
+
+41
+00:02:33,000 --> 00:02:37,000
+I will translate general requirements to specific set of requirements.
+
+42
+00:02:37,000 --> 00:02:43,000
+The first thing we have to implement is that our email template should have variable placeholders.
+
+43
+00:02:43,000 --> 00:02:49,000
+The second thing we have to implement is that our application should substitute verbal placeholders
+
+44
+00:02:49,000 --> 00:02:55,000
+from a template with values provided at runtime in case application will not have enough values to populate.
+
+45
+00:02:55,000 --> 00:02:59,000
+All of the placeholders in the template system will throw an error.
+
+46
+00:03:00,000 --> 00:03:03,000
+Well, it looks like this should be enough, at least for the beginning.
+
+47
+00:03:03,000 --> 00:03:09,000
+And based on our original requirements, what I have to do next, we have complete behaviors, scenarios.
+
+48
+00:03:09,000 --> 00:03:13,000
+Now let's turn this Tenaris into automated tests.
+
+49
+00:03:13,000 --> 00:03:20,000
+One of the key ideas internally is keeping things as simple as it is possible will not start full implementation
+
+50
+00:03:20,000 --> 00:03:22,000
+of all possible tasks.
+
+51
+00:03:22,000 --> 00:03:23,000
+Start small.
+
+52
+00:03:24,000 --> 00:03:27,000
+We'll start from one single test and we will proceed one by one.
+
+53
+00:03:28,000 --> 00:03:30,000
+Let's start implementation of our first error.
+
+54
+00:03:31,000 --> 00:03:38,000
+I translated the British language first and after that will implement test given I have an email template
+
+55
+00:03:38,000 --> 00:03:43,000
+that looks like hello first name and you can see that there is a first name placeholder in it.
+
+56
+00:03:43,000 --> 00:03:49,000
+When I said placeholder value into the template and I call method create email text with named John
+
+57
+00:03:50,000 --> 00:03:50,000
+that I have.
+
+58
+00:03:50,000 --> 00:03:51,000
+Hello John.
+
+59
+00:03:52,000 --> 00:03:54,000
+At the moment I create a test.
+
+60
+00:03:54,000 --> 00:04:01,000
+I ask myself what API will be comfortable to use, how I'd like to interact with the system to get a
+
+61
+00:04:01,000 --> 00:04:02,000
+specific result.
+
+62
+00:04:03,000 --> 00:04:08,000
+This is the moment when I realized that it would be just perfect to have template class that would take
+
+63
+00:04:08,000 --> 00:04:11,000
+some template as an argument in constructor.
+
+64
+00:04:11,000 --> 00:04:18,000
+It seems to be a good idea to separate placeholders somehow and I decide to use those side and parentheses.
+
+65
+00:04:19,000 --> 00:04:22,000
+But how I would like to pass values for variables.
+
+66
+00:04:22,000 --> 00:04:26,000
+It looks like I need to set a behavior to my template object.
+
+67
+00:04:26,000 --> 00:04:32,000
+I will declare a set method that can set value for specific placeholder and I feel like it is a good
+
+68
+00:04:32,000 --> 00:04:39,000
+idea to create email text message after I said all necessary values to get my final email text when
+
+69
+00:04:39,000 --> 00:04:42,000
+I wrote this test, it doesn't even compile.
+
+70
+00:04:42,000 --> 00:04:47,000
+I don't have such class as a template, for example, I don't have set method in it and I don't have
+
+71
+00:04:47,000 --> 00:04:49,000
+great email text method in it.
+
+72
+00:04:50,000 --> 00:04:53,000
+The first I have to do is just to make my compiler happy.
+
+73
+00:04:54,000 --> 00:05:00,000
+I will create a class and all necessary measures that do nothing or just return default values.
+
+74
+00:05:00,000 --> 00:05:02,000
+Now I am in a position to run my.
+
+75
+00:05:03,000 --> 00:05:06,000
+And it failed, as we expected.
+
+76
+00:05:06,000 --> 00:05:13,000
+We are in the red stage of our cycle, at least now we have a concrete measure of failure that is better
+
+77
+00:05:13,000 --> 00:05:15,000
+than just vaguely know we are failing.
+
+78
+00:05:16,000 --> 00:05:18,000
+We do not have bad requirements at this moment.
+
+79
+00:05:18,000 --> 00:05:23,000
+We have concrete tasks that we need to make green according to the approach.
+
+80
+00:05:23,000 --> 00:05:25,000
+We have to implement the easiest version of code.
+
+81
+00:05:25,000 --> 00:05:30,000
+It is possible and write as less as we can just to make this test pass.
+
+82
+00:05:31,000 --> 00:05:37,000
+We don't need to find the best ever solution now and sink an hour about implementation of our MACIT.
+
+83
+00:05:37,000 --> 00:05:41,000
+We have only one goal to make our test green.
+
+84
+00:05:41,000 --> 00:05:43,000
+So let's do it.
+
+85
+00:05:43,000 --> 00:05:48,000
+And the easiest way to make this test pass is just to hardcourt expected to return value.
+
+86
+00:05:49,000 --> 00:05:54,000
+I know that probably you will not like the solution, but to be patient you will understand everything
+
+87
+00:05:54,000 --> 00:05:55,000
+by the end of this lesson.
+
+88
+00:05:56,000 --> 00:05:58,000
+Just watch less until the end.
+
+89
+00:05:58,000 --> 00:06:04,000
+We can fake the result and gradually we will refactor this hardcourt as we implement another test cases.
+
+90
+00:06:05,000 --> 00:06:07,000
+We are in a green phase right now.
+
+91
+00:06:07,000 --> 00:06:09,000
+We can refactor this code now or a factory.
+
+92
+00:06:09,000 --> 00:06:15,000
+The next iteration, I would suggest to refactor this code during the next iteration when need for refactoring
+
+93
+00:06:15,000 --> 00:06:18,000
+will be more Augur's each iteration.
+
+94
+00:06:18,000 --> 00:06:25,000
+I will run all tests to make sure the tests that are already created not let us come up with the next
+
+95
+00:06:25,000 --> 00:06:25,000
+scenario.
+
+96
+00:06:26,000 --> 00:06:27,000
+What will happen in the case?
+
+97
+00:06:27,000 --> 00:06:29,000
+I will set another value to template.
+
+98
+00:06:30,000 --> 00:06:35,000
+Let's create additional tests where I pass another, where instead of John, I use name realignments
+
+99
+00:06:35,000 --> 00:06:39,000
+that in case I will run this test, it will be red again.
+
+100
+00:06:39,000 --> 00:06:46,000
+And obviously that is something that we expected because no matter what happens, I return hardcoded
+
+101
+00:06:46,000 --> 00:06:52,000
+value so far and now we're in a position when we need to do changes in our code to make a test pass.
+
+102
+00:06:53,000 --> 00:06:58,000
+After thinking a bit about the implementation, I see that I have duplication of failures here.
+
+103
+00:06:58,000 --> 00:07:05,000
+The attention that I pass Lane to the test method and also hardcoded as are transferring, let's get
+
+104
+00:07:05,000 --> 00:07:06,000
+rid of this duplication.
+
+105
+00:07:06,000 --> 00:07:12,000
+It looks like I have to save placeholder value when I pass it to set method to save this value.
+
+106
+00:07:12,000 --> 00:07:19,000
+Let's declare one more field that is called placeholder value and initialize it with values that I pass
+
+107
+00:07:19,000 --> 00:07:20,000
+to the set method.
+
+108
+00:07:20,000 --> 00:07:25,000
+And to be sure that both tests are passed, I need to just create email text method.
+
+109
+00:07:26,000 --> 00:07:29,000
+You're not going to like my solution and I understand that.
+
+110
+00:07:29,000 --> 00:07:33,000
+But it will be time to make this code looks more beautiful a little bit later.
+
+111
+00:07:33,000 --> 00:07:40,000
+As of now, I have called on the world together with common space and after that I concatenate the string
+
+112
+00:07:40,000 --> 00:07:47,000
+literal with my placeholder value and now I get the result that I expect in both cases, even when I
+
+113
+00:07:47,000 --> 00:07:48,000
+pass a different placeholder value.
+
+114
+00:07:49,000 --> 00:07:55,000
+While it is obvious for that such solution wouldn't work in all cases, I want you to prove me this
+
+115
+00:07:55,000 --> 00:08:02,000
+and specify in which specific cases this solution will not work so that we can adjust our core accordingly.
+
+116
+00:08:03,000 --> 00:08:07,000
+And to specify this, we have to create new tests.
+
+117
+00:08:07,000 --> 00:08:13,000
+I would even say that it is time for effect phase now, but this is not very obvious to my students.
+
+118
+00:08:13,000 --> 00:08:15,000
+What we have to refactor here.
+
+119
+00:08:15,000 --> 00:08:21,000
+We have at least something to refactor at all, usually the user factor and we are removing duplicated
+
+120
+00:08:21,000 --> 00:08:26,000
+chunks of code and it is not so obvious at the beginning what after a factor here, there is no need
+
+121
+00:08:26,000 --> 00:08:27,000
+to refactor.
+
+122
+00:08:27,000 --> 00:08:29,000
+There is need to change implementation.
+
+123
+00:08:29,000 --> 00:08:31,000
+That's what my students usually tell me.
+
+124
+00:08:31,000 --> 00:08:38,000
+If I would say that we need to remove the application, what it will be, press pause for a second and
+
+125
+00:08:38,000 --> 00:08:39,000
+think about it.
+
+126
+00:08:39,000 --> 00:08:40,000
+Let me give you a hint.
+
+127
+00:08:41,000 --> 00:08:46,000
+What if we talk not exactly about lines of code, the application, but talk about values, duplication,
+
+128
+00:08:47,000 --> 00:08:50,000
+just another one, remove duplication of one parameter.
+
+129
+00:08:51,000 --> 00:08:52,000
+Is there any other application?
+
+130
+00:08:53,000 --> 00:08:55,000
+Can you see how hello, what is duplicated?
+
+131
+00:08:56,000 --> 00:09:01,000
+We use it as an argument in our constructor and we hardcoded in our create email text method.
+
+132
+00:09:01,000 --> 00:09:02,000
+Can you see this?
+
+133
+00:09:03,000 --> 00:09:07,000
+We can either refactor this code now or just come up with another test case.
+
+134
+00:09:07,000 --> 00:09:09,000
+It will help us to adjust our code accordingly.
+
+135
+00:09:10,000 --> 00:09:11,000
+No matter what we will choose.
+
+136
+00:09:11,000 --> 00:09:14,000
+We'll get to the point that meets all the requirements.
+
+137
+00:09:15,000 --> 00:09:17,000
+That is the beauty of TI digits cycle.
+
+138
+00:09:17,000 --> 00:09:24,000
+And remember, the is not about making small steps to G is about making teeny tiny steps.
+
+139
+00:09:24,000 --> 00:09:30,000
+Usually for my students it is more clear when I explain the need of change with the help of a new test.
+
+140
+00:09:31,000 --> 00:09:33,000
+So let's just create a new test case.
+
+141
+00:09:33,000 --> 00:09:36,000
+Let's create another test and passed different template.
+
+142
+00:09:37,000 --> 00:09:41,000
+Let's say we are going to say hi instead of hello in the beginning of our message.
+
+143
+00:09:41,000 --> 00:09:43,000
+This test will be read at the beginning.
+
+144
+00:09:44,000 --> 00:09:45,000
+Let's make it green.
+
+145
+00:09:45,000 --> 00:09:51,000
+And to make sure that new test is passed, we have to get rid of the another duplication that we have
+
+146
+00:09:51,000 --> 00:09:51,000
+in our code.
+
+147
+00:09:52,000 --> 00:09:58,000
+Let's introduce one more field in this class and we will set the stage during the object in utilization,
+
+148
+00:09:58,000 --> 00:10:00,000
+we pass template our constructor.
+
+149
+00:10:01,000 --> 00:10:02,000
+So now we save the template.
+
+150
+00:10:03,000 --> 00:10:09,000
+The field called template text will use this template text during the creation of email text, and now
+
+151
+00:10:09,000 --> 00:10:12,000
+we can say that we removed duplication.
+
+152
+00:10:12,000 --> 00:10:13,000
+We have a template.
+
+153
+00:10:13,000 --> 00:10:19,000
+Now, the only thing that we still have to do is to substitute placeholder value in the template and
+
+154
+00:10:19,000 --> 00:10:20,000
+our test will pass.
+
+155
+00:10:21,000 --> 00:10:27,000
+The simplest option to implement this is to use regular expression to substitute placeholder with actual
+
+156
+00:10:27,000 --> 00:10:27,000
+value.
+
+157
+00:10:28,000 --> 00:10:30,000
+This is not a lesson about regular expressions.
+
+158
+00:10:30,000 --> 00:10:35,000
+I assume you know what it is in case you are interested in learning the regular expressions and how
+
+159
+00:10:35,000 --> 00:10:37,000
+to work with them in Java.
+
+160
+00:10:37,000 --> 00:10:41,000
+Check my Java course and that is why create email text message.
+
+161
+00:10:41,000 --> 00:10:47,000
+Currently it looks like this I could replace all Masset and substitute placeholder name with actual
+
+162
+00:10:47,000 --> 00:10:47,000
+value.
+
+163
+00:10:48,000 --> 00:10:51,000
+Hope you already see the drawbacks of this solution again.
+
+164
+00:10:52,000 --> 00:10:58,000
+I had recorded and duplicated placeholder value in create email, text method and insert method because
+
+165
+00:10:58,000 --> 00:11:02,000
+this solution doesn't allow me to use different placeholders in the template.
+
+166
+00:11:03,000 --> 00:11:06,000
+What will happen in case I want to add first name and last name.
+
+167
+00:11:06,000 --> 00:11:13,000
+So let's make things as easy as possible and we'll just write additional test in this test.
+
+168
+00:11:13,000 --> 00:11:19,000
+I want to be sure that when I add multiple placeholders and set different values for different placeholders,
+
+169
+00:11:19,000 --> 00:11:20,000
+I get a valid email text.
+
+170
+00:11:21,000 --> 00:11:25,000
+Let's say that we need to personalize our email with the first name and last name.
+
+171
+00:11:26,000 --> 00:11:31,000
+This test case seems to be completely valid and it looks like we really need this test case.
+
+172
+00:11:31,000 --> 00:11:33,000
+Nothing to add here.
+
+173
+00:11:33,000 --> 00:11:39,000
+The only thing that we have to do is to adjust our implementation to make sure that this test is passed.
+
+174
+00:11:40,000 --> 00:11:46,000
+When we have such test case, it becomes obvious for us that we need to store mapping between the placeholders,
+
+175
+00:11:46,000 --> 00:11:48,000
+names and placeholders values.
+
+176
+00:11:48,000 --> 00:11:52,000
+That's why I introduce my field in a template class.
+
+177
+00:11:52,000 --> 00:11:59,000
+Every time I set a value into my template, I add it to my map and when I create an email text based
+
+178
+00:11:59,000 --> 00:12:05,000
+on the template, I run over each entry in my verbose map and substitute them in my result template.
+
+179
+00:12:06,000 --> 00:12:07,000
+Does it make sense?
+
+180
+00:12:07,000 --> 00:12:10,000
+We still have one more requirement to cover.
+
+181
+00:12:10,000 --> 00:12:15,000
+We have to throw an exception in case there are not enough values for all placeholders.
+
+182
+00:12:15,000 --> 00:12:17,000
+We write our task first.
+
+183
+00:12:17,000 --> 00:12:22,000
+In this case, I have two placeholders in my template and I didn't set any value.
+
+184
+00:12:22,000 --> 00:12:29,000
+I expect this runtime exception with a message not enough values for template will be thrown that into
+
+185
+00:12:29,000 --> 00:12:29,000
+the mandate.
+
+186
+00:12:30,000 --> 00:12:32,000
+So different ways to implement that.
+
+187
+00:12:32,000 --> 00:12:38,000
+My goal is to opt for the easiest way to make turns green and update code later during the refactoring
+
+188
+00:12:38,000 --> 00:12:39,000
+phase in case it would be needed.
+
+189
+00:12:40,000 --> 00:12:44,000
+And the easiest way would be to check whether there is any placeholder left in a template.
+
+190
+00:12:44,000 --> 00:12:50,000
+After I replaced all values that I'm aware about in case there is still a placeholder without the value,
+
+191
+00:12:50,000 --> 00:12:52,000
+I throw an exception.
+
+192
+00:12:52,000 --> 00:12:53,000
+That's it.
+
+193
+00:12:53,000 --> 00:12:57,000
+It looks like that's all requirements that we agreed to implement at the beginning of our lesson.
+
+194
+00:12:58,000 --> 00:13:03,000
+Here is how template class looked at the beginning of our lesson and here is how it looks now after
+
+195
+00:13:03,000 --> 00:13:06,000
+we went through the multiple iterations of the cycle.
+
+196
+00:13:07,000 --> 00:13:13,000
+Can you see the difference now in such libraries as the unit and some local libraries like Marketo is
+
+197
+00:13:13,000 --> 00:13:14,000
+a mark.
+
+198
+00:13:14,000 --> 00:13:17,000
+You can create even more complex things following TEGA approach.
+
+199
+00:13:18,000 --> 00:13:23,000
+I believe that by this moment and now, of course, you have enough information and knowledge about
+
+200
+00:13:23,000 --> 00:13:26,000
+different tools to be able to work with dignity.
+
+201
+00:13:26,000 --> 00:13:32,000
+Anyway, in case you have any questions, you are always welcome to post them and Q&A section of this
+
+202
+00:13:32,000 --> 00:13:35,000
+course and always will be happy to answer those.
+
+203
+00:13:35,000 --> 00:13:40,000
+I believe we can consider this practical lesson as completed because the goal was achieved and if so,
+
+204
+00:13:40,000 --> 00:13:43,000
+how to apply to the series in real life.
+
+205
+00:13:43,000 --> 00:13:45,000
+Have a great day, my friends.
+
+206
+00:13:45,000 --> 00:13:46,000
+See you in the next lesson.
+
diff --git a/37 - TDD, BDD & ATTD/004 Quiz Testing for Software Engineers - Check yourself.html b/37 - TDD, BDD & ATTD/004 Quiz Testing for Software Engineers - Check yourself.html
new file mode 100644
index 0000000000000000000000000000000000000000..de87e9a299778db9b9c52c4a9bc0e14d1e30696f
--- /dev/null
+++ b/37 - TDD, BDD & ATTD/004 Quiz Testing for Software Engineers - Check yourself.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+ Quiz Testing for Software Engineers - Check yourself
+
+
+
+
+
+
+
Quiz Testing for Software Engineers - Check yourself
+
Quiz Link: https://forms.gle/bZyRsiEHG769M92B7
The quiz doesn’t require you to log in or submit any personal information. Your data privacy is my priority.
The Quiz covers content from the following lessons:
Testing for Software Engineers
Unit Testing & JUnit Overview
JUnit 5 examples VS JUnit 4 + Equivalence class partitioning
JUnit 5 API (Advanced) & Test Code Coverage
JUnit API (Advanced p.2) & Hamcrest
Mockito: Part 1
Mockito: Part 2
PowerMock
Test-Driven Development
BDD & ATTD
Quiz Instructions:
This quiz is designed to help you check your understanding of the content from the previous lessons. All questions are based only on material covered in the lessons you've already watched, so there’s no need to worry about unfamiliar topics.
Each question has one correct answer. Select the best answer and click "Submit" when you're ready.
After submitting, you'll see your score. For each question, you earn 1 point.
Click "View Results" to see the explanations for each correct answer. Reviewing these explanations can help reinforce your understanding.
If you score below 70%, I recommend revisiting the previous lessons. However, if the explanations make sense and you’re confident in your understanding, feel free to move on.
If any explanations are unclear, please don’t hesitate to post questions in the Q&A section—I’m here to help!
+
+
+
+
diff --git a/37 - TDD, BDD & ATTD/external-links.txt b/37 - TDD, BDD & ATTD/external-links.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b6c349066d91641092b1a3ac490f2a3371ccf2ab
--- /dev/null
+++ b/37 - TDD, BDD & ATTD/external-links.txt
@@ -0,0 +1,3 @@
+
+003 Source-code-examples-from-the-lesson
+https://github.com/AndriiPiatakha/learnit_java_core/blob/master/src/com/itbulls/learnit/javacore/tdd/Template.java
diff --git a/38 - Object-oriented Architecture, Clean Code Design (Advanced)/001 Clean Code Architecture, Coupling & Cohesion_en.srt b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/001 Clean Code Architecture, Coupling & Cohesion_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..75f4fc9c0d40c4da156cc17436b961171513b57b
--- /dev/null
+++ b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/001 Clean Code Architecture, Coupling & Cohesion_en.srt
@@ -0,0 +1,1108 @@
+1
+00:00:05,000 --> 00:00:11,000
+Hello, yes, students in this lesson, we'll talk about clean architecture, hopefully that after this
+
+2
+00:00:11,000 --> 00:00:15,000
+lesson you will understand what clean architecture is and why do we need it.
+
+3
+00:00:16,000 --> 00:00:23,000
+And to understand what clean architecture is, we have to understand basic and core concepts in this
+
+4
+00:00:23,000 --> 00:00:28,000
+lesson will give answers on questions, what is happening and what is cohesion.
+
+5
+00:00:28,000 --> 00:00:31,000
+We'll talk about different types of coplan and cohesion.
+
+6
+00:00:31,000 --> 00:00:36,000
+I will explain the benefits of clean architecture designed to motivate your watch following lessons
+
+7
+00:00:36,000 --> 00:00:37,000
+from this section.
+
+8
+00:00:38,000 --> 00:00:43,000
+On the real example, I'm going to show you what is a Plug-In concept in architecture.
+
+9
+00:00:43,000 --> 00:00:47,000
+And by the end of the lesson, you will understand why we need clean architecture.
+
+10
+00:00:48,000 --> 00:00:52,000
+Also, we'll talk about advantages and disadvantages of green architecture.
+
+11
+00:00:53,000 --> 00:00:57,000
+Let's answer first what can be considered as a clean architecture.
+
+12
+00:00:57,000 --> 00:01:03,000
+There are multiple ways to answer this question, but if you would ask me to answer this question in
+
+13
+00:01:03,000 --> 00:01:05,000
+one sentence, I will answer like this.
+
+14
+00:01:06,000 --> 00:01:10,000
+Clean architecture is a code that has low coupling and high cohesion.
+
+15
+00:01:10,000 --> 00:01:16,000
+Probably this statement produces even more questions like what is low carbon and high cohesion?
+
+16
+00:01:17,000 --> 00:01:18,000
+Let me answer this.
+
+17
+00:01:19,000 --> 00:01:22,000
+I will start from explaining of what Coplan is.
+
+18
+00:01:22,000 --> 00:01:26,000
+Captain is a degree of interconnection between program modules.
+
+19
+00:01:26,000 --> 00:01:33,000
+The other definition of carbon sounds like this carbon refers to the degree of direct knowledge that
+
+20
+00:01:33,000 --> 00:01:35,000
+one element has often another.
+
+21
+00:01:35,000 --> 00:01:41,000
+In other words, how often do changes in Class A force relate to changes in Class B?
+
+22
+00:01:42,000 --> 00:01:45,000
+The are two main types of Coplan Zaya.
+
+23
+00:01:45,000 --> 00:01:51,000
+High carbon are also tied carbon and low carbon that sometimes is called loose.
+
+24
+00:01:51,000 --> 00:01:59,000
+Coplin high carbon is usually considered as ADMET Design Y because the code that is written is not easy
+
+25
+00:01:59,000 --> 00:02:00,000
+to scale.
+
+26
+00:02:00,000 --> 00:02:08,000
+Test independently and support high carbon means that it is almost impossible to make change in one
+
+27
+00:02:08,000 --> 00:02:12,000
+module, one single unit like class without updating another class.
+
+28
+00:02:12,000 --> 00:02:19,000
+Also, you can to use program modules independently and it is harder to get the logic of the code and
+
+29
+00:02:19,000 --> 00:02:20,000
+read it in general.
+
+30
+00:02:20,000 --> 00:02:25,000
+If you have high Coplin, two or more classes are often changed together.
+
+31
+00:02:26,000 --> 00:02:28,000
+Low carbon is something completely opposite.
+
+32
+00:02:28,000 --> 00:02:32,000
+This is usually an indicator of a good design and clean architecture.
+
+33
+00:02:33,000 --> 00:02:40,000
+We can say that there is low carbon in our code in case modules in our application are relatively independent.
+
+34
+00:02:40,000 --> 00:02:44,000
+That means they can be improved independently and tested independently.
+
+35
+00:02:45,000 --> 00:02:53,000
+The different types of Coplin that we need to be aware of when we talk about copying Zaya content Koplin.
+
+36
+00:02:53,000 --> 00:02:59,000
+This is when one module relies on the content of another module, for example, in case we use data
+
+37
+00:02:59,000 --> 00:03:06,000
+from another module and when changes in the source code of one module will lead us to changes of code
+
+38
+00:03:06,000 --> 00:03:12,000
+in another module in a content coplan, one module can modify the data of another module or control
+
+39
+00:03:12,000 --> 00:03:15,000
+flow is passed from one to the other module.
+
+40
+00:03:16,000 --> 00:03:19,000
+This is the worst form of copying and should be avoided.
+
+41
+00:03:20,000 --> 00:03:21,000
+Common Koplin.
+
+42
+00:03:21,000 --> 00:03:28,000
+This case describes copying of two modules when both of them work with the same data shared across the
+
+43
+00:03:28,000 --> 00:03:29,000
+application.
+
+44
+00:03:29,000 --> 00:03:35,000
+For example, with some global variable, the modules have shared data such as global data structures.
+
+45
+00:03:36,000 --> 00:03:43,000
+The changes in global data mean tracking back to all modules, which acts as data to evaluate the effect
+
+46
+00:03:43,000 --> 00:03:44,000
+of the change.
+
+47
+00:03:44,000 --> 00:03:51,000
+So it has got disadvantages like difficulty in reusing modules, reduced ability to control data accesses
+
+48
+00:03:51,000 --> 00:03:59,000
+and reduced maintainability external coupling when two modules use protocol and formats for communication
+
+49
+00:03:59,000 --> 00:04:06,000
+that are set by as a module that is called external Koplin, an external Coplin, the modules depend
+
+50
+00:04:06,000 --> 00:04:13,000
+on the modules external to the software being developed or to a particular type of hardware control
+
+51
+00:04:13,000 --> 00:04:14,000
+coupling.
+
+52
+00:04:14,000 --> 00:04:19,000
+This type of coupling refers to the case when one module manages ASAWA.
+
+53
+00:04:19,000 --> 00:04:26,000
+If the modules communicate by posehn control information, then they are set to be controlled coupled.
+
+54
+00:04:26,000 --> 00:04:33,000
+It can be bad if parameters indicate completely different behaviour and good if parameters allow factoring
+
+55
+00:04:33,000 --> 00:04:34,000
+and reuse of functionality.
+
+56
+00:04:35,000 --> 00:04:40,000
+For example, imagine search function that takes comparison function as an argument.
+
+57
+00:04:40,000 --> 00:04:48,000
+Data structures Coplin when modules use the same data structure but different parts of it that is called
+
+58
+00:04:48,000 --> 00:04:49,000
+data structured.
+
+59
+00:04:49,000 --> 00:04:51,000
+Coplin data coupling.
+
+60
+00:04:52,000 --> 00:04:54,000
+This is when two modules use the same data.
+
+61
+00:04:55,000 --> 00:04:58,000
+Let's say with the help of mass parameters it.
+
+62
+00:04:58,000 --> 00:05:03,000
+The dependency between the modules is based on the fact that they communicate by passing on the data.
+
+63
+00:05:04,000 --> 00:05:11,000
+The modules are said to be data kaputt in data coplan, the components are independent to each other
+
+64
+00:05:11,000 --> 00:05:14,000
+and communicate through data message.
+
+65
+00:05:14,000 --> 00:05:21,000
+Coplin one module, talk to each other using only parameters on messages that is called Message Coplan.
+
+66
+00:05:22,000 --> 00:05:24,000
+Now let's answer the question.
+
+67
+00:05:24,000 --> 00:05:27,000
+What is better, low or high?
+
+68
+00:05:27,000 --> 00:05:32,000
+Koplin, I already gave give you a hint that no carbon is usually considered as a good design.
+
+69
+00:05:33,000 --> 00:05:37,000
+But why in general that carbon is bad in most of the time?
+
+70
+00:05:37,000 --> 00:05:41,000
+Because it reduces flexibility and reusability of code.
+
+71
+00:05:41,000 --> 00:05:46,000
+It makes changes much more difficult, it impacts testability, etc..
+
+72
+00:05:47,000 --> 00:05:54,000
+Loose coupling is a better choice because loosely coupled code will help you when your application need
+
+73
+00:05:54,000 --> 00:05:59,000
+to change or grow if you have good design was loosely coupled architecture.
+
+74
+00:05:59,000 --> 00:06:05,000
+One of the few parts of the application should be affected when the requirements change on the slide,
+
+75
+00:06:05,000 --> 00:06:08,000
+you can see visualisation of two cases with summary.
+
+76
+00:06:08,000 --> 00:06:12,000
+I believe we are clear on what Coplan is now.
+
+77
+00:06:12,000 --> 00:06:14,000
+Let's discuss what cohesion is.
+
+78
+00:06:15,000 --> 00:06:20,000
+Cohesion is the degree of interconnection between elements inside one single module.
+
+79
+00:06:20,000 --> 00:06:26,000
+Cohesion is a measure of the degree to which the elements of the module are functionally related.
+
+80
+00:06:27,000 --> 00:06:32,000
+In other words, cohesion is a measure of the degree to which the elements of the module are functional
+
+81
+00:06:32,000 --> 00:06:33,000
+related.
+
+82
+00:06:34,000 --> 00:06:38,000
+It is the degree to which all elements are directed towards performing.
+
+83
+00:06:38,000 --> 00:06:41,000
+A single task are contained in the component.
+
+84
+00:06:41,000 --> 00:06:48,000
+Basically, cohesion is internal glue that keeps them all together and good software design will have
+
+85
+00:06:48,000 --> 00:06:49,000
+high cohesion.
+
+86
+00:06:50,000 --> 00:06:52,000
+And as a definition of cohesion, sounds like this.
+
+87
+00:06:53,000 --> 00:06:58,000
+And object oriented design cohesion refers all about how a single class is designed.
+
+88
+00:06:59,000 --> 00:07:05,000
+Cohesion is an object oriented principle most closely associated with making sure that the class is
+
+89
+00:07:05,000 --> 00:07:07,000
+designed with a single will focus purpose.
+
+90
+00:07:08,000 --> 00:07:13,000
+The more focus the class is, the cohesiveness of that class is more.
+
+91
+00:07:13,000 --> 00:07:19,000
+The advantage of high cohesion is that such classes are much easier to maintain and less frequently
+
+92
+00:07:19,000 --> 00:07:22,000
+changed than the classes with low cohesion.
+
+93
+00:07:23,000 --> 00:07:29,000
+And that's a benefit of high cohesion, is that classis was a well focused purpose, tend to be more
+
+94
+00:07:29,000 --> 00:07:31,000
+reusable than asset classes.
+
+95
+00:07:31,000 --> 00:07:35,000
+But what I would like to mention, confusion is not about single class.
+
+96
+00:07:35,000 --> 00:07:41,000
+Just wanted to warn you that you can find something like taking cohesion only in scope of the single
+
+97
+00:07:41,000 --> 00:07:42,000
+class.
+
+98
+00:07:42,000 --> 00:07:49,000
+I would still focus your attention on the cohesion inside one module that consists of different classes
+
+99
+00:07:49,000 --> 00:07:52,000
+that are intended to do common work.
+
+100
+00:07:52,000 --> 00:08:00,000
+Let's not discuss different types of cohesion there next types of cohesion, functional cohesion, however
+
+101
+00:08:00,000 --> 00:08:06,000
+essential elements for a single computation is contained in the component, and functional cohesion
+
+102
+00:08:06,000 --> 00:08:08,000
+performs the task and functions.
+
+103
+00:08:09,000 --> 00:08:12,000
+It is an ideal situation, sequential cohesion.
+
+104
+00:08:13,000 --> 00:08:19,000
+In this case, an element outputs some data that becomes an input for other element.
+
+105
+00:08:19,000 --> 00:08:21,000
+That is data flow between the parts.
+
+106
+00:08:22,000 --> 00:08:29,000
+It occurs naturally in functional programming languages, communication or cohesion to elements operate
+
+107
+00:08:29,000 --> 00:08:33,000
+on the same input data or contribute towards the same output data.
+
+108
+00:08:34,000 --> 00:08:38,000
+For example, Abdeh trackers in the database and send it to the printer.
+
+109
+00:08:39,000 --> 00:08:48,000
+Procedural cohesion and of procedural cohesion ensure the order of execution actions are still weakly
+
+110
+00:08:48,000 --> 00:08:52,000
+connected and unlikely to be reusable temporal cohesion.
+
+111
+00:08:52,000 --> 00:08:59,000
+The elements are related by their time and involved and more connected with temporal cohesion when all
+
+112
+00:08:59,000 --> 00:09:02,000
+the tasks must be executed in the same time span.
+
+113
+00:09:03,000 --> 00:09:07,000
+This cohesion contains the code for initializing all the parts of the system.
+
+114
+00:09:08,000 --> 00:09:14,000
+Lots of different activities here or at initialization time, logical cohesion.
+
+115
+00:09:14,000 --> 00:09:18,000
+The elements are logically related and not functional.
+
+116
+00:09:19,000 --> 00:09:24,000
+For example, imagine a component that reads input from a tape disk and network.
+
+117
+00:09:25,000 --> 00:09:32,000
+All the code for these functions in the same combat operations are related, but the functions are significantly
+
+118
+00:09:32,000 --> 00:09:34,000
+different cohen-solal cohesion.
+
+119
+00:09:35,000 --> 00:09:37,000
+In this case, the elements are not related.
+
+120
+00:09:38,000 --> 00:09:42,000
+The elements have no conceptual relationship other than location.
+
+121
+00:09:42,000 --> 00:09:47,000
+In source code, it is accidental and the worst form of cohesion.
+
+122
+00:09:47,000 --> 00:09:53,000
+For example, put the next line and reverse the characters of a string in a single component.
+
+123
+00:09:54,000 --> 00:09:59,000
+So what is the difference between high and low cohesion while talking about differences between high
+
+124
+00:09:59,000 --> 00:10:01,000
+cohesion and low cohesion?
+
+125
+00:10:01,000 --> 00:10:08,000
+It is worth to mention in that sense how cohesion is when you have a class that does a well-defined
+
+126
+00:10:08,000 --> 00:10:08,000
+job.
+
+127
+00:10:08,000 --> 00:10:14,000
+A low cohesion is when a class does a lot of jobs that don't have much in common.
+
+128
+00:10:14,000 --> 00:10:21,000
+And if you talk about cohesion on the level of competence modules or packages, high cohesion means
+
+129
+00:10:21,000 --> 00:10:27,000
+that in one module you have classes that are related with one singular responsibility and designed to
+
+130
+00:10:27,000 --> 00:10:28,000
+solve one specific goal.
+
+131
+00:10:29,000 --> 00:10:35,000
+These classes are also ready to be released together, and low cohesion refers to cases when you put
+
+132
+00:10:35,000 --> 00:10:42,000
+random classes that have nothing in common in one module without any reasoning behind that high cohesion
+
+133
+00:10:42,000 --> 00:10:48,000
+use as better maintenance facility and low cohesion results in monolithic classes that are difficult
+
+134
+00:10:48,000 --> 00:10:53,000
+to maintain and understand and believe that is it regarding cohesion.
+
+135
+00:10:54,000 --> 00:11:01,000
+Now, when you know what Coplan and cohesion is, let's remember the rule of a good design code should
+
+136
+00:11:01,000 --> 00:11:03,000
+have low Coplin and high cohesion.
+
+137
+00:11:03,000 --> 00:11:05,000
+Now these words make sense to you.
+
+138
+00:11:06,000 --> 00:11:12,000
+And if you look on old patterns that exist on all the devices that you read in books or Internet, all
+
+139
+00:11:12,000 --> 00:11:19,000
+of them are directed on achieving low carbon and high cohesion and the different ways and parties to
+
+140
+00:11:19,000 --> 00:11:22,000
+achieve that, that what we are going to learn in this course.
+
+141
+00:11:23,000 --> 00:11:25,000
+Let's think now what else do we need?
+
+142
+00:11:25,000 --> 00:11:26,000
+Clean architecture.
+
+143
+00:11:27,000 --> 00:11:33,000
+The clean architecture allows us to write code that is independent of frameworks UI databases, for
+
+144
+00:11:33,000 --> 00:11:34,000
+example.
+
+145
+00:11:34,000 --> 00:11:37,000
+This is the main idea of the clean architecture.
+
+146
+00:11:37,000 --> 00:11:39,000
+We still will use all of this stuff.
+
+147
+00:11:39,000 --> 00:11:46,000
+But the main goal is that our core application logic won't be tied to the specific Web framework was
+
+148
+00:11:46,000 --> 00:11:53,000
+a database implementation and could be easily changed any time without impact on the core application
+
+149
+00:11:53,000 --> 00:11:55,000
+that is achieved because of zero carbon.
+
+150
+00:11:56,000 --> 00:11:57,000
+As you can already understand.
+
+151
+00:11:58,000 --> 00:12:05,000
+Usually when we open the project folder and look at its top level structure, first we see the framework.
+
+152
+00:12:05,000 --> 00:12:11,000
+You can see these folders like comptrollers, Helper's models, view, etc..
+
+153
+00:12:11,000 --> 00:12:17,000
+Imagine that you have just joined the project with this view and this information gives you a lot of
+
+154
+00:12:17,000 --> 00:12:21,000
+knowledge what this application is about and what it actually does.
+
+155
+00:12:21,000 --> 00:12:23,000
+I don't think so.
+
+156
+00:12:23,000 --> 00:12:28,000
+Y because in this case, approach is way too generic.
+
+157
+00:12:28,000 --> 00:12:35,000
+Almost all projects have models, comptrollers and we use if we are talking about MVC model view controller
+
+158
+00:12:35,000 --> 00:12:42,000
+part in what I would suggest instead it would be better if when we open the top layer structure of the
+
+159
+00:12:42,000 --> 00:12:49,000
+project, it would scream about what application does, because architecture is not about tools and
+
+160
+00:12:49,000 --> 00:12:49,000
+frameworks.
+
+161
+00:12:50,000 --> 00:12:52,000
+Instead it is about intent.
+
+162
+00:12:53,000 --> 00:12:59,000
+The main concept of green architecture is that everything that is not a business logic is a Plug-In
+
+163
+00:12:59,000 --> 00:13:05,000
+and could be easily changed, replaced without any impact on other parts of the system.
+
+164
+00:13:05,000 --> 00:13:07,000
+Let me explain you plug in concept.
+
+165
+00:13:08,000 --> 00:13:14,000
+The business logic describes system functionality, no matter where it will be used, is in the Web
+
+166
+00:13:14,000 --> 00:13:16,000
+app or a mobile app.
+
+167
+00:13:16,000 --> 00:13:21,000
+We don't know anything about platforms on the stage, frameworks, etc..
+
+168
+00:13:22,000 --> 00:13:28,000
+Business logic is the main part of the system and it means that it is at least part to be changed.
+
+169
+00:13:28,000 --> 00:13:37,000
+Frameworks, user interface databases and just plug ins frameworks, user interface databases, adjust
+
+170
+00:13:37,000 --> 00:13:44,000
+plugins so they could be easily changed any time and it won't affect other parts of the application.
+
+171
+00:13:44,000 --> 00:13:51,000
+As we mentioned before, business logic is main part of the system, so it is independent of any other
+
+172
+00:13:51,000 --> 00:13:52,000
+its components.
+
+173
+00:13:53,000 --> 00:13:55,000
+Plugins are dependent on business logic.
+
+174
+00:13:56,000 --> 00:14:01,000
+It means if anything is changed in the business, layer plugins could be changed to.
+
+175
+00:14:01,000 --> 00:14:08,000
+Let's imagine that our application uses some external framework for objects, relational mapping of
+
+176
+00:14:08,000 --> 00:14:13,000
+data in my relational database, in my application, the different tools for that.
+
+177
+00:14:13,000 --> 00:14:17,000
+But probably one of the most popular or around in Java is hibernate.
+
+178
+00:14:18,000 --> 00:14:24,000
+And imagine that one day new R.M. system become better or introduce new features that are needed to
+
+179
+00:14:24,000 --> 00:14:28,000
+be supported in your application and you need to change it.
+
+180
+00:14:28,000 --> 00:14:33,000
+Or imagine that you just need to switch from relational to no scale database.
+
+181
+00:14:33,000 --> 00:14:36,000
+And this will require you aurum system.
+
+182
+00:14:36,000 --> 00:14:41,000
+How much code it will take to substitute one was another.
+
+183
+00:14:41,000 --> 00:14:47,000
+In case you have clean architecture in your app with low carbon, it wouldn't take too much effort to
+
+184
+00:14:47,000 --> 00:14:51,000
+make appropriate changes without any impact on the rest of application.
+
+185
+00:14:51,000 --> 00:14:56,000
+Let's imagine that we are working on the social network like Instagram.
+
+186
+00:14:56,000 --> 00:15:01,000
+So when you start development, you could ask yourself what does this application do?
+
+187
+00:15:02,000 --> 00:15:08,000
+And after thinking about it, we come up with a list of behaviors that our application should support.
+
+188
+00:15:08,000 --> 00:15:18,000
+Look in search by hashtag show like a post comment on the course, send a message and it doesn't matter
+
+189
+00:15:18,000 --> 00:15:24,000
+if we are developing a Web app on mobile app because we didn't tell anything about specific platform
+
+190
+00:15:24,000 --> 00:15:25,000
+yet.
+
+191
+00:15:25,000 --> 00:15:27,000
+It is just a functionality.
+
+192
+00:15:27,000 --> 00:15:30,000
+Don't focus on the framework you are developing on.
+
+193
+00:15:30,000 --> 00:15:34,000
+It would be better to think about what the application does.
+
+194
+00:15:34,000 --> 00:15:41,000
+We can call each of these items as application use case, so let's dive deeper into one of them.
+
+195
+00:15:42,000 --> 00:15:45,000
+Let's say we want to send a one to one message.
+
+196
+00:15:45,000 --> 00:15:54,000
+First of all, it takes some input data sender, recipient message content, date time nodes that we
+
+197
+00:15:54,000 --> 00:15:56,000
+do not specify types of the fields.
+
+198
+00:15:57,000 --> 00:16:04,000
+Then we describe what does the use case do, the app for the dates message, then it sends it to the
+
+199
+00:16:04,000 --> 00:16:05,000
+recipient.
+
+200
+00:16:05,000 --> 00:16:08,000
+Finally, it's notify sender that message was sent.
+
+201
+00:16:09,000 --> 00:16:14,000
+If there are some exceptions during this workflow, sender will see an error message.
+
+202
+00:16:14,000 --> 00:16:18,000
+We need to create entities to support these use cases.
+
+203
+00:16:18,000 --> 00:16:23,000
+What entities are entities encapsulate business rules?
+
+204
+00:16:23,000 --> 00:16:26,000
+An entity can be an object with mass.
+
+205
+00:16:26,000 --> 00:16:31,000
+Your entities may be treated as business objects of the application.
+
+206
+00:16:31,000 --> 00:16:35,000
+They encapsulate the most general and high level rules.
+
+207
+00:16:35,000 --> 00:16:39,000
+They are the least likely to change when something external changes.
+
+208
+00:16:40,000 --> 00:16:47,000
+For example, you wouldn't expect these objects to be affected by change to page navigation or security.
+
+209
+00:16:47,000 --> 00:16:52,000
+No operational change to any particular application should affect the entity layer.
+
+210
+00:16:53,000 --> 00:16:55,000
+Let's go back to our social network.
+
+211
+00:16:55,000 --> 00:16:59,000
+We agreed that our application has different use cases.
+
+212
+00:16:59,000 --> 00:17:07,000
+This use cases will use different entities of our application and it is fine in case one use case we'll
+
+213
+00:17:07,000 --> 00:17:11,000
+use different entities and also it works in a different direction.
+
+214
+00:17:12,000 --> 00:17:15,000
+Multiple use cases could use the same entity.
+
+215
+00:17:15,000 --> 00:17:16,000
+It is not restricted.
+
+216
+00:17:17,000 --> 00:17:22,000
+Send the message use case works with message entity and users entities.
+
+217
+00:17:22,000 --> 00:17:27,000
+And as you can see, other use cases sometimes use the same entities.
+
+218
+00:17:27,000 --> 00:17:34,000
+In this case, use cases may be treated as separate classes that have, for example, execute method
+
+219
+00:17:34,000 --> 00:17:37,000
+that performs, use case flow and meetings and business goals.
+
+220
+00:17:38,000 --> 00:17:42,000
+But how could we get access to the UI database, etc.?
+
+221
+00:17:43,000 --> 00:17:45,000
+We should use boundaries.
+
+222
+00:17:45,000 --> 00:17:51,000
+They are represented by interfaces that could be implemented by components of alternate layers.
+
+223
+00:17:51,000 --> 00:17:52,000
+We do not specify.
+
+224
+00:17:52,000 --> 00:18:00,000
+The delivery mechanism here, but it could be Amarasinghe anywhere protocol or even cancel the delivery
+
+225
+00:18:00,000 --> 00:18:07,000
+mechanism is just a plug in that could be removed or replaced with something as a delivery mechanism
+
+226
+00:18:07,000 --> 00:18:10,000
+may consist of a set of interfaces.
+
+227
+00:18:10,000 --> 00:18:14,000
+This is a vivid example of dependency inversion principle in practice.
+
+228
+00:18:15,000 --> 00:18:20,000
+The main idea is to use dependency inversion principle in communication between layers.
+
+229
+00:18:21,000 --> 00:18:28,000
+This means that components of the system does not depend on others directly, but through boundaries.
+
+230
+00:18:29,000 --> 00:18:31,000
+Similarly, we can work with the database.
+
+231
+00:18:32,000 --> 00:18:38,000
+We don't access database directly from the business logic, but we use entity gateway for that.
+
+232
+00:18:38,000 --> 00:18:45,000
+This is just an interface that sets contract of interaction between our app and database.
+
+233
+00:18:45,000 --> 00:18:51,000
+It could be implemented and used by any database handling class entity.
+
+234
+00:18:51,000 --> 00:18:57,000
+Gateway Implementation is a class that implements entity Gateway and it can be considered as a part
+
+235
+00:18:57,000 --> 00:19:04,000
+of a database plugin that can be easily substituted when it will be needed in this case.
+
+236
+00:19:04,000 --> 00:19:11,000
+This class is in charge of direct access of database API and that the gateway could be represented by
+
+237
+00:19:11,000 --> 00:19:17,000
+data access objects, so-called GAYO classes or any other project.
+
+238
+00:19:17,000 --> 00:19:19,000
+The idea is simple.
+
+239
+00:19:19,000 --> 00:19:23,000
+You can have such an entity gateway for each entity separately.
+
+240
+00:19:24,000 --> 00:19:31,000
+This is how exactly you can keep some modules independent to ensure maintainability and scalability
+
+241
+00:19:31,000 --> 00:19:31,000
+of your code.
+
+242
+00:19:32,000 --> 00:19:39,000
+So now let's recap what benefits you get from clean architecture and what disadvantages you have to
+
+243
+00:19:39,000 --> 00:19:39,000
+accept.
+
+244
+00:19:40,000 --> 00:19:46,000
+Let's start from benefits following principles that we learned in this lesson and that we are going
+
+245
+00:19:46,000 --> 00:19:47,000
+to learn further.
+
+246
+00:19:47,000 --> 00:19:49,000
+It could become testable.
+
+247
+00:19:49,000 --> 00:19:56,000
+The code of your app is decoupled so every part could be tested in isolation from other components.
+
+248
+00:19:56,000 --> 00:19:58,000
+You should just more missing dependencies.
+
+249
+00:19:59,000 --> 00:20:01,000
+Your code is maintainable.
+
+250
+00:20:01,000 --> 00:20:04,000
+Functionality of the app is strictly separated.
+
+251
+00:20:04,000 --> 00:20:11,000
+So if you want to add new features, they would be implemented in a separate files without impact on
+
+252
+00:20:11,000 --> 00:20:12,000
+the existing code.
+
+253
+00:20:13,000 --> 00:20:21,000
+Your app is independent of any framework, UI database, etc. The core parts of your app is just pure
+
+254
+00:20:21,000 --> 00:20:22,000
+code.
+
+255
+00:20:22,000 --> 00:20:25,000
+All other modules are just plug ins.
+
+256
+00:20:25,000 --> 00:20:26,000
+That could be easily changed.
+
+257
+00:20:27,000 --> 00:20:34,000
+But as always, Amerson in programming comes with a price and it's always a matter of tradeoffs and
+
+258
+00:20:34,000 --> 00:20:39,000
+balance between advantages and disadvantages while following any of the suggested approaches.
+
+259
+00:20:39,000 --> 00:20:46,000
+So disadvantages that we need to accept are sometimes you need to accept that you should write more
+
+260
+00:20:46,000 --> 00:20:47,000
+code than usual.
+
+261
+00:20:48,000 --> 00:20:53,000
+All of this separation of concerns requires to write a lot of different interfaces.
+
+262
+00:20:53,000 --> 00:21:00,000
+However, now on this idea, you can do a lot on the job for us in terms of code writing and classes
+
+263
+00:21:00,000 --> 00:21:05,000
+generation when needed, while such structure and simplifies code understanding.
+
+264
+00:21:06,000 --> 00:21:13,000
+Sometimes if you are not used to such approach, it will take your time to understand how different
+
+265
+00:21:13,000 --> 00:21:15,000
+modules interact between each other.
+
+266
+00:21:16,000 --> 00:21:22,000
+So one of the disadvantages is the fact that understanding and implementation of clean architecture
+
+267
+00:21:22,000 --> 00:21:25,000
+requires practice and experience.
+
+268
+00:21:25,000 --> 00:21:28,000
+But to be honest, this is not a true disadvantage.
+
+269
+00:21:29,000 --> 00:21:30,000
+That's all for this lesson.
+
+270
+00:21:30,000 --> 00:21:38,000
+Let's recap what we have learned today in this lesson learned what Coplan is and what cohesion is.
+
+271
+00:21:39,000 --> 00:21:42,000
+Also, we have discussed different types of carbon and cohesion.
+
+272
+00:21:43,000 --> 00:21:46,000
+Now, you know what the clean architecture is.
+
+273
+00:21:46,000 --> 00:21:52,000
+I showed you an example, plug in concept and how to implement it on the example of social network.
+
+274
+00:21:53,000 --> 00:21:58,000
+And at the end of the lesson, we discussed advantages and disadvantages of green architecture.
+
+275
+00:21:58,000 --> 00:22:00,000
+I hope you enjoyed this lesson.
+
+276
+00:22:01,000 --> 00:22:02,000
+Thanks a lot for your attention.
+
+277
+00:22:03,000 --> 00:22:04,000
+See you in the next lesson.
+
diff --git a/38 - Object-oriented Architecture, Clean Code Design (Advanced)/002 Source-code-of-Tell-don-t-ask-example-.url b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/002 Source-code-of-Tell-don-t-ask-example-.url
new file mode 100644
index 0000000000000000000000000000000000000000..5db7b1d679d4a639d1aa5c591d3e204317193556
--- /dev/null
+++ b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/002 Source-code-of-Tell-don-t-ask-example-.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/oop/telldontask
\ No newline at end of file
diff --git a/38 - Object-oriented Architecture, Clean Code Design (Advanced)/002 Source-code-of-data-structures-example.url b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/002 Source-code-of-data-structures-example.url
new file mode 100644
index 0000000000000000000000000000000000000000..893015df30617f6d47bc682d5ce176d1209496b2
--- /dev/null
+++ b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/002 Source-code-of-data-structures-example.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/oop/datastructures
\ No newline at end of file
diff --git "a/38 - Object-oriented Architecture, Clean Code Design (Advanced)/002 Tell, Don\342\200\231t Ask Pricniple & Data Structures_en.srt" "b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/002 Tell, Don\342\200\231t Ask Pricniple & Data Structures_en.srt"
new file mode 100644
index 0000000000000000000000000000000000000000..e6580fa94cd8bf73f011db78fc0e32866c95302f
--- /dev/null
+++ "b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/002 Tell, Don\342\200\231t Ask Pricniple & Data Structures_en.srt"
@@ -0,0 +1,1116 @@
+1
+00:00:05,000 --> 00:00:07,000
+Hello, adjustments in this lesson?
+
+2
+00:00:07,000 --> 00:00:13,000
+Well, don't tell, don't ask principal and data structures, we'll start our lesson from understanding
+
+3
+00:00:13,000 --> 00:00:14,000
+of what they've don't ask.
+
+4
+00:00:14,000 --> 00:00:20,000
+Principal, if I will show you what this principal is about and how you may apply it on practice.
+
+5
+00:00:20,000 --> 00:00:25,000
+And knowing this principle, it will be important to understand the difference between data structures
+
+6
+00:00:25,000 --> 00:00:26,000
+and objects.
+
+7
+00:00:26,000 --> 00:00:30,000
+That is exactly the reason why I decided to combine these two topics.
+
+8
+00:00:30,000 --> 00:00:34,000
+In one lesson, we'll talk through the differences between objects and data structures.
+
+9
+00:00:35,000 --> 00:00:40,000
+We'll start with examples on how exactly objects are different from data structures and how objects
+
+10
+00:00:40,000 --> 00:00:47,000
+and data structures are opposite in the way they deal with data will continue as highlighted, in which
+
+11
+00:00:47,000 --> 00:00:51,000
+case we need these data structures over objects and vice versa.
+
+12
+00:00:51,000 --> 00:00:56,000
+And at the end of the lesson, I'll share with you advices and best practices for getters and setters
+
+13
+00:00:56,000 --> 00:00:57,000
+usage in classes.
+
+14
+00:00:58,000 --> 00:01:03,000
+And as I already mentioned, we'll start from the principles that is called Tell, Don't Ask.
+
+15
+00:01:03,000 --> 00:01:09,000
+Let's analyze specific example to understand this principle, because it is always easy to understand
+
+16
+00:01:09,000 --> 00:01:09,000
+new things.
+
+17
+00:01:09,000 --> 00:01:13,000
+And the examples here class called user account.
+
+18
+00:01:13,000 --> 00:01:17,000
+The class has its private attributes and propagator and certain assets.
+
+19
+00:01:18,000 --> 00:01:23,000
+This class aims to represent a user's bank account and its operations and attributes.
+
+20
+00:01:24,000 --> 00:01:26,000
+Let's focus on the current design of this class.
+
+21
+00:01:27,000 --> 00:01:30,000
+It only maintains attributes and basic users and setters for them.
+
+22
+00:01:31,000 --> 00:01:36,000
+What you have to do in case you want to increase the balance of this user account, you have to get
+
+23
+00:01:36,000 --> 00:01:43,000
+balance field and perform any operations you need, including and invalidate but do things that is OK.
+
+24
+00:01:43,000 --> 00:01:48,000
+I mean, forcing your client to interact directly with your fields of your object.
+
+25
+00:01:48,000 --> 00:01:54,000
+The principle tell don't ask tells us that in case user needs to change state of the balance object,
+
+26
+00:01:55,000 --> 00:01:57,000
+we don't have to request this field first.
+
+27
+00:01:57,000 --> 00:02:02,000
+What we have to do, then instead we have to tell our object directly what we want to do.
+
+28
+00:02:03,000 --> 00:02:07,000
+In other words, we need to tell a user account to increase balance.
+
+29
+00:02:07,000 --> 00:02:10,000
+That's why principle is called tell, don't ask.
+
+30
+00:02:10,000 --> 00:02:16,000
+Does it make more sense now in this case, we have to tell a user account object to increase balance.
+
+31
+00:02:17,000 --> 00:02:24,000
+So all the operations related with this class force it to tell its content to another class, which
+
+32
+00:02:24,000 --> 00:02:26,000
+will in turn manipulate the values of user account.
+
+33
+00:02:27,000 --> 00:02:30,000
+Let's consider another case with this class.
+
+34
+00:02:30,000 --> 00:02:33,000
+Imagine that we need not to add, but withdraw money.
+
+35
+00:02:34,000 --> 00:02:40,000
+What we have to do in this case, in this example, I withdraw operation, request any third class,
+
+36
+00:02:40,000 --> 00:02:46,000
+any class that is going to use our API to ask the current value of balance attribute in our class user
+
+37
+00:02:46,000 --> 00:02:47,000
+account.
+
+38
+00:02:47,000 --> 00:02:48,000
+It is not a good design.
+
+39
+00:02:49,000 --> 00:02:49,000
+Why?
+
+40
+00:02:50,000 --> 00:02:55,000
+Because we need information and other class details about user accounts attributes and then let another
+
+41
+00:02:55,000 --> 00:02:58,000
+class update state of user account.
+
+42
+00:02:58,000 --> 00:03:01,000
+This is not what encapsulation principle is about.
+
+43
+00:03:01,000 --> 00:03:08,000
+And by doing this we allow any external client to update the state of our class without our control
+
+44
+00:03:08,000 --> 00:03:08,000
+of this process.
+
+45
+00:03:09,000 --> 00:03:15,000
+And imagine that across all your program you perform manipulations like this in case you need to make
+
+46
+00:03:15,000 --> 00:03:16,000
+update and withdrawal operation.
+
+47
+00:03:17,000 --> 00:03:20,000
+Let's say you need to perform some daily limit verification.
+
+48
+00:03:20,000 --> 00:03:23,000
+You need to update this in all places.
+
+49
+00:03:23,000 --> 00:03:26,000
+You don't have one single place to control this process.
+
+50
+00:03:27,000 --> 00:03:33,000
+Even a simple change on their operation behavior across all your app would require an extra effort on
+
+51
+00:03:33,000 --> 00:03:36,000
+refactoring different classes that use this object.
+
+52
+00:03:36,000 --> 00:03:38,000
+Or imagine another case.
+
+53
+00:03:38,000 --> 00:03:43,000
+Now, let's suppose that the bank starts to charge one percent on every withdrawal of hires and one
+
+54
+00:03:43,000 --> 00:03:44,000
+thousand dollars.
+
+55
+00:03:45,000 --> 00:03:51,000
+All the classes that manipulate withdrawal operation should be changed in order to execute this operation.
+
+56
+00:03:51,000 --> 00:03:55,000
+This design is completely against object oriented approach.
+
+57
+00:03:55,000 --> 00:03:58,000
+I believe that you already understood how to fix this, do you?
+
+58
+00:03:59,000 --> 00:04:05,000
+It would be better if inside our class we would declare behaviors that would help our client to perform
+
+59
+00:04:05,000 --> 00:04:06,000
+operations that is needed.
+
+60
+00:04:07,000 --> 00:04:13,000
+That is a sense of object oriented programming approach to combine behavior and state in the object
+
+61
+00:04:13,000 --> 00:04:17,000
+and introduce math that can modify the state of the object.
+
+62
+00:04:17,000 --> 00:04:23,000
+We don't need to have pure data structures that just contained state and modified outside of the class.
+
+63
+00:04:23,000 --> 00:04:31,000
+In this case, I would add Massud that is called withdraw and all logic behavior processes will be triggered
+
+64
+00:04:31,000 --> 00:04:32,000
+from this point.
+
+65
+00:04:32,000 --> 00:04:38,000
+And when I use this method in all other classes across my app, I don't need to be bothered to update
+
+66
+00:04:38,000 --> 00:04:41,000
+each class in case logic of his drawing is changed.
+
+67
+00:04:41,000 --> 00:04:48,000
+In just one single point where I manage, withdraw and I don't need to ask object about it state.
+
+68
+00:04:48,000 --> 00:04:51,000
+I just tell object what I need to do.
+
+69
+00:04:52,000 --> 00:04:54,000
+That is key in principle.
+
+70
+00:04:54,000 --> 00:04:55,000
+Tell, don't ask.
+
+71
+00:04:55,000 --> 00:04:59,000
+It should be a responsibility of user account class and not of an asset class.
+
+72
+00:05:00,000 --> 00:05:02,000
+In other words, clients of the user account.
+
+73
+00:05:02,000 --> 00:05:08,000
+Glass should tell what operations it should perform and don't ask for its internal state.
+
+74
+00:05:09,000 --> 00:05:15,000
+This approach assurance that internal state of user account is managed by itself and we have a clear
+
+75
+00:05:15,000 --> 00:05:17,000
+object oriented design.
+
+76
+00:05:17,000 --> 00:05:23,000
+One more side effect we have from this design is an anomaly called an eminent domain model.
+
+77
+00:05:23,000 --> 00:05:30,000
+It can be defined as an entity that is open to provide its state to every type that calls it instead
+
+78
+00:05:30,000 --> 00:05:32,000
+of performance operation on itself.
+
+79
+00:05:33,000 --> 00:05:39,000
+This definition, created by Martin Fowler, describes glasses that doesn't contain behavior, making
+
+80
+00:05:39,000 --> 00:05:42,000
+them look like bags for getters and setters alike.
+
+81
+00:05:42,000 --> 00:05:45,000
+Schaap wrote in his book about small talk.
+
+82
+00:05:45,000 --> 00:05:50,000
+The following sentence procedural code gets information, then makes decisions.
+
+83
+00:05:50,000 --> 00:05:54,000
+Object oriented Cordell's objects to do things.
+
+84
+00:05:54,000 --> 00:06:01,000
+It clearly explains that don't ask principle in a broader way, stating that a developer should never
+
+85
+00:06:01,000 --> 00:06:07,000
+forget that object orientation is about message transfer between objects to tell what operations should
+
+86
+00:06:07,000 --> 00:06:07,000
+be done.
+
+87
+00:06:08,000 --> 00:06:14,000
+Never about getting information from an object in order to execute some task they tell don't ask, principal,
+
+88
+00:06:14,000 --> 00:06:15,000
+tell some one simple thing.
+
+89
+00:06:16,000 --> 00:06:21,000
+We have to delegate an action to an object directly instead of asking some data from this object.
+
+90
+00:06:22,000 --> 00:06:23,000
+In essence, that's it.
+
+91
+00:06:24,000 --> 00:06:27,000
+But if it's so obvious, why not everyone follows it?
+
+92
+00:06:27,000 --> 00:06:28,000
+Probably.
+
+93
+00:06:28,000 --> 00:06:31,000
+That is because in most of the times it is its request.
+
+94
+00:06:31,000 --> 00:06:35,000
+Some data from a class and only after that matters it is necessary to go.
+
+95
+00:06:36,000 --> 00:06:38,000
+But come on, guys don't like this.
+
+96
+00:06:38,000 --> 00:06:44,000
+If some data is encapsulated in this class, this exact class should be responsible for managing all
+
+97
+00:06:44,000 --> 00:06:50,000
+the behavior of encapsulated data instead of requesting data and let other class processes it.
+
+98
+00:06:50,000 --> 00:06:56,000
+In case you would follow this simple advice, you could become much more straightforward and cleaner,
+
+99
+00:06:56,000 --> 00:06:59,000
+more Alver for clients of your code.
+
+100
+00:06:59,000 --> 00:07:05,000
+It would be much easier to understand what behavior this class have and how to apply this API within
+
+101
+00:07:05,000 --> 00:07:11,000
+the program rather than constantly remember that in some specific cases we have to go get an asset and
+
+102
+00:07:11,000 --> 00:07:13,000
+only after that do what we need.
+
+103
+00:07:13,000 --> 00:07:14,000
+Does it make sense.
+
+104
+00:07:14,000 --> 00:07:20,000
+The correct usage of this principle helps the program to achieve better modularity and to have a clear
+
+105
+00:07:20,000 --> 00:07:26,000
+separation of concerns and other benefits from a good object oriented design that we are going to discuss
+
+106
+00:07:26,000 --> 00:07:32,000
+in this lesson and to understand better what benefits we get from using Tell, Don't Ask Principal,
+
+107
+00:07:32,000 --> 00:07:37,000
+let's ask first about what we'll get in case we won't follow this principle.
+
+108
+00:07:38,000 --> 00:07:45,000
+In other words, let's talk about issues that might happen in case will ignore this rule is data explosion
+
+109
+00:07:45,000 --> 00:07:47,000
+from objects for other classes safe?
+
+110
+00:07:47,000 --> 00:07:51,000
+No explosive data from objects for other classes to alter it.
+
+111
+00:07:52,000 --> 00:07:58,000
+It is very dangerous practice because this one class becomes tightly coupled to another class that may
+
+112
+00:07:58,000 --> 00:08:00,000
+not be directly related to the first one.
+
+113
+00:08:00,000 --> 00:08:05,000
+This practice violates also another principle called single responsibility principle.
+
+114
+00:08:06,000 --> 00:08:10,000
+I believe you are familiar with solid principles and know what s principle is about.
+
+115
+00:08:11,000 --> 00:08:15,000
+But just in case I will quickly recap the single responsibility.
+
+116
+00:08:15,000 --> 00:08:20,000
+Principle is a term created by Robert Martin to express the cohesion of a class.
+
+117
+00:08:20,000 --> 00:08:23,000
+He states that the class should have only one reason to change.
+
+118
+00:08:24,000 --> 00:08:28,000
+What are the drawbacks and issues may appear and case will not follow.
+
+119
+00:08:28,000 --> 00:08:29,000
+Tell, don't ask.
+
+120
+00:08:29,000 --> 00:08:35,000
+Principal data exposure's that we have already talked about normally also brings maintenance complexity
+
+121
+00:08:35,000 --> 00:08:40,000
+when some change should be performed in the internals of the class, forcing you to investigate all
+
+122
+00:08:40,000 --> 00:08:44,000
+the parts that may alter it in order to change it to.
+
+123
+00:08:44,000 --> 00:08:47,000
+Now, let's talk about another important topic.
+
+124
+00:08:47,000 --> 00:08:48,000
+In my opinion, none.
+
+125
+00:08:48,000 --> 00:08:53,000
+After all, don't ask principal is related with the things that I'm going to explain.
+
+126
+00:08:53,000 --> 00:08:57,000
+You now will learn more about the difference between objects and data structures.
+
+127
+00:08:57,000 --> 00:09:00,000
+You will look at an object outside.
+
+128
+00:09:00,000 --> 00:09:03,000
+We will see it has functions but has no variables.
+
+129
+00:09:03,000 --> 00:09:08,000
+An instance of a class, an object has no observable state from outside.
+
+130
+00:09:09,000 --> 00:09:16,000
+This is why it can be stated about objects that objects hide the data behind abstractions and expose
+
+131
+00:09:16,000 --> 00:09:18,000
+functions that operate on that data.
+
+132
+00:09:18,000 --> 00:09:20,000
+In object oriented programming.
+
+133
+00:09:20,000 --> 00:09:27,000
+We even use special term for that behavior that modifies state of an object usually called Massud,
+
+134
+00:09:27,000 --> 00:09:28,000
+but not functions.
+
+135
+00:09:28,000 --> 00:09:32,000
+To understand things better, let's look at example.
+
+136
+00:09:32,000 --> 00:09:36,000
+We'll start from object example and after that we'll talk about data structures.
+
+137
+00:09:37,000 --> 00:09:39,000
+Imagine that you have some interface.
+
+138
+00:09:39,000 --> 00:09:44,000
+We call all the classes that implements the interface are supposed to have drive.
+
+139
+00:09:44,000 --> 00:09:45,000
+MassArt, for example.
+
+140
+00:09:45,000 --> 00:09:48,000
+There is an electric car and petrol car.
+
+141
+00:09:49,000 --> 00:09:55,000
+The processes inside the car that makes it move are completely different in electric and petrol car.
+
+142
+00:09:55,000 --> 00:10:02,000
+If I add a new class to this hierarchy, let's say now we have motorcycles that implements vehicle interface.
+
+143
+00:10:02,000 --> 00:10:09,000
+And pay attention that after this action, Nesenoff classes were changed, no matter what state motorcycle
+
+144
+00:10:09,000 --> 00:10:14,000
+has, for example, all cars have for use, but motorcycle has only two wheels.
+
+145
+00:10:15,000 --> 00:10:21,000
+So as you can understand, it is not a big difference in case some new class will implement the interface
+
+146
+00:10:21,000 --> 00:10:23,000
+and declare its own state.
+
+147
+00:10:23,000 --> 00:10:27,000
+But what would happen in case the interface is changed?
+
+148
+00:10:27,000 --> 00:10:32,000
+For example, now we have not only drive MassArt, but also we have starts engine Macit.
+
+149
+00:10:33,000 --> 00:10:38,000
+Now every existing class that implements vehicle interface has to be changed.
+
+150
+00:10:38,000 --> 00:10:44,000
+That is something what we need to take into account when we talk about objects and object oriented programming.
+
+151
+00:10:45,000 --> 00:10:47,000
+Now let's talk about data structures.
+
+152
+00:10:48,000 --> 00:10:51,000
+Data structures are completely different things from objects.
+
+153
+00:10:51,000 --> 00:10:55,000
+And you remember the previous example about objects and behavior.
+
+154
+00:10:55,000 --> 00:11:00,000
+Data structure on the opposite has variables, but no functions.
+
+155
+00:11:00,000 --> 00:11:05,000
+And Arzamas data structures describes the state rather than behavior.
+
+156
+00:11:06,000 --> 00:11:09,000
+It can expose variables through public fields.
+
+157
+00:11:09,000 --> 00:11:12,000
+In case you see getters and setters and objects.
+
+158
+00:11:12,000 --> 00:11:15,000
+It is not necessarily the proof of the object behavior.
+
+159
+00:11:16,000 --> 00:11:20,000
+It is just a way of accessing and setting the state in the data structure.
+
+160
+00:11:21,000 --> 00:11:25,000
+So it could be the data structure has private fields was getters and setters.
+
+161
+00:11:26,000 --> 00:11:29,000
+Let's imagine that we have similar example about vehicles.
+
+162
+00:11:29,000 --> 00:11:35,000
+We have electric car and petrol car, how solution would look like with data structures.
+
+163
+00:11:35,000 --> 00:11:40,000
+In this case, driver behavior wouldn't be a part of our concrete classes.
+
+164
+00:11:40,000 --> 00:11:44,000
+In this case, this behavior will be handled by different type.
+
+165
+00:11:44,000 --> 00:11:49,000
+For example, if we still want to stick to object oriented approach, you have to create another class
+
+166
+00:11:49,000 --> 00:11:53,000
+that would manage all movements for all types of vehicles.
+
+167
+00:11:53,000 --> 00:12:00,000
+I can create vehicle service that has more Huichol masset and that takes any vehicle as an argument.
+
+168
+00:12:00,000 --> 00:12:06,000
+And inside this method, I will create a logical vehicle movement, a relying on the level of abstraction
+
+169
+00:12:06,000 --> 00:12:09,000
+that is said by the vehicle interface is it looks good.
+
+170
+00:12:10,000 --> 00:12:12,000
+Well, it has.
+
+171
+00:12:12,000 --> 00:12:15,000
+Your program will work and that is amazing.
+
+172
+00:12:15,000 --> 00:12:20,000
+But the power of object oriented programming exists not for the things like this.
+
+173
+00:12:21,000 --> 00:12:27,000
+We don't leverage the power of polymorphism if we would produce code like this and it's much more easier
+
+174
+00:12:27,000 --> 00:12:30,000
+to override drive method for each type of vehicle.
+
+175
+00:12:31,000 --> 00:12:36,000
+Rather, the BE is about making generic methods for all possible types of vehicles in our service.
+
+176
+00:12:37,000 --> 00:12:43,000
+That's why I would say that while using data structures like this is also possible and sometimes architecture
+
+177
+00:12:43,000 --> 00:12:50,000
+with data structures might be easier, it is not always the best case in terms of following object oriented
+
+178
+00:12:50,000 --> 00:12:50,000
+design.
+
+179
+00:12:51,000 --> 00:12:56,000
+And I know that there are frameworks and patterns in different programming languages that actively use
+
+180
+00:12:56,000 --> 00:12:59,000
+data structures such as it is completely fine.
+
+181
+00:12:59,000 --> 00:13:05,000
+I just want to say that probably having a lot of data structures and layer of different services that
+
+182
+00:13:05,000 --> 00:13:10,000
+modify state of such data structures, probably that is not completely object oriented approach.
+
+183
+00:13:11,000 --> 00:13:17,000
+By following this style in our architecture, we want to be able to leverage all the power of object
+
+184
+00:13:17,000 --> 00:13:18,000
+oriented programming.
+
+185
+00:13:18,000 --> 00:13:20,000
+This is all what I'm trying to say.
+
+186
+00:13:20,000 --> 00:13:26,000
+In this case, our concrete classes will stay and the fact that in case I need that additional behavior.
+
+187
+00:13:26,000 --> 00:13:31,000
+In previous example, you saw that when I add additional behavior on the interface level, I need to
+
+188
+00:13:31,000 --> 00:13:34,000
+implement this method in all concrete classes.
+
+189
+00:13:34,000 --> 00:13:41,000
+But in this case I can easily declare new behavior in my service, in my concrete classes will stay
+
+190
+00:13:41,000 --> 00:13:41,000
+untouched.
+
+191
+00:13:42,000 --> 00:13:48,000
+But in this case, when I add new concrete class, let's say motorcycle, I need to adjust methods in
+
+192
+00:13:48,000 --> 00:13:52,000
+my service to make sure that my service will handle and process and new data structure.
+
+193
+00:13:53,000 --> 00:13:58,000
+Now, when you saw different examples, we are in the position to make at least some conclusions.
+
+194
+00:13:59,000 --> 00:14:04,000
+I believe that you can understand that these concepts are opposite in the way how data is handled.
+
+195
+00:14:05,000 --> 00:14:09,000
+This is what is referred to as data object, and it's symmetry.
+
+196
+00:14:09,000 --> 00:14:16,000
+And it might seem trivial, but it's actually very important saying now that this also shows that an
+
+197
+00:14:16,000 --> 00:14:19,000
+idea that everything is an object is simply not true.
+
+198
+00:14:19,000 --> 00:14:25,000
+Sometimes you don't want everything to be an object, but a simple set data structure with some procedures
+
+199
+00:14:25,000 --> 00:14:27,000
+operating on them is needed.
+
+200
+00:14:28,000 --> 00:14:32,000
+Hope that this makes sense and the difference between data structures and objects is clear.
+
+201
+00:14:32,000 --> 00:14:37,000
+And now I want to warn you that using hybrid structures might not be a good idea.
+
+202
+00:14:38,000 --> 00:14:42,000
+You might want to get the benefits of both approaches by mixing them together.
+
+203
+00:14:43,000 --> 00:14:45,000
+I mean objects and data structures.
+
+204
+00:14:45,000 --> 00:14:49,000
+You can try, but believe me, that will end up with a nightmare.
+
+205
+00:14:49,000 --> 00:14:55,000
+For example, the code won't be easy to support and to use because sometimes you would ask clients of
+
+206
+00:14:55,000 --> 00:15:01,000
+your code to use special services, sometimes object masses and data manipulation of one beta.
+
+207
+00:15:02,000 --> 00:15:08,000
+Apparent and intuitive understanding, you will get not clean and hardly readable code, but important
+
+208
+00:15:08,000 --> 00:15:13,000
+questions that we need to answer is what to choose data structures or objects?
+
+209
+00:15:14,000 --> 00:15:20,000
+We learned that Classis hides the data behind abstractions and expose functions that operate on that
+
+210
+00:15:20,000 --> 00:15:21,000
+data.
+
+211
+00:15:21,000 --> 00:15:26,000
+This makes it very easy to add new kinds of objects without changing existing functions.
+
+212
+00:15:27,000 --> 00:15:34,000
+It also makes it difficult to add new functions to existing objects generally when we use classes and
+
+213
+00:15:34,000 --> 00:15:34,000
+objects.
+
+214
+00:15:34,000 --> 00:15:37,000
+We rely a lot on polymorphism.
+
+215
+00:15:37,000 --> 00:15:40,000
+This is what object oriented programming refers to.
+
+216
+00:15:40,000 --> 00:15:46,000
+On the contrary, data structures expose that data and have no meaningful functions.
+
+217
+00:15:46,000 --> 00:15:53,000
+This makes it easy to add new functions to existing data structures, but at the same time difficult
+
+218
+00:15:53,000 --> 00:15:55,000
+to add new data structures to existing functions.
+
+219
+00:15:56,000 --> 00:16:01,000
+And this is also a reason why it is better to use data structures when data they represent is not likely
+
+220
+00:16:01,000 --> 00:16:02,000
+to change.
+
+221
+00:16:03,000 --> 00:16:09,000
+Data structures are often used with masses and switch statements, which is referred to as procedural
+
+222
+00:16:09,000 --> 00:16:09,000
+programming.
+
+223
+00:16:10,000 --> 00:16:16,000
+So the things that are difficult to do when using object oriented programming are easy for procedures
+
+224
+00:16:16,000 --> 00:16:17,000
+and vice versa.
+
+225
+00:16:17,000 --> 00:16:21,000
+And it depends no requirements what approach will work best for us.
+
+226
+00:16:22,000 --> 00:16:24,000
+That's why there is no single answer.
+
+227
+00:16:24,000 --> 00:16:24,000
+What is better?
+
+228
+00:16:25,000 --> 00:16:32,000
+Sometimes we would benefit the flexibility to add new data types so objects and object oriented approach
+
+229
+00:16:32,000 --> 00:16:39,000
+is a good choice for the situation, and sometimes the flexibility to add new behaviors would be preferable.
+
+230
+00:16:39,000 --> 00:16:42,000
+And in this case, we prefer data types and procedural approach.
+
+231
+00:16:43,000 --> 00:16:49,000
+If you already had an opportunity to create web applications or integrate your application with other
+
+232
+00:16:49,000 --> 00:16:55,000
+systems, you faced with a case that is very convenient to have and use data structures.
+
+233
+00:16:55,000 --> 00:17:02,000
+For example, there is a pattern to use so-called data transfer objects that stores only state and used
+
+234
+00:17:02,000 --> 00:17:04,000
+to reflect the data from the database table.
+
+235
+00:17:05,000 --> 00:17:10,000
+In that case, we can keep that data structures close to application boundaries.
+
+236
+00:17:10,000 --> 00:17:15,000
+The important advice is not mix those together with hybrid's.
+
+237
+00:17:15,000 --> 00:17:18,000
+It's difficult to add both new types of new methods.
+
+238
+00:17:19,000 --> 00:17:21,000
+So using them is a bad design.
+
+239
+00:17:22,000 --> 00:17:28,000
+We'll get into more interesting things now in principle, tell, don't ask, what do you think having
+
+240
+00:17:28,000 --> 00:17:31,000
+getters and setters is a good idea in general?
+
+241
+00:17:31,000 --> 00:17:33,000
+And please don't take me wrong.
+
+242
+00:17:33,000 --> 00:17:40,000
+I'm not telling that we don't need to have getters and setters in our class because a lot of Java frameworks
+
+243
+00:17:40,000 --> 00:17:43,000
+will rely on the fact that getters and setters.
+
+244
+00:17:43,000 --> 00:17:50,000
+I'm just trying to say that building your logic around using getters and setters is an indicator of
+
+245
+00:17:50,000 --> 00:17:51,000
+bad design.
+
+246
+00:17:51,000 --> 00:17:54,000
+Why Patel don't ask Principal.
+
+247
+00:17:54,000 --> 00:17:58,000
+We shouldn't be asking an object for data and action on it.
+
+248
+00:17:59,000 --> 00:18:05,000
+Also, as you remember from single responsibility principle topic, a class should be a highly cohesive.
+
+249
+00:18:05,000 --> 00:18:12,000
+That means each method manipulates on a cohesive group of variables, whereas getters and setters manipulate
+
+250
+00:18:12,000 --> 00:18:18,000
+individual variables so that hinders implementation of single responsibility principle.
+
+251
+00:18:19,000 --> 00:18:25,000
+Overall, be careful with getters and setters if you just want to expose some data in your class.
+
+252
+00:18:25,000 --> 00:18:32,000
+Do not expose implementation details because it hurts polymorphism opportunities and also because using
+
+253
+00:18:32,000 --> 00:18:36,000
+getters and setters makes your class become looks like a hybrid structure.
+
+254
+00:18:36,000 --> 00:18:40,000
+Instead, expose data in the most abstract form possible.
+
+255
+00:18:41,000 --> 00:18:47,000
+Only the essential details should be displayed to clients of your code, the different sorts around
+
+256
+00:18:47,000 --> 00:18:49,000
+using data structures and objects.
+
+257
+00:18:49,000 --> 00:18:51,000
+And I am sure you already have your own opinion.
+
+258
+00:18:52,000 --> 00:18:58,000
+I just share my vision and give you advice that helps me and my developers to come up with better design.
+
+259
+00:18:58,000 --> 00:19:03,000
+I just quickly recap key points that we learned about data structures and objects.
+
+260
+00:19:03,000 --> 00:19:10,000
+So summer will look like this expression of data in Abstract Away is preferred to exposing the details
+
+261
+00:19:10,000 --> 00:19:11,000
+of our data.
+
+262
+00:19:11,000 --> 00:19:18,000
+So usage of getters and setters for objects will be often considered as a bad design code.
+
+263
+00:19:18,000 --> 00:19:24,000
+Using data structures makes it easy to add new functions without changing the existing data structures,
+
+264
+00:19:24,000 --> 00:19:27,000
+but makes adding new data structures complicated.
+
+265
+00:19:28,000 --> 00:19:34,000
+Object oriented code, on the other hand, makes it easy to add new classes, but had to add new functions
+
+266
+00:19:34,000 --> 00:19:36,000
+without changing existing classes.
+
+267
+00:19:37,000 --> 00:19:38,000
+Those are opposites.
+
+268
+00:19:38,000 --> 00:19:42,000
+You have to select approach based on the current system's requirements.
+
+269
+00:19:42,000 --> 00:19:45,000
+After you choose an approach, stick to it.
+
+270
+00:19:45,000 --> 00:19:47,000
+Don't use hybrid's.
+
+271
+00:19:47,000 --> 00:19:48,000
+That's it.
+
+272
+00:19:49,000 --> 00:19:51,000
+Now let's recap what we have learned today.
+
+273
+00:19:52,000 --> 00:19:53,000
+We learned tell, don't ask.
+
+274
+00:19:53,000 --> 00:19:57,000
+Principal, you saw real life examples of applying this principle.
+
+275
+00:19:58,000 --> 00:20:02,000
+Also, we learned what data structures are after this lesson.
+
+276
+00:20:02,000 --> 00:20:07,000
+You can understand the difference between objects and data structures and, you know, specifics of
+
+277
+00:20:07,000 --> 00:20:10,000
+using getters and setters in classes.
+
+278
+00:20:10,000 --> 00:20:12,000
+Thanks a lot for your attention.
+
+279
+00:20:12,000 --> 00:20:15,000
+Have a great day and see you in the next lesson.
+
diff --git a/38 - Object-oriented Architecture, Clean Code Design (Advanced)/003 Law of Demeter_en.srt b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/003 Law of Demeter_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..c2ebf9fe34d98ef6c6cbc88925d6788a39cf69d8
--- /dev/null
+++ b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/003 Law of Demeter_en.srt
@@ -0,0 +1,456 @@
+1
+00:00:05,000 --> 00:00:06,000
+Hello, Jim.
+
+2
+00:00:06,000 --> 00:00:13,000
+In this lesson, we'll talk about law of Demeter, we'll discuss what is law of Demeter, what our goals
+
+3
+00:00:13,000 --> 00:00:19,000
+of this law, exemptions from it, what the pros and cons of following it and recommendations to follow.
+
+4
+00:00:20,000 --> 00:00:25,000
+By the end of this lesson, you will understand how you can apply law of Demeter and practice your own
+
+5
+00:00:25,000 --> 00:00:26,000
+programming of your applications.
+
+6
+00:00:27,000 --> 00:00:33,000
+And the first thing we have to do is to learn theory and understand the definition of law of Demeter.
+
+7
+00:00:34,000 --> 00:00:38,000
+And in general, what is law of Demeter about love?
+
+8
+00:00:38,000 --> 00:00:44,000
+The matter is also known as principle of least knowledge and a set of rules and object oriented programming,
+
+9
+00:00:44,000 --> 00:00:48,000
+which puts some restrictions on interactions between programming modules.
+
+10
+00:00:48,000 --> 00:00:55,000
+These restrictions help to achieve loose coupling to simplify modifications and complexity of a program.
+
+11
+00:00:56,000 --> 00:01:01,000
+According to the law of Demeter, each unit should have limited knowledge about as a unit.
+
+12
+00:01:02,000 --> 00:01:08,000
+You should be aware only about other modules which are directly relevant, should interact only with
+
+13
+00:01:08,000 --> 00:01:12,000
+modules which are known and to not interact with strangers.
+
+14
+00:01:12,000 --> 00:01:19,000
+In other words, love Demetre for functions requires that the method and of an object also may only
+
+15
+00:01:19,000 --> 00:01:28,000
+cause the masses of the following kinds of objects all itself about parameters and objects created or
+
+16
+00:01:28,000 --> 00:01:35,000
+instantiated within an almost direct component objects, a global variable accessible by all in the
+
+17
+00:01:35,000 --> 00:01:36,000
+scope of M.
+
+18
+00:01:37,000 --> 00:01:40,000
+Does it make sense to simplify this?
+
+19
+00:01:40,000 --> 00:01:47,000
+Each class should not be able to provide client with details of all possible fields of a class if a
+
+20
+00:01:47,000 --> 00:01:49,000
+client wants this object.
+
+21
+00:01:49,000 --> 00:01:56,000
+Thus, Sampson would just object what to do without exposing any additional details and also without
+
+22
+00:01:56,000 --> 00:02:01,000
+calling masses of nonrelated objects from the method that we have just called.
+
+23
+00:02:01,000 --> 00:02:08,000
+We as software engineers can easily identify a violation of law of Demeter in case we see a long chain
+
+24
+00:02:08,000 --> 00:02:10,000
+of nested invocations.
+
+25
+00:02:10,000 --> 00:02:16,000
+Law of Demeter pursues these goals, hide information we don't want.
+
+26
+00:02:16,000 --> 00:02:23,000
+That client of our court knows everything about all other types which we aggregate control access to
+
+27
+00:02:23,000 --> 00:02:24,000
+another object.
+
+28
+00:02:25,000 --> 00:02:32,000
+Moreover, we don't want to grant right to change state of aggregated objects and always be in mind
+
+29
+00:02:32,000 --> 00:02:40,000
+one of the key OPIS principles encapsulation to minimize carbon within an application to foster clean
+
+30
+00:02:40,000 --> 00:02:44,000
+design and make our code more usable and easy to change.
+
+31
+00:02:44,000 --> 00:02:48,000
+We want to achieve low carbon between our units and modules.
+
+32
+00:02:49,000 --> 00:02:51,000
+Let's take a look at a few examples here.
+
+33
+00:02:51,000 --> 00:02:55,000
+The first one car get engine start.
+
+34
+00:02:56,000 --> 00:03:00,000
+You have a car, you get engine from a car to start engine.
+
+35
+00:03:01,000 --> 00:03:07,000
+If you have reference to a car object and you need to start engine problem, you have to just start
+
+36
+00:03:07,000 --> 00:03:08,000
+engine in the car.
+
+37
+00:03:08,000 --> 00:03:10,000
+And yes, this is so easy.
+
+38
+00:03:11,000 --> 00:03:18,000
+We can even say that Love the Meter is a formal representation of tell don't ask principal when another
+
+39
+00:03:18,000 --> 00:03:21,000
+example you have a car and then some point of program.
+
+40
+00:03:21,000 --> 00:03:28,000
+We think that we can utilize car to get access to the user to pay fine for road rules violation.
+
+41
+00:03:28,000 --> 00:03:34,000
+And you have something like this car, get owner, get wallet, pay fine.
+
+42
+00:03:35,000 --> 00:03:38,000
+And a nation not in the chain call itself.
+
+43
+00:03:39,000 --> 00:03:43,000
+Even if we would extract local variables and will have something like this.
+
+44
+00:03:43,000 --> 00:03:49,000
+User, owner, car owner, wallet, get wallet, wallet, pay.
+
+45
+00:03:49,000 --> 00:03:49,000
+Fine.
+
+46
+00:03:50,000 --> 00:03:51,000
+The issue still exists.
+
+47
+00:03:52,000 --> 00:03:56,000
+It is not very object oriented approach to use car object to pay fine.
+
+48
+00:03:57,000 --> 00:04:04,000
+It is better to have reference to user object in the masset where pay fine supposed to be called violation
+
+49
+00:04:04,000 --> 00:04:06,000
+of law of the meter is a good sign.
+
+50
+00:04:06,000 --> 00:04:12,000
+That code must be decomposed and that object oriented approach is not followed.
+
+51
+00:04:12,000 --> 00:04:17,000
+Law of the meter, the same as all other laws, has some exceptions.
+
+52
+00:04:17,000 --> 00:04:20,000
+The law is not applicable for data structures.
+
+53
+00:04:20,000 --> 00:04:22,000
+Let's consider the next example.
+
+54
+00:04:22,000 --> 00:04:25,000
+User get car yet manufacturer.
+
+55
+00:04:26,000 --> 00:04:29,000
+There is no violation of law of the meter here.
+
+56
+00:04:29,000 --> 00:04:32,000
+We can't apply this law to pure data structures.
+
+57
+00:04:33,000 --> 00:04:35,000
+One we reference to pure data structures.
+
+58
+00:04:35,000 --> 00:04:39,000
+We mean objects that have no behavior, just data.
+
+59
+00:04:40,000 --> 00:04:46,000
+Does such law of object oriented programming as lot of the meter is not applicable to data structures
+
+60
+00:04:47,000 --> 00:04:51,000
+and thus a change course might be considered as exceptions.
+
+61
+00:04:51,000 --> 00:04:54,000
+Builder recreational partan was changed methods in locations.
+
+62
+00:04:55,000 --> 00:05:00,000
+Car said doors set, roof type set engine type built.
+
+63
+00:05:01,000 --> 00:05:02,000
+Does this matter?
+
+64
+00:05:02,000 --> 00:05:04,000
+Violate the law of the meter.
+
+65
+00:05:04,000 --> 00:05:11,000
+No, it is not it is even not pure exemption from law of Demeter because messaging does not violate
+
+66
+00:05:11,000 --> 00:05:18,000
+it at all during the object, construction, etc. the reference to the same object.
+
+67
+00:05:18,000 --> 00:05:21,000
+This is not a violation of law of Demeter.
+
+68
+00:05:21,000 --> 00:05:27,000
+It is also worth to mention the blind following of law of Demeter will not allow you to implement other
+
+69
+00:05:27,000 --> 00:05:28,000
+pathogens.
+
+70
+00:05:28,000 --> 00:05:36,000
+For example, factory MassArt Barton Product Factory get product list variance from one side.
+
+71
+00:05:36,000 --> 00:05:42,000
+The code on the slide can seems like a violation of law of Demeter, but actually it is not.
+
+72
+00:05:43,000 --> 00:05:43,000
+Why?
+
+73
+00:05:44,000 --> 00:05:50,000
+Because the sense of correlational pertains to create new objects, but the way how they create objects
+
+74
+00:05:50,000 --> 00:05:56,000
+looks like methods and location chain with involvement of different types such as products, factory
+
+75
+00:05:56,000 --> 00:05:57,000
+and product.
+
+76
+00:05:57,000 --> 00:06:01,000
+So in this particular case, though, of the meta is not violated.
+
+77
+00:06:02,000 --> 00:06:07,000
+The similar situations in your code can happen while implementation of all the parties.
+
+78
+00:06:07,000 --> 00:06:11,000
+But we need to understand the essence of the law of Demeter.
+
+79
+00:06:12,000 --> 00:06:14,000
+It is not about eliminating of mass.
+
+80
+00:06:14,000 --> 00:06:15,000
+It's in location change.
+
+81
+00:06:15,000 --> 00:06:21,000
+It is about restricting the amount of interactions between nonrelated units to implement law.
+
+82
+00:06:21,000 --> 00:06:23,000
+Coplin Does it make sense?
+
+83
+00:06:23,000 --> 00:06:29,000
+Try to take a look at your code through the essence of the law, but not actual court presentation.
+
+84
+00:06:30,000 --> 00:06:36,000
+To summarize what we have discussed, let's come up with a list of pros and cons of a planned law of
+
+85
+00:06:36,000 --> 00:06:36,000
+Demeter.
+
+86
+00:06:37,000 --> 00:06:40,000
+Let's start from Perth first law COPLIN.
+
+87
+00:06:40,000 --> 00:06:45,000
+We achieved this because unions interact only with a limited number of other units.
+
+88
+00:06:45,000 --> 00:06:53,000
+The closest ones, encapsulation law of the meta allows us to use exactly what we need instead of getting
+
+89
+00:06:53,000 --> 00:06:58,000
+objects out of another and get more information about code structure than we need.
+
+90
+00:06:58,000 --> 00:07:05,000
+And instead of having more opportunities to modify state of other objects, then we want data localisation.
+
+91
+00:07:05,000 --> 00:07:12,000
+But here in this law will limit possible options of interaction, could become easy to understand and
+
+92
+00:07:12,000 --> 00:07:14,000
+to navigate in class.
+
+93
+00:07:14,000 --> 00:07:16,000
+Responsibility becomes clearer.
+
+94
+00:07:17,000 --> 00:07:22,000
+The class, which takes multiple responsibilities, have is a long MassArt course or huge dependency
+
+95
+00:07:22,000 --> 00:07:24,000
+list in real life.
+
+96
+00:07:24,000 --> 00:07:31,000
+Applying of Law of Demeter brings us to refactoring of existing units and creation of another units.
+
+97
+00:07:31,000 --> 00:07:36,000
+Smaller ones with clear responsibility units become more testable.
+
+98
+00:07:37,000 --> 00:07:37,000
+Low.
+
+99
+00:07:37,000 --> 00:07:43,000
+Coplin allows us to write a unit test without thinking of Starbound of all necessary dependencies to
+
+100
+00:07:43,000 --> 00:07:45,000
+test units functionality.
+
+101
+00:07:46,000 --> 00:07:53,000
+And now let's talk about Conse man, new rapper Marcedes, we need to have more mascots to pass information
+
+102
+00:07:53,000 --> 00:07:59,000
+between different objects, it can sound like a valid point, but from another point of view, it can
+
+103
+00:07:59,000 --> 00:08:03,000
+sound like we are not following all the design and all principles.
+
+104
+00:08:04,000 --> 00:08:10,000
+By the time when creation of a lot of rubber masses will look like a disadvantage, we will understand
+
+105
+00:08:10,000 --> 00:08:15,000
+that probably our object has a lot of duties related with different pieces of application.
+
+106
+00:08:16,000 --> 00:08:21,000
+So this disadvantage should not bother you in case all other objects around the principles are followed.
+
+107
+00:08:22,000 --> 00:08:24,000
+That's all what I wanted to share with you.
+
+108
+00:08:24,000 --> 00:08:28,000
+Regarding Law of the meta, let's recap what we have learned today.
+
+109
+00:08:28,000 --> 00:08:35,000
+In this lesson we learned what law of the matter is also explained, what the goals of law of Demeter
+
+110
+00:08:35,000 --> 00:08:35,000
+are.
+
+111
+00:08:36,000 --> 00:08:38,000
+We reviewed exceptions from this law.
+
+112
+00:08:38,000 --> 00:08:43,000
+And at the end of the last review, the pros and cons of the law of the meta.
+
+113
+00:08:43,000 --> 00:08:44,000
+That's all for this lesson.
+
+114
+00:08:45,000 --> 00:08:48,000
+Thanks a lot for your attention and see you in the next lesson.
+
diff --git a/38 - Object-oriented Architecture, Clean Code Design (Advanced)/004 KISS Principle in OOP_en.srt b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/004 KISS Principle in OOP_en.srt
new file mode 100644
index 0000000000000000000000000000000000000000..598c4564b8393df789a4cbeb5514e0362920a1d8
--- /dev/null
+++ b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/004 KISS Principle in OOP_en.srt
@@ -0,0 +1,1368 @@
+1
+00:00:06,000 --> 00:00:11,000
+Hello dear students, in this lesson we are going to learn what the key principle in object oriented
+
+2
+00:00:11,000 --> 00:00:12,000
+programming is.
+
+3
+00:00:13,000 --> 00:00:18,000
+Despite this principle seeming simple, it is not that easy to follow.
+
+4
+00:00:18,000 --> 00:00:25,000
+However, it is crucial for you to learn it because based on my experience, not many developers nowadays
+
+5
+00:00:25,000 --> 00:00:28,000
+unfortunately follows this principle.
+
+6
+00:00:28,000 --> 00:00:31,000
+So here's what we'll be covering today.
+
+7
+00:00:31,000 --> 00:00:37,000
+We'll start by defining the Kiss principle and understanding its significance in software development.
+
+8
+00:00:37,000 --> 00:00:43,000
+I will then introduce you to various common variants of keys and how they apply to different contexts
+
+9
+00:00:43,000 --> 00:00:45,000
+within software engineering.
+
+10
+00:00:45,000 --> 00:00:53,000
+Next, we'll delve into the key concepts that underpin the Kiss principle, helping you grasp the foundational
+
+11
+00:00:53,000 --> 00:00:56,000
+ideas that make this principle so effective.
+
+12
+00:00:56,000 --> 00:01:02,000
+Following that, we'll discuss the benefits of using the case principle, highlighting why simplicity
+
+13
+00:01:02,000 --> 00:01:05,000
+can lead to better, more maintainable code.
+
+14
+00:01:05,000 --> 00:01:12,000
+I'll then provide practical advice on how to apply the Kiss principle in your own projects, ensuring
+
+15
+00:01:12,000 --> 00:01:14,000
+you have actionable steps to simplify your code.
+
+16
+00:01:15,000 --> 00:01:21,000
+We'll look at several real world case studies that demonstrate the keys principle in action, illustrating
+
+17
+00:01:21,000 --> 00:01:24,000
+how simplicity leads to success.
+
+18
+00:01:25,000 --> 00:01:31,000
+Finally, we'll review some code examples before and after applying the keys principle, giving you
+
+19
+00:01:31,000 --> 00:01:34,000
+a clear understanding of how to simplify complex code.
+
+20
+00:01:35,000 --> 00:01:36,000
+Let's start our lesson.
+
+21
+00:01:37,000 --> 00:01:42,000
+Let's learn the definition of keys principle and understand what it is about.
+
+22
+00:01:42,000 --> 00:01:49,000
+The Kiss principle, which stands for Keep it Simple Stupid, is a design philosophy emphasizing simplicity
+
+23
+00:01:49,000 --> 00:01:52,000
+in both design and implementation.
+
+24
+00:01:52,000 --> 00:01:59,000
+The idea is that simplicity should be a key goal in design, and unnecessary complexity should be avoided.
+
+25
+00:02:00,000 --> 00:02:03,000
+Here is a detailed explanation of the Kiss principle.
+
+26
+00:02:03,000 --> 00:02:11,000
+The Kiss principle asserts that systems, designs, and processes should be kept as simple as possible,
+
+27
+00:02:11,000 --> 00:02:14,000
+and unnecessary complexity should be avoided.
+
+28
+00:02:14,000 --> 00:02:20,000
+The belief is that most systems work best if they are kept simple rather than made complicated.
+
+29
+00:02:21,000 --> 00:02:27,000
+The term keep it simple stupid is attributed to Kelly Johnson, lead engineer at the Lockheed Skunk
+
+30
+00:02:27,000 --> 00:02:33,000
+Works, creators of the Lockheed U-2 and SR 71 Blackbird spy planes.
+
+31
+00:02:34,000 --> 00:02:39,000
+The phrase has been widely adopted in various fields, including software development, engineering,
+
+32
+00:02:39,000 --> 00:02:43,000
+and project management in the domain of software development.
+
+33
+00:02:44,000 --> 00:02:46,000
+There are different versions of this principle.
+
+34
+00:02:46,000 --> 00:02:52,000
+Each of variants of the keys principle provides a different perspective on maintaining simplicity in
+
+35
+00:02:52,000 --> 00:02:58,000
+software development, ensuring that systems remain efficient, understandable, and easy to maintain.
+
+36
+00:02:59,000 --> 00:03:01,000
+Let's review them one by one.
+
+37
+00:03:02,000 --> 00:03:03,000
+Keep it super simple.
+
+38
+00:03:03,000 --> 00:03:10,000
+Emphasizing an extreme level of simplicity, this approach advocates for the most basic and uncomplicated
+
+39
+00:03:10,000 --> 00:03:11,000
+solutions possible.
+
+40
+00:03:12,000 --> 00:03:18,000
+It aligns with the minimalist philosophy, where every element is scrutinized for its necessity and
+
+41
+00:03:18,000 --> 00:03:21,000
+anything deemed superfluous is removed.
+
+42
+00:03:21,000 --> 00:03:25,000
+This helps in creating lean and efficient systems.
+
+43
+00:03:26,000 --> 00:03:28,000
+Keep it short and simple.
+
+44
+00:03:28,000 --> 00:03:32,000
+This version focuses on brevity as well as simplicity.
+
+45
+00:03:32,000 --> 00:03:39,000
+It's particularly useful in contexts like communication, documentation, and presentations, where
+
+46
+00:03:39,000 --> 00:03:43,000
+conveying messages succinctly and clearly is highly valued.
+
+47
+00:03:44,000 --> 00:03:51,000
+This approach encourages developers to avoid verbose explanations and unnecessary details, making their
+
+48
+00:03:51,000 --> 00:03:54,000
+communications more effective and easily understandable.
+
+49
+00:03:55,000 --> 00:04:02,000
+Keep it silly simple adding a touch of humor, this playful variant reminds developers to keep simplicity
+
+50
+00:04:02,000 --> 00:04:06,000
+in perspective and not overcomplicate things.
+
+51
+00:04:06,000 --> 00:04:12,000
+It encourages a light hearted approach to problem solving, suggesting that sometimes the simplest,
+
+52
+00:04:12,000 --> 00:04:15,000
+even seemingly silly solutions can be the most effective.
+
+53
+00:04:16,000 --> 00:04:23,000
+Keep it stupid, simple and streamlined, combining the emphasis on simplicity with the concept of efficiency,
+
+54
+00:04:23,000 --> 00:04:28,000
+this variant advocates for solutions that are both basic and streamlined.
+
+55
+00:04:28,000 --> 00:04:36,000
+It suggests optimizing processes and designs to eliminate any unnecessary steps, thereby enhancing
+
+56
+00:04:36,000 --> 00:04:38,000
+overall performance and maintainability.
+
+57
+00:04:39,000 --> 00:04:42,000
+Keep it simple and straightforward.
+
+58
+00:04:42,000 --> 00:04:48,000
+This variant underscores the importance of both simplicity and straightforwardness.
+
+59
+00:04:48,000 --> 00:04:55,000
+It advocates for solutions that are not only simple, but also direct and easy to grasp.
+
+60
+00:04:55,000 --> 00:05:01,000
+This means avoiding convoluted methods and ensuring that the design and code are intuitive, making
+
+61
+00:05:01,000 --> 00:05:04,000
+it easier for others to understand and maintain.
+
+62
+00:05:05,000 --> 00:05:08,000
+Keep it simple, smart, or stupid.
+
+63
+00:05:08,000 --> 00:05:15,000
+This interpretation expands the principle to include smart solutions, suggesting that simplicity doesn't
+
+64
+00:05:15,000 --> 00:05:17,000
+preclude cleverness or innovation.
+
+65
+00:05:17,000 --> 00:05:25,000
+It promotes finding solutions that are easy, simple, or, if complexity is unavoidable, exceptionally
+
+66
+00:05:25,000 --> 00:05:30,000
+smart and well thought out, ensuring they still remain accessible and manageable.
+
+67
+00:05:31,000 --> 00:05:33,000
+Keep it simple and stupidly obvious.
+
+68
+00:05:34,000 --> 00:05:41,000
+This version stresses that solutions should be not only simple, but also incredibly clear and obvious.
+
+69
+00:05:41,000 --> 00:05:47,000
+It encourages developers to design systems that anyone can understand at a glance.
+
+70
+00:05:47,000 --> 00:05:50,000
+Prioritizing clarity and intuitive design.
+
+71
+00:05:50,000 --> 00:05:56,000
+This can be particularly helpful in ensuring that new team members or stakeholders can quickly grasp
+
+72
+00:05:56,000 --> 00:05:57,000
+how the system works.
+
+73
+00:05:58,000 --> 00:06:04,000
+Let's continue, and please remember, in case you have any questions, feel free to post your questions
+
+74
+00:06:04,000 --> 00:06:07,000
+below the video and I will be happy to answer.
+
+75
+00:06:08,000 --> 00:06:11,000
+Let me now elaborate more on key concepts of keys.
+
+76
+00:06:11,000 --> 00:06:12,000
+Principle.
+
+77
+00:06:12,000 --> 00:06:13,000
+Simplicity.
+
+78
+00:06:14,000 --> 00:06:17,000
+Strive for simplicity and design and implementation.
+
+79
+00:06:18,000 --> 00:06:21,000
+Simple systems are easier to understand, debug, and maintain.
+
+80
+00:06:22,000 --> 00:06:26,000
+Avoid overengineering and complexity that does not add direct value.
+
+81
+00:06:27,000 --> 00:06:29,000
+Avoid unnecessary complexity.
+
+82
+00:06:29,000 --> 00:06:35,000
+Do not add features or functionality that are not necessary for the current requirements.
+
+83
+00:06:35,000 --> 00:06:41,000
+Avoid gold plating or adding embellishments that do not contribute to the core functionality.
+
+84
+00:06:42,000 --> 00:06:48,000
+Ease of understanding code and designs should be easy to read and understand for other developers.
+
+85
+00:06:49,000 --> 00:06:54,000
+Use clear and straightforward logic rather than convoluted algorithms or patterns.
+
+86
+00:06:55,000 --> 00:06:57,000
+Maintainability.
+
+87
+00:06:57,000 --> 00:07:00,000
+Simple systems are easier to maintain and extend.
+
+88
+00:07:01,000 --> 00:07:07,000
+Fewer components and less complex interactions reduce the likelihood of bugs and issues.
+
+89
+00:07:08,000 --> 00:07:09,000
+Efficiency.
+
+90
+00:07:09,000 --> 00:07:13,000
+Simplicity often leads to more efficient use of resources.
+
+91
+00:07:14,000 --> 00:07:19,000
+Streamline designs can lead to better performance and lower costs in development and maintenance.
+
+92
+00:07:20,000 --> 00:07:25,000
+And now let's understand why you need to use key principle.
+
+93
+00:07:25,000 --> 00:07:31,000
+What benefits you will get and why we are having this lesson about keys principle.
+
+94
+00:07:32,000 --> 00:07:39,000
+The keys principle standing for Keep It Simple stupid is a foundational philosophy in software development
+
+95
+00:07:39,000 --> 00:07:43,000
+that promotes simplicity and discourages unnecessary complexity.
+
+96
+00:07:44,000 --> 00:07:48,000
+Here are the key reasons for using the Kiss principle and the benefits it offers.
+
+97
+00:07:49,000 --> 00:07:52,000
+Improved readability and understandability.
+
+98
+00:07:52,000 --> 00:07:55,000
+Simple code is easier to read and understand.
+
+99
+00:07:56,000 --> 00:08:02,000
+When developers can quickly grasp what the code does, they are more productive and make fewer mistakes.
+
+100
+00:08:03,000 --> 00:08:08,000
+New team members can understand and contribute to the code base more rapidly if it follows the keys
+
+101
+00:08:08,000 --> 00:08:09,000
+principle.
+
+102
+00:08:09,000 --> 00:08:14,000
+This reduces the learning curve and accelerates integration into the team.
+
+103
+00:08:15,000 --> 00:08:17,000
+Enhanced maintainability.
+
+104
+00:08:18,000 --> 00:08:24,000
+Simpler systems are easier to test and debug because there are fewer components and interactions to
+
+105
+00:08:24,000 --> 00:08:25,000
+consider.
+
+106
+00:08:25,000 --> 00:08:32,000
+This leads to quicker identification and resolution of bugs by avoiding unnecessary complexity.
+
+107
+00:08:32,000 --> 00:08:38,000
+Technical debt is minimized, making long term maintenance and enhancements more manageable.
+
+108
+00:08:39,000 --> 00:08:42,000
+Increased flexibility and adaptability.
+
+109
+00:08:42,000 --> 00:08:46,000
+Simpler designs are easier to refactor when requirements change.
+
+110
+00:08:46,000 --> 00:08:52,000
+This flexibility is crucial in an agile development environment where changes are frequent.
+
+111
+00:08:53,000 --> 00:08:57,000
+Simple systems can be scaled more easily than complex ones.
+
+112
+00:08:58,000 --> 00:09:05,000
+When a system is easy to understand, scaling strategies can be implemented without extensive rework.
+
+113
+00:09:06,000 --> 00:09:07,000
+Cost efficiency.
+
+114
+00:09:08,000 --> 00:09:14,000
+Simplicity in design and implementation reduces the time and effort required for development.
+
+115
+00:09:14,000 --> 00:09:17,000
+This directly translates to cost savings.
+
+116
+00:09:18,000 --> 00:09:24,000
+Maintaining a simple system is less resource intensive compared to a complex one.
+
+117
+00:09:24,000 --> 00:09:30,000
+Lower maintenance costs contribute to the overall cost efficiency of the project.
+
+118
+00:09:31,000 --> 00:09:38,000
+Better collaboration and communication following the Keys principle encourages consistent coding practices
+
+119
+00:09:38,000 --> 00:09:42,000
+across the team, fostering better collaboration and code reviews.
+
+120
+00:09:43,000 --> 00:09:50,000
+Simple systems require straightforward documentation, making it easier for team members to understand
+
+121
+00:09:50,000 --> 00:09:51,000
+and follow.
+
+122
+00:09:52,000 --> 00:09:54,000
+Higher reliability and stability.
+
+123
+00:09:55,000 --> 00:10:00,000
+Simpler systems have fewer bugs because there are fewer places for errors to hide.
+
+124
+00:10:00,000 --> 00:10:04,000
+Each component is easier to test and verify.
+
+125
+00:10:05,000 --> 00:10:09,000
+Simple systems are generally more robust and less prone to failures.
+
+126
+00:10:09,000 --> 00:10:13,000
+They handle changes and unexpected scenarios more gracefully.
+
+127
+00:10:14,000 --> 00:10:16,000
+Improved performance.
+
+128
+00:10:16,000 --> 00:10:22,000
+Simple code often runs more efficiently because it avoids the overhead associated with complex logic
+
+129
+00:10:22,000 --> 00:10:23,000
+and structures.
+
+130
+00:10:24,000 --> 00:10:31,000
+Simplified designs typically make better use of available resources, enhancing overall system performance.
+
+131
+00:10:32,000 --> 00:10:36,000
+User satisfaction for user facing applications.
+
+132
+00:10:36,000 --> 00:10:41,000
+Simplicity often translates to the more intuitive and user friendly interface.
+
+133
+00:10:42,000 --> 00:10:46,000
+Users can accomplish their tasks more easily and with less confusion.
+
+134
+00:10:47,000 --> 00:10:53,000
+Simplified backend processes lead to faster response times, enhancing the user experience.
+
+135
+00:10:55,000 --> 00:10:56,000
+Compliance and security.
+
+136
+00:10:57,000 --> 00:11:03,000
+Simple systems are easier to audit and ensure compliance with standards and regulations.
+
+137
+00:11:04,000 --> 00:11:07,000
+Fewer components and interactions reduce the attack surface.
+
+138
+00:11:07,000 --> 00:11:13,000
+Enhancing the security of the system encourages good design practices.
+
+139
+00:11:14,000 --> 00:11:20,000
+The key principle promotes modularity, where each component has a single responsibility.
+
+140
+00:11:20,000 --> 00:11:24,000
+This aligns with other best practices like solid principles.
+
+141
+00:11:25,000 --> 00:11:32,000
+Simple designs often have clear boundaries and well-defined interfaces, making them easier to manage
+
+142
+00:11:32,000 --> 00:11:33,000
+and extend.
+
+143
+00:11:34,000 --> 00:11:38,000
+So how you can apply these principles already today?
+
+144
+00:11:39,000 --> 00:11:46,000
+Applying the Kiss principle in software development involves a mindset and a set of practices that prioritize
+
+145
+00:11:46,000 --> 00:11:49,000
+simplicity and avoid unnecessary complexity.
+
+146
+00:11:50,000 --> 00:11:54,000
+Here are detailed strategies to apply the Kiss principle effectively.
+
+147
+00:11:55,000 --> 00:11:57,000
+Simplify requirements.
+
+148
+00:11:57,000 --> 00:12:01,000
+Focus on understanding the core requirements of the project.
+
+149
+00:12:01,000 --> 00:12:05,000
+Avoid adding features based on speculative future needs.
+
+150
+00:12:05,000 --> 00:12:11,000
+Aligned with Eugenie principles that we will learn in the separate lesson Eugenie stands for you ain't
+
+151
+00:12:11,000 --> 00:12:12,000
+gonna need it.
+
+152
+00:12:13,000 --> 00:12:17,000
+Work with stakeholders to prioritize features that provide the most value.
+
+153
+00:12:18,000 --> 00:12:22,000
+Keep the initial scope limited to the essential functionalities.
+
+154
+00:12:23,000 --> 00:12:25,000
+Design with simplicity in mind.
+
+155
+00:12:26,000 --> 00:12:31,000
+Choose straightforward architectural patterns that suit the problem at hand.
+
+156
+00:12:32,000 --> 00:12:37,000
+Avoid Overengineering was complex frameworks or patterns unless absolutely necessary.
+
+157
+00:12:38,000 --> 00:12:43,000
+Design your system in small, manageable and independent modules.
+
+158
+00:12:43,000 --> 00:12:46,000
+Each module should have a single responsibility.
+
+159
+00:12:46,000 --> 00:12:48,000
+Single responsibility principle.
+
+160
+00:12:50,000 --> 00:12:52,000
+Write clean and clear code.
+
+161
+00:12:52,000 --> 00:12:57,000
+Adhere to coding standards and best practices to ensure consistency across the code base.
+
+162
+00:12:59,000 --> 00:13:02,000
+Write code that is easy to read and understand.
+
+163
+00:13:02,000 --> 00:13:10,000
+Use meaningful variable names, clear and concise comments, and avoid deep nesting of loops and conditionals.
+
+164
+00:13:11,000 --> 00:13:14,000
+Resist the temptation to write overly clever code.
+
+165
+00:13:14,000 --> 00:13:18,000
+Clever code is often harder to understand and maintain.
+
+166
+00:13:19,000 --> 00:13:22,000
+Simplify logic and algorithms.
+
+167
+00:13:22,000 --> 00:13:25,000
+Use the simplest algorithm that meets the requirements.
+
+168
+00:13:26,000 --> 00:13:31,000
+Avoid overly complex algorithms unless they are necessary for performance reasons.
+
+169
+00:13:32,000 --> 00:13:35,000
+Continuously refactor code to improve simplicity.
+
+170
+00:13:35,000 --> 00:13:39,000
+Break down complex matters into smaller, more manageable ones.
+
+171
+00:13:40,000 --> 00:13:42,000
+Minimize dependencies.
+
+172
+00:13:42,000 --> 00:13:46,000
+Only use external libraries and frameworks that are necessary.
+
+173
+00:13:46,000 --> 00:13:51,000
+Each additional dependency adds complexity and potential points of failure.
+
+174
+00:13:52,000 --> 00:13:56,000
+Encapsulate dependencies within well defined interfaces.
+
+175
+00:13:56,000 --> 00:14:00,000
+This makes it easier to manage changes and updates to external libraries.
+
+176
+00:14:01,000 --> 00:14:04,000
+Simplify user interfaces.
+
+177
+00:14:04,000 --> 00:14:08,000
+Design user interfaces that are intuitive and easy to use.
+
+178
+00:14:09,000 --> 00:14:14,000
+Avoid clutter and focus on providing a clear and straightforward user experience.
+
+179
+00:14:15,000 --> 00:14:21,000
+Apply a minimalist approach to UI design, presenting users with only the essential information and
+
+180
+00:14:21,000 --> 00:14:22,000
+controls.
+
+181
+00:14:23,000 --> 00:14:26,000
+Document clearly and concisely.
+
+182
+00:14:26,000 --> 00:14:30,000
+Provide documentation that is clear, concise, and relevant.
+
+183
+00:14:30,000 --> 00:14:34,000
+Avoid overwhelming users and developers with excessive details.
+
+184
+00:14:34,000 --> 00:14:38,000
+Ensure documentation is kept up to date with the code base.
+
+185
+00:14:38,000 --> 00:14:42,000
+Outdated documentation can lead to confusion and errors.
+
+186
+00:14:43,000 --> 00:14:45,000
+Automate and simplify testing.
+
+187
+00:14:46,000 --> 00:14:50,000
+Write tests that are straightforward and easy to understand.
+
+188
+00:14:50,000 --> 00:14:55,000
+Unit tests should focus on small, isolated pieces of functionality.
+
+189
+00:14:56,000 --> 00:15:02,000
+Leverage testing frameworks and tools that simplifies the process of writing and running tests.
+
+190
+00:15:03,000 --> 00:15:05,000
+Continuous integration and deployment.
+
+191
+00:15:05,000 --> 00:15:13,000
+Use continuous integration and continuous deployment CI CD pipelines to automate the build, test and
+
+192
+00:15:13,000 --> 00:15:14,000
+deployment processes.
+
+193
+00:15:14,000 --> 00:15:18,000
+This reduces manual intervention and potential for errors.
+
+194
+00:15:19,000 --> 00:15:24,000
+Write deployment and build scripts that are simple and easy to understand.
+
+195
+00:15:24,000 --> 00:15:30,000
+Document these scripts will emphasize communication and collaboration.
+
+196
+00:15:31,000 --> 00:15:36,000
+Conduct regular code reviews to ensure that the code adheres to simplicity principles.
+
+197
+00:15:36,000 --> 00:15:40,000
+Encourage feedback and discussion on ways to simplify the code.
+
+198
+00:15:41,000 --> 00:15:47,000
+Work closely with stakeholders to ensure that requirements are clearly understood and that any complexity
+
+199
+00:15:47,000 --> 00:15:54,000
+is justified and necessary, And to help you understand this principle, let me share with you some
+
+200
+00:15:54,000 --> 00:15:59,000
+case studies from practical experience and you could feel the vibe of case principle.
+
+201
+00:16:00,000 --> 00:16:05,000
+I want to share with you examples from real life to simplify this concept for you.
+
+202
+00:16:05,000 --> 00:16:09,000
+And then we will learn examples from the software development domain.
+
+203
+00:16:10,000 --> 00:16:11,000
+Google search engine.
+
+204
+00:16:12,000 --> 00:16:16,000
+Google search engine interface is a prime example of simplicity.
+
+205
+00:16:16,000 --> 00:16:23,000
+The homepage features a single search bar with minimal text, ensuring ease of use and understanding
+
+206
+00:16:23,000 --> 00:16:24,000
+for users.
+
+207
+00:16:25,000 --> 00:16:30,000
+Although the search algorithms are highly complex, Google's commitment to a simple and user friendly
+
+208
+00:16:30,000 --> 00:16:35,000
+design has helped it become the most widely used search engine in the world.
+
+209
+00:16:36,000 --> 00:16:37,000
+Instagram.
+
+210
+00:16:38,000 --> 00:16:44,000
+Instagram's initial design focused on allowing users to share photos and videos with minimal additional
+
+211
+00:16:44,000 --> 00:16:45,000
+features.
+
+212
+00:16:46,000 --> 00:16:52,000
+The app's interface is clean and intuitive, with a simple layout that makes it easy to post and view
+
+213
+00:16:52,000 --> 00:16:53,000
+content.
+
+214
+00:16:54,000 --> 00:16:56,000
+IKEA's product assembly.
+
+215
+00:16:56,000 --> 00:17:03,000
+IKEA's Flatpack furniture is designed to be assembled by the consumer using simple instructions and
+
+216
+00:17:03,000 --> 00:17:05,000
+a minimal number of tools.
+
+217
+00:17:05,000 --> 00:17:11,000
+The assembly instructions are typically pictorial, easy to follow, and designed to require minimal
+
+218
+00:17:11,000 --> 00:17:12,000
+technical knowledge.
+
+219
+00:17:13,000 --> 00:17:16,000
+Let's review some examples from the software development.
+
+220
+00:17:17,000 --> 00:17:21,000
+Consider a simple task like reading a file and processing its contents.
+
+221
+00:17:22,000 --> 00:17:26,000
+A Kiss compliant approach might involve straightforward steps.
+
+222
+00:17:27,000 --> 00:17:28,000
+Open the file.
+
+223
+00:17:29,000 --> 00:17:30,000
+Read the contents.
+
+224
+00:17:31,000 --> 00:17:32,000
+Process the contents.
+
+225
+00:17:32,000 --> 00:17:34,000
+Close the file.
+
+226
+00:17:34,000 --> 00:17:41,000
+A non-case approach might involve unnecessary abstractions, complex error handling mechanisms that
+
+227
+00:17:41,000 --> 00:17:47,000
+aren't required for the task at hand, or using advanced design patterns that complicate the simple
+
+228
+00:17:47,000 --> 00:17:48,000
+task.
+
+229
+00:17:49,000 --> 00:17:52,000
+Let's talk about another practical examples.
+
+230
+00:17:53,000 --> 00:17:54,000
+Simple functions.
+
+231
+00:17:55,000 --> 00:18:01,000
+Instead of writing a single complex function that does multiple things, break it down into smaller
+
+232
+00:18:01,000 --> 00:18:04,000
+functions, each handling a specific task.
+
+233
+00:18:05,000 --> 00:18:07,000
+Avoid unnecessary patterns.
+
+234
+00:18:07,000 --> 00:18:11,000
+Don't use design patterns like singleton or factory.
+
+235
+00:18:11,000 --> 00:18:14,000
+If a simple constructor or a plain object suffices.
+
+236
+00:18:15,000 --> 00:18:17,000
+Simple error handling.
+
+237
+00:18:17,000 --> 00:18:20,000
+Handle errors in a straightforward manner.
+
+238
+00:18:21,000 --> 00:18:25,000
+Instead of catching generic exceptions and performing complex logging.
+
+239
+00:18:25,000 --> 00:18:30,000
+Handle specific exceptions where they occur and provide meaningful messages.
+
+240
+00:18:31,000 --> 00:18:33,000
+Use clear data structures.
+
+241
+00:18:33,000 --> 00:18:36,000
+Choose the simplest data structures that fits the need.
+
+242
+00:18:36,000 --> 00:18:43,000
+For instance, use lists and dictionaries for simple data storage instead of complex custom data structures.
+
+243
+00:18:44,000 --> 00:18:49,000
+So I believe you already have the feeling of what a Kiss principle is about.
+
+244
+00:18:49,000 --> 00:18:55,000
+But to make sure that we are on the same page, let me show you some code examples written in Java about
+
+245
+00:18:55,000 --> 00:18:56,000
+Kiss principle.
+
+246
+00:18:57,000 --> 00:19:00,000
+Let's review the code before we apply the Kiss principle.
+
+247
+00:19:01,000 --> 00:19:05,000
+You will be able to find the source code examples in attachments of the lesson.
+
+248
+00:19:06,000 --> 00:19:08,000
+Let me explain what we have here.
+
+249
+00:19:08,000 --> 00:19:16,000
+As the program starts, it greets the user with a prompt asking them to enter a number for this interaction.
+
+250
+00:19:16,000 --> 00:19:22,000
+It uses a scanner object, which is a tool that allows the program to read input from the console.
+
+251
+00:19:22,000 --> 00:19:29,000
+The user then types in a number, and this number is captured and stored in a variable named number.
+
+252
+00:19:30,000 --> 00:19:36,000
+After capturing the input, the program courteously closes the scanner to ensure no resources are wasted.
+
+253
+00:19:37,000 --> 00:19:41,000
+Next, the program checks whether the entered number is negative.
+
+254
+00:19:42,000 --> 00:19:43,000
+Why does it do that?
+
+255
+00:19:44,000 --> 00:19:49,000
+Well, factorials are mathematically defined only for non-negative integers.
+
+256
+00:19:49,000 --> 00:19:54,000
+So if the number is less than zero, the program prints a friendly message.
+
+257
+00:19:55,000 --> 00:19:58,000
+Factorial is not defined for negative numbers.
+
+258
+00:19:58,000 --> 00:20:04,000
+This way it informs the user about the invalid input without any technical jargon.
+
+259
+00:20:05,000 --> 00:20:09,000
+Now let's assume the user enters a valid non-negative number.
+
+260
+00:20:10,000 --> 00:20:14,000
+The program then calls a special method named calculate factorial.
+
+261
+00:20:14,000 --> 00:20:16,000
+Pressing the entered number to it.
+
+262
+00:20:17,000 --> 00:20:24,000
+This method is where the magic of calculating the factorial happens inside the calculate factorial method.
+
+263
+00:20:24,000 --> 00:20:27,000
+The program first checks if the number is zero.
+
+264
+00:20:28,000 --> 00:20:31,000
+By definition, the factorial of zero is one.
+
+265
+00:20:31,000 --> 00:20:36,000
+If the number is indeed zero, the method returns one immediately.
+
+266
+00:20:36,000 --> 00:20:41,000
+For other numbers, the program uses a loop to calculate the factorial.
+
+267
+00:20:41,000 --> 00:20:43,000
+However, there is a twist in this loop.
+
+268
+00:20:44,000 --> 00:20:51,000
+It contains a conditional check to see if the current number in the loop is even or odd, regardless
+
+269
+00:20:51,000 --> 00:20:54,000
+of whether the number is even or odd.
+
+270
+00:20:54,000 --> 00:20:56,000
+It multiplies the running total.
+
+271
+00:20:56,000 --> 00:20:59,000
+The factorial variable by this number.
+
+272
+00:21:00,000 --> 00:21:04,000
+This is just an example of redundant check that makes code less obvious.
+
+273
+00:21:05,000 --> 00:21:11,000
+I just tried to come up with a simple example and imagine that there can be different versions of the
+
+274
+00:21:11,000 --> 00:21:11,000
+problem.
+
+275
+00:21:11,000 --> 00:21:17,000
+But the main thing that I want you to learn from this particular example is that this check is redundant
+
+276
+00:21:17,000 --> 00:21:20,000
+and doesn't affect the outcome, and we don't need it.
+
+277
+00:21:21,000 --> 00:21:27,000
+Finally, after the loop has run its course and the factorial has been calculated, the method returns
+
+278
+00:21:27,000 --> 00:21:29,000
+the result back in the main method.
+
+279
+00:21:29,000 --> 00:21:32,000
+This result is then printed out to console.
+
+280
+00:21:33,000 --> 00:21:37,000
+Now let me open a file with a solution of this challenge.
+
+281
+00:21:37,000 --> 00:21:41,000
+The main method looks the same as in previous example.
+
+282
+00:21:41,000 --> 00:21:44,000
+That's why I will not comment on it.
+
+283
+00:21:44,000 --> 00:21:47,000
+Let's focus on the calculate factorial method.
+
+284
+00:21:48,000 --> 00:21:54,000
+Let's imagine that in this case, we decided to apply our knowledge about keys principles and we simplified
+
+285
+00:21:54,000 --> 00:21:56,000
+calculate factorial method.
+
+286
+00:21:56,000 --> 00:21:58,000
+Let's check what was simplified.
+
+287
+00:21:59,000 --> 00:22:06,000
+Let's explore a method that calculates the factorial of a given number using a straightforward and concise
+
+288
+00:22:06,000 --> 00:22:06,000
+approach.
+
+289
+00:22:07,000 --> 00:22:12,000
+The process begins by initializing a variable called factorial to one.
+
+290
+00:22:13,000 --> 00:22:18,000
+This variable will hold the result of our factorial calculation as it progresses.
+
+291
+00:22:19,000 --> 00:22:25,000
+The core of the method is a for loop that iterates from one to the given number n.
+
+292
+00:22:26,000 --> 00:22:32,000
+During each iteration, the current value of the loop counter I is multiplied by the current value of
+
+293
+00:22:32,000 --> 00:22:37,000
+factorial, and the result is stored back in factorial.
+
+294
+00:22:37,000 --> 00:22:45,000
+This loop continues until all integers from one to n have been multiplied together, effectively calculating
+
+295
+00:22:45,000 --> 00:22:46,000
+the factorial.
+
+296
+00:22:46,000 --> 00:22:53,000
+Once the loop completes, the method returns the final value of factorial, which is the factorial of
+
+297
+00:22:53,000 --> 00:22:54,000
+the input number n.
+
+298
+00:22:55,000 --> 00:23:00,000
+The simplified version of this code adheres to the Kiss principle.
+
+299
+00:23:00,000 --> 00:23:07,000
+Keep it simple, stupid, by focusing solely on the essential steps needed to calculate the factorial.
+
+300
+00:23:07,000 --> 00:23:11,000
+Here's why this approach is simpler and more effective.
+
+301
+00:23:11,000 --> 00:23:18,000
+Direct multiplication is a loop directly multiplies the factorial variable by the current loop counter
+
+302
+00:23:18,000 --> 00:23:18,000
+I.
+
+303
+00:23:18,000 --> 00:23:21,000
+Avoiding any unnecessary conditions or checks.
+
+304
+00:23:21,000 --> 00:23:25,000
+This makes the code more straightforward and easier to understand.
+
+305
+00:23:26,000 --> 00:23:28,000
+Elimination of redundancy.
+
+306
+00:23:28,000 --> 00:23:34,000
+The original version of the code contained redundant checks and conditions inside the loop, which added
+
+307
+00:23:34,000 --> 00:23:36,000
+unnecessary complexity.
+
+308
+00:23:36,000 --> 00:23:40,000
+By removing these, the method becomes cleaner and more readable.
+
+309
+00:23:41,000 --> 00:23:43,000
+Initialization and iteration.
+
+310
+00:23:43,000 --> 00:23:51,000
+The initialization of factorial to one and the loop iterating from one to n are clear and intuitive.
+
+311
+00:23:51,000 --> 00:23:58,000
+This matches the standard definition of calculating a factorial, making the logic immediately recognizable
+
+312
+00:23:58,000 --> 00:24:00,000
+to anyone familiar with the concept.
+
+313
+00:24:01,000 --> 00:24:03,000
+Efficient and maintainable.
+
+314
+00:24:03,000 --> 00:24:09,000
+The streamlined code is not only efficient in terms of execution, but also easier to maintain.
+
+315
+00:24:10,000 --> 00:24:16,000
+Any future modifications or debugging will be simpler due to the straightforward nature of the implementation.
+
+316
+00:24:16,000 --> 00:24:23,000
+By applying the key principle, the The factorial calculation method has been refined to focus on the
+
+317
+00:24:23,000 --> 00:24:26,000
+essential steps needed to achieve its goal.
+
+318
+00:24:26,000 --> 00:24:33,000
+This results in a method that is easier to read, understand, and maintain, making it a prime example
+
+319
+00:24:33,000 --> 00:24:37,000
+of the benefits of keeping things simple and software development.
+
+320
+00:24:37,000 --> 00:24:41,000
+I hope that now you understand Key's principle.
+
+321
+00:24:41,000 --> 00:24:46,000
+Even in case you still have any questions, please let me know in the comments below the video.
+
+322
+00:24:46,000 --> 00:24:48,000
+I'm always happy to help.
+
+323
+00:24:49,000 --> 00:24:49,000
+That's it.
+
+324
+00:24:49,000 --> 00:24:52,000
+Let's recap what we've learned today.
+
+325
+00:24:53,000 --> 00:24:59,000
+We started by defining the key principle and understanding its importance in software development.
+
+326
+00:25:00,000 --> 00:25:04,000
+You learned about various common variants of the keys principle and their applications.
+
+327
+00:25:05,000 --> 00:25:12,000
+We delved into the key concepts that form the foundation of Kiss, ensuring a solid grasp of its core
+
+328
+00:25:12,000 --> 00:25:13,000
+ideas.
+
+329
+00:25:13,000 --> 00:25:20,000
+We discussed the benefits of using the Kiss principle, highlighting how simplicity leads to better,
+
+330
+00:25:20,000 --> 00:25:21,000
+more maintainable code.
+
+331
+00:25:22,000 --> 00:25:27,000
+Practical steps on how to apply the Kiss principle in your projects were provided.
+
+332
+00:25:28,000 --> 00:25:34,000
+Together, we examined real world case studies that illustrate the successful application of Kiss.
+
+333
+00:25:35,000 --> 00:25:40,000
+Finally, we reviewed code examples before and after applying the Kiss principle to see the difference
+
+334
+00:25:40,000 --> 00:25:42,000
+in simplicity and clarity.
+
+335
+00:25:43,000 --> 00:25:50,000
+The Kiss principle is a foundational concept that helps in creating systems that are easy to work with
+
+336
+00:25:50,000 --> 00:25:51,000
+and maintain.
+
+337
+00:25:51,000 --> 00:25:57,000
+By focusing on simplicity, developers can produce more reliable and efficient software.
+
+338
+00:25:58,000 --> 00:26:05,000
+The principle acts as a guideline to remind developers to resist the temptation to overcomplicate solutions,
+
+339
+00:26:05,000 --> 00:26:11,000
+and to always strive for the most straightforward path to solving a problem.
+
+340
+00:26:11,000 --> 00:26:14,000
+That's all what I wanted to discuss with you today.
+
+341
+00:26:14,000 --> 00:26:16,000
+Thanks a lot for your attention.
+
+342
+00:26:16,000 --> 00:26:19,000
+Have a great day and see you in the next lesson.
+
diff --git a/38 - Object-oriented Architecture, Clean Code Design (Advanced)/004 Source-code-examples-shown-in-the-lesson.url b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/004 Source-code-examples-shown-in-the-lesson.url
new file mode 100644
index 0000000000000000000000000000000000000000..d24b5955a85d44dc532acdc3ac86d5f15843f99e
--- /dev/null
+++ b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/004 Source-code-examples-shown-in-the-lesson.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/oop/kiss
\ No newline at end of file
diff --git a/38 - Object-oriented Architecture, Clean Code Design (Advanced)/005 Source-code-examples-shown-in-the-lesson.url b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/005 Source-code-examples-shown-in-the-lesson.url
new file mode 100644
index 0000000000000000000000000000000000000000..0e305b8bf6ac13b071678191da503c07aff28591
--- /dev/null
+++ b/38 - Object-oriented Architecture, Clean Code Design (Advanced)/005 Source-code-examples-shown-in-the-lesson.url
@@ -0,0 +1,2 @@
+[InternetShortcut]
+URL=https://github.com/AndriiPiatakha/learnit_java_core/tree/master/src/com/itbulls/learnit/javacore/oop/yagni
\ No newline at end of file