
This review article is devoted to the study of the rapidly growing in recent times trends in the IT industry - chat bots, as well as the role of Microsoft in the process of their development. The following will be considered: the history of occurrence, features of bots, the main and unexpected areas of their application, prospects and limitations of the technology.
The choice of Microsoft as the main comparative platform for research is not accidental. The company conducts a lot of work in the field of popularization and development of intelligent bots. One of the main steps in this direction can be considered a free
framework presented by her at the exhibition
Build 2016 to create your own Microsoft Bot Framework bots, not tied to a specific platform and open source.
Introduction
Generally, a chat bot is a program that can simulate a meaningful dialogue with the user in a language he understands using text or speech. The purpose of this dialogue, as a rule, is the execution of bot commands and user requests. Not being essentially something radically new, chat bots, however, are positioned on the market as a kind of know-how. Not the least role in this is played by a certain hype created around such bots as smart and, often, indispensable helpers for the user.
Chat bots do not let you get bored while communicating with other users of the messenger, entertaining you with a fresh joke or a game in time; send a fresh weather forecast; help with ordering pizza; give recommendations on healthy nutrition in response to a message about your weight and blood pressure; skillfully conduct a dialogue with you on the legal services website, imitating a real interlocutor; they ask you in a pleasant voice about your mood and, based on an analysis of the answer, they can pick up a musical composition in a smartphone; confidently cope with the role of a specialist support service of any service through e-mail. These are just a few of the examples with the real use of smart bots. There is also a separate group of corporate bots that solves equally important corporate tasks.
')

Like any new technology, chat bot is a logical development of more familiar methods of communication and bringing information to the end user: websites, applications, push notifications, etc. At the same time, this technology is attractive, first of all, by the orientation of the bot to the end user, integration into the final platform, ease of use, intelligence, friendliness.
Large IT players (first of all, in the online communications market) have long appreciated the potential and possible benefits of using chat bots in their solutions. Bots in one form or another are actively used in all popular instant messengers, Internet platforms and mobile devices.
Microsoft did not stand aside, having carried out work in several directions at once: the assistant for mobile devices Cortana; not entirely successful, but undoubtedly an interesting experiment with the girl-bot Tay on Twitter; more successful experiment in China with a girl-bot Xiaoice (Xiaois); bots for Skype; Finally, the Microsoft Bot Framework for creating and integrating your own bots for various platforms.
A bit of history
The first chat program is considered to be ELIZA, developed in 1964 by a professor at the Massachusetts Institute of Technology, Joseph Weisenbaum. The program tried to imitate the user's communication with the psychotherapist and often discouraged her patients with an amazing likelihood of work and phrases like "Do you want to talk about this?".
After this, many more attempts were made to create such virtual interlocutors, but they were all fairly simple and the person easily recognized that he was dealing with a machine.
The use of the term “chat bot” is attributed to developer Michael Molding, who in 1994 developed a program for communication Julia and called it a chat bot. The program was uncomplicated, but, nevertheless, it allowed maintaining a more or less meaningful dialogue and supporting self-learning functions.
In the late 1990s and early 2000s, simple chat bots were actively used, for example, in IRC and IM programs, to add variety to user conversations and to moderate chat. And, of course, enthusiasts and AI researchers from around the world did not abandon attempts to create a truly 'smart' program for conducting a full-fledged dialogue with the user.
All this, as well as the natural development of technology, has led to significant progress in the creation of intelligent chat bots. A chat program has already been created that has successfully passed the Turing test. On June 8, 2014, at an event organized by the British University of Reading, the program developed in St. Petersburg successfully simulated communication with a real person, managing to mislead some of the examiners.
And based on the IBM Watson supercomputer, DeepQA can process incoming commands in natural language. The Nuance Communications technology used for this is also used by Apple in the work of the Siri assistant on the devices of this company.
Modern chat bots have reached heights unattainable for pioneer programs like ELIZA. They use advanced developments in the analysis of natural language and speech, have advanced AI algorithms and are capable of learning.
Areas of use
Chat bots can now be found on almost any platform, be it a messenger, a web portal or a smartphone. In this case, all of them are used within certain scenarios and for the specific needs of the user.

