Friday, 6 October 2017

Artificial Intelligence - Transforming the face of Retail experience

Artificial Intelligence: 
Artificial intelligence technology takes some huge data set as an input, processes it through AI algorithms (say neural networks) and then produces a model as an output which can provide answers like a real human. So in layman term it is like a human brain knowing some behavior/ trait about someone and then acting accordingly at proper time and location. 
Artificial Intelligence in Retail: 
Think as a Retailer? Wouldn’t it be great if you know Demographics, Shopping behavior/Trend and need of a customer who has just walked in your retail outlet or on online site on a fly? It would be easier to showcase the customized best possible products and offers for the customer in order to encash the opportunity. Even as a Customer, I would be very happy if I am presented with everything which I am in need for as that would save my time in decision making and shopping enhancing my shopping experience. 

This is exactly what Artificial Intelligence does for your Retail. 

Below shows some of the recent example in Retail Industry where Artificial Intelligence is used: 

Amazon Go: 
Technology behind the concept of Amazon Go includes “computer vision, sensor fusion and deep learning.” Using a mobile application, customers will scan their smartphones at a kiosk when they walk into the store. The store’s technology, which the online retailer calls “Just Walk Out,” automatically detects when products are taken from or returned to the shelves and keeps track of them in a virtual cart. When customers finish shopping they will simply leave. Shortly thereafter the company will charge each customer's Amazon account and send a receipt. 

AI can also be supportive in many other retail units likes: 
  • Store Location Selection 
  • Optimization of Product Mix 
  • Optimizing Supply Chain 
  • Virtual Mirrors, Gesture Recognition, 
  • Visual Listening 
Conclusion: 
Any information and knowledge is always helpful and if received during correct time and place can turn out into an opportunity. AI helps in providing Accurate and on the fly information. Considering this AI is surely to stay and positively transform the face of Retail.

About Author:
Saurabh Kane is a consultant in Systems Plus Pvt. Ltd. Within Systems Plus, he actively contributes to the areas of Technology and Information Security. He can be contacted at: saurabh.k@spluspl.com

Thursday, 5 October 2017

Need for Business Analyst and activities involved

Why do we need Business Analysts?
In today’s IT sector Business analyst play an important role. Business analysts play key roles in the project lifecycle, and ensure that the final solution meets business objectives. Business analyst are those who will always be working on artefacts which is deliverable of a part of the SDLC. The role changes as the SDLC goes through the cycle.

For any Business Analyst the biggest challenge after getting a project is, how to start and from where to start or what should be created and how to complete the project successfully. 

To help with all questions, here are some of the key techniques for a successful business process analysis.

Roles and responsibilities of BA –
Requirements are core of developing IT solutions. Defining, analyzing and documenting requirements evolve from business analyst’s creative process. Some roles are as follows-

Extract requirements –Requirements play a key part in IT. Incomplete /improper requirements usually lead to project failure. A business analyst needs to determine a project’s requirements by extracting them.
Organize requirements –The business analyst must organize requirements into related categories to manage and communicate them. Requirements are sorted according to their source and applicability. Proper organization prevents project requirements from becoming overlooked, and leads to optimum use of time and budgets.
Simplify requirements – The business analyst emphasizes simplicity and ease of use but especially during implementation. Business analysts identify and avoid extraneous activities that do not solve the problem. 
Verify requirements –The business analyst is most knowledgeable about use cases and other diagrams, therefore they continually verify the requirements and reject implementations that do not advance business objectives. Verifying requirements is done through analysis, test and inspection.
Managing requirements – A formal requirements presentation, review and approval session occurs, where project schedules, costs and duration estimates are updated and the business objectives are revisited. Upon approval, the business analyst transitions into requirements management activities for the rest of the IT solution life cycle.
Documenting- Business analysts spend a fair amount of time documenting what they learn and observe, and the results of their analyses. She/he takes the time to consider the best ways to document specific types of information, whether as text or visual form (charts, graphs, illustrations, etc.).

Diagrammatic way of presenting BA role-
Conclusion:
Whether you currently work in IT or a related field, if you’re a leader in your organization and want the chance to pursue the opportunities presented by the business analyst career path, it is a great time to start planning. With business analysis training, one can obtain the core skills that businesses need to advance.

About Author:
Ayushi Guda is a consultant in Systems Plus Pvt. Ltd. Within Systems Plus, she actively contributes to the areas of Technology and Information Security. She can be contacted at: Ayushi.Guda@spluspl.com 

Unit Testing using xUnit

Unit Testing is a level of software testing where individual components of a software are tested. The purpose is to validate that each unit of the software perform its required functionality properly.

In Software development Unit Test methods are written to test the code internally while the code gets executed, it makes the development Test driven. Below is the flow diagram that shows how test method works:
The above diagram makes the flow of unit test execution very clear. So now, we’ll discuss our topic Unit testing using xUnit framework.

xUnit framework helps in writing test methods in .net. The xUnit test runner contains the program entry point to run your tests. Dotnet test starts the test runner using the unit test project you've created.
Below is the basic example to write xUnit Unit test for .net Service:

using System;

namespace Number.Services
{
    public class PrimeService
    {
        public bool IsPrime(int number)
        {
            if (candidate == 1)
          {
            return false ;
          }
            throw new NotImplementedException("Please create a test method");
        }
    }
}
 Each Test method should group these functional sections as shown in the test method below:

1 Arrange all necessary preconditions and inputs.
2 Act on the object or method under test.
3 Assert that the expected results have occurred or not.

using Xunit;
using Number.Services;

namespace Number.UnitTests.Services
{
    public class PrimeService_IsPrime
    {
        private readonly PrimeService _primeService;

