Friday, 19 May 2017

Test Driven Development with example


TDD life-cycle

Before explaining best practices, it is important to understand the TDD life-cycle.
  1. Write the test
  2. Run the test (there is no implementation code, test does not pass)
  3. Write just enough implementation code to make the test pass
  4. Run all tests (tests pass)
  5. Refactor
  6. Repeat
Test-driven development is not about testing. Test-driven development is about development (and design), specifically improving the quality and design of code. The resulting unit tests are just an extremely useful by-product.
For more information, please read the Test-Driven Development (TDD) article.

TDD Best practices

Practices have been separated into following categories:
  • Naming Conventions
  • Processes
  • Development practices
  • Tools

Naming Conventions

Naming conventions help organize tests better so that it is easier for developers to find what they’re looking for. Another benefit is that many tools expect that those conventions are followed. There are many naming conventions in use and those presented here are just a drop in the sea. The logic is that any naming convention is better than none. Most important is that everyone on the team knows what conventions are used and is comfortable with them. Choosing “more popular” conventions has the advantage that newcomers to the team can get up to speed fast since they can leverage existing knowledge to find their way around.

Separate the implementation from the test code

Benefits: avoids accidentally packaging tests together with production binaries; many build tools expect tests to be in a certain source directory.
Common practice is to have at least two source directories. Implementation code should be located in src/main/java and test code in src/test/java. In bigger projects number of source directories can increase but the separation between implementation and tests should remain.
Build tools like Maven and Gradle expect source directories separation as well as naming conventions.
[GRADLE: build.gradle]
1
2
3
4
5
6
7
8
9
apply plugin: 'java'
 
repositories {
mavenCentral()
}
 
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}
The build.gradle can be found in the GitHub TechnologyConversations repository.
[COMMAND PROMPT]
1
gradle test jar
You’ll notice that we are not specifying what to test nor what classes to use to create a jar file. Gradle assumes that tests are in src/test/java and that the implementation code that should be packaged to the jar file is in src/main/java.

Place test classes in the same package as implementation

tddBestPracticesPackagesBenefits: helps finding tests.
Knowing that tests are in the same package as the code they test helps finding them faster. For example, examples in this article are in the package com.wordpress.technologyconversations.tddbestpractices. As stated in the previous practice, even though packages are the same, classes are in the separate source directories.

Name test classes in a similar fashion as classes they test

tddBestPracticesClassesBenefits: helps finding tests.
One commonly used practice is to name tests the same as implementation classes with suffix Test. If, for example, implementation class is StringCalculator, test class should be StringCalculatorTest.
Often, number of lines in test classes is bigger than number of lines in corresponding implementation class. There can be many test methods for each implementation method. To help locate methods that are tested, test classes can be split. For example, if StringCalculator has methods add and remove, there can be test classes StringCalculatorAddTest and StringCalculatorRemoveTest.

Use descriptive names for test methods

Benefits: helps understanding the objective of tests.
Using method names that describe tests is beneficial when trying to figure out why some test failed or when the coverage should be increased with more tests. It should be clear what conditions are set before the test, what actions are performed and what is the expected outcome.
There are many different ways to name test methods. Our prefered method is to name them using the Given/When/Then syntax used in BDD scenarios. Given describes (pre)conditions, When describes actions and Then describes the expected outcome. If some test does not have preconditions (usually set using @Before and @BeforeClass annotations), Given can be skipped.
An example of BDD format for naming test methods would be:
1
2
3
4
@Test
public final void whenSemicolonDelimiterIsSpecifiedThenItIsUsedToSeparateNumbers() {
Assert.assertEquals(3+6+15, StringCalculator.add("//;n3;6;15"));
}
The whole class can be found in the GitHub TechnologyConversations repository.
tddBestPracticesMethodsDo NOT rely only on comments to provide information about test objective. Comments do not appear when tests are executed from your favorite IDE nor do they appear in reports generated by CI or build tools.
In the example screenshot, both failed tests have the same code inside. The only difference is in the name of the method. Test1 does not give much info regarding the failure. Method name whenSemicolonDelimiterIsSpecifiedThenItIsUsedToSeparateNumbers is much more descriptive and provides information even without going deeper into the log or the test code.

Processes

TDD processes are the core set of practices. Successful implementation of TDD depends on practices described in this section.