It is accepted to carry out the following division according to the main scenarios for the use of chatbots:
- Technical support;
- Search by specified parameters;
- Content consumption and entertainment;
- Purchases.
Technical support. Many service companies have long and successfully used voice chat bots, as well as text bots via e-mail to organize technical support. At the same time, according to the statements of some such companies, they manage to save up to 40% of the funds previously spent on technical support of their clients by means of only personnel. The main advantage of chat bots in this case is the ability to work without interruption and at night, as well as with a large number of clients at the same time. The disadvantages are usually in the lack of intelligence of such bots. In difficult cases, an operator is forced to connect to solve a client’s problem.
Search by specified parameters. The use of chat bots to search the Internet, in my opinion, is still not convenient enough compared to the classical methods of work. Of course, if you use a bot that is built into your smartphone or instant messenger, you will not have to switch to another application to start searching. But you still have to somehow formulate your question, and then, perhaps, answer a number of additional questions from the bot to achieve the result. At the same time, any search engine would most likely immediately give you a meaningful result. This issue is the subject of
an article by Ariel Werber, in which he compares the usability of a search using a bot and the Google search engine.
Content consumption and entertainment. This area is already better mastered by bots, but here, as in the case of the search, the problems described earlier are possible. However, the situation is greatly improved by the use of bots that download content by subscription. In the role of such content are usually the news and articles. In this case, the bot not only delivers the required content, but also filters it according to the desired subject, relevance, etc. A bot can also analyze the user's download history and recommend content to it. Many large information portals and news aggregators actively use their own bots to simplify access to their materials. To this area can also be attributed all sorts of bots, helpers, gaming and entertainment chat bots. It is no secret that one of the most popular goals for which bots are created in the Telegram messenger is dating.
Purchases. Perhaps the most interesting area of chatbots, which allows you to link together a virtual assistant and real-world objects, which, coupled with the focus of the bot on a specific user and imitation of real communication, brings them together in a certain way. But, unfortunately, this use case is now the least developed. This is due to the frequent inability to directly pay for the goods directly through the bot interface, and the fundamental unsuitability of this interface for such operations. To select a specific product chat bot can still be useful. But working with a large assortment and complex trading options are beyond his power. In this case, the work of a virtual bot merchant is reduced to the functions of a search engine.
The development of chat bots continues unabated. There are new areas of their use, and improved old scenarios. For example, the Kik messenger popular among North American teenagers allows you to add a bot to your chat by scanning a QR code with your smartphone. So you can talk, for example, with a virtual waiter in a cafe and make an order before you see the present. And in China, we have already successfully implemented the function of payments in the WeChat messenger: currently, online trading is actively developing in the application, including through chat bots.
Chat bots market
Today, the leadership in the use of chat bots is confidently held by instant messengers. And this is not surprising, because applications for instant messaging and content between users are the most suitable place for chat bots. It was the active development of instant messengers that gave a significant impetus to the almost universal use of chat bots. Activate cites statistics, from which it follows that at least one instant messenger for 2.5 billion people is currently used in the world. And the leaders in popularity among instant messengers are Facebook Messenger and WhatsApp. According to experts, in the next 2-3 years, users of instant messengers, who will press social networks in popularity, will be more than half of the world's inhabitants.
An additional factor in promoting the use of chat bots in instant messengers is support for large businesses. Most companies are gradually realizing how much more profitable can be the creation and integration of specialized bots for personalized promotion of their products and services in instant messengers, compared to the development of complex Internet portals and applications. In addition, according to analysts, in the world there is a steady decline in user interest in new applications. Most are accustomed to using the already proven set of instant messengers, social networks and programs installed on their devices.
The creation of chat bots is now engaged in both regular users for their own entertainment, and industrial giants to attract new audiences and effectively promote services. This direction is already quite popular. On the Internet, you can find comprehensive guidelines for creating and promoting your chat bots of any orientation and complexity.
An example of a good article on this topic.

