Saturday, 29 November 2014

7 ways to help your sales be more effective

Every organization wants its salespeople to be successful -- that is, close more sales. Yet ask many salespeople and they will tell you that their organization often makes it difficult for them meet their quotas, requiring them to do lots of administrative work (e.g., enter data into a CRM system) or not providing them with mobile tools.
So what can organizations do to better support and free up their salespeople, so they can close more sales? Here are seven sales strategies for success gleaned from sales and marketing experts.

1. Employ a sales-friendly CRM system.

"A good [sales-focused] CRM system can help your sales force stay organized and focused," says Mack Dudayev, CEO and cofounder, InsureChance, an online life insurance marketplace. "With features such as lead prioritization, automatic reminders, lead nurturing and notes, you can expect to see an increase in your sales team's closing ratio and improved productivity." Another benefit of CRM: "You can see how fast leads are being contacted, amount of attempts made, total sales and idle time."

2. Qualify leads.

"Define your target audience and recognize that people outside of that definition are more likely to be wasting your time than resulting in sales," says Al Huizenga, managing director of product at Sparkroom, which specializes in higher education performance marketing. "Third-party demographic and behavioral data from sources like Neustar can be appended to inquiries in real time to quickly evaluate how well [prospects] fit a defined target profile."
"It is counterproductive to hand leads to sales when those people are not ready for a sales conversation," says Katy Keim, CMO, Lithium Technologies, a provides social software to companies. Therefore, it's important to "take the time to understand the buyer's journey. Provide them with useful content. Then hand them to sales only when they demonstrate they are ready for a sales conversation."

3. Arm your sales force with the mobile communication and collaboration tools.

"Salespeople can spend the better part of their days in the field, so you need to provide them with easy, remote access to timely and critical customer and sales information through a mobile CRM solution or app," says Anthony Smith, CEO and founder, Insightly, a small business CRM and project management Web app. "This allows them to always work with real-time data and to update a prospect's information immediately, rather than wait until they're back in the office, enabling managers to effectively track data through the sales funnel."
You should also "make it easy for your salespeople to have instant access to the latest product specs and contracts from any device -- laptop, tablet or phone," says Bill Carovano, senior director, Product Management, Citrix, a provider of cloud, mobile, virtualization, collaboration & networking solutions. "And since they're going to need to be able to draw up or edit documents, say a contract to close a deal at the end of a quarter, ensure that they can easily do so without jumping across multiple apps and devices."
As for signing contracts, consider using a service such as DocuSign. "This is a wonderful tool that lets your sales team get sales orders and agreements signed electronically," explains Dudayev. "When out in the field, the salesperson can make changes as necessary, using an iPad to get a digital signature."
Finally, because "communication is crucial, if you don't already have an enterprise-level communication app in place, it's time to get one," says Michael DeFranco, CEO, Lua, a mobile messaging provider. "Instantaneous communication coupled with data security and privacy lead to better [sales and] customer experiences, fewer errors and employees that work as one cohesive force."

4. Offer regular training and opportunities to share best practices.

"Top performing sales organizations invest in the development of their teams," says Mark Donnolo, a sales compensation strategy/design expert and founder of SalesGlobe, which helps sales organizations be more effective. "From technical training on products and services to sales process training, or gathering regional teams together once a year to share best practices, a well-planned training and development program provides a measurable ROI," he says. "In addition, training helps to retain top performers and shift critical middle performers into top performers."

5. Minimize time spent on administrative tasks.

"Almost all sales roles have non-selling administrative or customer service aspects," notes Donnolo. "But too often, those activities take up more time than the selling activities," he notes.
"Organizations that understand how to minimize the amount of time salespeople spend doing administrative tasks, such as data entry, win by helping them be more productive," says Somrat Niyogi, cofounder & CEO, Stitch, a sales automation app.
So what can organizations do to minimize the amount of admin work for salespeople? They can hire sales support personnel and/or make sure non-sales issues get routed to the right department, be it marketing, tech support or customer service, says Donnolo. They can also provide tools that make it easy to enter customer data from a mobile device, says Niyogi.

6. Employ gamification strategies.

"Gamification taps into the natural competitive streak in reps and delivers positive results as reps strive to climb to the top of the leader board," says Leslie Stretch, CEO, CallidusCloud, a SaaS provider of sales effectiveness technology. "Give points not just for customer wins but also for sales activity -- getting a new lead or face-to-face meetings with senior executives," he advises. "According to a report from Aberdeen Group, companies do better on their quotas with gamification: with it 85 percent of reps attain their quota and 51 percent of new hires achieve their numbers in their first year. While in the absence of gamification, only 78 percent of reps make quota and only 42 percent of new hires meet their numbers."

7. Track performance and identify areas for improvement.

"The most important thing you can do to improve your [sales team's] performance is to figure out how well [they're] actually performing now and then make a plan to [help them do] better," says Huizenga. So you need have a system in place that tracks sales performance throughout the sales cycle, so managers can analyze and measure how each member of the sales team is doing -- and then determine where he or she needs help.

Tuesday, 25 November 2014

5 Tips To Creating A More Usable E-Commerce Site

E-commerce is a very competitive field because your rival is no more than a click away. If a customer doesn’t like your site, he simply looks for another e-commerce site to buy products from. If you want to gain more customers and attract attention, you want to make sure that your website is as usable and as customer-friendly as possible.