Write the test before writing the implementation code

Benefits: ensures that testable code is written; ensures that every line of code gets tests written for it.
By writing or modifying test first, developer is focused on requirements before starting to work on a code. This is the main difference when compared to writing tests after the implementation is done. Additional benefit is that with tests first we are avoiding the danger that tests work as quality checking instead of quality assurance.

Only write new code when test is failing

Benefits: confirms that the test does not work without the implementation
If tests are passing without the need to write or modify the implementation code then either the functionality is already implemented or test is defective. If new functionality is indeed missing then test always passes and is therefore useless. Test should fail for the expected reason. Even though there are no guarantees that test is verifying the right thing, with fail first and for the expected reason, confidence that verification is correct should be high.

Rerun all tests every time implementation code changes

tddBestPracticesAllTestsPassBenefits: ensures that there is no unexpected side-effect caused by code changes.
Every time any part of the implementation code changes, all tests should be run. Ideally, tests are fast to execute and can be run by developer locally. Once code is submitted to version control, all tests should be run again to ensure that there was no problem due to code merges. This is specially important when more than one developer is working on the code. Continuous Integration tools like Jenkins, Hudson, Travis and Bamboo should be used to pull the code from the repository, compile it and run tests.

All tests should pass before new test is written

Benefits: focus is maintained on a small unit of work; implementation code is (almost) always in working conditions.
It is sometimes tempting to write multiple tests before the actual implementation. In other cases, developers ignore problems detected by existing tests and move towards new features. This should be avoided whenever possible. In most cases breaking this rule will only introduce technical debt that will need to be paid with interests. One of the goals of TDD is that the implementation code is (almost) always working as expected. Some projects, due to pressures to reach the delivery date or maintain the budget, break this rule and dedicate time to new features leaving fixing of the code associated with failed tests for later. Those projects usually end up postponing the inevitable.

Refactor only after all tests are passing

Benefits: refactoring is safe
If all implementation code that could be affected has tests and they are all passing, it is relatively safe to refactor. In most cases there is no need for new tests. Small modifications to existing tests should be enough. Expected outcome of refactoring is to have all tests passing both before and after the code is modified.

Development practices

Practices listed in this section are focused on the best way to write tests.

Write the simplest code to pass the test

Benefits: ensures cleaner and clearer design; avoids unnecessary features
The idea is that the simpler the implementation the better and easier to maintain is the product. The idea adheres to the “keep it simple stupid” (KISS) principle. It states that most systems work best if they are kept simple rather than made complex; therefore simplicity should be a key goal in design and unnecessary complexity should be avoided.

Write assertions first, act later

Benefits: clarifies the purpose of the requirement and test early.
Once assertion is written, purpose of the test is clear and developer can concentrate on the code that will accomplish that assertion and, later on, on the actual implementation.

Minimize assertions in each test

Benefit: avoids assertion roulette; allows execution of more asserts.
If multiple assertions are used within one test method, it might be hard to tell which of them caused a test failure. This is especially common when tests are executed as part of continuous integration process. If the problem cannot be reproduced on a developer’s machine (as may be the case if the problem is caused by environmental issues) fixing the problem may be difficult and time-consuming.
When one assert fails, execution of that test method stop. If there are other asserts in that method, they will not be run and information that can be used in debugging is lost.
Last but not least, having multiple asserts creates confusion about the objective of the test.
This practice does not mean that there should always be only one assert per test method. If there are other asserts that test the same logical condition or unit of functionality, they can be used within the same method.
Few examples:
1
2
3
4
5
6
7
8
9
@Test
public final void whenOneNumberIsUsedThenReturnValueIsThatSameNumber() {
Assert.assertEquals(3, StringCalculator.add("3"));
}
 
