Browsed by
Month: May 2016

Which knowledge management tools should we use?

Which knowledge management tools should we use?

There are several methods to make managing knowledge more common practice in each team.

Knowledge base

This is the most basic tool for managing information. One of the knowledge management principles mentioned earlier is to storing and sharing. Knowledge base satisfies them. There exist many sophisticated software tools to manage it and almost everybody broadly knows the biggest one. Wikipedia is probably the most major open knowledge management tool on the internet. You can use a custom library to configure your Wiki website. It is crucial to structure knowledge in this repository respectively to organization needs.

http://www.mediawiki.org/

Job rotation

Another very common technique to ensure that many people would know what to do is changing places. It consists of assigning an employee to different job positions or different organizational structures over the time. It lets to share knowledge about a variety of duties over the team. It also can help to reduce boredom and stress level of team members. However, some positions need a specialized knowledge which is very hard to teach other people. So it can be not easy to introduce new people, but it may be beneficial for him and all team knowledge.

Most of all let’s make sure that employee is at least a little eager to learn new thing. Otherwise, the role of team leader is to build this desire.

https://www.cornerstoneondemand.com/rework/employee-rotation-works
http://evolvingstrategies.com/job-rotations-overcoming-obstacles-and-developing-staff-to-their-full-potential/
http://www.wholestacksolutions.com/Blog/lack-of-job-rotation-is-limiting-transformation

Automatization

A lot of tasks we do in our everyday work is schematic. So we can automatize them in several ways. There exist many services to automate your daily workflow. For example, you can create a trigger to handle automatically the invoices that you get on mail to copy it to appropriate folder and set up an alarm to remind about it.

There are plenty of possibilities. You can create a script, use an on-line service or whatever you can imagine. It can speed up your work for sure. But you may ask where is the knowledge managing in this. Your knowledge could be processed by some automatic processes, which you can manage and share with others. That is management.

https://zapier.com/
https://ifttt.com/
http://blog.getbase.com/how-to-automate-repetitive-work-to-up-your-productivity
https://www.yast.com/productivity/15-common-business-tasks-automate/

Mentoring

The other type of learning in work could be mentoring. It requires that a more experienced team member take care of the person who needs some more knowledge. However, it not means that this mentor should make a lecture for him or some other kind of workshops. It is only needed that experienced (in some scope) worker would be open to answering to questions and willing to work with the less experienced man.

http://blog.teamtreehouse.com/share-knowledge-mentorship
http://chronus.com/mentoring-fixing-skills-gap-knowledge-transfer

Standup meetings

In Agile teams there is a practice to meet every day for about 10 minutes and tell your whole team what we did last day. This habit can increase the broad knowledge about team and responsibilities. Also, it can help with the problem when we have some question to the particular part of the system, and we don’t know who is responsible for it. It is not exactly the knowledge transfer, but it may help to spread the information where we can find the knowledge about some topics.

http://martinfowler.com/articles/itsNotJustStandingUp.html
http://blog.teamtreehouse.com/a-better-way-to-do-daily-standup-meetings

Code review

Another form of sharing knowledge about tasks and functionality which particular employee is involved in can be cross checking the code. According to this method, every change made by one team member should be check by somebody else. This practice could be extended to style, security, guidelines checking and improving code quality.

http://blog.jetbrains.com/upsource/2015/07/23/what-to-look-for-in-a-code-review/
http://blog.codinghorror.com/code-reviews-just-do-it/

Keeping consistent style and rules

Referring to code review, following one consistent standard of writing code can be valuable for project quality. It may decrease the time needed to read the code. Therefore the time of learning the new code, in uniform standards, can be considerably reduced. Some tools are helping us to keep a consistent style. For example, JSLint or StyleCop are tools with a defined set of rules to check the proper form of code. They can be used before developer tries to send the code to the repository and inform him about all violations.

http://www.jslint.com/
http://jshint.com/
https://stylecop.codeplex.com/

There are also many ready and reviewed style guidelines on the internet. They exist for different languages and can be easily found on the internet.

https://github.com/airbnb/javascript
https://github.com/rwaldron/idiomatic.js

Tests as a documentation

People tell that tests are the best documentation. There is a grain of truth in this sentence. If somebody looks on tests for some functionality, in most cases he can easily see what is done by this class and what is the test cases or use cases. This is another method to simplify maintaining and knowledge transfer.

Bragging about knowledge

The title is a little bit deceptive. It doesn’t mean that developers should walk around and tell everybody how many they know. Quite the opposite. Team leaders can organize meetings to let team member to tell other people what he do and how he do this. This is an excellent method to share the knowledge among all team members. It also motivates the source of information to better work.

Risks and problems

Despite these all tools mentioned above, there are also some problems that we can meet.

False help