It doesn't matter if your prices are very low or you have the best products in the market because if customers get confused navigating your website, reaching a preset target will likely be difficult.

Usability means that you have to make the buying process as quick and as easy as possible. These tips will let you create a more usable e-commerce website that can create higher conversion rates.

1. Call To Action & Sign-Up Buttons

Avoid lengthy sign-up forms that can take a few pages or so before visitors can successfully register to your site. As an e-commerce site, you don’t actually need to know their address, phone number, what kind of work they do, etc. A simple email address and a password are just all you need. That being said, never underestimate call-to-action buttons as this help in building higher conversion rates and improving site usability. Make these call-to-action buttons stand out.

2. Buying Without The Need To Register

One thing online shoppers hate the most is the long and tedious sign-up process before finalizing a purchase. What if you go about allowing guest users to checkout products without the need to register, then ask them afterwards if they want to sign up, to make the next purchase on your site easier? This kind of method is known to increase sales (up to the tune of $300 million), improve customer retention, and reduce cart abandonment.

3. Search Function

Search functionality helps customers to find what they are looking for, making their shopping experience more satisfying than frustrating. Who would want to go from one page to another, read the description of every product you have in your online store, just to find what they are looking for these days?

4. Breadcrumb Navigation


When placing orders, customers have to know where they stand in their purchase process – how many steps have they accomplished, and how many more to go. Without breadcrumb navigation, customers will easily get bored and think your shopping procedures take forever, making them more likely to just abandon their purchases, halfway through.

5. Shopping Cart

No e-commerce website is complete without proper content management and personal detail security. Shoppers should feel confident in buying products at your e-commerce site, so you need to assure them that your site is a reputable site that has features to protect the privacy of your customers. Get a trust certificate like Hacker Safe or VeriSign and an updated SSL certificate to build up customer trust and offer better shopping security.

Suggest Related Items

The way Amazon.com suggests related items, like batteries, accessories and peripheral products when a buyer is purchasing a laptop, not only help save the customer’s time but also helps increase revenue and customer retention on your e-commerce site.

Hidden Charges

Customers hate agreeing to the price of a product only to find out that it is going to cost them 2% more when it is time to share their credit card details. Make sure that you display prices, taxes, shipping charges, discounts early, so that buyers know the final sum they will be forking out.

If you present your customers with a lot of unexplained costs, they will more likely to abandon their purchase, and even worse, their trust in your site will be broken.

Sunday, 23 November 2014

10 Ways to Deal With Upset Customers Using Social Media


1. You Can’t Respond to Conversations You Don’t See

Great response starts with great listening.
Set up Google Alerts for your brand and industry keywords.
Keep a close eye on your Facebook page.
Listen on Twitter.
Depending on the type of business you have, read reviews on sites such asYelp, TripAdvisor and Zagat.
Make a list of any forums or communities where your customers congregate andregularly check in on them.

Whether you’re paying attention or not, the conversations are happening. But a great listening program makes it easier for you to catch negative buzz and spot issues before they build momentum and become much harder to turn around.

Google alerts are free, easy to set up, and instantly help you keep an eye on key conversations.

2. Determine if it’s Worth a Response

Not all negative comments are worth a response, and not all critics are worth trying to win over. Sometimes, as hard as it can be, it’s best just to move on.

Avoid these situations:
  • The criticism is on a really small blog or forum, and your response will only bring attention and credibility to an issue nobody saw in the first place.
  • It’s a blatant attack that’s clearly rude and outrageous—and anyone who reads it can see the critic has a personal problem.
  • A known crackpot who is only looking to pick a fight.

There’s just no way to win in these scenarios. So stay out, move on, keep your head up and focus on the wrongs you can right.

3. Act Quickly

When you’re facing negative word of mouth, time is not on your side. The longer you wait to respond, the angrier the customer will get—and the more likely others will pick up on the issue and spread the negative buzz.

At the very least, say this:


“Hi, my name is ____ and I hear you. We’re looking into it now, and I’ll get back to you as soon as possible. If you have any questions, contact me directly at _____.”

A message like this does two things:
  • The ranter knows he or she has your attention—there’s much less incentive to keep spreading the anger and
  • It makes a real person with real contact info available, so if the person is still angry, you’ve at least specified a place to vent other than online.

4. Speak Like a Human

The only thing worse than ignoring upset customers is to respond with a canned corporate response. If you thought they were mad before, wait until you see how they react to an excerpt of your policy terms and fine print.

Show empathy, communicate in a friendly tone and use your real name. And if the forum supports it, it helps to include your actual photo.

It’s easy to yell and scream at an anonymous company. But when someone shows up and says, “Hi, this is Emily and I’m so sorry for the trouble…” it changes everything.

The critic now realizes he wasn’t yelling at a giant, faceless company. He was yelling at Emily. Quickly, the anger fades—and you’ll often get an apology.

Check out how Zappos replies to this fan. It’s human; it’s friendly. And even though they couldn’t immediately fix the problem, you can bet this fan will be back.

Check out Zappos’ Facebook page for a real-time guide on how to respond in a personable, friendly tone.

5. Offer a Real Apology or Don’t Apologize

A strong, direct apology will always earn more respect than a flimsy, “kinda-sorta” apology.