        public PrimeService_IsPrime()
        {
            _primeService = new PrimeService();
        }

        [Fact]
        public void ReturnFalseForValue1()
        {
            //Arrange
            var number = 1;

            //Act
            var result = _primeService.IsPrime(number);

            //Assert
            Assert.True(result, false );
        }
    }
}
 The above test will pass as the code in the actual method returns false and we are also checking that if the result is false.

The [Fact] attribute indicates a test method that is run by the test runner. Eexecute dotnet test to build the tests and the class library and then run the tests. 

The above example does not contain dependencies but if the code has dependency on other layers of the project the best practice is to MOQ the dependencies and then test the code.
The above diagram shows how the Mocking is different. MOQ is basically a nuget package that you can use to mockup any dependency. MOQ is the only mocking library for .NET developed from scratch to take full advantage of .NET Linq expression trees and lambda expressions, which makes it the most productive mocking library available.It also supports mocking interfaces as well as classes.

You will get an idea of MOQ in below example. Here, I will explain how we write test methods and mock up dependencies.

namespace Products.Controllers
{

public class ProductController : Controller
    {
        private readonly IProductRepository<Product> _productRepository;

        public ProductController(IProductRepository<Product> productRepository)
        {
            _productRepository = productRepository;
        }

        [HttpGet]
        public IActionResult GetAllProduct()
        {
            var data = _productRepository.GetAll().ToList();

            return View(data);
        }
 The above controller method is dependent on repository layer. So to write test method in such scenarios we need to use MOQ framework, as used in the below example:

 using Moq;
using Xunit;

namespace Products.Tests
{
    public class ProductController Tests
    {
        private ProductController _productController;
        private IProductRepository<Product> _productRepository;

        [Fact]
        public void IndexActionReturnsProductList()
        {
            //Arrange
            var products = GetProductList();
            var mock = new Mock<IProductRepository<Product>>();
            mock
                 .Setup(x => x.GetAll())
                 .Returns(products);

            _productController = new ProductController(mock.Object);

            //Act
           
              var data = _productController.Index() as ViewResult;
              var result = (List<Product>) data.Model;

            //Assert
            Assert.Equal(4, result.Count);
        }

        private IQueryable<Product> GetProductList()
        {
            var product= new List<Product>
            {
                new Product
                {
                     Name = "Car",
                     ProductCode= "0986",
                },
                new Product
                {
                     Name = "Scooter",
                     ProductCode= "0945",
                }             
            };
            return product.AsQueryable();
        }
   }
}

In the test method above, we have mocked the ProductRepository and its method GetAll() and instead get data from private method GetProductList() and do the testing and checking the result for controller layer only.

Conclusion: In this way, you can write test methods for all layers of project (i.e. Controller, Services, Repositories, etc.) by mocking the dependencies. Test driven Development helps to make development more bug free and xUnit framework makes it much easier. Hope with this blog you get an overview of writing test methods using xUnit and MOQ.

About Author:
Shivangi Verma  is a consultant in Systems Plus Pvt. Ltd. Within Systems Plus, she actively contributes to the areas of Technology and Information Security. She can be contacted at: Shivangi.Verma@spluspl.com 

Wednesday, 4 October 2017

Persistent Link in SharePoint

As we all know,

SharePoint is very well known for content management and for content sharing.

This time let’s talk about one of the rarely used feature of SharePoint.
“Document ID Service”

Let’s talk about one of the scenario to understand the importance of feature.

Scenario:
We have process set up in HR as new joiner joins company, after induction that person has to fill up one form as employee details and upload it on intranet portal to ‘New Joiner’ document library.

This will trigger one workflow and sends email to HR team with that document link within it.

One day, while HR member accessing documents from ‘New Joiner’ document library accidently one document got misplaced to another folder by him during drag-drop action.
He was not sure where did he dragged that document. At other end, link mentioned in email notification was pointing as ‘Document Does Not exists’!😢

HR team discussed this scenario with us to search that document as that was critical one.

We did manual search within folders and finally found that document, everyone was happy☺

Sometime PAIN become originator of IDEA!☺  

This scenario made us to think on, can we create a link for such documents that will remain same even after document location changes within site?

Persistent Link?☺

Yes we can !

Solution:
There is feature available at site collection level call “Document ID Service”.

This is made up for same purpose that we were looking.

On Activation of this feature it starts to assign Document ids to documents within site collection.

Kindly refer this link to configure this service: Click Here

After configuration it will take some time to assign document id for all documents.

After document ID assignment, document property will look like:
Now, let’s see how we can generate Persistent Link for this document?

There is generic format to construct link , just we need to follow it:


e.g :

And you are all set!☺

This url acts as permanent link for that document.

We can configure our document link within workflow email notification based on this one.

Even though document get rename or its location changes within site collection, document link remains same.

There are some limitations that we need to consider.
Limitation:
1) This is workable only if document move within same site collection.
    Outside site collection move, this link will not work.
2) Under certain circumstances the Document ID is not always maintained. The      following table summarizes these exceptions.

Action
Result
Tried to send a file from one library to another using the ‘Send To’ command (in same SharePoint Site)
Document is considered a copy and a new document ID will be assigned.
Tried to copy a file between two libraries using file explorer view
Document ID not preserved
Tried using the Copy command in “Manage Content and Structure
Document ID not preserved
Cutting & Pasting a file between two SharePoint libraries using file explorer view
Document ID preserved
Tried using the Move command in “Manage Content and Structure”
Document ID preserved

About Author:
Vishal Himane is a consultant in Systems Plus Pvt. Ltd. Within Systems Plus, he actively contributes to the areas of Technology and Information Security. He can be contacted at: vishal.himane@spluspl.com