@Test
public final void whenTwoNumbersAreUsedThenReturnValueIsTheirSum() {
Assert.assertEquals(3+6, StringCalculator.add("3,6"));
}
This code contains 2 tests that clearly define what is the objective of those tests. By reading method name and looking at the assert it should be clear what is being tested.
1
2
3
4
5
6
7
8
9
10
11
@Test
public final void whenNegativeNumbersAreUsedThenRuntimeExceptionIsThrown() {
RuntimeException exception = null;
try {
StringCalculator.add("3,-6,15,-18,46,33");
} catch (RuntimeException e) {
exception = e;
}
Assert.assertNotNull("Exception was not thrown", exception);
Assert.assertEquals("Negatives not allowed: [-6, -18]", exception.getMessage());
}
This test has more than one assert but they are testing the same logical unit of functionality. First assert is confirming that exception exists and the second that its message is correct. When multiple asserts are used in one test method, they should all contain messages that explain the failure. This way debugging of the failed assert is easier. In case of one assert per test method, messages are welcome but not necessary since it should be clear from the method name what is the objective of the test.
1
2
3
4
5
6
7
8
9
10
@Test
public final void whenAddIsUsedThenItWorks() {
Assert.assertEquals(0, StringCalculator.add(""));
Assert.assertEquals(3, StringCalculator.add("3"));
Assert.assertEquals(3+6, StringCalculator.add("3,6"));
Assert.assertEquals(3+6+15+18+46+33, StringCalculator.add("3,6,15,18,46,33"));
Assert.assertEquals(3+6+15, StringCalculator.add("3,6n15"));
Assert.assertEquals(3+6+15, StringCalculator.add("//;n3;6;15"));
Assert.assertEquals(3+1000+6, StringCalculator.add("3,1000,1001,6,1234"));
}
This test has many asserts. It is unclear what is the functionality and if one of them fails it is unknown whether the rest would work or not. It might be hard to understand the failure when this test is executed through some of CI tools.

Do not introduce dependencies between tests

Benefits: tests work in any order independently whether all or only subset is run
Each test should be independent from others. Developers should be able to execute any individual test, set of tests or all of them. Often there is no guarantee that tests will be executed in any particular order. If there are dependencies between tests they might easily be broken with introduction of new tests.

Tests should run fast

tddBestPracticesDurationBenefits: tests are used often
If it takes a lot of time to run tests, developers will stop using them or run only a small subset related to the changes they are making. Benefit of fast tests, besides fostering their usage, is fast feedback. Sooner the problem is detected, easier it is to fix it. Knowledge about the code that produced the problem is still fresh. If developer already started working on a next feature while waiting for the completion of the execution of tests, he might decide to postpone fixing the problem until that new feature is developed. On the other hand, if he drops his current work to fix the bug, time is lost in context switching.

Use mocks

Benefits: reduced code dependency; faster tests execution.
Mocks are prerequisites for fast execution of tests and ability to concentrate on a single unit of functionality. By mocking dependencies external to the method that is being tested developer is able to focus on the task at hand without spending time to set them up. In case of bigger teams, those dependencies might not even be developed. Also, execution of tests without mocks tends to be slow. Good candidates for mocks are databases, other products, services, etc. Mock objects are a big topic and will be described in more details in a future article.

Use setup and tear-down methods

Benefits: allows setup and tear-down code to be executed before and after the class or each method.
In many cases some code needs to be executed before test class or before each method in a class. For that purpose JUnit has @BeforeClass and @Before annotations that should be used as the setup phase. @BeforeClass executes the associated method before the class is loaded (before first test method is run). @Before executes the associated method before each test is run. Both should be used when there are certain preconditions required by tests. Most common example is setting up test data in the (hopefully in-memory) database. On the opposite end are @After and @AfterClass annotations that should be used as tear-down phase. Their main purpose is to destroy data or state created during the setup phase or by tests themselves. As stated in one of the previous practices, each test should be independent from others. More over, no test should be affected by others. Tear-down phase helps maintaining the system as if no test was previously executed.

Do not use base classes

Benefits: test clarity.
Developers often approach test code in the same way as implementation. One of the common mistakes is to create base classes that are extended by tests. This practice avoids code duplication at the expense of tests clarity. When possible, base classes used for testing should be avoided or limited. Having to navigate from the test class to its parent, parent of the parent and so on in order to understand the logic behind tests introduces, often unnecessary, confusion. Tests clarity should more important than avoiding code duplication.

Tools

TDD, coding and testing in general are heavily dependent on other tools and processes. Some of the most important are following. Each of them is a too big of a topic to be explored in this article so they will be described only briefly.

Code coverage

Benefit: assurance that everything is tested.
Code coverage practice and tools are very valuable in determining that all code, branches and complexity is tested. Some of the tools are JaCoCo, Clover and Cobertura.