Consider the difference between an apology like “We’re sorry you feel that way” to “Absolutely, positively unacceptable”—which was the headline to FedEx’s blog postafter a delivery driver was caught throwing a package over a customer’s fence. The post included this straightforward video from Matthew Thornton, a senior vice president at the company:

And it doesn’t get much better or more direct than Jeff Bezos’ apology for how they handled pulling copies of 1984 and other novels off Kindles:


This simple, straightforward apology from Jeff Bezos drew more than 750 overwhelmingly positive responses.

6. Offer to Make it Right

Apologizing is part of turning around negative word of mouth, but to actually fix a problem is how you really win over critics.

We all make mistakes. It’s how we fix them that people remember.

At burrito chain California Tortilla, making it up to customers is part of every response they send when someone is upset. It’s this simple:


California Tortilla replies to every upset customer with a simple, straightforward offer to make it up.

7. Never Get into a Fight

Any time you win an argument online, you’re losing. All anyone really remembers is that you’re combative.

This doesn't mean you can’t respond, explain your side of the story and start a conversation. You just need to be in the right mindset:
Don’t get emotional.
Remember, it’s a real person. Just as they see you as a faceless company, it’s easy to see them as just another complainer.
The critic is actually doing you a favor. They’re helping you learn to be a better company. For every person who actually speaks up, many more walk away quietly, never to return.

For more on how to reply, check out this quick explanation from Jeff Diamond of Oakland’s Farmstead Cheeses and Wines:

8. Keep the Discussion in the Open

When a negative issue comes up, a common gut reaction is to ask to move the conversation offline. But when you do this, the world can’t see all the effort you put into fixing the problem.

Nobody sees the private email where you give that sincere apology. We can’t search for that phone conversation where you politely explain why the situation happened in the first place.

But when you do it online, in public, you earn word of mouth. For the same effort and cost, thousands more people see that you actually care about customers. Plus, you save on all the people who now don’t need to call in (or write a similarly angry post) to find an answer to the same question.

Graco’s quick and transparent use of Twitter during a recall of more than 2 million strollers, for example, helped get an important message out much more quickly, showed customers how much they cared and it just might have saved some lives, too.

Customers were thrilled with how Graco kept them updated and informed during a product recall.

9. Use Fans and Third-Party Sources to Help Tell the Story

What you say about yourself isn’t as powerful as what others say about you. It’s true when people are promoting you, and it’s true when people are calling you out.

When their brand was under attack from a competitor-led PR campaign, UPS’ Debbie Curtis-Magley and her team pointed to third-party content from news articles and industry experts to help explain the full story.

And even more powerful than experts can be the voice of your fans. You never want to put them in an uncomfortable situation, but it’s OK to ask for help sometimes.

For example, a blogger might share how he’s frustrated with a particular product feature. In which case, you might turn to your Facebook or Twitter fans with this message:


“Hey guys! Chris over at [blog name] is having trouble with [feature]. Can anyone share how they’re using it?”

10. Involve Them in the Fix

If someone’s criticizing you, it’s often just a form of tough love. They’re doing it because they care. They see potential, and they want you to do better.

So instead of seeing them as critics, start looking at them as frustrated fans that might have some worthwhile ideas.

On one hand, Dell’s IdeaStorm is just a big list of things people think they’re doing wrong. But it’s actually a release valve—a proactive community that gives people with ideas, suggestions and complaints a place to share and vote on their favorites.

Every idea on Dell’s IdeaStorm can be voted up or down, and Dell keeps everyone updated on progress.

A platform like IdeaStorm isn't right for everyone, but giving your biggest critics a way to get involved is. Try inviting yours to customer advisory boards, beta tests of new products and brainstorming sessions.

See! Negative word of mouth doesn't have to be so bad after all.

How do you handle critics? How are you making the most of negative word of mouth?


How are you responding to upset customers? No matter what you sell or what industry you’re in, you’re going to experience negative word of mouth. You know, those customers who are expressing their complaints on social media.

It just happens.
Things break, problems come up and employees have bad days. But it’s how you handle it that separates you from everyone else.

Remember: Negative word of mouth is an opportunity.

A great response strategy can convert angry and upset customers into loyal, raving fans. The rule of thumb is that while unhappy customers talk to 5 people, formerly unhappy customers you win back talk to 10.

So get out there and embrace the negativity. Start responding. Here are 10 steps you can take to stop the negative, earn new fans and generate a ton of respect.

Saturday, 22 November 2014

Test Driven Development - TDD

Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: first the developer writes an (initially failing) automated test case that defines a desired improvement or new function, then produces the minimum amount of code to pass that test, and finally refactors the new code to acceptable standards. Kent Beck, who is credited with having developed or 'rediscovered' the technique, stated in 2003 that TDD encourages simple designs and inspires confidence.[1]
Test-driven development is related to the test-first programming concepts of extreme programming, begun in 1999,[2]but more recently has created more general interest in its own right.[3]
Programmers also apply the concept to improving and debugging legacy code developed with older techniques.[4]

Wednesday, 4 June 2014

PHP Interfaces

Lots of developers struggle to grasp the concept of the "interface" in PHP. But once they get the idea and understand how it works, they then struggle with a new problem: writing interfaces that are too complicated.

This might seem like a contradiction in terms: after all, we want to create comprehensive interfaces that describe the behaviour of a particular object type. And since we don't generally want to extend the interface, shouldn't the interface we write be complete?