One of the most dangerous risks in knowledge management is the following situation. Employee seems to be willing to spread his knowledge, but in fact, he teaches others only less important pieces of his expertise. It is quite hard to identify such kind of threat. Your only help can be other team members. They can tell you if they would need more knowledge to understand the topic thoroughly. If knowledge owner doesn’t pass all necessary knowledge for others, we should motivate/persuade him to do so.

Distributed knowledge

On the other hand, some teams knowledge can be distributed more equally and separably. This kind of specialization is also a problem because any part of your team can become a fragile element. Managers should show the value of sharing for each employee to encourage them to cooperate. One of the methods may be persuading them to introduce their knowledge in front of others (i.e. bragging mentioned earlier).

Single knowledge sources

Opposite situation also can be risky. If only a few team members store most of the project knowledge, it puts them in lot higher position than other developers. It also increases dependency on this people. In this case, we should take into consideration showing them how they can improve the quality of their work by sharing his duties with others.

Motivation to share

We can notice that most important part of this whole knowledge managing is employee motivation and their will to do this. Indeed, this is crucial to the success of this approach.

It is not all of the techniques for managing, but only chosen by me. What is your favorite method to introduce knowledge management into team?

NUnit – generic classes tests

NUnit – generic classes tests

Some times ago I faced a task to write tests for generic classes. In the simplest approach it is quite easy task. At the beginning let’s assume that class which we want to test implement following interface:

public interface ISerializer<T>
{
    T Deserialize(string text);

    string Serialize(T obj);
}

If we want to test this class using for example NUnit library we can simply write a few test cases. In our case we decide to write 2 basic tests.

[Test]
public void ShouldSerializeAndDeserializeCorrectly()
{
    var serializer = new Serializer<Cat>();
    var obj = new Cat();

    var serialized = serializer.Serialize(obj);
    var deserialized = serializer.Deserialize(serialized);

    Assert.AreEqual(deserialized, obj);
}

[Test]
public void ShouldDeserializeWithErrorCorrectly()
{
    var serializer = new Serializer<Cat>();
    var obj = new Cat();

    var serialized = serializer.Serialize(obj);
    var deserialized = serializer.Deserialize(serialized + "=");

    Assert.AreEqual(deserialized, obj);
}

As you can see this kind of tests is easy to understand and very simple at all. In this case it is the best choice. However how do you think it will work when we would have a dozen implementation of our interface and we would want to test them all? Or we want to test some implementation with a several classes as a generic parameter. Or imagine that we want both: many implementations tested with many classes. Now of test cases would grow very fast. Ad it could be quite hart to maintain that amount of similar code.

Testing for different type parameters

To achieve this we can use a NUnit functionality named TestCaseSource. It gives us a possibility to define our test cases dynamically.

[TestFixture]
public class TestClass
{
    public static IEnumerable<IGenericTestCase> TestCases()
    {
        yield return new GenericTestCase<Cat>();
        yield return new GenericTestCase<Dog>();
    }

    [Test]
    [TestCaseSource("TestCases")]
    public void ShouldSerializeAdnDeserializeCorrectly(IGenericTestCase testCase)
    {
        testCase.ShouldDeserializeWithErrorCorrectly();
    }

    [Test]
    [TestCaseSource("TestCases")]
    public void ShouldDeserializeWithErrorCorrectly(IGenericTestCase testCase)
    {
        testCase.ShouldDeserializeWithErrorCorrectly();
    }
}

As you can see, we can add a parameters to our tests define how this parameter will be populated using a TestCaseSource attribute. In static method we can create test cases dynamically. But let’s look what is a test parameter. We pass an interface to tests, but we define a specific typed objects into our source data. It looks as follow:

public interface IGenericTestCase
{
    void ShouldSerializeAdnDeserializeCorrectly();

    void ShouldDeserializeWithErrorCorrectly();
}


public class GenericTestCase<T> : IGenericTestCase
where T : new()
{
    public void ShouldSerializeAdnDeserializeCorrectly()
    {
        var serializer = new Serializer<T>();
        var obj = new T();

        var serialized = serializer.Serialize(obj);
        var deserialized = serializer.Deserialize(serialized);

        Assert.AreEqual(deserialized, obj);
    }

    public void ShouldDeserializeWithErrorCorrectly()
    {
        var serializer = new Serializer<T>();
        var obj = new T();

        var serialized = serializer.Serialize(obj);
        var deserialized = serializer.Deserialize(serialized + "=");

        Assert.AreEqual(deserialized, obj);
    }
}

Test login into GenericTestCase is exactly the same as in the previous basic tests. That is correct because the logic is the same. The only thing that we want change is a way of generating test cases.

This method is also very easy but it is the most beneficial if you really want to test generic class in many dimensions.

Probably you noticed that above generic test case support only change of type parameter but it is not a problem to support also different implementations. We have to change just a few places.

public class GenericTestCase<T, TImpl> : IGenericTestCase
    where T : new()
    where TImpl : ISerializer<T>, new()
{
    public void ShouldSerializeAdnDeserializeCorrectly()
    {
        var serializer = new TImpl();
        // ...
    }

    public void ShouldDeserializeWithErrorCorrectly()
    {
        var serializer = new TImpl();
        // ...
    }
}