Continuous integration (CI)

Continuous Integration (CI) tools are a must for all but most trivial projects. Some of the most used tools are Jenkins, Hudson, Travis and Bamboo.

Thursday, 27 April 2017

Design Patterns in Java

A design patterns are well-proved solution for solving the specific problem/task.
Now, a question will be arising in your mind what kind of specific problem? Let me explain by taking an example.
Problem Given:
Suppose you want to create a class for which only a single instance (or object) should be created and that single object can be used by all other classes.
Solution:
Singleton design pattern is the best solution of above specific problem. So, every design pattern has some specification or set of rules for solving the problems. What are those specifications, you will see later in the types of design patterns.

But remember one-thing, design patterns are programming language independent strategies for solving the common object-oriented design problems. That means, a design pattern represents an idea, not a particular implementation.
By using the design patterns you can make your code more flexible, reusable and maintainable. It is the most important part because java internally follows design patterns.
To become a professional software developer, you must know at least some popular solutions (i.e. design patterns) to the coding problems.

Advantage of design pattern:

  1. They are reusable in multiple projects.
  2. They provide the solutions that help to define the system architecture.
  3. They capture the software engineering experiences.
  4. They provide transparency to the design of an application.
  5. They are well-proved and testified solutions since they have been built upon the knowledge and experience of expert software developers.
  6. Design patterns don?t guarantee an absolute solution to a problem. They provide clarity to the system architecture and the possibility of building a better system.

When should we use the design patterns?

We must use the design patterns during the analysis and requirement phase of SDLC(Software Development Life Cycle).
Design patterns ease the analysis and requirement phase of SDLC by providing information based on prior hands-on experiences.

Categorization of design patterns:

Basically, design patterns are categorized into two parts:
  1. Core java (or JSE) Design Patterns.
  2. JEE Design Patterns.

Core Java Design Patterns

In core java, there are mainly three types of design patterns, which are further divided into their sub-parts:

1.Creational Design Pattern

  1. Factory Pattern
  2. Abstract Factory Pattern
  3. Singleton Pattern
  4. Prototype Pattern
  5. Builder Pattern.

2. Structural Design Pattern

  1. Adapter Pattern
  2. Bridge Pattern
  3. Composite Pattern
  4. Decorator Pattern
  5. Facade Pattern
  6. Flyweight Pattern
  7. Proxy Pattern

3. Behavioral Design Pattern

  1. Chain Of Responsibility Pattern
  2. Command Pattern
  3. Interpreter Pattern
  4. Iterator Pattern
  5. Mediator Pattern
  6. Memento Pattern
  7. Observer Pattern
  8. State Pattern
  9. Strategy Pattern
  10. Template Pattern
  11. Visitor Pattern

Creational design patterns

Creational design patterns are concerned with the way of creating objects. These design patterns are used when a decision must be made at the time of instantiation of a class (i.e. creating an object of a class).
But everyone knows an object is created by using new keyword in java. For example:
  1. StudentRecord s1=new StudentRecord();  
Hard-Coded code is not the good programming approach. Here, we are creating the instance by using the new keyword. Sometimes, the nature of the object must be changed according to the nature of the program. In such cases, we must get the help of creational design patterns to provide more general and flexible approach.

Types of creational design patterns

There are following 6 types of creational design patterns.
  1. Factory Method Pattern
  2. Abstract Factory Pattern
  3. Singleton Pattern
  4. Prototype Pattern
  5. Builder Pattern
  6. Object Pool Pattern

Factory Method Pattern

A Factory Pattern or Factory Method Pattern says that just define an interface or abstract class for creating an object but let the subclasses decide which class to instantiate. In other words, subclasses are responsible to create the instance of the class.
The Factory Method Pattern is also known as Virtual Constructor.

Advantage of Factory Design Pattern

  • Factory Method Pattern allows the sub-classes to choose the type of objects to create.
  • It promotes the loose-coupling by eliminating the need to bind application-specific classes into the code. That means the code interacts solely with the resultant interface or abstract class, so that it will work with any classes that implement that interface or that extends that abstract class.

Usage of Factory Design Pattern

  • When a class doesn't know what sub-classes will be required to create
  • When a class wants that its sub-classes specify the objects to be created.
  • When the parent classes choose the creation of objects to its sub-classes.

