How to Create .NET Bot (DIY #1)

Oleg Romanyuk
 
 

You’ve heard a lot of buzz about bots, artificial intelligence, and machine learning. Maybe, you’ve wondered how practical a . NET bot is and should you adopt the new, trendy tech. All in all, one thing you should know about bots and all the tech that empowers them. Bot technologies are here to stay! The main reason: they are cheaper than your local working guy. If you need the proof, check out our wonderful blog post — AI Bots are Coming for Your Testing Jobs or just browse the web.

Bots will save you money. And despite all the hi-tech chatter in the media, they’re not that complicated to make. We will tell you how to create your own .NET bot in 6 easy steps and 2 short blog posts:

DIY (Part 1)

  1. Introduction to the Bot Framework for .NET
  2. Create Your First .NET Bot
  3. Make the Bot Smarter

DIY (Part 2)

  1. Bring Your Bot to Life
  2. Connect the Bot to Channels
  3. Give Your Bot a Voice

Introduction to the Bot Framework for .NET

Let’s make everything clear from the start. When we use the word ‘bot’, we mean an app that users interact with in a conversational way. You can always create a proper bot from scratch but let’s leave it to digital cavemen. There’s a framework for everything software nowadays, especially bots. Moreover, the .NET bot framework will solve some of your basic issues by providing:

  • Basic I/O (input-output processing)
  • Language and dialogue skills
  • Connection to users
  • Language support

The .NET bot framework itself consists of the following tools and features:

  • Bot Builder (with SDKs for .NET)
  • Bot Framework Emulator
  • Developer Portal
  • Bot Connector Service
  • Channel APIs

How it all works? So simple you won’t believe it. First, you’ve got your Bot Builder SDK for actual coding together with the Developer Portal for additional services like APIs, databases, Azure, machine learning etc. Additionally, there’s a Bot Framework Emulator for testing your code.

Second, you have a Bot Connector Service for managing the input-output messaging

Third, there’s a whole collection of Channel APIs, including social media. If you want to add the bot to the channel that’s not provided (image below), remember there’s a custom API builder. In other words, you’ve got everything you need for your first .NET bot.

Create Your First .NET Bot

Okay, enough with the theory! Let’s get to the business. Follow the steps:

Step 1. Install Bot Builder SDK via Nuget Package Manager

Step 2. Install the Bot Application template to your Visual Studio

Step 3. Use the source code from GitHub to get a ready-made bot

Step 4. Use the Bot Framework Emulator, in order to test out your bot

The final step will be securing your newly built bot. This will require a few additional measures. However, securing a good piece of software always pays back.

There are several rules how to secure your bot properly:

  • use only an HTTPS endpoint
  • Enable a Bot Framework authentication by registering your bot to acquire a Microsoft App ID and a password
  • specify its app ID and password in your bot’s web.config file (look for the tip)
  • use the [BotAuthentication] attribute to specify authentication credentials when using Bot Builder SDK for .NET

Tip: The ID authentication goes like this. You add the Microsoft App ID in a proper field. Wait for the initial authentication. Add the newly generated BotID to a proper field and to the config(Bot handle). That’s it!

Still puzzled? Click here for a Microsoft tutorial on how to build your bot.

Moreover, in its Bot Framework, Microsoft offers a wonderful glossary of all the concepts that can be unfamiliar: https://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-concepts.

Hopefully, at the end of the chapter, you’re all set and done with creating your first bot. In case it’s not the case, please address me — the author of the article — Oleh Romanyuk @ Linkedin hereI will make sure you have a proper .NET bot created!

Make Your Bot Smarter

Congratulations — you’ve made it this far. Your bot is alive and you are a proud botfather. However, the bot is still primitive and pretty much useless. At this point, Microsoft provides a whole bunch of solution for boosting the brains of your bot, specifically 5 different APIs for language understanding.

Don’t know which to choose? Don’t panic. The first one is the most useful one. The name is LUIS. LUIS (Language Understanding Intelligent Service) is able to process natural language using pre-built or custom-trained language models. It has a bunch of advantages that will suit you just fine (image below).

Without any further introduction, let’s get to the drawing board and plan your LUIS app. What is the purpose of your bot and your business? How do you see your bot helping your clients?

For a smart plan for teaching the bot, let’s go through the following steps:

Step 1. Identify your domain — The way how LUIS functions is usually built around a domain-specific topic. For example, you have an app for selling tickets or an app for tracking your fitness. Both of them will be apps in different domains, and they will require different LUIS settings. In addition, there are 20 pre-built domains for your convenience that can be found here.

Step 2. Identify your intents — Intents are keywords that explain what your customer wants. If your customer writes ‘buy tickets’ obviously that’s what (s)he wants. If a fitness bot sees the word ‘pulse’ anywhere in the conversation, most probably the client needs to know something about his or her pulse. Plain and simple, make a list of all the keywords your customers can use in a conversation with your bot and connect them with an appropriate action from the side of the bot.

Step 3. Identify your entities — In order to book your flight, you need some information like the destination, date, airline, ticket category and travel class — that’s entities. You must add them in order to truly accomplish an intent.

So, here’s where all the fun starts. There are many types of entities you can create:

  • Simple entities — A simple entity describes a single concept.
  • Hierarchical entities — A hierarchical entity represents a category and its members.
  • Composite entities — A composite entity is made up of other entities that form parts of a whole.
  • Prebuilt entities — LUIS provides pre-built entities for common types like Number, which you can use for the number of tickets in a ticket order.
  • List entities — A list entity is an explicitly specified list of values. Each value consists of one or more synonyms. In a travel app, you might choose to create a list entity to represent airport names.

lanned your LUIS App? Sure what intents and entities you’ll use? Perfect! And no worries, if you’re not sure about everything, you’ll be able to change the settings afterward. Now’s the time to create an actual LUIS app and make your bot smarter!

WHAT IS SDLC?

VIKTORIA RUBAN

BA at Computools

The development of technology has shown people that successful products are supposed to make life easier and more comfortable. Get instant access to applications for ordering and delivering, booking and planning, online banking, a personal assistant, and so much more by simply clicking an icon on your smartphone. Building powerful software requires an integrated approach and careful planning. It’s time to find out more about SDLC.

WHAT IS SDLC?

SDLC stands for Software Development Life Cycle.

It’s a list of project phases that helps a team understand what actually needs to be done at each step, and what artifacts need to be ready to start a particular phase.

LET’S TAKE A LOOK:

SDLC table

1. IDEATION

At this stage, the team has a lot to learn about the client’s business and ideas.

Here are the basic actions conducted during the ideation phase:

● review the documentation sent by the client (if it exists);

● research the domain and spend time getting familiar with it (especially if it’s niche);

● conduct meetings with the stakeholders to discuss basic requirements, provide suggestions, and brainstorm ideas;

● make sure to consider the following:

○ Whose opinion can influence the product (it can be someone from the client’s side, specific departments like Marketing, or national or international regulations, laws, and institutions)?

○ What are the goals of these people, departments, or institutions?

○ Who is the product being made for?

○ Who will use the product?

○ Why is the product interesting and/or useful for these people?

○ Where do they live?

○ Do their daily routines need to be considered?

○ Does the client have any ideas about the monetization strategy for the product?

By the end of this first stage, the team already has some information about the product and found a common ground with the client.

○ general idea of the project;

○ high-level mind map;

○ stakeholders and their goals;

○ competitors;

○ key terms and definition

2. REQUIREMENTS

This stage is still a part of the discovery phase. It gives a business analyst a chance to gather any specific requirements for the project and prepare the documentation needed for the next step.

Below are the main techniques used to elicit requirements:

● interviewing;

● holding workshops;

● brainstorming;

● observing.

By the end of this stage, a software requirements specification (SRS) is drafted and continuously reviewed by a quality assurance specialist to help all technical and non-technical stakeholders stay on the same page. The document describes functional and non-functional requirements and comes with a prototype.

3. DESIGN

This step is based on work done during the previous step. A solution architect prepares documentation pertaining to software architecture describing the architectural approach and data flow for the particular project, as well as technical decisions and third-party integrations.

During this phase, a test strategy is also defined for the further stages.

The perfect case is when all the documentation can be checked by stakeholders in terms of product relevance and legal constraints.

By the end of this stage, the discovery phase of the software development life cycle is considered to be finished and the project is ready for development.

 

4. DEVELOPMENT

Only at this step developers start implementing the project according to prepared documentation.
The quality of this step greatly depends on developers’ experience and how well documents are detailed.

5. TESTING

This stage usually goes hand in hand with development. Testing provides quality assurance and makes sure that the project is implemented according to the requirements.

During testing, if any number of bugs are found, the team returns to development again. It’s common that a short cycle of these two steps will repeat until all bugs are removed.

There are several types of testing conducted at this stage:

● manual testing according to acceptance criteria;

● regression testing;

● load testing;

● unit-testing (optional);

● integrational (optional);

● auto testing (optional).

6. DEPLOYMENT

This is the final stage of the project. It implies deployment to the product server and/or digital distribution platforms.

7. MAINTENANCE

After product release, additional support may be needed. Additional documentation and support hours are discussed individually.

Several SDLC models can be used during the software development process:

● waterfall model;

● iterative model;

● V-model;

● spiral model;

● big bang model.

Each model has a specific set of steps and special processes. The team can experience different kinds of work efficiency by deploying different models. The most common is the iterative model.

Summing up, choosing an SDLC model suitable for your business and following the above mentioned software development life cycle steps helps facilitate work efficiency and successful product development.

 

SEEING A BIG PICTURE IS VITAL WHEN YOU BEGIN DEVELOPING SOFTWARE. SO BEFORE YOU START CRAFTING YOUR PRODUCT, TAKE A LOOK AT THE MOST COMMON AND SECURE SOFTWARE ENGINEERING LIFE CYCLE TO GRASP THE CONCEPT OF HOW A COMPLETE PROCESS LOOKS LIKE.

9 out of 10 startups fail because their solution has no market fit. This indicates that the software development analysis stage was skipped or conducted wrong. In such a case all further design, coding, and testing have little sense.

Seeing the big picture is vital when you begin developing software. So before you start crafting your product, take a look at the most common and secure software engineering life cycle to grasp the concept of how a complete process looks like.

1. ANALYSIS

Software Development Life Cycle image 1

Goal: To gather requirements and define the direction of the software engineering process.

Mistakes made during the analysis phase are the most expensive to fix later. This is the only time to build a foundation for your future product:

  • Carry out user research;
  • Analyze the competitors;
  • Establish business goals;
  • Measure success;
  • Map the customer journey;
  • Plan the budget.

It’s important to take into account the team on the client’s side. Its in-depth knowledge about the product goals and requirements, level of industry knowledge, and readiness to collaborate will contribute to the overall strategy and will make the discovery stage more effective. It’s crucial to engage at least one person from the client’s side to get a better understanding of the scope and goals of your product. Such interaction will help to write a detailed Software Requirements Specification (SRS) and to eliminate risks such as understaffing, over budget, and lack of market demand.

Outcome: Setting requirements and writing SRS

2. PRODUCT DESIGN

Software Development Life Cycle image 2

Goal: To convert requirements into detailed software architecture.

Product design can be divided into three fundamental components:

  • Functionality;
  • Appearance;
  • Quality.

Functionality is the priority of an Architect. By narrowing the focus he helps business and technical teams work together on a product that targets both clients’ needs and business goals.

Appearance is a tangible input of UX designers that conduct user research followed by sketching (any kind of it), prototyping, and creating MVP.

Quality stands for meeting customer needs and expectations with a product.

All the above components should be sourced from the SRS document that is a reference point for everyone involved in the project. The vital thing here is a vast understanding of the context for the existence of software engineering services. The more detailed the description of how the application needs to be created would be, the less additional input developers will require at the next coding stage.

Outcome: Software design description.

3. SOFTWARE DEVELOPMENT

Software Development Life Cycle image 3

Goal: Translate the design of the system into code.

This is a lengthy phase though less complicated than the previous two. Using the design description, programmers code the modules using the chosen programming language. The coding tasks are divided between the software engineering team members according to their skillset. Front-end developers create codes for displaying an application or product UI and the elements users need to interplay with the site. Their Back-end counterparts are in charge of the technical side of a product.

Establish conditions for organized and consistent coding:

  • Use proper guidelines;
  • Supervise every developer;
  • Automate deployment process;
  • Nourish the best programming practices.

Well-written code significantly reduces the number of test runs and maintenance-related problems at the next stages. At Erbis we use innovative design and development practices to drive our client’s growth.

Outcome: testable, functional software, and a Source Code Document.

4. PRODUCT TESTING

Software Development Life Cycle image 4

Goal: Code verification and bugs detection.

There is one step missing before mass-production testing. It consists of Quality Assurance (QA), Quality Control (QC), and Testing. While these are technically separate parts of the development process dependent on project size, stakeholders often group them as they have the same end goal: to make a high-quality product.

Let’s figure out the difference:

  • Quality Assurance. This is a process-oriented activity aimed to ensure that the team manages and creates deliverables consistently. The role of QA automation is to identify the reason for the error and to re-engineer the system so that such defects won’t appear any further. Thus focusing efforts on improving QA processes is one of the best investments an organization can make.
    • Quality Control. This is a product-oriented performance related to intermediate and final results of software engineering. Examples of QC include technical reviews, software testing, and code inspections.
      • Testing. The tester creates tests and observes the behavior of the particular program under certain conditions. He fills in the documentation and returns it to developers. The best way to ensure that tests are run regularly is to automate them.

Outcome: Software is completely free of bugs and compliant.

5. DEPLOYMENT

Software Development Life Cycle image 5

Goal: Software delivery to a target device.

Software deployment refers to the process of running a product on a server or device and can be summarized in three general phases:

  • Preparation; 
  • Testing;
  • Deployment.

A piece of software may be deployed several times during the software development lifecycle depending on its functioning and error check results. If it runs smoothly and the way it was intended, then consider your software ready to be launched for beta testing. The support team collects feedback from the first users, and if any bugs come up, the development team fixes them. After that, the final version is rolled out.

Outcome: Fully operational software in a live environment.

6 phases of the software development life cycle

6. MAINTENANCE

Software Development Life Cycle image 6

Goal: Ongoing security monitoring and update.

The process of software development is a never-ending cycle as the plan rarely turns out perfect when it meets reality. In most cases, product maintenance is the continuous phase intended to keep the software stable and up to date. If any new bugs and vulnerabilities appear, the maintenance team will mitigate them or flag them to be addressed in a future version of the software.

There are 2 types of maintenance:

  • Corrective. This means the fixation of defects that are rooted in production. They emerge because removing all the faults before delivery is extremely difficult.
  • Adaptive. It’s an addition of requirements you didn’t have in the original plan. Such modification takes shape due to environment or input data change.

Outcome: Utter user experience and productivity.

CONCLUSION

These steps are roughly the same from one software development life cycle model to another. They tend to occur in this order, though they can also be mixed into a rapidly-repeating cycle (like Agile) or break down into linear sequential phases (like Waterfall). Regardless of the method, the desired result of software engineering services is a competitive and customer-oriented product.

Reference: https://erbis.com/blog/6-phases-of-the-software-development-life-cycle/