I hope these examples will help you to understand TestCases mechanism in NUnit.

Photo source

Technical teams motivation

Technical teams motivation

During my whole professional experience I always wondering what is the most important factor of technical project success. This question is important although for every day work and our side projects. I also reveal that during the work on start up projects we can meet this problem.

Project success factor

We can’t definitely say that it is one the most important success factor for sure. Great skills of team members, outstanding idea or good architecture can be important, but it means nothing without one the factor.

Motivation

We can create a great team composed of friends and helpful folks but if we don’t take a special consideration about people motivation we can just stay with a technically masterpiece but not finished project at the end. Also without motivation team can be not as productive as it should be. It is harmful for project creation. We can see this in almost every project.

On regular commercial projects we can observe different phases of interests. At the beginning when we try to solve some problems we have big motivation. We can see a direct impact on our customers. We encounter many initial problems and we can solve it. People have many interesting work to do. But after some time all this willingness to work may disappear. Then we will have a much less desire to give our energy for that projects. This is especially visible in further – maintenance phase of projects. Some people on this moment can take a decision to change a job, which could be damaging for project.

It is also happens when we are working on our side projects or start ups. In these cases, I can say that, it is even more important to keep motivation of our team. When we are working on some project without any financial gratification, we should know what can motivate your team and do this.

Moving motivators

The first part of motivation management is to identify what is the motivators of your people. We can ask them directly, but let’s think for a while if you are able to specify and name what motivates you the most in your every day work or in side projects. Probably it won’t be easy. It was quite hard exercise for me at the beginning. Just as for your team mates.

However some times ago my friend introduced me an interesting tool, that help me to identify our motivations. It is Moving Motivators. This conception define 10 groups of motivation factors:

  • acceptance
  • curiosity
  • freedom
  • status
  • goal
  • honor
  • mastery
  • order
  • power
  • relatedness

The main part of this method is defining which motivators is the most important for you.

  1. At first you should place them in order from left – least important to right – the most important.
  2. Then you can tell how you think that these motivators are fulfilled in current project. Move card up if project positively affect this motivation and down otherwise.
  3. At the end you can think what can you do to move your all motivations up (especially these more important).

That’s all. This is very simple but powerful method that can gives you a very comprehensive view of your team motivations. Everyone has a different view, so it is important to do this individually.

Now you can print that cards and try it on your team mates.

What do you think about that method? What is your method to explore and improve people motivations?

Image source

Storing filters Kendo Grid

Storing filters Kendo Grid

KendoUI Grid control is very flexible and powerful widget to present table data. It provides us a set of useful features. All of them is described very well in Kendo Grid documentation. However there is some cases that these possibilities is not enough to fulfill our requirements.

KendoUI Grid support filters and sorting data in user interface. These filters can do some complex logic. Especially if we decide to pass them to API layer and evaluate server side. Let’s imagine that user set a complex filtering and sorting rules that helps him to manage his data. Then he move to another page and when he want to get back he have to set all filters again.

Persist state functionality

One solution for this problem is persist state mechanism provided to us by KendoUI. It gives a functionality of saving and loading Grid state (filtering, sorting and all information about columns). However all information saved by this mechanism is quite large, so we should use a localStorage to save them.

With this option we can add user a functionality to save and load filters produced by him. Also he can give names to this predefined setups and so on.

But what if we want to do this automatically. To restore filters when user get back to previous page. We can also use this mechanism but it definitely fail if user opens a multiple tabs in web browser and set a different filters on each of them.

Storing settings in query string

To solve this problem we have to write some custom implementation, because there is no that option in Kendo. We decide to store that kind of information in query string because it is a place contextually belonging to single page. We can modify query string when filters changes and restore then on page load.

In following Gist I present a sample code how we can do this. This will be done using Angular framework, but can be also simply adapted to any popular SPA framework.

This service provides us 2 methods: addFilterStoring, which is responsible for adding and restoring query parameters

kendoStateStore.addFilterStoring({
    dataSource: {
        type: "odata",
        transport: {
            read: "//demos.telerik.com/kendo-ui/service/Northwind.svc/Customers"
        }
    },
    height: 550,
    columns: [{
        field: "ContactName",
        title: "Contact Name",
        width: 240
    }, {
        field: "ContactTitle",
        title: "Contact Title"
    }, {
        field: "CompanyName",
        title: "Company Name"
    }, {
        field: "Country",
        width: 150
    }]
}}

Other function provided by our service is a rememberLocationParametersIn. It enables to execute some code e.g. change Grid filtering with remember of query parameters. We can use it as follow:

kendoStateStore.rememberLocationParametersIn(function() {
    // change filters 
    // grid.dataSource.filter(filtersUpdated);
});

This little snippet gives me a missing functionality to powerful Kendo Grid control. I hope that it can help you also.

Image source