{"id":370249,"date":"2024-05-21T04:20:53","date_gmt":"2024-05-21T04:20:53","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=370249"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=370249","title":{"rendered":"<span>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437 \u043c\u043e\u043a\u043e\u0432: \u044f\u0437\u044b\u043a \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432. \u0427\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b. \u0411\u0435\u0437 \u043d\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043c\u043d\u043e\u0433\u0438\u0435 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b <em>\u0442\u0430\u043a\u0436\u0435<\/em> \u0442\u0440\u0430\u0442\u044f\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435<a href=\"https:\/\/martinfowler.com\/bliki\/BroadStackTest.html\"> \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0440\u0443\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u041d\u043e \u043e\u043d\u0438 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b \u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b.<\/p>\n<p>\u0417\u043d\u0430\u044e\u0449\u0438\u0435 \u043b\u044e\u0434\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043c\u043e\u043a\u0438 (mocks) \u0438 \u0448\u043f\u0438\u043e\u043d\u044b (spies) (\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0434\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438 \u0433\u043e\u0432\u043e\u0440\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u00ab\u043c\u043e\u043a\u0438\u00bb) \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445<a href=\"http:\/\/blog.jayfields.com\/2008\/02\/behavior-based-testing.html\"> \u0442\u0435\u0441\u0442\u043e\u0432, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438<\/a>. \u0418\u0445 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u0434\u0451\u0436\u043d\u044b \u0438 \u0431\u044b\u0441\u0442\u0440\u044b, \u043d\u043e \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044e \u00ab\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u00bb \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433, \u0438 \u0438\u0445 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0448\u0438\u0440\u043e\u043a\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438 \u0442\u0440\u0443\u0434\u043d\u044b\u0435 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u041f\u043b\u043e\u0445\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u043a\u0430\u043a<a href=\"https:\/\/en.wikipedia.org\/wiki\/Hexagonal_architecture_(software)\"> \u0433\u0435\u043a\u0441\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/a> \u0438<a href=\"https:\/\/www.destroyallsoftware.com\/screencasts\/catalog\/functional-core-imperative-shell\"> \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u044f\u0434\u0440\u043e, \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430<\/a>, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. (\u0418\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u2014 \u044d\u0442\u043e \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435). \u042d\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443&#8230; \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u043a\u0438. \u041d\u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0447\u0430\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0439, \u0438 \u043e\u043d\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u0441\u0435\u0445 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c: \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u043e\u043a\u0438, \u043d\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041e\u043d \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043c\u043e\u0449\u044c\u044e \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e, \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e\u043c \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u0441\u0443\u0449\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0430\u043c. \u041d\u043e \u043d\u0435 \u043e\u0431\u043e\u0448\u043b\u043e\u0441\u044c \u0438 \u0431\u0435\u0437 <a href=\"#id1\">\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u043e\u0432<\/a>.<\/p>\n<p>\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0441\u043e\u0447\u0435\u0442\u0430\u044e\u0442<a href=\"#id2\"> \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435<\/a> \u0442\u0435\u0441\u0442\u044b (sociable),<a href=\"#id4\"> \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445<\/a>, \u0441 \u043d\u043e\u0432\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u043e\u0439 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c &#171;Nullables&#187;. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, Nullables \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0432\u043e\u0439\u043d\u0438\u043a\u0438, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434 \u0441 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0435\u043c. \u0418 \u0432 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441: \u0445\u043e\u0442\u0438\u0442\u0435 \u043b\u0438 \u0432\u044b \u0432\u0438\u0434\u0435\u0442\u044c \u044d\u0442\u043e \u0432 \u0441\u0432\u043e\u0451\u043c \u043a\u043e\u0434\u0435? \u0412\u0430\u0448 \u043e\u0442\u0432\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442, \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0432\u043e \u0432\u0441\u0451\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435. \u041f\u0443\u0441\u0442\u044c \u0432\u0430\u0441 \u043d\u0435 \u043f\u0443\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u043e\u043d\u0430 \u0440\u0430\u0437\u0431\u0438\u0442\u0430 \u043d\u0430 \u0434\u0432\u0435 \u0433\u043b\u0430\u0432\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0434\u0430. \u0412\u0442\u043e\u0440\u0430\u044f \u0433\u043b\u0430\u0432\u0430 \u0432\u044b\u0439\u0434\u0451\u0442 \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<h2>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<ol>\n<li>\n<p><a href=\"#id25\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id26\">\u0426\u0435\u043b\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id1\">\u041a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id28\">\u041e\u0441\u043d\u043e\u0432\u043e\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0449\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#id7\">\u0423\u0437\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id4\">\u0422\u0435\u0441\u0442\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (State-Based Tests)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id2\">\u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b (Overlapping Sociable Tests)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id10\">Smoke-\u0442\u0435\u0441\u0442\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id11\">\u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c (Zero-Impact Instantiation)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id12\">\u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (Parameterless Instantiation)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id13\">\u042d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440 (Signature Shielding)<\/a><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p><a href=\"#id30\">\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#id5\">A-Frame Architecture (\u00ab\u0410-\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u00bb)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id17\">Logic Sandwich (\u00ab\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0421\u044d\u043d\u0434\u0432\u0438\u0447\u00bb)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id18\">Traffic Cop (\u00ab\u0420\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0422\u0440\u0430\u0444\u0438\u043a\u0430\u00bb)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id19\">Grow Evolutionary Seeds (\u00ab\u0412\u044b\u0440\u0430\u0449\u0438\u0432\u0430\u043d\u0438\u0435 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0437\u0451\u0440\u0435\u043d\u00bb)<\/a><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p><a href=\"#id6\">\u041f\u0430\u0442\u0442\u0435\u0440\u043d \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438<\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#id31\">Easily-Visible Behavior (\u00ab\u041b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u00bb)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id20\">Testable Libraries (\u00ab\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00bb)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id21\">Collaborator-Based Isolation (\u00ab\u0418\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043b\u043b\u0430\u0431\u043e\u0440\u0430\u0446\u0438\u0438\u00bb)<\/a><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<hr\/>\n<p><a class=\"anchor\" name=\"id25\" id=\"id25\"><\/a><\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b<\/h2>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0435\u0451 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<a href=\"https:\/\/en.wikipedia.org\/wiki\/ROT13\"> ROT-13<\/a> \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>\u0412 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d <a href=\"#id5\">\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b A-Frame<\/a>. <code>App<\/code> \u2014 \u044d\u0442\u043e \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041e\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 Rot13 \u2014 \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"#id6\">\u043b\u043e\u0433\u0438\u043a\u0438<\/a>, \u0438 <code>CommandLine<\/code> \u2014  \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<pre><code class=\"javascript\">\/\/ Example production code (JavaScript + Node.js) import CommandLine from \".\/infrastructure\/command_line\";  \/\/ Infrastructure Wrapper import * as rot13 from \".\/logic\/rot13\";  export default class App {   constructor(commandLine = CommandLine.create()) {   \/\/ Parameterless Instantiation     this._commandLine = commandLine;   }    run() {     const args = this._commandLine.args();      if (args.length === 0) {    \/\/ Tested by Test #2       this._commandLine.writeOutput(\"Usage: run text_to_transform\\n\");       return;     }     if (args.length !== 1) {    \/\/ Tested by Test #3       this._commandLine.writeOutput(\"too many arguments\\n\");       return;     }      \/\/ Tested by Test #1     const input = args[0];                          \/\/ Logic Sandwich     const output = rot13.transform(input);     this._commandLine.writeOutput(output + \"\\n\");   } };<\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442\u044b <code>App<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b. \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e<a href=\"#id7\"> \u0443\u0437\u043a\u0438\u0435<\/a>, <a href=\"#id2\">\u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435<\/a> \u0442\u0435\u0441\u0442\u044b (Narrow, Sociable), \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435 \u043a\u043e\u0434 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445.<\/p>\n<p>\u0411\u0443\u0434\u0443\u0447\u0438 \u0443\u0437\u043a\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u043e\u043d\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <code>App.run()<\/code>. \u041e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u0422\u0435\u0441\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 Nullable <code>CommandLine<\/code> \u0434\u043b\u044f \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044f <code>stdout<\/code> \u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/otus\/articles\/799939\/#id8\">\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b (Configurable Responses)<\/a> \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u041e\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <a href=\"https:\/\/habr.com\/ru\/companies\/otus\/articles\/799939\/#id9\">\u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 (Output Tracking)<\/a>, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <code>stdout<\/code>.<\/p>\n<pre><code class=\"javascript\">\/\/ Example tests (JavaScript + Node.js) import assert from \"assert\"; import CommandLine from \".\/infrastructure\/command_line\"; import App from \".\/app\";  describe(\"App\", () => {   \/\/ Test #1   it(\"reads command-line argument, transform it with ROT-13, and writes result\", () => {     const { output } = run({ args: [ \"my input\" ] });     \/\/ Signature Shielding, Configurable Responses     assert.deepEqual(output.data, [ \"zl vachg\\n\" ];       \/\/ Output Tracking   });    \/\/ Test #2   it(\"writes usage when no argument provided\", () => {     const { output } = run({ args: [] });                                 \/\/ Signature Shielding, Configurable Responses     assert.deepEqual(output.data, [ \"Usage: run text_to_transform\\n\" ]);  \/\/ Output Tracking   });    \/\/ Test #3   it(\"complains when too many command-line arguments provided\", () => {     const { output } = run({ args: [ \"a\", \"b\" ] });                       \/\/ Signature Shielding, Configurable Responses     assert.deepEqual(output.data, [ \"too many arguments\\n\" ]);            \/\/ Output Tracking   });    function run({ args = [] } = {}) {                      \/\/ Signature Shielding     const commandLine = CommandLine.createNull({ args }); \/\/ Nullable, Infrastructure Wrapper, Configurable Responses     const output = commandLine.trackOutput();             \/\/ Output Tracking      const app = new App(commandLine);     app.run();      return { output };                                    \/\/ Signature Shielding   } });<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u043c\u043e\u043a\u0430\u043c\u0438, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e <code>CommandLine<\/code> \u2014 \u044d\u0442\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0434\u0432\u043e\u0439\u043d\u0438\u043a. \u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0442\u044c\u044e \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430.<\/p>\n<pre><code class=\"javascript\">\/\/ Example Nullable infrastructure wrapper (JavaScript + Node.js) import EventEmitter from \"node:events\"; import OutputTracker from \"output_tracker\";  const OUTPUT_EVENT = \"output\";  export default class CommandLine {   static create() {     return new CommandLine(process);                  \/\/ 'process' is a Node.js global   }    static createNull({ args = [] } = {}) {             \/\/ Parameterless Instantiation, Configurable Responses     return new CommandLine(new StubbedProcess(args)); \/\/ Embedded Stub   }    constructor(proc) {     this._process = proc;     this._emitter = new EventEmitter();               \/\/ Output Tracking   }    args() {     return this._process.argv.slice(2);   }    writeOutput(text) {     this._process.stdout.write(text);     this._emitter.emit(OUTPUT_EVENT, text);           \/\/ Output Tracking   }    trackOutput() {                                     \/\/ Output Tracking     return OutputTracker.create(this._emitter, OUTPUT_EVENT);   } };  \/\/ Embedded Stub class StubbedProcess {   constructor(args) {     this._args = args;                                \/\/ Configurable Responses   }    get argv() {     return [ \"nulled_process_node\", \"nulled_process_script.js\", ...this._args ];   }    get stdout() {     return {       write() {}     };   } }<\/code><\/pre>\n<p>\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u044e\u0442 \u0441\u0435\u0431\u044f \u0432 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0411\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u0437\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-example\"><strong>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.<\/strong><\/a> \u041f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-example\/tree\/javascript\"> (JavaScript<\/a> \u0438\u043b\u0438<a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-example\/tree\/typescript\"> TypeScript<\/a> \u0441 Node.js)<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-complex\"><strong>\u0421\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.<\/strong><\/a> \u0423\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0412\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 ROT-13. \u041a\u043e\u0434 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043e\u043a, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430\u043c\u0438 \u0438 \u043e\u0442\u043c\u0435\u043d\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-complex\/tree\/javascript\"> (JavaScript<\/a> \u0438\u043b\u0438<a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-complex\/tree\/typescript\"> TypeScript<\/a> \u0441 Node.js)<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.jamesshore.com\/v2\/projects\/lunch-and-learn\"><strong>TDD Lunch &amp; Learn Screencast.<\/strong><\/a> \u0421\u0435\u0440\u0438\u044f \u0447\u0430\u0441\u043e\u0432\u044b\u0445 \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u043e\u0432, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432. (JavaScript \u0441 Node.js)<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.jamesshore.com\/v2\/projects\/nullables\/jitterted-livestream\"><strong>Nullables Livestream.<\/strong><\/a> \u0421\u0435\u0440\u0438\u044f \u0442\u0440\u0451\u0445\u0447\u0430\u0441\u043e\u0432\u044b\u0445 \u043f\u0440\u044f\u043c\u044b\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0439 \u0441 \u0414\u0436\u0435\u0439\u043c\u0441\u043e\u043c \u0428\u043e\u0440\u043e\u043c \u0438 \u0422\u0435\u0434\u043e\u043c \u041c. \u042f\u043d\u0433\u043e\u043c. \u041e\u043d\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. (Java \u0441 Spring Boot)<\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"id26\" id=\"id26\"><\/a><\/p>\n<h2>\u0426\u0435\u043b\u0438<\/h2>\n<p>\u042d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0434\u043b\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0446\u0435\u043b\u0435\u0439:<\/p>\n<ul>\n<li>\n<p><em>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445.<\/em> \u041d\u0430\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u00ab<a href=\"https:\/\/martinfowler.com\/bliki\/IntegrationTest.html\">\u0443\u0437\u043a\u0438\u0445<\/a>\u00bb \u0442\u0435\u0441\u0442\u043e\u0432, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438. \u0428\u0438\u0440\u043e\u043a\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0438, \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0443\u0442, \u044d\u0442\u043e \u0443\u043a\u0430\u0436\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0431\u0435\u043b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><em>\u041b\u0451\u0433\u043a\u0438\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433.<\/em> \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0430 \u043d\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0425\u043e\u0442\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u2014 \u043d\u0435\u0442. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433, \u043d\u0435 \u043b\u043e\u043c\u0430\u044f \u0442\u0435\u0441\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p><em>\u0427\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b.<\/em> \u0422\u0435\u0441\u0442\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043f\u0440\u044f\u043c\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u00ab\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u0432\u044b\u0437\u043e\u0432, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u00bb (AAA \u2014 Arrange, Act, Assert). \u041e\u043d\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0432\u0438\u0434\u0438\u043c\u043e\u0435 \u0438\u0437\u0432\u043d\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0430 \u043d\u0435 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<\/li>\n<li>\n<p><em>\u041d\u0438\u043a\u0430\u043a\u043e\u0439 \u043c\u0430\u0433\u0438\u0438.<\/em> \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0449\u0438\u0435 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u0438\u043d\u044a\u0435\u043a\u0446\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u043a\u0438\u043d\u0433\u0430, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><em>\u0411\u044b\u0441\u0442\u0440\u043e\u0442\u0430 \u0438 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c.<\/em> \u041d\u0430\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u00ab\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439\u00bb \u043a\u043e\u0434, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u044f\u0432\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u0422\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0434\u0430\u0432\u0430\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u043f\u044b\u0442 \u0432\u044b\u044f\u0432\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/p>\n<ul>\n<li>\n<p><em>\u0411\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u043a\u043e\u0432.<\/em> \u041f\u0440\u0438 \u043f\u0440\u044f\u043c\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u044d\u0442\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b, \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043d\u0430 2-3 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0442\u0435\u0441\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u043a\u043e\u0432.<a href=\"https:\/\/github.com\/jamesshore\/livestream\/blob\/rot13-cli\/src\/_comparisons_test.js\"> (\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0437\u0434\u0435\u0441\u044c<\/a>).<\/p>\n<\/li>\n<li>\n<p><em>\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432.<\/em> \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u0440\u043e\u0441\u0442\u0430 \u0438 \u043b\u0435\u0433\u043a\u043e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<\/li>\n<li>\n<p><em>\u0412\u044b\u0441\u043e\u043a\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/em> \u0421\u0430\u043c\u044b\u0439 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432, \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0438\u043c \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><em>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b in-memory.<\/em> \u0412\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043e\u0431\u0451\u0440\u0442\u043a\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043c\u043e\u0436\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<a href=\"https:\/\/github.com\/jamesshore\/livestream\/blob\/2020-09-22-end\/src\/rot13-cli\/infrastructure\/_rot13_client_test.js#L22-L35\"> (\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0441\u0442\u0430<\/a>)<\/p>\n<\/li>\n<li>\n<p><em>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043f\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432.<\/em> \u041b\u0451\u0433\u043a\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u044b.<a href=\"https:\/\/github.com\/jamesshore\/livestream\/blob\/2020-09-22-end\/src\/rot13-cli\/_rot13_cli_test.js#L34-L67\"> (\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0442\u0435\u0441\u0442\u043e\u0432<\/a>)<\/p>\n<\/li>\n<li>\n<p><em>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/em> \u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 \u043c\u043e\u043a\u0430\u043c\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0432\u043e\u0439\u043d\u0438\u043a\u0430\u043c\u0438 \u0438 \u0434\u0430\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0435. \u0423\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e, \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"id1\" id=\"id1\"><\/a><\/p>\n<h2>\u041a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b<\/h2>\n<p>\u041d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e. \u0412\u043e\u0442 \u043c\u0438\u043d\u0443\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><em>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434\u0435.<\/em> \u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u0435\u0441\u0442\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p><em>\u0412\u0440\u0443\u0447\u043d\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0437\u0430\u0433\u043b\u0443\u0448\u0435\u043a.<\/em> \u0418\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043a\u043e\u0434\u0430 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438. \u0415\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438 \u043e\u043d \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p><em>\u041c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0431\u043e\u0438 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445.<\/em> \u0425\u043e\u0442\u044f \u0442\u0435\u0441\u0442\u044b \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f\u0445, \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043a\u043e\u0434 \u0432 \u0441\u0432\u043e\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445. (\u0414\u0436\u0435\u0439 \u0424\u0438\u043b\u0434\u0441 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u0442\u0435\u0440\u043c\u0438\u043d \u00ab<a href=\"https:\/\/martinfowler.com\/bliki\/UnitTest.html\">\u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b<\/a>\u00bb \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f). \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0431\u0430\u0433\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442.<\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"id28\" id=\"id28\"><\/a><\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043e\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0449\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/h2>\n<p>\u042d\u0442\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u043d\u0438\u0445.<\/p>\n<ul>\n<li>\n<p>\u0423\u0437\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b<\/p>\n<\/li>\n<li>\n<p><a href=\"#id4\">\u0422\u0435\u0441\u0442\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/a> (State-Based Tests)<\/p>\n<\/li>\n<li>\n<p><a href=\"#id2\">\u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b<\/a> (Overlapping Sociable Tests)<\/p>\n<\/li>\n<li>\n<p><a href=\"#id10\">\u0414\u044b\u043c\u043e\u0432\u044b\u0435 \u0442\u0435\u0441\u0442\u044b<\/a> (Smoke Tests)<\/p>\n<\/li>\n<li>\n<p><a href=\"#id11\">\u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c<\/a> (Zero-Impact Instantiation)<\/p>\n<\/li>\n<li>\n<p><a href=\"#id12\">\u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/a> (Parameterless Instantiation)<\/p>\n<\/li>\n<li>\n<p><a href=\"#id13\">\u042d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440<\/a> (Signature Shielding)<\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"id7\" id=\"id7\"><\/a><\/p>\n<h3>\u0423\u0437\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b<\/h3>\n<p>\u0428\u0438\u0440\u043e\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u0435) \u043e\u0431\u044b\u0447\u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 \u0438 \u0445\u0440\u0443\u043f\u043a\u0438\u0435. \u041e\u043d\u0438 \u0441\u043b\u043e\u0436\u043d\u044b \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438, \u0447\u0430\u0441\u0442\u043e \u0434\u0430\u044e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0441\u0431\u043e\u0438 \u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/em><\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0443\u0437\u043a\u0438\u0435. \u0423\u0437\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043b\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0430 \u043d\u0435 \u0432\u0441\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432 \u0446\u0435\u043b\u043e\u043c. \u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0443\u0437\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u2014 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u041f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0443\u0437\u043a\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b. \u041f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0447\u0438\u0441\u0442\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <a href=\"#id6\">\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438<\/a>. \u041f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430, \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <a href=\"https:\/\/habr.com\/ru\/companies\/otus\/articles\/799939\/#id5\">Nullables<\/a>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0430\u0448 \u043a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u0435\u0441\u0442\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438<a href=\"#id2\"> \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b<\/a>.<\/p>\n<p><a class=\"anchor\" name=\"id4\" id=\"id4\"><\/a><\/p>\n<h3>\u0422\u0435\u0441\u0442\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \/ State-Based Tests<\/h3>\n<p>\u041c\u043e\u043a\u0438 \u0438 \u0448\u043f\u0438\u043e\u043d\u044b \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u00ab\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438\u00bb \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442, \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0440\u0443\u0434\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c, \u0438 \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044e \u00ab\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u00bb \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0447\u0442\u043e \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/em><\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u0435\u0441\u0442\u044b, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u0435\u0441\u0442\u043e\u0432, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438. \u0422\u0435\u0441\u0442\u044b, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0432\u044b\u0432\u043e\u0434 \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">\/\/ Production code to describe phase of moon (JavaScript) import * as moon from \"astronomy\"; import { format } from \"date_formatter\";  export function describeMoonPhase(date) {   const visibility = moon.getPercentOccluded(date);   const phase = moon.describePhase(visibility);   const formattedDate = format(date);   return `The moon is ${phase} on ${formattedDate}.`; }<\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0432\u0432\u043e\u0434\u0438\u0442 \u0434\u0430\u0442\u0443 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">\/\/ State-based test of describeMoonPhase() (JavaScript) import { describeMoonPhase } from \"describe_phase\";  it(\"describes phase of moon\", () => {   const dateOfFullMoon = new Date(\"8 Dec 2022\");    \/\/ a date when the moon was actually full   const description = describeMoonPhase(dateOfFullMoon);   assert.equal(description, \"The moon is full on December 8th, 2022.\"; });<\/code><\/pre>\n<p>\u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0442\u0435\u0441\u0442, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<pre><code class=\"javascript\">\/\/ Interaction-based test of describeMoonPhase() (JavaScript and fictional mocking framework) const moon = mocker.mockImport(\"astronomy\"); const { format } = mocker.mockImport(\"date_formatter\"); const { describeMoonPhase } = mocker.importWithMocks(\"describe_phase\");  it(\"describes phase of moon\", () => {   const date = new Date();    \/\/ specific date doesn't matter    mocker.expect(moon.getPercentOccluded).toBeCalledWith(date).thenReturn(999);   mocker.expect(moon.describePhase).toBeCalledWith(999).thenReturn(\"PHASE\");   mocker.expect(format).toBeCalledWith(date).thenReturn(\"DATE\");    const description = describeMoonPhase(date);   mocker.verify();   assert.equal(description, \"The moon is PHASE on DATE\"); };<\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442\u044b, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0430\u043c. \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435 \u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <a href=\"https:\/\/habr.com\/ru\/companies\/otus\/articles\/799939\/#id4\">\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b Nullability<\/a>.<\/p>\n<p><a class=\"anchor\" name=\"id2\" id=\"id2\"><\/a><\/p>\n<h3>\u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \/ Overlapping Sociable Tests<\/h3>\n<p>\u0422\u0435\u0441\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u043c\u043e\u043a\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0432\u043e\u0439\u043d\u0438\u043a\u0438, \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u044e\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u0434, \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u0435\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u042d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0435, \u043d\u043e \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/em><\/p>\n<p>\u041f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0438 \u0435\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435, \u0447\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e <code>describeMoonPhase<\/code> \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 <code>Moon<\/code> \u0438 <code>format<\/code>. \u0415\u0441\u043b\u0438 \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u0435\u0442 <code>describeMoonPhase<\/code>, \u0442\u0435\u0441\u0442 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442.<\/p>\n<pre><code class=\"javascript\">\/\/ Example of sociable tests (JavaScript)  \/\/ Test code it(\"describes phase of moon\", () => {   const dateOfFullMoon = new Date(\"8 Dec 2022\");   const description = describeMoonPhase(dateOfFullMoon);   assert.equal(description, \"The moon is full on December 8th, 2022.\"; };  \/\/ Production code describeMoonPhase(date) {   const visibility = moon.getPercentOccluded(date);   const phase = moon.describePhase(visibility);   const formattedDate = format(date);   return `The moon is ${phase} on ${formattedDate}.`; }<\/code><\/pre>\n<p>\u041f\u0438\u0448\u0438\u0442\u0435 \u0443\u0437\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0430 \u043d\u0435 \u043d\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u041a\u0430\u0436\u0434\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0443\u0437\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <em>\u043d\u0435<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435 \u0432\u0441\u0435 \u0444\u0430\u0437\u044b \u043b\u0443\u043d\u044b \u0432 \u0442\u0435\u0441\u0442\u0435 <code>describeMoonPhase()<\/code>, \u043d\u043e <em>\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435<\/em> \u0438\u0445 \u0432 \u0442\u0435\u0441\u0442\u0435 <em>Moon<\/em>. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, <em>\u043d\u0435<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u0442\u044b \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 <code>describeMoonPhase<\/code>, \u043d\u043e <em>\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435<\/em> \u0438\u0445 \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 <code>format(date)<\/code>.<\/p>\n<p>\u041e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442, \u043a\u0430\u043a \u0432\u0430\u0448 \u043a\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0442 \u043e\u0442 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0440\u0430\u0437\u0440\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041a\u0430\u0436\u0434\u044b\u0439 \u0442\u0435\u0441\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0441 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043f\u0440\u043e\u0447\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0442\u0435\u0441\u0442\u043e\u0432. \u042d\u0442\u043e \u0434\u0430\u0451\u0442 \u0432\u0430\u043c \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 <code>LoginController<\/code><em> \u2192 <\/em><code>Auth0Client<\/code><em> \u2192 <\/em><code>HttpClient<\/code>:<\/p>\n<ul>\n<li>\n<p>\u0422\u0435\u0441\u0442\u044b <code>LoginController<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b <code>LoginController<\/code>, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0442\u043e, \u043a\u0430\u043a \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>Auth0Client<\/code>. (<code>Auth0Client<\/code>, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <code>HttpClient<\/code>, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438 <code>LoginController<\/code> \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435).<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u0441\u0442\u044b <code>Auth0Client<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b <code>Auth0Client<\/code>, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0442\u043e, \u043a\u0430\u043a \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>HttpClient<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u0441\u0442\u044b <code>HttpClient<\/code> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c <code>HttpClient<\/code>, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0443\u0437\u043a\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043c\u0435\u0441\u0442\u0435 \u043e\u043d\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432\u0441\u0435\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0438. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 <code>HttpClient<\/code> \u0438 \u0435\u0433\u043e \u0442\u0435\u0441\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u043c\u0430\u0435\u0442 <code>Auth0Client<\/code>, \u0435\u0433\u043e \u0442\u0435\u0441\u0442\u044b \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0443\u0442 (\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u0435\u0441\u0442\u044b <code>LoginController<\/code> \u0442\u043e\u0436\u0435). \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f <code>Auth0Client<\/code> \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u043f\u043e\u043b\u043e\u043c\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 <code>LoginController<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u043f\u0440\u043e\u0442\u0438\u0432, \u0435\u0441\u043b\u0438 \u0431\u044b \u0442\u0435\u0441\u0442\u044b <code>LoginController<\/code> \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 <code>Auth0Client<\/code>, \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0431\u044b\u043b\u0430 \u0431\u044b \u0440\u0430\u0437\u043e\u0440\u0432\u0430\u043d\u0430. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f <code>Auth0Client<\/code> \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0438\u0442 \u0442\u0435\u0441\u0442\u044b <code>LoginController<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442, \u043a\u0430\u043a <code>LoginController<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 <code>Auth0Client<\/code>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432\u0441\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043e\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Nullables. \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <a href=\"https:\/\/habr.com\/ru\/companies\/otus\/articles\/799939\/#id3\">\u00ab\u043f\u0430\u0440\u0430\u043d\u043e\u0438\u0434\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u0435\u043b\u0435\u043c\u0435\u0442\u0440\u0438\u044e\u00bb<\/a>. \u0414\u043b\u044f \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Smoke-\u0442\u0435\u0441\u0442\u044b.<\/p>\n<p><a class=\"anchor\" name=\"id10\" id=\"id10\"><\/a><\/p>\n<h3>Smoke-\u0442\u0435\u0441\u0442\u044b <\/h3>\n<p>\u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c. \u041d\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0435\u043d, \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0443 \u0432\u0441\u0435\u0445. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/em><\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u0434\u0432\u0430 \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0436\u0443\u0442, \u0447\u0442\u043e \u043a\u043e\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u0431\u0449\u0438\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0432\u0430\u0436\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443.<\/p>\n<p>\u041d\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 Smoke-\u0442\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a. \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u0443\u0437\u043a\u0438\u0445 \u0438 \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 Smoke-\u0442\u0435\u0441\u0442\u044b \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0447\u0442\u043e-\u0442\u043e, \u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043f\u0440\u043e\u0431\u0435\u043b \u0431\u043e\u043b\u0435\u0435 \u0443\u0437\u043a\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<p><a class=\"anchor\" name=\"id11\" id=\"id11\"><\/a><\/p>\n<h3>\u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \/ Zero-Impact Instantiation<\/h3>\n<p>\u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u0443\u044e\u0442 \u0441\u0432\u043e\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u0443\u044e\u0442 \u0441\u0432\u043e\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0415\u0441\u043b\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0430\u0443\u0442\u0438\u043d\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438\u043b\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b, \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c\u0438, \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c\u0438. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/em><\/p>\n<p>\u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\u0445. \u041d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435\u0441\u044c \u043a \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c, \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0439\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0439\u0442\u0435 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441, \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <code>connect()<\/code><em> <\/em>\u0438\u043b\u0438 <code>start()<\/code>. \u0414\u043b\u044f \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<a href=\"https:\/\/martinfowler.com\/bliki\/LazyInitialization.html\"> \u043b\u0435\u043d\u0438\u0432\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/a>. (\u041d\u043e \u0434\u0430\u0436\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u0440\u044f\u0434 \u043b\u0438 \u0441\u0442\u0430\u043d\u0443\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445).<\/p>\n<p><a class=\"anchor\" name=\"id12\" id=\"id12\"><\/a><\/p>\n<h3>\u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \/ Parameterless Instantiation<\/h3>\n<p>\u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043d\u043e \u043c\u043d\u043e\u0433\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 \u0442\u0435\u0441\u0442\u0430\u0445. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (Dependency injection, DI) \u043e\u0431\u0445\u043e\u0434\u044f\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u043e \u043c\u044b \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u043c\u0430\u0433\u0438\u0438. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/em><\/p>\n<p>\u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443 \u0432\u0441\u0435\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0438\u043b\u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u042d\u0442\u0430 \u0444\u0430\u0431\u0440\u0438\u043a\u0430 (\u0438\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440) \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0443, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0435\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u043c\u0438. (\u0415\u0441\u043b\u0438 \u0432\u0430\u0448 \u044f\u0437\u044b\u043a \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 Options, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0435 \u042d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440).<\/p>\n<p>\u0414\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f<a href=\"https:\/\/www.martinfowler.com\/bliki\/ValueObject.html\"> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/a>, \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u2014 \u043d\u0435 \u043b\u0443\u0447\u0448\u0430\u044f \u0438\u0434\u0435\u044f \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043b\u044e\u0434\u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>Address<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0443\u043b\u0438\u0446\u044b, \u0433\u043e\u0440\u043e\u0434\u0430 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0423\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0433\u043e\u0440\u043e\u0434\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0440\u043e\u0434\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0433\u043e\u0440\u043e\u0434.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0444\u0430\u0431\u0440\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0441 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u044f\u0442 \u043a\u043b\u0430\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0438\u043c\u044f <code>createTestInstance()<\/code>, \u0447\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432. \u0412 \u0441\u0432\u043e\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u0436\u043d\u044b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430, \u0430 \u043d\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0422\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0431\u0440\u0438\u043a\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \u043a \u043f\u043e\u043b\u043e\u043c\u043a\u0435 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">\/\/ Test-specific factory using named, optional parameters (JavaScript) class Address {   \/\/ Production constructor   constructor(street, city, state, country, postalCode) {     this._street = street;     this._city = city;     \/\/...etc...   }    \/\/ Test-specific factory   static createTestInstance({     street = \"Address test street\",     city = \"Address test city\",     state = State.createTestInstance(),     country = Country.createTestInstance(),     postalCode = PostalCode.createTestInstance(),   } = {}) {     return new Address(street, city, state, country, postalCode);   } }<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0444\u0430\u0431\u0440\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434\u0435 \u0440\u044f\u0434\u043e\u043c \u0441 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u043a\u043e\u0434, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432, \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0439, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0442\u0442\u0435\u0440\u043d<a href=\"https:\/\/www.martinfowler.com\/bliki\/ObjectMother.html\"> Object Mother<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p><a class=\"anchor\" name=\"id13\" id=\"id13\"><\/a><\/p>\n<h3>\u042d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440  \/ Signature Shielding<\/h3>\n<p>\u041f\u043e \u043c\u0435\u0440\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f. \u0415\u0441\u043b\u0438 \u043a\u043e\u0434 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d, \u044d\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445. \u041d\u043e \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u043d\u0435\u0441\u0451\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b, \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0434 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/em><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041f\u0443\u0441\u0442\u044c \u044d\u0442\u0438 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043b\u044e\u0431\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0442\u0435\u0441\u0442\u0430\u043c, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>before()<\/code> \u0438\u043b\u0438 <code>setup()<\/code> \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430.<\/p>\n<p>\u041f\u0443\u0441\u0442\u044c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0432 \u0432\u0430\u0448\u0435\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435 \u043b\u043e\u043c\u0430\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<pre><code class=\"javascript\">\/\/ Optional parameters and multiple return values (JavaScript)  \/\/ Example test it(\"uses hosted page for authentication\", () => {   const { url } = getLoginUrl({       \/\/ Use the helper function     host: \"my.host\",     clientId: \"my_client_id\",     callbackUrl: \"my_callback_url\"   });    assert.equal(url, \"https:\/\/my.host\/authorize?response_type=code&amp;client_id=my_client_id&amp;callback_url=my_callback_url\"); });  \/\/ Example helper function function getLoginUrl({   host = \"irrelevant.host\",           \/\/ Optional parameters   clientId = \"irrelevant_client_id\",   clientSecret = \"irrelevant_secret\",   connection = \"irrelevant_connection\"   username = \"irrelevant_username\",   callbackUrl = \"irrelevant_url\", } = {}) {   const client = new LoginClient(host, clientId, clientSecret, connection);   const url = client.getLoginUrl(username, callbackUrl);    return { client, url };             \/\/ Multiple return values }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044f\u0437\u044b\u043a \u0431\u0435\u0437 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 &#171;Options&#187;. \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044f\u0437\u044b\u043a \u0431\u0435\u0437 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"javascript\">\/\/ Optional parameters and multiple return values (Java)  \/\/ Example tests @Test public void usesHostedPageForAuthentication() {   GetLoginUrlResult actual = getLoginUrl(new GetLoginUrlOptions()   \/\/ Use the helper function and Options object     .withHost(\"my.host\")     .withClientId(\"my_client_id\")     .withCallbackUrl(\"my_callback_url\")   );   assert.equal(actual.url, \"https:\/\/my.host\/authorize?response_type=code&amp;client_id=my_client_id&amp;callback_url=my_callback_url\"); }  \/\/ Helper function using Options object and return data structure private GetLoginUrlResult getLoginUrl(GetLoginUrlOptions options) {   LoginClient client = new LoginClient(options.host, options.clientId, options.secret, options.connection);   String url = client.getLoginUrl(options.username, options.callbackUrl);   return new GetLoginUrlResult(client, url); }  \/\/ Options object private static final class GetLoginUrlOptions {   public String host = \"irrelevant.host\";   public String clientId = \"irrelevant_client_id\";   public String clientSecret = \"irrelevant_secret\";   public String connection = \"irrelevant_connection\";   public String username = \"irrelevant_username\";   public String callbackUrl = \"irrelevant_url\";    GetLoginUrlOptions withHost(String host) {     this.host = host;     return this;   }    GetLoginUrlOptions withClientId(String clientId) {     this.clientId = clientId;     return this;   }    GetLoginUrlOptions withCallbackUrl(String url) {     this.callbackUrl = url;     return this;   } }  \/\/ Return data structure private static final class GetLoginUrlResult {   public LoginClient client;   public String url;    public GetLoginUrlResult(LoginClient client, String url) {     this.client = client;     this.url = url;   } }<\/code><\/pre>\n<p><a class=\"anchor\" name=\"id30\" id=\"id30\"><\/a><\/p>\n<h2>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/h2>\n<p>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0443\u0434\u0435\u043b\u044f\u0435\u0442\u0435 \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c \u0432 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u0435. \u042d\u0442\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u0430\u043c \u0432 \u044d\u0442\u043e\u043c. \u041e\u043d\u0438 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b.<\/p>\n<ul>\n<li>\n<p>A-Frame Architecture (\u00ab\u0410-\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u00bb)<\/p>\n<\/li>\n<li>\n<p><a href=\"#id17\">Logic Sandwich<\/a> (\u00ab\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 c\u044d\u043d\u0434\u0432\u0438\u0447\u00bb)<\/p>\n<\/li>\n<li>\n<p><a href=\"#id18\">Traffic Cop<\/a> (\u00ab\u0420\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0442\u0440\u0430\u0444\u0438\u043a\u0430\u00bb)<\/p>\n<\/li>\n<li>\n<p><a href=\"#id19\">Grow Evolutionary Seeds<\/a> (\u00ab\u0412\u044b\u0440\u0430\u0449\u0438\u0432\u0430\u043d\u0438\u0435 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0437\u0451\u0440\u0435\u043d\u00bb)<\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"id5\" id=\"id5\"><\/a><\/p>\n<h3>A-Frame Architecture\u00a0<\/h3>\n<p>\u041a\u043e\u0434 \u0431\u0435\u0437 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u043a\u043e\u0434 \u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043c\u043d\u043e\u0433\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0438\u0437\u0443 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code>Application\/UI       |       V     Logic       |       V Infrastructure<\/code><\/pre>\n<p><em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/em><\/p>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0438 \u043b\u043e\u0433\u0438\u043a\u0430 \u0431\u044b\u043b\u0438 \u0440\u0430\u0432\u043d\u043e\u043f\u0440\u0430\u0432\u043d\u044b \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0431\u0435\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0438 \u043b\u043e\u0433\u0438\u043a\u043e\u0439. \u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Logic Sandwich \u0438\u043b\u0438 Traffic Cop. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435<a href=\"https:\/\/www.martinfowler.com\/bliki\/ValueObject.html\"> \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/a> \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0443\u0440\u043e\u0432\u043d\u044f\u043c\u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<pre><code>   Application\/UI     Values    \/            \\   V              V Logic   Infrastructure<\/code><\/pre>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0441\u043b\u043e\u0438 &#171;Logic&#187; \u0438 &#171;Values&#187;, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438. \u041f\u043e\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u041f\u043e\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0441\u043b\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \/ UI \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Logic Sandwich \u0438\u043b\u0438 Traffic Cop \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Nullables \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0425\u043e\u0442\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d A-Frame Architecture \u2014 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u043d \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d. \u042d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c A-Frame \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Grow Evolutionary Seeds. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 <a href=\"https:\/\/habr.com\/ru\/companies\/otus\/articles\/799939\/#id13\">Descend the Ladder.<\/a><\/p>\n<p><a class=\"anchor\" name=\"id17\" id=\"id17\"><\/a><\/p>\n<h3>Logic Sandwich \/ \u00ab\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 c\u044d\u043d\u0434\u0432\u0438\u0447\u00bb<\/h3>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 A-Frame \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0443\u0440\u043e\u0432\u043d\u0438 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u041d\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0441\u043b\u043e\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/em><\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u0434 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u00ab\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u044d\u043d\u0434\u0432\u0438\u0447\u0430\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0439\u0442\u0435 \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e.<\/p>\n<pre><code class=\"javascript\">\/\/ JavaScript const input = infrastructure.readData(); const output = logic.processInput(input); infrastructure.writeData(output);<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u0435\u0441\u043b\u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0446\u0438\u043a\u043b \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043d\u0443\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0435, \u0438\u043b\u0438 \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u00ab\u0441\u044d\u043d\u0434\u0432\u0438\u0447\u0435\u0439\u00bb.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Traffic Cop.<\/p>\n<p><a class=\"anchor\" name=\"id18\" id=\"id18\"><\/a><\/p>\n<h3>Traffic Cop \/ \u00ab\u0420\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0442\u0440\u0430\u0444\u0438\u043a\u0430\u00bb<\/h3>\n<p>Logic Sandwich \u0441\u0432\u043e\u0434\u0438\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f\u043c<em> <\/em><code>infrastructure.readData()<\/code> \u0438 <code>infrastructure.writeData()<\/code>. \u041d\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u043c \u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u043b\u043e\u044f\u043c\u0438. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443<\/em>:<\/p>\n<p>\u0417\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0439\u0442\u0435 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Observer \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u0435\u0439. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 Logic Sandwich.<\/p>\n<pre><code class=\"javascript\">\/\/ Traffic Cop example (JavaScript)  server.onPost(\"\/login\", (formData) => {               \/\/ event from infrastructure layer   const loginData = processLoginForm(formData);           \/\/ application logic   const userData = userService.logInUser(loginData);      \/\/ infrastructure layer   this._user = new User(userData);                        \/\/ logic layer    const userIsValid = this._user.isValid();               \/\/ logic layer   if (userIsValid) {                                      \/\/ application logic     const sessionData = user.sessionData;                 \/\/ logic layer     sessionServer.createSession(sessionData);             \/\/ infrastructure layer     return redirect(loginData.postLoginUrl);              \/\/ application logic   }   else {     return redirect(LOGIN_FAILED_URL);                    \/\/ application logic   } });  this._user.onChange((userData) => {                   \/\/ event from logic layer   userService.updateUser(userData);                       \/\/ infrastructure layer });<\/code><\/pre>\n<p>\u0411\u0443\u0434\u044c\u0442\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b, \u0447\u0442\u043e\u0431\u044b Traffic Cop \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432<a href=\"https:\/\/wiki.c2.com\/?GodClass\"> God Class<\/a>. \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442\u0441\u044f, \u043f\u043e\u043c\u043e\u0447\u044c \u043c\u043e\u0433\u0443\u0442 \u043b\u0443\u0447\u0448\u0438\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438. \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u0435\u043d\u0435\u0435 \u00ab\u0447\u0438\u0441\u0442\u044b\u0439\u00bb \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u043b\u043e\u0433\u0438\u043a\u0438 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044e \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0412 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043e \u0441\u0432\u043e\u0438\u043c Logic Sandwich \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c Traffic Cop.<\/p>\n<p><a class=\"anchor\" name=\"id19\" id=\"id19\"><\/a><\/p>\n<h3>Grow Evolutionary Seeds \/ \u00ab\u0412\u044b\u0440\u0430\u0449\u0438\u0432\u0430\u043d\u0438\u0435 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0437\u0451\u0440\u0435\u043d\u00bb<\/h3>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u0438\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014<a href=\"https:\/\/www.amazon.com\/gp\/product\/0321503627\"> \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u00ab\u0441\u043d\u0430\u0440\u0443\u0436\u0438 \u0432\u043d\u0443\u0442\u0440\u044c<\/a>\u00bb, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u044e\u0442, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0438\u0434\u0438\u043c\u043e\u0433\u043e \u0438\u0437\u0432\u043d\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u0434\u0435\u0442\u0430\u043b\u0438.<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0438\u0448\u0443\u0442 \u0448\u0438\u0440\u043e\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u0438\u0434\u0438\u043c\u043e\u0435 \u0438\u0437\u0432\u043d\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0442\u0435\u0441\u0442\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0435\u0440\u0435\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u041d\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0437\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b, \u0430 \u043d\u0435 \u0448\u0438\u0440\u043e\u043a\u0438\u0435, \u0438 \u0442\u0435\u0441\u0442\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0442\u0435\u0441\u0442\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443:<\/em><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a <a href=\"https:\/\/www.jamesshore.com\/v2\/books\/aoad2\/design\">\u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/a>, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0440\u0430\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043e\u0434\u0438\u043d \u043a\u043b\u0430\u0441\u0441, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f. \u0417\u0430\u043a\u043e\u0434\u0438\u0440\u0443\u0439\u0442\u0435 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0442\u0435\u0441\u0442\u044b, \u0430 \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435. \u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u0443 \u0441\u043b\u043e\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"javascript\">\/\/ Simplest possible Application seed (JavaScript)  \/\/ Test code it(\"renders user name\", () => {   const app = new MyApplication();   assert.equal(\"Hello, Sarah\", app.render()); });  \/\/ Production code class MyApplication {   render() {     return \"Hello, Sarah\";   } }<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u00ab\u0433\u043e\u043b\u0443\u044e\u00bb \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0443\u044e \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b \u0436\u0451\u0441\u0442\u043a\u043e \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043b\u0438. \u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0437\u043a\u0438\u0445 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u043e\u0434\u0430, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u0435\u043d \u0432\u0430\u0448\u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0439\u0442\u0435\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u043c. \u041a\u043b\u0430\u0441\u0441 <code>Infrastructure Wrapper<\/code> \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u0443 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f.<\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432 \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b Nullability, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0438\u0437 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0417\u0430\u0442\u0435\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043a\u043b\u0430\u0441\u0441 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0432\u043d\u0435\u0434\u0440\u044f\u044f Null-\u0432\u0435\u0440\u0441\u0438\u044e \u0432 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<pre><code class=\"javascript\">\/\/ Application + read from infrastructure (JavaScript)  \/\/ Test code it(\"renders user name\", async () => {   const usernameService = UsernameService.createNull({ username: \"my_username\" });  \/\/ Nullable with Configurable Responses   const app = new MyApplication(usernameService);   assert.equal(\"Hello, my_username\", await app.renderAsync()); });  \/\/ Production code class MyApplication {   static create() {     \/\/ Parameterless Instantiation     return new MyApplication(UsernameService.create());   }    constructor(usernameService) {     this._usernameService = usernameService;   }    async renderAsync() {     const username = await this._usernameService.getUsernameAsync();     return `Hello, ${username}`;   } } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0432\u044b\u0432\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0432\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, DOM \u0438\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441), \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0433\u043e\u043b\u0443\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0443\u044e \u043e\u0431\u0451\u0440\u0442\u043a\u0443. \u0421\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0435\u0433\u043e Nullable \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u043a\u043e\u0434 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"javascript\">\/\/ Application + read\/write to Infrastructure (JavaScript)  \/\/ Test code it(\"renders user name\", () => {   const usernameService = UsernameService.createNull({ username: \"my_username\" });  \/\/ Nullable with Configurable Responses   const uiService = UiService.createNull();   \/\/ Nullable   const uiOutput = uiService.trackOutput();   \/\/ Output Tracking    const app = new MyApplication(usernameService, uiService);    await app.renderAsync();   assert.deepEqual(uiOutput.data, [ \"Hello, my_username\"]); });  \/\/ Production code class MyApplication {   static create() {     \/\/ Parameterless Instantiation     return new MyApplication(UsernameService.create(), UiService.create());   }    constructor(usernameService, uiService = UiService.create()) {     this._usernameService = usernameService;     this._uiService = uiService;   }    async renderAsync() {     const username = await this._usernameService.getUsernameAsync();     await uiService.renderAsync(`Hello, ${username}`);   } }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0430\u0442 \u0442\u043e\u0439 \u0436\u0435 \u0446\u0435\u043b\u0438, \u0447\u0442\u043e \u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b: \u043e\u043d\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0442 \u0432\u0438\u0434\u0438\u043c\u043e\u0435 \u0438\u0437\u0432\u043d\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0443\u0437\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 Nullable \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043e\u043d\u0438 \u043d\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u0431\u044b\u0441\u0442\u0440\u044b\u043c\u0438 \u0438 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u043c\u0438. \u041d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u043c\u0438\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u043e\u043d\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0442\u0443 \u0436\u0435 \u0437\u0430\u0449\u0438\u0442\u0443, \u0447\u0442\u043e \u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0437\u0430\u0447\u0430\u0442\u043a\u0438 \u00ab\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0441\u043a\u0435\u043b\u0435\u0442\u0430\u00bb (<a href=\"https:\/\/wiki.c2.com\/?WalkingSkeleton\">walking skeleton<\/a>) \u2014 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430, \u043d\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d\u043d\u043e\u0441\u0442\u0438. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u043a\u0435\u043b\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0444\u0438\u0447. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0430\u0441\u043f\u0435\u043a\u0442 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043d\u043e \u043d\u0435\u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d, \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0439\u0442\u0435 \u0434\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438.<\/p>\n<pre><code class=\"javascript\">\/\/ Application + read\/write to Infrastructure + respond to UI events (JavaScript)  \/\/ Test code it(\"renders user name\", async () => {   const usernameService = UsernameService.createNull({ username: \"my_username\" });  \/\/ Nullable with Configurable Responses   const uiService = UiService.createNull();   \/\/ Nullable   const uiOutput = uiService.trackOutput();   \/\/ Output Tracking    const app = new MyApplication(usernameService, uiService);   await app.startAsync();    uiService.simulateRequest(\"greeting\");      \/\/ Behavior Simulation   assert.deepEqual(uiOutput.data, [ \"Hello, my_username\" ]); });  \/\/ Production code class MyApplication {   static create() {     \/\/ Parameterless Instantiation    return new MyApplication(UsernameService.create(), UiService.create());  }   constructor(usernameService, uiService = UiService.create()) {    this._usernameService = usernameService;    this._uiService = uiService;  }    async startAsync() {     this._uiService.on(\"greeting\", () => {       const username = await this._usernameService.getUsernameAsync();       await uiService.renderAsync(`Hello, ${username}`);     });   } }<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u043b\u0430\u0441\u0441 \u0441\u043b\u043e\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0447\u043d\u0451\u0442 \u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0431\u0435\u0441\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u043d\u044b\u043c. \u041a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442, \u0438\u0449\u0438\u0442\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441. \u042d\u0442\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0441\u043b\u043e\u044f \u043b\u043e\u0433\u0438\u043a\u0438. \u041f\u043e \u043c\u0435\u0440\u0435 \u0440\u043e\u0441\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0439\u0442\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0431\u044b\u043b\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u0430 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u2014 \u0447\u0451\u0442\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b.<\/p>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <a href=\"https:\/\/habr.com\/ru\/companies\/otus\/articles\/799939\/#id12\">\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0435\u0433\u0430\u0441\u0438-\u043a\u043e\u0434\u0430.<\/a><\/p>\n<p><a class=\"anchor\" name=\"id6\" id=\"id6\"><\/a><\/p>\n<h2>\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438<\/h2>\n<p>\u041a\u043e\u0434 \u043b\u043e\u0433\u0438\u043a\u0438 \u2014 \u044d\u0442\u043e \u0447\u0438\u0441\u0442\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c, \u043a\u043e\u0434 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u0435\u0442\u0438, \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u0442\u0443 \u0438 \u0432\u0440\u0435\u043c\u044f, \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u0438 \u0432\u0435\u0449\u0438.<\/p>\n<p>\u0427\u0438\u0441\u0442\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043b\u0435\u0433\u043a\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0415\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438 \u043f\u043e\u0439\u0434\u0451\u0442 \u0440\u0435\u0447\u044c \u0434\u0430\u043b\u0435\u0435.<\/p>\n<ul>\n<li>\n<p>Easily-Visible Behavior (\u00ab\u041b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u00bb)<\/p>\n<\/li>\n<li>\n<p><a href=\"#id20\">Testable Libraries<\/a> (\u00ab\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00bb)<\/p>\n<\/li>\n<li>\n<p><a href=\"#id21\">Collaborator-Based Isolation<\/a> (\u00ab\u0418\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043b\u043b\u0430\u0431\u043e\u0440\u0430\u0446\u0438\u0438\u00bb)<\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"id31\" id=\"id31\"><\/a><\/p>\n<h3>Easily-Visible Behavior \/ \u00ab\u041b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u00bb<\/h3>\n<p>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432\u0438\u0434\u043d\u044b \u0442\u0435\u0441\u0442\u0430\u043c. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443<\/em>:<\/p>\n<p>\u041f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u0442\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0442\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \u0432\u0445\u043e\u0434\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438.<\/p>\n<pre><code class=\"javascript\">\/\/ JavaScript function add(a, b) {   return a + b; }<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043e\u043c \u0447\u0438\u0441\u0442\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c.<\/p>\n<pre><code class=\"javascript\">\/\/ JavaScript class Value {   constructor(initialValue) {     this._value = initialValue;   }    plus(addend) {     return new Value(this._value + addend);   } }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u2014 \u043c\u0435\u0442\u043e\u0434 getter \u0438\u043b\u0438 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Observer_pattern\">\u0441\u043e\u0431\u044b\u0442\u0438\u0435<\/a>.<\/p>\n<pre><code class=\"javascript\">\/\/ JavaScript class RunningTotal {   constructor(initialValue) {     this._total = initialValue;   }    add(addend) {     this._total += addend;   }    getTotal() {     return this._total;   } }<\/code><\/pre>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0437\u0431\u0435\u0433\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u0438\u043b\u0438 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043d\u0435\u0433\u043e) \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 \u043e\u0434\u0438\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u0433\u043b\u0443\u0431\u044c. \u042d\u0442\u043e \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0430. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u0432\u043e\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f.<\/p>\n<p><a class=\"anchor\" name=\"id20\" id=\"id20\"><\/a><\/p>\n<h3>Testable Libraries \/ \u00ab\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00bb<\/h3>\n<p>\u0421\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043a\u043e\u0434 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u00ab\u043b\u0435\u0433\u043a\u043e \u043e\u0431\u043e\u0437\u0440\u0438\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u00bb. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044e \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 API \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u0440\u0435\u043b\u0438\u0437\u0430\u043c\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443<\/em>:<\/p>\n<p>\u041e\u0431\u0435\u0440\u043d\u0438\u0442\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043a\u043e\u0434 \u0432 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0435. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0432\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0432\u0430\u0448\u0443 \u043e\u0431\u0451\u0440\u0442\u043a\u0443. \u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 API \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044f\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u00ab\u043b\u0435\u0433\u043a\u043e \u043e\u0431\u043e\u0437\u0440\u0438\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u00bb. (\u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0433\u0435\u0442\u0442\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u00ab\u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0441\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u00bb). \u0415\u0441\u043b\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043a\u043e\u0434 \u0432\u043d\u043e\u0441\u0438\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u043c\u0435\u043d\u0435, \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0439\u0442\u0435 \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u0434.<\/p>\n<p>\u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441 \u0440\u0430\u0437\u0432\u0435\u0442\u0432\u043b\u0451\u043d\u043d\u044b\u043c API \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c, \u0438\u043c\u0435\u044e\u0449\u0438\u043c \u0443\u0437\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0443\u044e \u0446\u0435\u043b\u044c \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 API.<\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u044b\u043c \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c, \u043a\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432. \u0414\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0440\u043e\u0433\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u043c \u0434\u043b\u044f \u043e\u0431\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u0451\u0440\u0442\u043a\u0443.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0443\u044e \u043e\u0431\u0451\u0440\u0442\u043a\u0443, \u0435\u0441\u043b\u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043a\u043e\u0434 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c.<\/p>\n<p><a class=\"anchor\" name=\"id21\" id=\"id21\"><\/a><\/p>\n<h3>Collaborator-Based Isolation \/ \u00ab\u0418\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043b\u043b\u0430\u0431\u043e\u0440\u0430\u0446\u0438\u0438\u00bb<\/h3>\n<p>\u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u044e\u0442, \u0447\u0442\u043e \u0432\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u044b \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442, \u0435\u0441\u043b\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0434\u0430\u043b\u0435\u043a\u043e \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u044d\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f. \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0435, \u0432\u044b \u043e\u0431 \u044d\u0442\u043e\u043c \u0443\u0437\u043d\u0430\u0435\u0442\u0435. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0444\u0438\u0447\u0435\u0439 \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u0434\u043e\u0440\u043e\u0433\u0438\u043c\u0438. \u041c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043d\u0430\u0440\u0443\u0448\u0438\u043b\u043e \u0442\u0435\u0441\u0442\u044b \u0441\u043e\u0442\u0435\u043d \u043d\u0435\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u0447\u0451\u0442\u043e\u0432. <em>\u041f\u043e\u044d\u0442\u043e\u043c\u0443<\/em>:<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043a \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443 \u043a\u043e\u0434\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u043e\u0447\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043e\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0435 \u043e\u0442\u0447\u0451\u0442, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0430\u0434\u0440\u0435\u0441, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0436\u0451\u0441\u0442\u043a\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c &#171;123 Main St.&#187; \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0439. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u0435 \u0441\u0430\u043c \u0430\u0434\u0440\u0435\u0441, \u043a\u0430\u043a \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u044d\u0442\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0439.<\/p>\n<p>\u0411\u0443\u0434\u044c\u0442\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b \u0438 \u043d\u0435 \u043f\u0438\u0448\u0438\u0442\u0435 \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043f\u0438\u0435\u0439 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0418\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043b\u043b\u0430\u0431\u043e\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0443\u0437\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e\u0442 \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043a\u043e\u0434\u0435 \u0442\u0435\u0441\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0447\u0430\u0441\u0442\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043e\u0442\u0447\u0451\u0442\u0430 \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c, \u0430 \u043d\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u043e\u0432. \u041e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0443\u0437\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<pre><code class=\"javascript\">\/\/ JavaScript  \/\/ Example test it(\"includes the address in the header when reporting on one address\", () => {   \/\/ Instantiate the unit under test and its dependency   const address = Address.createTestInstance();                 \/\/ Parameterless Instantiation   const report = new InventoryReport(Inventory.create(), [ address ]);    \/\/ Define the expected result using the dependency   const expected = \"Inventory Report for \" + address.renderAsOneLine();    \/\/ Run the production code and make the assertion   assert.equal(report.renderHeader(), expected); });  \/\/ Example production code class InventoryReport {   constructor(inventory, addresses) {     this._inventory = inventory;     this._addresses = addresses;   }    renderHeader() {     let result = \"Inventory Report\";     if (this._addresses.length === 1) {       result += \" for \" + this._address[0].renderAsOneLine();     }     return result;   } }<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0434\u0430\u0451\u0442 \u043b\u0443\u0447\u0448\u0435\u0435 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043c\u0438\u0440\u043e\u0432: \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u044e\u0442, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043d\u044b, \u0430 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043b\u043b\u0430\u0431\u043e\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043d\u0435 \u043b\u043e\u043c\u0430\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0441\u0442\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u0435\u0441\u043d\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e.<\/p>\n<hr\/>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0439\u0434\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u0441\u043a\u043e\u0440\u043e, \u0432 \u043d\u0451\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b,  Nullability \u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0435\u0433\u0430\u0441\u0438-\u043a\u043e\u0434\u0430. \u0410 \u043f\u043e\u043a\u0430 \u0432\u0441\u0435\u0445 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u043e\u0432 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0443\u0440\u043e\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>7 \u043c\u0430\u0440\u0442\u0430 \u0432 20:00: <a href=\"https:\/\/otus.pw\/V3Gr\/\">\u00ab\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435. \u041f\u0438\u0448\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0435\u0441\u0442 \u043d\u0430 Java\u00bb:<\/a> \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438 JUnit 4, JUnit 5 \u0438 TestNG; \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<\/li>\n<li>\n<p>14 \u043c\u0430\u0440\u0442\u0430 \u0432 20:00: <a href=\"https:\/\/otus.pw\/kgxd\/\">\u00ab\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 API \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e POSTMAN\u00bb:<\/a> \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u044d\u043a\u0435\u043d\u0434\u0430, \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0430\u0432\u0442\u043e\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043b\u044f API.<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0449\u0438\u0442\u0435 <a href=\"https:\/\/otus.pw\/TJFI\/\">\u043d\u0430 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u0430\u0445 OTUS.<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/798771\/\"> https:\/\/habr.com\/ru\/articles\/798771\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b. \u0411\u0435\u0437 \u043d\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043c\u043d\u043e\u0433\u0438\u0435 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u044b <em>\u0442\u0430\u043a\u0436\u0435<\/em> \u0442\u0440\u0430\u0442\u044f\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041f\u0440\u043e\u0441\u0442\u044b\u043c \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435<a href=\"https:\/\/martinfowler.com\/bliki\/BroadStackTest.html\"> \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0440\u0443\u0447\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432. \u041d\u043e \u043e\u043d\u0438 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b \u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b.<\/p>\n<p>\u0417\u043d\u0430\u044e\u0449\u0438\u0435 \u043b\u044e\u0434\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043c\u043e\u043a\u0438 (mocks) \u0438 \u0448\u043f\u0438\u043e\u043d\u044b (spies) (\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0434\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438 \u0433\u043e\u0432\u043e\u0440\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u00ab\u043c\u043e\u043a\u0438\u00bb) \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445<a href=\"http:\/\/blog.jayfields.com\/2008\/02\/behavior-based-testing.html\"> \u0442\u0435\u0441\u0442\u043e\u0432, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438<\/a>. \u0418\u0445 \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u0434\u0451\u0436\u043d\u044b \u0438 \u0431\u044b\u0441\u0442\u0440\u044b, \u043d\u043e \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044e \u00ab\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u00bb \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433, \u0438 \u0438\u0445 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0448\u0438\u0440\u043e\u043a\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438 \u0442\u0440\u0443\u0434\u043d\u044b\u0435 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u041f\u043b\u043e\u0445\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u2014 \u044d\u0442\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u043a\u0430\u043a<a href=\"https:\/\/en.wikipedia.org\/wiki\/Hexagonal_architecture_(software)\"> \u0433\u0435\u043a\u0441\u0430\u0433\u043e\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/a> \u0438<a href=\"https:\/\/www.destroyallsoftware.com\/screencasts\/catalog\/functional-core-imperative-shell\"> \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u044f\u0434\u0440\u043e, \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430<\/a>, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. (\u0418\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u2014 \u044d\u0442\u043e \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435). \u042d\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443&#8230; \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u043a\u0438. \u041d\u043e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0447\u0430\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0439, \u0438 \u043e\u043d\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u0441\u0435\u0445 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c: \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u043e\u043a\u0438, \u043d\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u041e\u043d \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043c\u043e\u0449\u044c\u044e \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e, \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e\u043c \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u0441\u0443\u0449\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u0430\u043c. \u041d\u043e \u043d\u0435 \u043e\u0431\u043e\u0448\u043b\u043e\u0441\u044c \u0438 \u0431\u0435\u0437 <a href=\"#id1\">\u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u043e\u0432<\/a>.<\/p>\n<p>\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0441\u043e\u0447\u0435\u0442\u0430\u044e\u0442<a href=\"#id2\"> \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435<\/a> \u0442\u0435\u0441\u0442\u044b (sociable),<a href=\"#id4\"> \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u0445<\/a>, \u0441 \u043d\u043e\u0432\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u043e\u0439 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c &#171;Nullables&#187;. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, Nullables \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0434\u0432\u043e\u0439\u043d\u0438\u043a\u0438, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434 \u0441 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u0435\u043c. \u0418 \u0432 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441: \u0445\u043e\u0442\u0438\u0442\u0435 \u043b\u0438 \u0432\u044b \u0432\u0438\u0434\u0435\u0442\u044c \u044d\u0442\u043e \u0432 \u0441\u0432\u043e\u0451\u043c \u043a\u043e\u0434\u0435? \u0412\u0430\u0448 \u043e\u0442\u0432\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442, \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0432\u043e \u0432\u0441\u0451\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435. \u041f\u0443\u0441\u0442\u044c \u0432\u0430\u0441 \u043d\u0435 \u043f\u0443\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u043e\u043d\u0430 \u0440\u0430\u0437\u0431\u0438\u0442\u0430 \u043d\u0430 \u0434\u0432\u0435 \u0433\u043b\u0430\u0432\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0434\u0430. \u0412\u0442\u043e\u0440\u0430\u044f \u0433\u043b\u0430\u0432\u0430 \u0432\u044b\u0439\u0434\u0451\u0442 \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<h2>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h2>\n<ol>\n<li>\n<p><a href=\"#id25\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id26\">\u0426\u0435\u043b\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id1\">\u041a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id28\">\u041e\u0441\u043d\u043e\u0432\u043e\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0449\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#id7\">\u0423\u0437\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id4\">\u0422\u0435\u0441\u0442\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (State-Based Tests)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id2\">\u041f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b (Overlapping Sociable Tests)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id10\">Smoke-\u0442\u0435\u0441\u0442\u044b<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id11\">\u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043d\u0443\u043b\u0435\u0432\u044b\u043c \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c (Zero-Impact Instantiation)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id12\">\u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (Parameterless Instantiation)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id13\">\u042d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440 (Signature Shielding)<\/a><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p><a href=\"#id30\">\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#id5\">A-Frame Architecture (\u00ab\u0410-\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u00bb)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id17\">Logic Sandwich (\u00ab\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0421\u044d\u043d\u0434\u0432\u0438\u0447\u00bb)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id18\">Traffic Cop (\u00ab\u0420\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0422\u0440\u0430\u0444\u0438\u043a\u0430\u00bb)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id19\">Grow Evolutionary Seeds (\u00ab\u0412\u044b\u0440\u0430\u0449\u0438\u0432\u0430\u043d\u0438\u0435 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0437\u0451\u0440\u0435\u043d\u00bb)<\/a><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p><a href=\"#id6\">\u041f\u0430\u0442\u0442\u0435\u0440\u043d \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u043a\u0438<\/a><\/p>\n<ol>\n<li>\n<p><a href=\"#id31\">Easily-Visible Behavior (\u00ab\u041b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u043c\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u00bb)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id20\">Testable Libraries (\u00ab\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00bb)<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"#id21\">Collaborator-Based Isolation (\u00ab\u0418\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043b\u043b\u0430\u0431\u043e\u0440\u0430\u0446\u0438\u0438\u00bb)<\/a><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<hr\/>\n<p><a class=\"anchor\" name=\"id25\" id=\"id25\"><\/a><\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b<\/h2>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0435\u0451 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<a href=\"https:\/\/en.wikipedia.org\/wiki\/ROT13\"> ROT-13<\/a> \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>\u0412 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d <a href=\"#id5\">\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b A-Frame<\/a>. <code>App<\/code> \u2014 \u044d\u0442\u043e \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041e\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 Rot13 \u2014 \u043a\u043b\u0430\u0441\u0441\u0430 <a href=\"#id6\">\u043b\u043e\u0433\u0438\u043a\u0438<\/a>, \u0438 <code>CommandLine<\/code> \u2014  \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<pre><code class=\"javascript\">\/\/ Example production code (JavaScript + Node.js) import CommandLine from \".\/infrastructure\/command_line\";  \/\/ Infrastructure Wrapper import * as rot13 from \".\/logic\/rot13\";  export default class App {   constructor(commandLine = CommandLine.create()) {   \/\/ Parameterless Instantiation     this._commandLine = commandLine;   }    run() {     const args = this._commandLine.args();      if (args.length === 0) {    \/\/ Tested by Test #2       this._commandLine.writeOutput(\"Usage: run text_to_transform\\n\");       return;     }     if (args.length !== 1) {    \/\/ Tested by Test #3       this._commandLine.writeOutput(\"too many arguments\\n\");       return;     }      \/\/ Tested by Test #1     const input = args[0];                          \/\/ Logic Sandwich     const output = rot13.transform(input);     this._commandLine.writeOutput(output + \"\\n\");   } };<\/code><\/pre>\n<p>\u0422\u0435\u0441\u0442\u044b <code>App<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u0441\u043a\u0432\u043e\u0437\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b. \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e<a href=\"#id7\"> \u0443\u0437\u043a\u0438\u0435<\/a>, <a href=\"#id2\">\u043e\u0431\u0449\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435<\/a> \u0442\u0435\u0441\u0442\u044b (Narrow, Sociable), \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0435 \u043a\u043e\u0434 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u0445.<\/p>\n<p>\u0411\u0443\u0434\u0443\u0447\u0438 \u0443\u0437\u043a\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u043e\u043d\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <code>App.run()<\/code>. \u041e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>\u0422\u0435\u0441\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 Nullable <code>CommandLine<\/code> \u0434\u043b\u044f \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044f <code>stdout<\/code> \u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/otus\/articles\/799939\/#id8\">\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b (Configurable Responses)<\/a> \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u041e\u043d\u0438 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <a href=\"https:\/\/habr.com\/ru\/companies\/otus\/articles\/799939\/#id9\">\u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 (Output Tracking)<\/a>, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <code>stdout<\/code>.<\/p>\n<pre><code class=\"javascript\">\/\/ Example tests (JavaScript + Node.js) import assert from \"assert\"; import CommandLine from \".\/infrastructure\/command_line\"; import App from \".\/app\";  describe(\"App\", () => {   \/\/ Test #1   it(\"reads command-line argument, transform it with ROT-13, and writes result\", () => {     const { output } = run({ args: [ \"my input\" ] });     \/\/ Signature Shielding, Configurable Responses     assert.deepEqual(output.data, [ \"zl vachg\\n\" ];       \/\/ Output Tracking   });    \/\/ Test #2   it(\"writes usage when no argument provided\", () => {     const { output } = run({ args: [] });                                 \/\/ Signature Shielding, Configurable Responses     assert.deepEqual(output.data, [ \"Usage: run text_to_transform\\n\" ]);  \/\/ Output Tracking   });    \/\/ Test #3   it(\"complains when too many command-line arguments provided\", () => {     const { output } = run({ args: [ \"a\", \"b\" ] });                       \/\/ Signature Shielding, Configurable Responses     assert.deepEqual(output.data, [ \"too many arguments\\n\" ]);            \/\/ Output Tracking   });    function run({ args = [] } = {}) {                      \/\/ Signature Shielding     const commandLine = CommandLine.createNull({ args }); \/\/ Nullable, Infrastructure Wrapper, Configurable Responses     const output = commandLine.trackOutput();             \/\/ Output Tracking      const app = new App(commandLine);     app.run();      return { output };                                    \/\/ Signature Shielding   } });<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u043c\u043e\u043a\u0430\u043c\u0438, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e <code>CommandLine<\/code> \u2014 \u044d\u0442\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0434\u0432\u043e\u0439\u043d\u0438\u043a. \u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d \u043a\u043e\u0434 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0442\u044c\u044e \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430.<\/p>\n<pre><code class=\"javascript\">\/\/ Example Nullable infrastructure wrapper (JavaScript + Node.js) import EventEmitter from \"node:events\"; import OutputTracker from \"output_tracker\";  const OUTPUT_EVENT = \"output\";  export default class CommandLine {   static create() {     return new CommandLine(process);                  \/\/ 'process' is a Node.js global   }    static createNull({ args = [] } = {}) {             \/\/ Parameterless Instantiation, Configurable Responses     return new CommandLine(new StubbedProcess(args)); \/\/ Embedded Stub   }    constructor(proc) {     this._process = proc;     this._emitter = new EventEmitter();               \/\/ Output Tracking   }    args() {     return this._process.argv.slice(2);   }    writeOutput(text) {     this._process.stdout.write(text);     this._emitter.emit(OUTPUT_EVENT, text);           \/\/ Output Tracking   }    trackOutput() {                                     \/\/ Output Tracking     return OutputTracker.create(this._emitter, OUTPUT_EVENT);   } };  \/\/ Embedded Stub class StubbedProcess {   constructor(args) {     this._args = args;                                \/\/ Configurable Responses   }    get argv() {     return [ \"nulled_process_node\", \"nulled_process_script.js\", ...this._args ];   }    get stdout() {     return {       write() {}     };   } }<\/code><\/pre>\n<p>\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u044e\u0442 \u0441\u0435\u0431\u044f \u0432 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0411\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u0437\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-example\"><strong>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.<\/strong><\/a> \u041f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-example\/tree\/javascript\"> (JavaScript<\/a> \u0438\u043b\u0438<a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-example\/tree\/typescript\"> TypeScript<\/a> \u0441 Node.js)<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-complex\"><strong>\u0421\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.<\/strong><\/a> \u0423\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0412\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443 ROT-13. \u041a\u043e\u0434 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043e\u043a, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430\u043c\u0438 \u0438 \u043e\u0442\u043c\u0435\u043d\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-complex\/tree\/javascript\"> (JavaScript<\/a> \u0438\u043b\u0438<a href=\"https:\/\/github.com\/jamesshore\/testing-without-mocks-complex\/tree\/typescript\"> TypeScript<\/a> \u0441 Node.js)<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.jamesshore.com\/v2\/projects\/lunch-and-learn\"><strong>TDD Lunch &amp; Learn Screencast.<\/strong><\/a> \u0421\u0435\u0440\u0438\u044f \u0447\u0430\u0441\u043e\u0432\u044b\u0445 \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u043e\u0432, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432. (JavaScript \u0441 Node.js)<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.jamesshore.com\/v2\/projects\/nullables\/jitterted-livestream\"><strong>Nullables Livestream.<\/strong><\/a> \u0421\u0435\u0440\u0438\u044f \u0442\u0440\u0451\u0445\u0447\u0430\u0441\u043e\u0432\u044b\u0445 \u043f\u0440\u044f\u043c\u044b\u0445 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0439 \u0441 \u0414\u0436\u0435\u0439\u043c\u0441\u043e\u043c \u0428\u043e\u0440\u043e\u043c \u0438 \u0422\u0435\u0434\u043e\u043c \u041c. \u042f\u043d\u0433\u043e\u043c. \u041e\u043d\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. (Java \u0441 Spring Boot)<\/p>\n<\/li>\n<\/ul>\n<p><a class=\"anchor\" name=\"id26\" id=\"id26\"><\/a><\/p>\n<h2>\u0426\u0435\u043b\u0438<\/h2>\n<p>\u042d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0434\u043b\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0446\u0435\u043b\u0435\u0439:<\/p>\n<ul>\n<li>\n<p><em>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445.<\/em> \u041d\u0430\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u00ab<a href=\"https:\/\/martinfowler.com\/bliki\/IntegrationTest.html\">\u0443\u0437\u043a\u0438\u0445<\/a>\u00bb \u0442\u0435\u0441\u0442\u043e\u0432, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438. \u0428\u0438\u0440\u043e\u043a\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0438, \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0443\u0442, \u044d\u0442\u043e \u0443\u043a\u0430\u0436\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0431\u0435\u043b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><em>\u041b\u0451\u0433\u043a\u0438\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433.<\/em> \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0430 \u043d\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0425\u043e\u0442\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u2014 \u043d\u0435\u0442. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433, \u043d\u0435 \u043b\u043e\u043c\u0430\u044f \u0442\u0435\u0441\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p><em>\u0427\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b.<\/em> \u0422\u0435\u0441\u0442\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043f\u0440\u044f\u043c\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u00ab\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u0432\u044b\u0437\u043e\u0432, \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u00bb (AAA \u2014 Arrange, Act, Assert). \u041e\u043d\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0432\u0438\u0434\u0438\u043c\u043e\u0435 \u0438\u0437\u0432\u043d\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0430 \u043d\u0435 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<\/li>\n<li>\n<p><em>\u041d\u0438\u043a\u0430\u043a\u043e\u0439 \u043c\u0430\u0433\u0438\u0438.<\/em> \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0449\u0438\u0435 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u0438\u043d\u044a\u0435\u043a\u0446\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u043a\u0438\u043d\u0433\u0430, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><em>\u0411\u044b\u0441\u0442\u0440\u043e\u0442\u0430 \u0438 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c.<\/em> \u041d\u0430\u0431\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u00ab\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439\u00bb \u043a\u043e\u0434, \u0442\u0430\u043a\u043e\u0439 \u043a\u0430\u043a \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u044f\u0432\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u0422\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0434\u0430\u0432\u0430\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0441\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u043f\u044b\u0442 \u0432\u044b\u044f\u0432\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/p>\n<ul>\n<li>\n<p><em>\u0411\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u043a\u043e\u0432.<\/em> \u041f\u0440\u0438 \u043f\u0440\u044f\u043c\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-370249","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=370249"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370249\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=370249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=370249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=370249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}