Przejdź do głównej zawartości

Practical Scrum Training (6) Discussion of Product Backlog (continued)

Let's consider the product backlog item related to the editing of data. Just this one more and then we'll jump straight into ordering the product backlog.

In order to correct the information about a person in the family tree as a family tree user, I want to be able to edit the data of a person I choose.

I didn't like this item from the start, because it seemed to me rather complicated to develop. When I think about it now, it doesn't seem that complicated. But for the purpose of training, I need to ask a question: can we do anything smaller, break it into smaller parts or do any other trick to achieve something similar quicker than if we were to develop it as is.

As always, there is something we can do. The aim here is correct data. If we add a new item that introduces deletion of people from the tree, it will be possible to delete a person with incorrect data and then add same person again, this time with good data. Maybe a little awkward to the user, but if we desperately wanted to deliver the "correction" functionality quickly, then maybe we could get away with this approach and deliver real editing functionality one iteration later.

But there's a catch: if we delete a person and add them again, then the "new" person will have a new, unique identifier and the identifier of the deleted person may be spread in several other records (children).

It may be a good point for the training to suggest the deceitful solution with deletions and see when the trainees are able to spot this problem. At planning? Maybe during the development? Maybe someone writing a test for it will be able to spot it quickest?

After thinking about all of this, I conclude that deletions are important (but are not good substitutes for editions) and they deserve to be a product backlog item on their own.

This is how I would order the product backlog item now:

  • In order to correct the information about a person in the family tree as a family tree user, I want to be able to edit the data of a person I choose
  • In order to make corrections in the family tree as a family tree user, I want to be able to delete a person from the tree
  • In order to add new people to the family tree efficienty as a family tree user, I want to be asked if I want to add another person right after I added the last one
  • In order for the family tree to be easier to read as a family tree user, I want the graphical representation of the tree to alternately use one of two different colors for each generation
  • In order for the family tree to be easier to read as a family tree user, I want the graphical representation of the tree to rotate colors of generations from a predefined set of colors
  • In order to maintain integrity of family tree data as a family tree user, I want the identifiers of the parents checked (natural numbers, identifiers are optional) and blocked from being entered if invalid
  • In order to maintain integrity of family tree data as a family tree user, I want the identifiers of the parents checked to be existing identifiers of people already existing in the tree and blocked from being entered if that is not the case
  • In order to disallow non-logical connections in the family tree as a family tree user, I want to be blocked from pointing a person as their own parent
  • In order to disallow non-logical connections in the family tree as a family tree user, I want to be blocked from pointing the same person as both mother and father of someone
  • In order to distinguish the gender of a person in the family tree as a family tree user, I want to be able to assign gender attribute to each person
  • In order to maintain the data about births and deaths in the family as a family tree user, I want to be able to assign birth and death dates to each person
Is this the only good order possible? Of course not. This is only how I see it and I did not consult this with anybody (customer, potential user). Also, once the items are estimated, the order of development may slightly change when the development team estimates what can be done in each iteration.

That's it. The next post will outline how I imagine the training should be conducted.

Komentarze

Popularne posty z tego bloga

Unit Testing code with IO file operations (in Python)

We may often come across a piece of code that was written without Unit Tests at all. In addition, the piece of code may be dealing with IO like file writing and reading, which makes it more difficult to Unit Test it when we are trying to refactor and modify. Let's suppose the code in question looks like this:

def writeInitialsToFile(filename, name, surname):
    initials = name[0] + '.' + surname[0] + '.'
    with open(filename, 'w') as file:
        file.write(initials)

def readInitials(filename):
    initials = None
    with open(filename, 'r') as file:
        initials = file.readline()
    return initials

A straightforward and bad idea would be to write a couple of Unit Tests that make use of a real file and simply test the reading and writing. Is therea a better way to test this code?

First of all, we need a way to replace the real file with something else. For both reading and writing we will now have a couple of functions, one that expects a stream fo…

Piotr's Less Obvious Advice on Google Mock: State maintenance

Google Mock provides several ways to maintain state inside mock objects. One way of implementing state maintenance is with SaveArg. Consider the following example.

We have a class Configurator, which allows a caller to set and get values of a parameter:

class Configurator
{
    public:

    virtual ~Configurator() {}

    virtual void setParamX(int n) = 0;
    virtual int getParamX() = 0;
};

And we have a class Client that calls Configurator's methods and it also has a method incParamXBy, that can be used to increase the current value of paramX by a certain value.

class Client
{
    public:

    Client(Configurator & cfg);
    virtual ~Client() {}

    void setParamX(int n);
    void incParamXBy(int n);
    int getParamX();

    private:

    Configurator & _cfg;
};

incParamXBy internally calls setParamX and getParamX on Configurator:

void Client::incParamXBy(int n)
{
    _cfg.setParamX(_cfg.getParamX() + n);
}

Let's assume that the initial value of paramX is A and that we want to increase paramX by…

Piotr's Less Obvious Advice on Google Mock: Returning new objects from a mock

Google Mock provides a way to return newly created objects from a mock method. Suppose we have a  Generator class that is supposed to generate new objects when createNewRecord method is called:

class Generator
{
    public:
    virtual ~Generator() {}
    virtual Record * createNewRecord() = 0;
};

...and suppose we want to mock this class:

class MockGenerator : public Generator
{
    public:
    MOCK_METHOD0(createNewRecord, Record * ());
};

Suppose the caller class Client has run method defined as follows:

void Client::run()
{
    for(int i = 0; i < 3; i++)
    {
        rec_tab[i] = gen.createNewRecord();
    }
}

We want the mock to return a pointer to a new object each time createNewRecord is called. This is how we can express this in the test code:

TEST(ClientTest, CanRun)
{
    MockGenerator gen;
    Client c(gen);

    EXPECT_CALL(gen, createNewRecord())
        .Times(3)
                 //this is equivalent of returning new Record(1,2,3)
        .WillOnce(ReturnNew<Record>(1,2,3))
        .Will…