One of the pioneers of the movement on the introduction of chat bots in instant messengers was Telegram. In June 2015, Pavel Durov’s company was one of the first to launch the Bot API platform, as well as a store for bots. Now in the Telegram messenger, there are about 100 thousand of the most diverse bots. An improved API version is already available for self-creation of Telegram
Bot API 2.0 bots. Almost any programming language can be used to create bots: PHP, Python, Java, C #, Ruby. At the same time, you can create your own bot for Telegram without programming skills at all. It is enough to use the @BotFather service account to register a new bot and get a unique id, then you can link your bot to @Paquebot via the @Paquebot account and start sending messages to all subscribers of your new bot.
Do not lag behind other messengers. Facebook also announced a platform for creating bots in its messenger in March 2015. Opportunities to create bots have become part of the
Messenger Platform service, which allows you to integrate Facebook chat into other applications. The API for sending and receiving messages is more than enough. But if you want to create a more complex bot, then use our Bot Engine ', - said Facebook Vice President David Marcus. As noted, the Bot Engine will allow 'teach' bots to behave in a different way depending on the situation. Unlike competitors, Facebook already allows users to send not plain text, but interactive “cards” with images, links, buttons and other elements with which you can interact. Corresponding with the robot, the user can instantly book a table at a restaurant or at any time buy the product he likes by flipping through the product catalog.
Developing your own services for creating chat bots, introducing bots into instant messengers and other platforms has long been not just a good tone, but a vital necessity. Many services around the world are actively promoting the idea of using bots. Search Engines: American Google and Russian Yandex; messengers: Chinese WeChat, Japanese Line, South Korean KakaoTalk, Canadian Kik, etc.
Manufacturers of smartphones, too, were not idle. Siri's voice assistants from Apple and Microsoft's Cortana actively use the voice interface to fulfill user requests. Voice Assistant also has the American Amazon.
According to experts, in the near future we will expect even greater integration of chat bots into existing platforms, as well as increased monetization in this direction.
Microsoft's contribution
In March 2016, Microsoft experts posted a chat bot called Tay (@TayandYOu) on Twitter. Also, Tei could be added to the contact list in the Kik messenger or the GroupMe social network. Initially, the developers communicated with the program themselves, teaching it on large amounts of anonymous information from social networks. A small group of people also participated in the training. As planned by the authors, Tay, who imitated the behavior of a sweet and kind teenage girl, was supposed to continue self-study after graduation, learning from users. And so it happened, only less than a day after the start of communication with users, Tei turned into a Nazi, anti-Semitic and misanthropic. The program successfully learned everything that she was taught. Unfortunately, the authors could not lay in their program the opportunity to distinguish the good from the bad. For a while, Microsoft tried to control Tei’s behavior by editing some of her particularly offensive statements. But very soon the experiment was declared complete and Tay was turned off. Nevertheless, during the event, Microsoft secured a good advertisement, as well as greatly stimulated interest in the topic of using AI and chat bots.
Another similar experiment involving Microsoft turned out to be more successful. In the Chinese equivalent of Twitter (Weibo), a linguistic bot named Xiaoice (Xiaois) was launched. The bot mimics the behavior of a 17-year-old teenage girl, can maintain a meaningful dialogue, expresses sympathy and often behaves very unpredictably, like an ordinary person. Apparently, when working on Xiaois, the authors took into account the previous negative experience with Tei. Millions of Chinese teenagers communicate with Xiaois for hours, calling her a "sensitive and caring girl."
On March 30, at the exhibition
Build 2016, Microsoft introduced its
Microsoft Bot Framework for creating text, audio and video bots for Skype, Slack, Facebook Messenger, Kik, Office 365 e-mail and other popular services. The platform consists of three main parts:
- Bot Builder SDK: a set of open source tools (Node.js, .NET or REST are available for development) for creating and testing chat bots;
- Bot Framework Developer Portal: a service for registering, connecting to popular channels, setting up and testing, publishing your bot;
- Bot Directory: a directory of bots created using the Bot Framework and registered in the Developer Portal, designed for downloading and checking bots, sharing experiences.
The main advantages of the Bot Framework platform include the absence of binding to a specific platform, the availability of an open source SDK, advanced tools for debugging and testing bots, built-in communication and management of web applications, support for automatic translation in more than 30 languages, the presence of a community. At the same time, the Microsoft Bot Framework platform continues to grow rapidly.
Also during the exhibition Build 2016 it was announced the release of a new version of Skype with support for bots for Windows, Android, iPhone and iPad, as well as the opening of the SDK and API for Skype Bot Platform. In order to add the bot to your Skype, Slack or Telegram contact list, you can use the
bot directory . In the new version of Skype for iOS and Android, the search for bots is implemented directly in the application.
Microsoft declares that in the near future it will be possible to communicate with a chat bot in a natural language via an audio or video call (Skype Video Bots). In this case, the chat bot will be equipped with advanced AI and represent a kind of 3D model. Microsoft is confident that the use of bots to automate the user's usual actions and the use of voice control will change the usual ways of communication, games, shopping, etc.
A spoon of tar
But do chat bots really carry such enormous potential that they will soon be able to force out familiar applications, search engines and consultants from the market? Whether they become an annoying or even a dangerous factor over time. On this issue there are a variety of opinions.