Yes, and no. Let me explain.

The overbearing interface

Let's take a look at a common database interface that many of developers come up with when they're tasked with writing a database layer:

<?php
    interface MyDBObject {
        public function connect($host, $db, $user, $pass);
        public function query($query, array $params);
        public function prepare($query);
        public function beginTransaction();
        public function commit();
        public function rollback();
    }


This interface looks good: it handles the connection and the connection-level functionality without adding in query-specific behaviours. That's what we want.

But then let's pose the question: what happens when you encounter a database that doesn't support transactions?

Most modern databases are ACID compliant. But some still aren't. And what happens when you have to implement one of those?

Their answer is often to simply leave the transaction-aware methods blank. But this is a problem, because the Interface Segregation Principle says that no object should be required to implement a method it doesn't use.

Oops.

Fixing the interface

PHP doesn't require that we use a single interface for each object we create. In fact, the beauty of PHP interfaces is that we can implement lots of them, even though we don't have the ability to do multiple inheritance.

So, to solve this problem we can break this interface into *two separate interfaces*:

<?php
    interface MyDBObject {
        public function connect($host, $db, $user, $pass);
        public function query($query, array $params);
        public function prepare($query);
    }

    interface TransactionAware extends MyDBObject {
        public function beginTransaction();
        public function commit();
        public function rollback();
    }


There, now we have two interfaces we can use. Great! This lets us implement only those methods we need for older, non-ACID compliant databases, while giving us the methods we need for modern database applications.

Avoiding "God" objects

Another common error is the creation of an interface that does *everything*. Even if a behaviour is in scope for a particular object, that doesn't mean we should necessarily implement it in this object.

Let me explain.

The Imagick library in PHP has a single object that has literally hundreds of public methods. The object interface is huge.

This is a classic "God" object. The object is enormous, and probably does far more than it should.

My general rule of thumb is that an object should have no more than six to eight public methods or it is probably overreaching. Of course, this is not a hard and fast rule: there are many objects with a single role that have ten or twelve methods. But it is a good rule for the start of the evaluation process, and for taking a hard look at your object.

The bottom line

Creating an overbearing object or an inflexible interface is a good way to end up with objects that describe behaviours that are out of scope or not even implemented. We want to avoid both. Discrete, clean interfaces are preferable in all cases, and that's what we should strive to achieve.

Friday, 23 May 2014

Refactoring and Kata

Martin Fowler has a pretty good site on refactoring - http://www.refactoring.com/

Coding Dojo Katas - http://codingdojo.org/cgi-bin/index.pl?KataCatalogue

PHP TDD Shopping Cart from scratch.

So, I've finally taken the plunge again and started seriously looking into refreshing my dusty old brain cells about TDD and unit testing.

Over the past few weeks I have been re-reading various books, reading articles and watching video-casts by some of the leading names surrounding Testing, TDD, Design patterns and tackling legacy code, and the inspiration has finally got to me that I just need to tackle this head on.  Consuming a wealth of information about greenfield and brownfield systems and how to tackle them.

I have also revisited daily coding Kata's, taking 15mins in the morning or evening to tackle a simple Kata to get my brain in "test first" mode.

The array of books and information I have consumed has been immense and I'll probably re-read and watch everything again, and get a different perspective on things, although I guess the main way to learn is by doing, which is why I raked through the archives (then ended up password resetting) my github account to allow me to post updates to here with my personal coding ventures.  I have only hooked up tonight's work, but I do hope to get a few of my Kata's in there for people who haven't seen them before, as well as links to where you can find these for practicing yourself.

Tonight's project has been getting the basis of a shopping cart system up and running TDD style. So you'll see at my github account, I've literally written 3 tests and a few lines or production code.  There is quite a way to go, but I do hope to take time and regularly update and work on this as a reference for anyone who wants to follow along or help out.


Well enough typing for tonight, here are a quick list of links to some resources I've been consuming the past while.

Github - https://github.com/williamcameron/tdd-cart
Art of Unit Testing - http://artofunittesting.com/ and http://www.amazon.co.uk/Art-Unit-Testing-examples/dp/1617290890/
Various Roy Osherove talks and videos on youtube.
Working Effectively With Legacy Code - http://www.amazon.co.uk/Working-Effectively-Legacy-Robert-Martin/dp/0131177052
Refactoting Existing Code - http://www.amazon.co.uk/Refactoring-Improving-Design-Existing-Technology/dp/0201485672/

Wednesday, 7 May 2014

Why you should never extend the interface

Hello, there
What's wrong with this code sample?

<?php
    class MyClass {
        public function myFunction() {
        }
    }
    
    class myOtherClass extends MyClass {
        public function MyOtherFunction() {
        }
    }
   
    class Controller {
        public function doSomething(MyClass $object) {
            $object->MyOtherFunction();
        }
    }



On first blush, it might seem that this is ordinary inheritance, and we're doing everything we should be doing. But there's something very wrong here.

The problem here is that we're extending the interface. Extending the interface itself isn't necessarily bad, but we're making a second mistake: we're then typehinting on the wrong object type.

Let's talk about why we want to avoid this practice.

The Liskov Substitution Principle
I've discussed the Liskov Substitution Principle a few times through this newsletter. But let's go over it again.

The Liskov Substitution Principle says that one object should be replacable with another object of the same type, without breaking the program.