UML for Factory Method Pattern

  • We are going to create a Plan abstract class and concrete classes that extends the Plan abstract class. A factory class GetPlanFactory is defined as a next step.
  • GenerateBill class will use GetPlanFactory to get a Plan object. It will pass information (DOMESTICPLAN / COMMERCIALPLAN / INSTITUTIONALPLAN) to GetPalnFactory to get the type of object it needs.
factory pattern

Calculate Electricity Bill : A Real World Example of Factory Method

Step 1: Create a Plan abstract class.
import java.io.*;      
abstract class Plan{  
         protected double rate;  
         abstract void getRate();  
   
         public void calculateBill(int units){  
              System.out.println(units*rate);  
          }  
}//end of Plan class.  
Step 2: Create the concrete classes that extends Plan abstract class.

class  DomesticPlan extends Plan{  
        //@override  
         public void getRate(){  
             rate=3.50;              
        }  
   }//end of DomesticPlan class.  
 
class  CommercialPlan extends Plan{  
   //@override   
    public void getRate(){   
        rate=7.50;  
   }   
//end of CommercialPlan class.  
  1. class  InstitutionalPlan extends Plan{  
  2.    //@override  
  3.     public void getRate(){   
  4.         rate=5.50;  
  5.    }   
  6. /end of InstitutionalPlan class.  
Step 3: Create a GetPlanFactory to generate object of concrete classes based on given information.


class GetPlanFactory{  
      
   //use getPlan method to get object of type Plan   
       public Plan getPlan(String planType){  
            if(planType == null){  
             return null;  
            }  
          if(planType.equalsIgnoreCase("DOMESTICPLAN")) {  
                 return new DomesticPlan();  
               }   
           else if(planType.equalsIgnoreCase("COMMERCIALPLAN")){  
                return new CommercialPlan();  
            }   
          else if(planType.equalsIgnoreCase("INSTITUTIONALPLAN")) {  
                return new InstitutionalPlan();  
          }  
      return null;  
   }  
}//end of GetPlanFactory class.  
 
 
Step 4: Generate Bill by using the GetPlanFactory to get the object of concrete classes by passing an information such as type of plan DOMESTICPLAN or COMMERCIALPLAN or INSTITUTIONALPLAN.

import java.io.*;    
class GenerateBill{  
    public static void main(String args[])throws IOException{  
      GetPlanFactory planFactory = new GetPlanFactory();  
        
      System.out.print("Enter the name of plan for which the bill will be generated: ");  
      BufferedReader br=new BufferedReader(new InputStreamReader(System.in));  
  
      String planName=br.readLine();  
      System.out.print("Enter the number of units for bill will be calculated: ");  
      int units=Integer.parseInt(br.readLine());  
  
      Plan p = planFactory.getPlan(planName);  
      //call getRate() method and calculateBill()method of DomesticPaln.  
  
       System.out.print("Bill amount for "+planName+" of  "+units+" units is: ");  
           p.getRate();  
           p.calculateBill(units);  
            }  
    }//end of GenerateBill class. 


Preprocessor instruction in C # pragma

The #pragma preprocessor directive is used to provide additional information to the compiler. The #pragma directive is used by the compiler to offer machine or operating-system feature.
Syntax:

#pragma token  
 
Different compilers can provide different usage of #pragma directive.
The turbo C++ compiler supports following #pragma directives.

#pragma argsused  
#pragma exit  
#pragma hdrfile  
#pragma hdrstop  
#pragma inline  
#pragma option  
#pragma saveregs  
#pragma startup  
#pragma warn  
 
Let's see a simple example to use #pragma preprocessor directive.

#include<stdio.h>  
#include<conio.h>  
  
void func() ;  
  
#pragma startup func  
#pragma exit func  
  
void main(){  
printf("\nI am in main");  
getch();  
}  
  
void func(){  
printf("\nI am in func");  
getch();  
}  
Output:
I am in func
I am in main
I am in func

Wednesday, 26 April 2017

Future of Digital Marketing in India

The advent of the digital marketing has opened up a novel landscape of doing business i.e. online business.
According to a survey- by 2017, India will have around 600 million internet users that ultimately create a fascinating business opportunity to sell services and products to a growing population of tech-savvy internet users. Recently, booming prevalence of digital India campaign is also adding lots of new flavors and fervors to the future of digital marketing in India. Growing startup trend is another reason that plays significant role in creating a great scope of digital marketing in India. The most common problem that startups face is lack of funds and digital marketing can rescue them as the most cost-effective blessing in disguise. It is highly economical and equally powerful way of conversion-oriented marketing. All the digital marketing maneuvers can also be quantified through powerful digital marketing tools like Kissmetrics, Google Analytics, Google Website Optimizer, etc. that make it one of the most result-oriented modes of marketing.
       There are more than 900 private TV channels and 250+ radio stations in India, which make traditional marketing quite expensive and highly confusing with lots of in-built vacillations. However, in today’s world of internet, Digital Marketing is the only one and most guaranteed way of marketing, which is popularly being the most preferred space of marketing communications and related interactions.
Changing statistical dynamics of future of Digital Marketing in India are-statistics-about-future-of-digital-marketing-in-india
The future of marketing is way beyond the traditional marketing or outbound marketing methodologies that have been using TV and radio ads, print ads, hoardings, banners, magazines, etc. Now, marketing is majorly based on online marketing (inbound marketing) — Marketing in the Digital Sphere. Scope of Digital Marketing provides some of the most powerful techniques of marketing where traditional modes of marketing fail.
Digital Marketing has great panjandrum over entrepreneurs as it not only rescues but also empowers them to optimize their startups in the most cost-effective and quickest possible fashion. Future of digital marketing is going to be more encompassing in 2017, thanks to its ability to offer wide range of economical, powerful and contemporary mechanisms and mediums of marketing.
Digital marketing takes things into consideration like –
  • Page rankings in search engine results
  • Advertising on search engine platforms
  • Conversion through SMO & SEO campaigns
  • Optimization of internet marketing & associated ROI
  • Banner ads on other websites & Marketing on Digital World
Key findings of some of the Recent Digital Marketing Surveys are –
  1. 34% of the companies already had an integrated digital marketing strategy in 2016
  2. 72% marketers believe that traditional model of marketing is no longer sufficient
  3. Company revenue driven by internet marketing will get increased by 30%
  4. In 2017, 80% businesses will increase their digital marketing budget
  5. Digital Marketing budget may surpass the IT budget in 2017

Future Trends of Digital Marketing in India

Digital Marketing will remain as the most powerful and result-oriented way of marketing in 2017 too, and some of my observations on current and future outlook of 5 key channels that will pay key role in deciding future of digital marketing in India are–

1. Mobile Marketing

To devise result-oriented marketing plans and campaigns, mobile marketing is going to play one of the most significant roles in 2017. Understanding customers’ changing needs and characteristics lets marketers plan in a result-oriented fashion. As per stats-
  • Current Outlook of Mobile Marketing in Driving Customer-Engagement- 40% (approx)
  • Future Outlook of Mobile Marketing in Driving Customer-Engagement- 75% (approx)
From consumers’ device usage perspective, Smartphone adoption and prevalence of mobile apps and messaging are going to be the topmost trends of digital marketing in 2017. From Facebook’s Mobile Messenger, to Whatsapp and WeChat, we have been witnessing the growing wish of consumers to communicate directly through mobiles compared to public social network pages. 2017 will come with some of the new options for paid media on mobile messaging apps that will further be boosted by artificial intelligence, which is another trend that will go hand in hand with mobile marketing. Brands are developing bots to engage customers, and Facebook’s Bot Engine for Messenger and Google’s new assistance service introduced in Google I/O 2016 indicated towards the rise of Artificial Intelligence to provide more personalized and interactive assistance to consumers through mobile marketing.
  • More than 52% of searches are done through mobile.
  • 89% of Facebook Daily Active users come through mobile.
  • 83% of Facebook advertising revenue comes through Smartphones.
  • 92% of mobile media time is spent in Smartphone apps by consumers.mobile-marketing-is-going-to-be-a-top-future-trend-of-digital-marketing

2. Video Marketing

Modern customers prefer to view a video content on company promos. Growing need for the visual content has turned video marketing be one of the most appealing trends of digital marketing in 2017. When a visual content is well produced to communicate the message in an interactive and engaging way, conversions are always guaranteed.
  • Current Outlook of Video Marketing in driving Customer Engagement- 37%
  • Future Outlook of Video Marketing in driving Customer Engagement- 69%
Video content is swallowing up the content marketing and online marketers take advantage of its power to tempt more customers in quickest possible time. With booming mobile marketing, videos are now offered on mobile phones that fuel up the whole process. Video marketing is the most powerful way that companies use for –
  • Introducing themselves
  • Spreading their messages
  • Promoting their products/services
  • Increasing their reach and optimizing search ranking
  • Boosting customer engagement and enhancing returns on investments
 Different kinds of Trending Video Content are-
  • Social Media Videos like Facebook Videos, Facebook 360 Videos, YouTube Videos, Snapchat Videos, etc.
  • Use of GIF videos on different social media channels like Twitter & Facebook
  • Product Description/Demo Videos and Landing Page Videos
  • Storytelling with the help of live streaming videos
  • Use of Videos in Email Marketing

3. Email Marketing

Email marketing is so effective in nurturing leads and ensuring conversions. Email marketers of some of the most successful marketing agencies claim a return of $40 for every dollar they invested. Well-targeted email marketing will be one of the most effective ways of ensuring conversions in 2017. 
  • Current Outlook of Email Marketing in Driving Customer Engagement- 45%
  • Future Outlook of Email Marketing in Driving Customer Engagement- 57%
Email marketing is the most important part of your business branding and you need to choose those trends that befit with your customer profile and business objective.  Your emails should reflect your quality and using professional email templates should be the base of your e-mail marketing campaign in 2017. Some of the top trends of email marketing in 2017 are-
  • Use of Email automation tools for sending and tracking of targeted and personalized emails that will let you understand more and more about your customer base like their demographics, tendencies, age, loyalty, etc.
  • Integration of social media content in email marketing strategy is another trend that will see great rise in 2017. Marketers will preferably provide references to their social content within their emails.
  • 2017 will see a decrease in email blast, as this year would be of customized mails. Mobile-friendly email marketing is another trend that will be quite popular within the domains of digital marketing.
  • Aesthetically appealing animated emails are also going to be a popular trend of digital marketing as such fun new mails entice visitors and hold their attention that ultimately aids in conversions. 

4. Social Media Marketing

Social media changes quickly as there are dozens of new platforms arrive each year. The year 2017 will also be a host for the variety of new social media trends, and social media marketing will for sure be one of the most popular digital marketing channels for branding, optimization, lead generations and conversions.
  • Current Outlook of Social Media Marketing in Driving Customer Engagement- 36%
  • Future Outlook of Social Media Marketing in Driving Customer Engagement- 55%
As social media keeps evolving, it has a massive power to channelize marketing campaigns in innovative and effective ways. Social media is a medium that adeptly responds to new tech innovations, but at the same time, it also exceeds customer’s expectations. Knowing future trends of social media and planning strategy as per that will ensure success for companies. Some of the key social media trends in 2017 are –
  • Enormous evolution of Snapchat is going to be one of the most interesting, powerful and creative trends of social media marketing in 2017.
  • Live video streaming is slowly changing the scenario of social media campaigns, and the trend will see great rise in next year too. Different platforms like Facebook live, SnapChat, Twitter, and Instagram all are blending live streaming videos that will let them be a top pick for marketers.
  • Live videos also ensure 10 times more comments than pre-recorded videos, and such qualities will let them dominate social media marketing more efficaciously
  • Instagram stories, social slideshow ads, social chats, etc. would be the top components of social media marketing in 2017.

5. Search & SEO Marketing

Search engines evolve constantly, and their changes prompt shift in marketers’ ways of targeting audiences. To succeed, it is important for you to know latest changes of SEO marketing and employing effective search engine strategies accordingly. Mobile marketing and social media optimization has enhanced the frequencies of searches all across the globe, and as per statistics, 14 billion web searches are conducted each month through different search engines.
  • Current Outlook of SEO Marketing in driving Customer Engagement- 21%
  • Future Outlook of SEO Marketing in driving Customer Engagement- 40%
  Some of the SEO trends that will turn out to be major hits in 2017 are-
  • Link building will stay as a powerful SEO technique, mobile marketing will rock the house, and along with Google, other search engines will also play significant roles in ensuring great search results.
  • Use of keyword search tools like Google’s Keyword Planner, Moz’s keyword Planner are going to be the most effective trends to know right keywords that your audiences search.
  • Quality content marketing with perfect blending of video content would be another prudent practice that experts think as the most dominant future trend of digital marketing in 2017.
  • Personalizing SEO campaigns as per target audiences, being creative, use of natural links and moving site to HTTPS will be the SEO trend that will decide future of internet marketing campaigns in 2017.moving-site-to-https-is-smoothing-that-google-will-love
Conclusion 
To survive in today’s competitive and frenzied market scenario; it is must for Indian businesses to have a well-integrated internet marketing strategy. Without Digital Marketing, businesses may fall short of creating contemporary marketing strategies and hence, they may turn directionless. Digital Marketing is the present and the future of marketing that will not only let businesses survive but also thrive in the most result-oriented fashion. Including new techniques, following latest updates of Google and incorporating future trends of digital marketing will let your inbound marketing reap great benefits for you in 2017.
In the year 2016, most of the industries were kind of struggling with a growth rate around 6 to 11%; only digital industry saw a growth rate of 41%, which is not going to be stagnant in 2017 as well. Digital Marketing will for sure remain as the most effective way of marketing in the future too, and it will be worthwhile for you to climb on to the digital bandwagon when the time is right, either career-wise or business-wise.

Monday, 24 April 2017

Friday, 21 April 2017

What is the difference between double DES and 3-DES?

Double-DES is two successive DES instances, while Triple-DES is three successive DES instances.
Use 3DES and not 2DES because 2DES does not yield the security increase that you would believe. Namely, 2DES uses 112 key bits (two 56-bit DES keys) but offers a security level of about 257, not 2112, because of a "meet-in-the middle attack" which is well explained there (not to be confused with "man-in-the-middle", a completely different concept). Similarly, 3DES uses 168 key bits, but offers "only" 2112 security (which is quite sufficient in practice). This also explains why 3DES is sometimes used with a 112-bit key (the third DES key is a copy of the first): going to 168 bits does not actually make things more secure.
This can be summarized as: we use n-DES because a simple DES is too weak (a 56-bit key can be brute-forced by a determined attacker), but in order to really improve security, we must go to n ≥ 3. Of course, every additional DES implies some computational overhead (simple DES is already quite slow in software, 3DES thrice as much).

Current Issues with Cloud Computing

Cloud computing is steadily becoming a popular and cheaper option for most IT-reliant companies for various integral services to their operations. What used to be investments for servers, hardware and storage devices are now monthly service fees for virtual storage and applications that a network of computers can access anytime and anywhere with the right IT infrastructure.
Cloud computing
Although the emergence of great cloud-based computing companies like RingCentral and Dropbox that provide awesome services is such a treat for SMEs and startups, the way the technology is structures presents various issues that need to be addressed.

These issues include but are not limited to the following:

Security
Since the data isn’t protected by security measures you employed yourself, how sure can you be that the cloud computing company you contracted is taking every measure to keep it safe? And who are they keeping it safe from? The data itself is stored on the service provider’s own infrastructure. You pay them to store it and manage it, along with giving you a way to access and change the data. But how about the people who access it illegally? How does your service provider prevent this? Since the service provider hosts the data, is it allowed access to it, or must it simply facilitate your usage? Before you ump headfirst into the trend, make sure you ask your service provider what it does to secure the data you upload.

Tampering
In relation to data security, your data may be tampered while it is under the purview of  your service provider’s infrastructure. While the data may not be taken or deleted, it can be changed or modified.

Data ownership
The transference of data to servers that aren’t physically-owned by the authors or uploaders of the data themselves begs the question of whom does the data belong to? Lawmakers continue to debate and try to define the parameters of the data stored in the cloud as to whose the pieces are, or if it’s actually owned by no one.

Impact on other industries
VoIP phone services are basically telephony solutions that work through software phones and access to cloud-based computing services and applications. The great price difference from a landline phone system may impact the PSTN-based companies greatly when users switch to digitized and cheaper systems, creating more jobs but turning others almost obsolete. Although this move into the future may be favorable, old systems become outdated. New courses in education may emerge from the shift while others that involve older technology may not be taught anymore.
So if you’re planning to switch to internet-based services for storing your files, making phone calls or collaborating on a project, consider the risks and issues that face this exciting new tech first before you decide it’s time for you to enter the future.