One of these opinions: chat bots are nothing more than just a new user interaction mechanism. This is a logical development of the chain: sites - applications - chat bots. And for this interaction, as before, advanced advanced AI is not necessary at all. A bot just needs to have a well thought out command system. At the same time, the utility of bots is not questioned.
Another point of view is that bots are, in fact, an extra way to get information. All existing at the moment is quite enough. And in order to download a new issue of your favorite magazine or a new application from the App Store, you do not need to launch an instant messenger, search for a chat bot you need, chat with it, answering 2-3 leading questions and only then get what you need. Existing applications have not gone away, they are still at hand and they are convenient. But only chat bots that are actively involved directly in the process of correspondence can be useful: translators, statisticians, analysts, etc.
Even now it is still not possible to create a chat bot that could effectively promote products. Do not offer the person what he has already chosen, namely, to convince the person of the need to make a purchase. Of course, the experiments to create smart chat programs are impressive. But they still have much to develop. An interesting example could be the comparison of a modern chat bot with an ATM. Yes, the ATM is much faster and with fewer errors will perform routine actions, interact with the user. But an ATM can never convince a user to take a loan.
One can definitely say that the issue of indispensability, convenience and, in particular, chatbots intelligence is overheated and maintained in this state mainly by the manufacturers of instant messengers, who are the main habitat of bots, as well as owners of large platforms. And often, only owners of large platforms can afford the creation of truly intelligent chat bots, combining advanced AI, as well as extensive functionality.
Now to create a bot, you can use a variety of services. You can create a bot without writing a single line of source code at all, using a special service provided on the messenger platform. You can use a third-party service, like
Chatfuel . Free development tools are available, such as the Microsoft Bot Framework. Finally, you can purchase tools to create a bot through the service
Gupshup . But will your bot be intelligent enough to fully compete with applications familiar to the user? Will your chat bot fit in its habitat enough to become indispensable? Or will they supplement the numerous cohort of quite good, but, to be honest, quite monotonous virtual assistants?
Most likely, the chat bots industry is eventually waiting for the same thing that happened with mobile and Internet applications. The most sought-after, 'smart', comfortable chatbots that best fit into their specific habitat will survive.
Conclusion
The initial idea was that this article at the end will tell about the search for errors in the source code of Microsoft Bot Builder (available on
GitHub ) using the PVS-Studio static analyzer. However, it turned out that the Bot Builder platform contains only 50 thousand lines of C # code available for inspection (the remaining source code was developed using Node.js and REST). In addition, the code was very high quality, which is not surprising for Microsoft. During the verification of the Bot Builder solution, almost no errors were found in it, with the exception of two not very critical, but, nevertheless, requiring attention of suspicious structures. All this was not enough to write a full-fledged article on the verification of the project, as we
usually do. It happens. Nevertheless, the Bot Builder platform is actively developing, and in the future I will repeat my experiment, hoping to find more interesting errors in the code of this platform and tell readers about them. Now, as an example, I will simply give a description of the observed flaws. Both errors are related to potential access via null link.
PVS-Studio analyzer warning :
V3019 Possibly an incorrect variable compared to null after type conversion using 'as' keyword. Check variables 'step', 'prop'. FieldReflector.cs 231
The analyzer detected a suspicious construct associated with the use of the cast operator
as :
protected Type StepType(object step) { var field = step as FieldInfo; var prop = step as PropertyInfo; return (step == null ? null : (field == null ? prop.PropertyType :
The above code snippet will work correctly until the
step variable is of type
FieldInfo or
PropertyInfo . Otherwise, it is possible to access the zero reference, since there is no additional check for
null for the variable
prop.PVS-Studio analyzer warning :
V3105 The 'parts' variable was used after it was assigned through the null-conditional operator. NullReferenceException is possible. JwtTokenExtractor.cs 60
In the following code snippet, the author assumes that the
authorizationHeader variable can be
null . In this case, the
parts variable will also be initialized to
null . However, in the future, the
parts variable is used without proper checking, which may result in a
NullReferenceException exception:
public async Task<ClaimsIdentity> GetIdentityAsync(string authorizationHeader) { .... string[] parts = authorizationHeader?.Split(' '); if (parts.Length == 2)
The correct version of this design is:
public async Task<ClaimsIdentity> GetIdentityAsync(string authorizationHeader) { .... string[] parts = authorizationHeader?.Split(' '); if (parts != null && parts.Length == 2) return await GetIdentityAsync(parts[0], parts[1]). ConfigureAwait(false); .... }
In conclusion, I would like to note that the topic of creating and promoting chat bots is quite interesting. This direction will be developed, and in the future we are waiting for new interesting experiments related to chat bots, as well as the use of AI.
Create your own chat bots and check the source code for errors using the
PVS-Studio static analyzer.
If you want to share this article with an English-speaking audience, then please use the link to the translation: Sergey Khrenov.
Chatbots, Microsoft Help us with this? .