In other words, all objects of type A should replace one another, and the application should work just fine.

But our code sample above has a big problem: we're typehinting on one object type (MyClass) but we're relying on the interface of a different object type: myOtherClass. This means that if we actually pass in an instance of MyClass, our application will break.

Let's fix it.
So, now that we know what the problem is, how do we fix it? There are three different possible solutions.

1. Treat as abstract. First, we can treat MyClass as an abstract class, and mark it abstract. We can then include the abstract method definition, but not the code. This fixes our typehint.


<?php
    abstract class MyClass {
        public function myFunction() {
        }
    
        abstract public function MyOtherFunction();
    }



Once we've done this, our typehint is accurate and we don't have to worry about the method we want not existing, because the abstract definition guarantees it.

2. Change the typehint for the object being used. Instead of fixing the base class, we can fix the typehint and typehint on the actual object type we want. This solves the problem by ensuring that we are telling the application precisely what to expect.

<?php
    class Controller {
        public function doSomething(MyOtherClass $object) {
            $object->MyOtherFunction();
        }
    }


Of course, we are now hinting on a specific object, instead of an interface. But this is still better than relying on an interface that may or may not exist in future.

3. Define different interfaces, and hint on the one we want. It's possible in PHP to define two interfaces, and implement both of them in the same object. For example:


<?php

interface MyClass {
  public function myFunction(); }
  
  interface myOtherClass extends MyClass {
    public function MyOtherFunction();
  }


With these two interfaces, we can typehint on the interface we want, but leave the implementation details up to the future object that's going to be created. We're still guaranteed a particular interface, and this makes it easy to follow the Liskov Substitution Principle.

Objects know one another by their interface.
Regardless of the solution you might choose, there's one rule that you have to remember and understand: objects know each other by their interfaces.

The public methods form the "interface" or "API" that other objects use to communicate with a given object. Outside objects know nothing of the internal protected and private methods an object has; they can't use them. So, an object's interface is the only way to describe it to the outside world.

This interface therefore define's an objects type. In PHP, interfaces can't define anything besides public methods, and this is by design: when we typehint, we're saying "give me an object that has these methods."

Thursday, 24 April 2014

Upgrading from Sagepay protocol 2.23 to Sagepay protocol 3.00

I have recently been involved in upgrading a sagepay integration on an ecommerce site from Sagepay Protocol v2.23 to Sagepay Protocol v3.00.

Once this has been actioned, I am to update this blog as a point of reference for anyone else working on a similar update.


Saturday, 22 February 2014

LinkedIn offer ability to block 'friends'

LinkedIn on Friday announced a new feature that members have been requesting for quite some time: the ability to block other members. It’s a feature that will no doubt be incredibly useful, especially on a social network where many can be relentless in their pursuit of making a professional connection.

In a post on the matter, Paul Rockwell, LinkedIn’s head of Trust & Safety, said they built the feature not only because it was requested but simply because it’s the right thing to do. The feature is being made active as of today to all members, Rockwell noted.

To enable member blocking, simply head over to your LinkedIn profile and navigate to the profile of the person you wish to block. Select “Block or report” in the drop-down menu located next to the Connect and Send InMail buttons.

Pro tip – if you want to avoid an awkward moment, enable anonymous profile viewing before doing so. That way, you can visit and block the person’s profile without them knowing about it.

Once blocked, neither you nor the person you blocked will be able to view each other’s profile. In the event that you are already connected with said person, that connection will automatically be severed. What’s more, you will no longer be able to communication with said person (not that you’d want to anyway) and all recommendations and endorsements will be removed.

PHP refactoring in legacy code

http://www.tomslabs.com/index.php/2012/01/php-refactoring-in-legacy-code/

The story we’ll talk about is a true story. It happened to be challenging and helped the team keep testing its beliefs in XP, iterative developments and code quality.

Product elevator statement

Imagine a well legac”ied” project you don’t know.
  • Product is a web forum with millions of messages.
  • We want to rebuild the categorization mechanism (messages are “categorized” meaning they are assigned to a category that best describes their content).
  • Mission : fix all bugs
  • “Short delay” and “no regression” are the words.
  • Only few people share the knowledge of the categories system to be refactored.
  • Numerous bugs (useless to mention that several generations of developers brought contributions to the project).
  • 20 commiters.
Background
From the team’s point of view, here are the goals we anticipated we needed to achieve:
  • Understand the expected behavior of the categorization mechanism
  • Bring no regression to the actual behavior
  • Replace the old mechanism by a new one
First decision we took was to use Git to work on that project. We won’t explain in details that choice (20 commiters, we wanted to avoid working in a dedicated branch for weeks and commit in the HEAD trunk of the project…). It has already been discussed here.

Refactoring strategy

As a Team, we decided to do the refactoring as follow:
  1. With the Product Owner, write BDD scenarii describing how the categories mechanism works
  2. Switch on the “Test Harness” by automating (implementing) the BDD scenarii
  3. Encapsulate ALL calls to the old categories mechanism behind an API (adding Unit Tests to that new API aswell)
  4. Based on the API contract, build the new mechanism relying on a new categories data model

1. Write BDD scenarii to describe the categorization behavior

First two weeks were spent “extracting” all the possible knowledge from the Product Owner about the product and translate it into BDD scenarii.
Example:

Given I am a visitor
When I go to url "http://www.infos-du-net.com.sf/forum/"
Then below the meta-category "Multimédia", I have the following sub-categories with content
| cat name                 | decrypted url                                      |
| Image et son             | http://www.infos-du-net.com.sf/forum/forum-20.html |
| Appareils photo, cameras | http://www.infos-du-net.com.sf/forum/forum-47.html |
| Consoles                 | http://www.infos-du-net.com.sf/forum/forum-29.html |
At the end of this step:
  • 100 BDD scenarii written
  • Shared knowledge of the expected application behavior

2. Switch on the “Test Harness”

We used Behat (PHP based) to implement the scenarii.
Some of the scenarii written with the Product Owner describe a behavior involving integration with third-party systems. They were not implemented because such tests, seen as “integration tests”, were seen as complicated and hard to maintain. We preferred to invest on Unit Tests by Contract (as well explained byJBrains).
Some scenarii were implemented but not automated because describing a behavior that highlights a bugor describing the future behavior. They got RED at the time of the implementation and would go GREEN by the end of the project.
At the end of this step:
  • The “Test Harness” is switched on !
  • Thanks to the Continuous Integration Platform, we are able to frequently test the categories behavior and ensure we will not break anything during the refactoring.

3. Encapsulate old categorization mechanism behind an API

Example of code BEFORE encapsulation (old DAO was FrmCategoryTable)

public function executeIndex(sfWebRequest $request) {

$categoryList = FrmCategoryTable::getForumList($idSite, $culture, $user);

}
In order to better test and avoid perturbation with other commiters, we’ve encapsulated all calls to the old category mechanism behind a new API.
We keep the calls to the old category mechanism, but we isolate them into a dedicated API.
Example of code AFTER encapsulation (new API is categoryProvider)

public function executeIndex(sfWebRequest $request) {

$categoryList = $this->categoryProvider->getAllCategories($culture, $brand, $country, ICategoryProvider::SERVICE_FORUM, $user);

}
Code that implements the new API

class CategoryProvider implements ICategoryProvider {
public function getAllCategories($culture, $brand, $country, $service, $user) {
$categoryList =
CatBrandAndCountryTable::getInstance()
->getAllCategories
($culture, $brand, $country, $service, $user);
return $categoryList;
}
}
At the end of this step:
  • The old mechanism is isolated behind an API
  • The “Test Harness” is still switched on !

4. Based on the API contract, build the new mechanism relying on the new categories data model

During the encapsulation step we’ve created the API that is the CONTRACT of our categories mechanism.
At this time we made the choice to start the implementation of the new API. It was probably not the best choice because for several days the new behavior was only partly implemented. We should have worked on another implementation of the API based on the CONTRACT we had extracted from the previous step.
Only once this is done, we should have switched from one implementation of the API to the other.
Code that implements the new API

class CategoryProvider implements ICategoryProvider {
public function getAllCategories($culture, $brand, $country, $service, $user) {

$categoryList = FrmCategoryTable::getForumList(
$siteId, $culture, $user, $categoryLevel);

}
}
At the end of this step:
  • The new mechanism is plugged (new DAO CatBrandAndCountryTable)
  • The “Test Harness” is still switched on !

Conclusion

  • Quite a big system was refactored without service interruption
  • No merge conflicts because we always committed in the trunk/HEAD
  • No projects conflicts because we isolated the pieces of code that were aimed to be re-factored
  • The writing of BDD scenarii WITH THE Product Owner helped implementing the right behavior and sharing the knowledge.

Kali Linux

Kali Linux Features

Kali is a complete re-build of BackTrack Linux, adhering completely to Debian development standards. All-new infrastructure has been put in place, all tools were reviewed and packaged, and we use Git for our VCS.
  • More than 300 penetration testing tools: After reviewing every tool that was included in BackTrack, we eliminated a great number of tools that either did not work or had other tools available that provided similar functionality.
  • Free and always will be: Kali Linux, like its predecessor, is completely free and always will be. You will never, ever have to pay for Kali Linux.
  • Open source Git tree: We are huge proponents of open source software and ourdevelopment tree is available for all to see and all sources are available for those who wish to tweak and rebuild packages.
  • FHS compliant: Kali has been developed to adhere to the Filesystem Hierarchy Standard, allowing all Linux users to easily locate binaries, support files, libraries, etc.
  • Vast wireless device support: We have built Kali Linux to support as many wireless devices as we possibly can, allowing it to run properly on a wide variety of hardware and making it compatible with numerous USB and other wireless devices.
  • Custom kernel patched for injection: As penetration testers, the development team often needs to do wireless assessments so our kernel has the latest injection patches included.
  • Secure development environment: The Kali Linux team is made up of a small group of trusted individuals who can only commit packages and interact with the repositories while using multiple secure protocols.
  • GPG signed packages and repos: All Kali packages are signed by each individual developer when they are built and committed and the repositories subsequently sign the packages as well.
  • Multi-language: Although pentesting tools tend to be written in English, we have ensured that Kali has true multilingual support, allowing more users to operate in their native language and locate the tools they need for the job.
  • Completely customizable: We completely understand that not everyone will agree with our design decisions so we have made it as easy as possible for our more adventurous users to customize Kali Linux to their liking, all the way down to the kernel.
  • ARMEL and ARMHF support: Since ARM-based systems are becoming more and more prevalent and inexpensive, we knew that Kali’s ARM support would need to be as robust as we could manage, resulting in working installations for both ARMEL and ARMHFsystems. Kali Linux has ARM repositories integrated with the mainline distribution so tools for ARM will be updated in conjunction with the rest of the distribution. Kali is currently available for the following ARM devices:
Kali is specifically tailored to penetration testing and therefore, all documentation on this site assumes prior knowledge of the Linux operating system.

Friday, 21 February 2014

Help! I'm drowning in legacy code!

It can be easy to feel dejected when looking at a pile of code you inherited from four generations of programmer ago. None of the best practices or principles. No tests. Hell, you're lucky if you even have objects that don't rely on PHP 4 style constructors. You're in legacy code hell.

But there's hope.

Software as a long game

Even though it can feel hopeless when starting at such a massive pile of crap, there is in fact hope. There is a redemption waiting for you. That redemption is found in a simple revelation: software is a long game.

Consider: that steaming pile of detritus you're working on didn't get that way overnight. In fact, it took a long time to get a code base that big together in the first place. Code takes time to grow. Rome wasn't built in a day, and neither was your application.

PHP has been around for a long time, over 10 years. Much of that time, PHP didn't many of the features that now make it a world class programming language. Add to that the fact that PHP's low barrier to entry means that best practices we now take for granted weren't known let alone followed means there's lots of in production business-critical code that we're now responsible for maintaining.

What can you do, today?

But everything doesn't need to be fixed overnight. In fact, it can't be fixed overnight, so relax.

Writing software is a long process that takes time. It's okay - in fact, it's expected, that you'll take time to make incremental changes. The first step is to make something better, today, that wasn't better yesterday. Refactor something small. Create a group of objects that talk to each other a little bit more reasonably. Decouple a few small things. Make incremental improvements.

As you move through the code, you have an opportunity to improve each part of it in small ways. Combined with the fact that new additions you make will adhere to current best practices, over time the code will begin to dramatically improve. That's how you make a difference in a legacy code base - through small, incremental changes over time.

To defend everything is to defend nothing.

And even though it's easy to be a perfectionist and think "everything has to be perfect", that kind of thinking won't get you where you need to go. Frederick the Great told his men, "to defend everything is to defend nothing." You have to pick and choose your battles. Maybe you can't refactor the entire database logic section this week. But if you can refactor one model, one controller, one function or one algorithm, you can make steady, incremental progress. And that's something.

Good luck!

Google Launches Project Tango

Google have today announced an experimental Android-powered smartphone with powerful 3D sensors called Project Tango. The phone is the latest project out of Google's Advanced Technology and Projects (ATAP) group.

"The goal of Project Tango is to give mobile devices a human-scale understanding of space and motion," Johnny Lee, ATAP's technical program lead, wrote in a Google+ post announcing the project.

The 5-inch phone will run Android and be equipped a series of 3D sensors capable of taking more than a quarter of a million measurements each second. Google envisions these sensors will have a number of applications from gaming to indoor navigation.

The phone is still in early stages of development, and the first prototypes will only be available to a limited group of developers. The first 200 prototypes, which Google expects to be distributed by mid-March, will go to a group of developers hand-picked by Google.

Google says many of those first devices will go to companies focusing on creating gaming, data processing and navigation and mapping application, but some units have been set aside for "applications we haven't thought it yet," Google said. Interested developers can sign up on Project Tango's website for a chance at getting one of the early prototypes.

Project Tango, though experimental, will likely play a big role in the upcoming Google I/O Developer Conference, which will take places from June 25 to 26.

Thursday, 20 February 2014

Why do object oriented principles matter, anyway?

Last week I was chatting with a friend who was asking me about object oriented programming. He asked me a pointed question that I thought deserved a broad and public answer. His question? "Why do these object oriented principles matter, anyway?"

It's a good question. You probably came to PHP writing procedural code, never caring about object oriented development. And maybe you've heard that object oriented development is the way of the future, but for now you haven't seen much of a need for it. You wonder, why does it matter?

There are three reasons you should care about understanding and mastering object oriented programming.

Object oriented programming is about reuse.
Writing object oriented applications is about being able to reuse code that you've written elsewhere.

For example, if you've developed a great database API, you may want to take that along to other applications. Rather than starting from first principles, this object gives you a starting point that you can use in other applications.

Reusing code reduces the time it takes to write new code. Period.

Frameworks are impossible without object oriented development.
Imagine Zend Framework or Laravel without the object oriented model. Would it be possible to create these frameworks with straight procedural code? WordPress has tried; diving into that code base is a sure way to end the day with a headache.

Simply put, the patterns and practices used in modern frameworks rely upon and require understanding object oriented principles. It's difficult if not impossible to work effectively within these frameworks without understanding these concepts.

PHP isn't the only language you'll ever use.
For most of us, we use PHP regularly, but it's far from the only langauge we'll ever use. In fact, most of us will work with Javascript, Python and maybe even some Ruby at some point or another. Those three languages I listed are all 100% object oriented.

PHP allows us to work with procedural code, but in the scheme of modern languages this is an exception, not a rule. You can write procedural code with Python or Javascript, but it's incredibly difficult. And since everything in Python and Javascript is an object, well, you're doing object oriented programming whether you want to or not.

Microsoft Launches OneDrive — Basically the Same as SkyDrive, but With 100GB Free if You Hurry

There’s not much in the way of surprises for today’s announcement by Microsoft of the general availability of its cloud storage service OneDrive.

The new name had already been previewed, and the product is largely the same as its predecessor, SkyDrive. New features include auto uploads from Android, adaptive personal video streaming a la Netflix and better document collaboration tools that don’t require a Microsoft account.

But as with SkyDrive, the main advantages of storing your stuff with Microsoft is that it should work well with Microsoft Office (unlike Dropbox) and that it’s not wedded to a company that also controls the dominant mobile platform, so it has more platform independence (unlike Google Drive). Also, OneDrive doesn’t do dumb things like store new photos for only 30 days (unlike Apple’s iCloud).

Other than that, the big advantage of OneDrive over SkyDrive is that the first 100,000 people to sign up get 100 gigabytes free for one year.

That’s just one of many possible freebies and tie-ins. Starting with a free base of 7GB, Microsoft will also give 3GB to users who connect their camera rolls, 500MB for users who refer their friends, 200GB for two years for Surface buyers and 100GB for Office 365 users. Additional storage costs 50 cents per gig per month.

Despite competition, there still seems to be plenty of room to grow in the cloud. For the OneDrive launch, Microsoft commissioned a study from Harris that found that 77 percent of people who have heard of cloud storage say they still have important files stored only on one device.

Microsoft said it planned to share details about OneDrive for Business at its SharePoint conference on March 3.

Tuesday, 18 February 2014

5 Ways to Learn SEO

For most websites, natural search is the most effective free digital marketing channel. Except for the human resources, platform costs, and other mostly hidden costs required to plan and implement search engine optimization, it is free.
As a result, I'm often asked for the best free ways to learn how to become an expert in SEO. The following are my five free go-to tips for learning SEO.
  • Moz.com’s Beginner’s Guide to SEO. The friendly folks at Moz (formerly known as SEOmoz) have developed this free beginner's guide to teach anyone willing to read through it. With helpful illustrations and cross-linked concepts, this guide is well done and worth reading. If reading on your computer screen isn't for you, download the free PDF version to print or take with you on your tablet.
  • Books. The public library system is still a great way to get an informal and free education. Check out one of the many SEO books in paper form, or look for a digital version to read on your e-reader. Because SEO changes quickly, books published more than a year or two ago may recommend tactics that are no longer considered ethical, especially in the link building space. For instance, optimizing press releases was once a valuable SEO tactic but has been devalued now due to abuse by some sites. Try these for trusted SEO education.
    • The Art of SEO, by Eric Enge, Stephen Spencer, Rand Fishkin, and Jessica Stricchiolia.
    • Optimize: How to Attract and Engage More Customers by Integrating SEO, Social Media, and Content Marketing, by Lee Odden.
    • SMX West Expo+ Pass. SMX West is an annual convention held in San Jose, Calif. focusing on search marketing. All-access passes run $1,695 for early registrants, with another $100 tacked on for on-site registration. But SMX is offering a free Expo+ Pass that gives access on the first two days (March 11 to 12, 2014) to the show’s keynotes, theater presentations, and meet the vendors participating. It is also including special "Plus" sessions, which feature case studies and best practices from well-known solutions providers like Stone Temple, Covario, and Google. Register before March 10 to get a free pass. Expo+ passes are $50 at the door and online after March 10.
    • Read the experts. SEO Industry blogs are full of recommendations, case studies and tips for improving SEO. Many also include SEM, content marketing, and other disciplines closely related to SEO and search marketing. The challenge is that they’re not organized in such a way that you can learn SEO by reading them. But remember that anyone can publish anything on the Internet, including inaccurate or unethical advice on SEO. Stick with the major sites who work with trusted industry experts to ensure that the advice received will indeed benefit your site instead of hurting it. Stick with the trusted resources and compare advice from other sites that seems questionable to what you read on these.
    • Start a blog. The key to learning SEO is practice. Reading all the books ever published won’t help you understand how to manage SEO in real life. But you might not want to practice on your ecommerce site at first. A blog or other practice site can help you tune your SEO skills without risking your ecommerce site’s performance. Blog about anything you’re interest in. Research keywords and practice targeting those phrases in your pages. Reach out to others interested in the same thing and practice networking and earning links. In time, you may even develop a new revenue source built from the ground up with SEO in mind.
    Free resources still involve investment. In the same way that SEO is free, free SEO education is only free until you factor in the cost of your time. Learning SEO is an investment in yourself and your site. Depending on how important SEO is to you or your business, you may want to consider investing more for a larger and faster performance increase.
    One of the best ways to learn more about SEO is to engage a reputable search-marketing agency to work on your site. Read more at “10 Tips to Hire a Great SEO Agency.” As it develops a strategy with you to improve your SEO, insist on understanding each element and why it’s important. You’re paying for the agency’s knowledge, it’s only fair that some of it should rub off on you.
    Attending classes in person can also speed up the learning curve. When you’re face to face with an instructor, you can ask questions, see their gestures, and examine their whiteboarding. These elements are lost in the free learning options and with online education.

Mastering Frontend Interviews: 10 Essential Concepts Every Developer Should Know

Frontend development interviews can be daunting, particularly with the breadth of topics covered. From JavaScript fundamentals to performanc...