Testing scalar type hints in PHP7 and PHPUnit

I have recently been playing with some of the new features in PHP 7. Although only in alpha release at present, I am pleasantly surprised at the platform stability and the backwards-compatibility which allows most of my existing code to run unmodified.

Scalar types and return types

The two features which most interest me are scalar type hints and return type declarations. I appreciate there are numerous schools of thought in the PHP community, but I am firmly in the camp which believes the following function is an abuse of at least two different languages:

<?php
function fingleTheFangles($fangle) {
    if (is_array($fangle)) {
        foreach ($fangle as $subfangle) {
            if (is_object($subfangle)) {
                // Do something objecty.
            } else if (is_string($subfangle)) {
                // Do something stringy.
            } else {
                // This must be numeric.
                // (it would obviously be FALSE to expect anything else!)
                // Do something numbery.
            }
            return $fingles.
        }
    } else {
        if (is_object($fangle)) {
            // Do something objecty.
        } else if (is_string($fangle)) {
            // Do something stringy.
        } else {
            // This must be numeric.
            // (it would obviously be FALSE to expect anything else!)
            // Do something numbery.
        }
        return $fingles.
    }
}

But now we could define the much more pleasing:

function fingleTheFangle(Fangle $fangle): Fingle {
    // Do something with a fangle.
    return $fingle;
}

function fingleTheFangleLabel(string $fangle_label): Fingle {
    // Do something with a string holding a fangle label.
    return $fingle;
}

function fingleTheFangleId(int $fangle_id): Fingle {
    // Do something with a numeric fangle id.
    return $fingle;
}

function fingleAnArrayOfFangles(array $fangles): array {
    // Do something with a whole array.
    return $fingles;
}

Testing scalar types

So how can we write unit tests to confirm our scalar hints are behaving as expected? Consider the following class:

<?php
declare(strict_types = 1);

class ScalarType {
    public function expectsInteger(int $integer) {
        // Do nothing
    }
}

If we call the function with an integer

expectsInteger(1)

it will execute as expected.

If instead we call the function with some other variable type (eg a string)

expectsInteger("not an integer")

then a TypeException is thrown by the PHP engine. So the following PHPUnit testcase should confirm this behaviour:

<?php
declare(strict_types = 1);

class ScalarTypeTest extends PHPUnit_Framework_TestCase {
    /**
     * @test
     * @expectedException TypeException
     */
    public function passStringWhenIntegerExpected() {
        $sut = new ScalarType();
        $sut->expectsInteger('Not an integer');
    }
}

It uses the PHPUnit annotation @expectedException to indicate the exception we expect to be thrown. Let’s try it out:

$ phpunit tests/ScalarTypeTest.php 
PHPUnit 4.7.3 by Sebastian Bergmann and contributors.

PHP Fatal error:  Uncaught TypeException: Argument 1 passed to ScalarType::expectsInteger() must be of the type integer, string given, called in .../PHPUnitTests/tests/ScalarTypeTest.php on line 11 and defined in .../PHPUnitTests/src/ScalarType.php:5
Stack trace:
#0 .../PHPUnitTests/tests/ScalarTypeTest.php(11): ScalarType->expectsInteger('Not an integer')
#1 [internal function]: ScalarTypeTest->passStringWhenIntegerExpected()
#2 .../PHPUnitTests/vendor/phpunit/phpunit/src/Framework/TestCase.php(863): ReflectionMethod->invokeArgs(Object(ScalarTypeTest), Array)
#3 .../PHPUnitTests/vendor/phpunit/phpunit/src/Framework/TestCase.php(741): PHPUnit_Framework_TestCase->runTest()
#4 .../PHPUnitTests/vendor/phpunit/phpunit/src/Framework/TestResult.php(605): PHPUnit_Framework_TestCase->runBare()
#5 .../PHPUnitTests/vendor/phpunit/phpunit/src/Framework/TestCa in .../PHPUnitTests/src/ScalarType.php on line 5

Fatal error: Uncaught TypeException: Argument 1 passed to ScalarType::expectsInteger() must be of the type integer, string given, called in .../PHPUnitTests/tests/ScalarTypeTest.php on line 11 and defined in .../PHPUnitTests/src/ScalarType.php:5
Stack trace:
#0 .../PHPUnitTests/tests/ScalarTypeTest.php(11): ScalarType->expectsInteger('Not an integer')
#1 [internal function]: ScalarTypeTest->passStringWhenIntegerExpected()
#2 .../PHPUnitTests/vendor/phpunit/phpunit/src/Framework/TestCase.php(863): ReflectionMethod->invokeArgs(Object(ScalarTypeTest), Array)
#3 .../PHPUnitTests/vendor/phpunit/phpunit/src/Framework/TestCase.php(741): PHPUnit_Framework_TestCase->runTest()
#4 .../PHPUnitTests/vendor/phpunit/phpunit/src/Framework/TestResult.php(605): PHPUnit_Framework_TestCase->runBare()
#5 .../PHPUnitTests/vendor/phpunit/phpunit/src/Framework/TestCa in .../PHPUnitTests/src/ScalarType.php on line 5

Okay… that’s not what we expected to happen. It looks like the TypeException was thrown, but PHPUnit has not caught the exception.

You see, another change in PHP 7 is the introduction of a new hierarchy of exceptions to replace Fatal Errors. Unfortunately for PHPUnit, these EngineExceptions do not derive from the Exception class, which is what PHPUnit attempts to catch. (In fact, Exception and EngineException now both derive from the BaseException class).

So if we want to test for this exception type, we’re going to have to catch it ourselves:

<?php
declare(strict_types = 1);

class ScalarTypeTest extends PHPUnit_Framework_TestCase {
    /**
     * @test
     */
    public function passStringWhenIntegerExpected() {
        $sut = new ScalarType();
        try {
            $sut->expectsInteger('Not an integer');
            $this->fail('Expected TypeException but none thrown.');
        } catch (TypeException $e) {
            // All good if we reach here.
        }
    }
}
$ phpunit tests/ScalarTypeTest.php 
PHPUnit 4.7.3 by Sebastian Bergmann and contributors.

.

Time: 421 ms, Memory: 4.00Mb

OK (1 test, 0 assertions)

I can only assume future releases of PHPUnit will be able to catch these exceptions too, but this workaround is hopefully not too painful in the short term.

Post to Twitter Post to Facebook

Mellow Bakers: Flaky butter buns

I am a little late posting this. I baked these buns on Sat 21 April, but life got in the way of me posting before now. Ah, well; it won’t be the last time this happens!

And now for something completely (well, slightly) different. This is my next bake, for the Mellow Baker’s, from Dan Lepard’s The Handmade Loaf, and it’s not a loaf of bread. These are flaky butter buns – a sort of savoury croissant – and quite unlike anything else I have baked.

This was not a difficult bake, but it did take three days from start to finish. It’s not as labour intensive as that makes it sound; for most of that time the dough sat in the fridge.

Thursday

This bake began, as most do, by weighing out the ingredients. This is where I made two mistakes: firstly, instead of letting the milk warm to 20°C, I used it straight from the fridge. What a mistake! No dough is going to rise like that… except my second mistake was to add three times the required amount of yeast, so I reckon they cancel each other out! The yeast error is due to me using instant yeast, whereas Dan Lepard’s recipes specify fresh yeast. In practice, they are interchangeable as long as you remember to divide the fresh yeast weight by three; I forgot until it was too late.


image

When mixed together, the dough was very stiff. The recipe tells us to “mix with your hands until you have a firm dough”. Well, to achieve that, I had to tip it all out onto the workshop and give it a good kneading.
image

After that, followed by Dan Lepard’s customary “knead for 10 seconds, leave for 10 minutes” cycle, it was looking like a nice dough and ready to retard in the fridge overnight.
image

Friday

The next morning, I removed the dough from the fridge and let it come back to room temperature. Then I rolled it out…
image

…and layered with butter. I should point out that this is as close to a rectangle as I could manage to roll. If anyone has any good tips for improving that (other than trimming it down) then please leave a friendly comment!
image

Next the folding and rolling cycle began, which I found to be easier than I expected. Having failed at croissants in the past, I really appreciate Dan Lepard’s “slices of butter” approach, instead of the “roll out the butter” method which I have tried to follow previously.
image

image

image

The next three images show my interpretation of the “book fold”. I know other people in the group have interpreted the instructions differently, but this way made most sense to me.
image

image

image

Followed by another (poor) attempt to roll out a rectangle!
image

Now to cut out the buns. I managed five from my “rectangle”.
image

I struggle to throw out any dough I work with, so I reformed the offcuts, rolled and cut again. The front five were the first set; those behind represent various generations of reformed offcuts. I know the layered structure will be malformed but, when the alternative is through them out, what did I have to lose?
image

As for shaping the buns, I found the instructions to be quite vague. I think this image succesfully shows how I interpreted them:
image

And here are all of the shaped buns about to be placed into the fridge again, ready for breakfast baking in the morning.
image

Saturday

Not much to talk about day three. Once I had been woken (far earlier than I would have liked!) I removed the buns from the fridge, heated the oven and then baked them in time for breakfast. I followed Dan’s advice and stuffed them with bacon.

image

It was a very nice breakfast. However, we struggled a little to find good ways to eat the rest. It seemed odd to eat then plain, but we didn’t want to add much in the way of toppings, considering how much butter was already present! Probably the best use we found was to accompany some home-made soup.

Would I bake them again? I’m not sure; probably not. But I am glad I baked them this time, and feel I have learnt a lot about how to handle dough/butter layers. Maybe I’ll give croissants another go.

Post to Twitter Post to Facebook

Apple, tomato and smoked bacon soup

After trying my hand at pea & mint soup, last week, I decided to have a go at another soup this week.

To be honest, I have actually wanted to make my own soup for a while, but had never found the time to do it. I had even picked up copies of three of The New Covent Garden Soup Company‘s recipe books, when I saw them discounted, around six months ago. So maybe it’s time to cook something from one of them!

After flicking through all three, I set my heart on “apple, vine tomato and smoked bacon”, from Soup for All Seasons. In the book, this is listed as a spring soup, specifically for March. Call me picky, but I tend to think of the season for apples and tomatoes – they specifically call for “ripe vine tomatoes” – being the other side of summer. Never mind; my curiosity is already piqued so I’ll make do with whatever Sainsburys have been storing in a warehouse. The recipe also calls for rashers of smoked bacon, which I replaced with pre-cut smoked bacon lardons.

You can read the fill recipe in the book, but here’s my summary:

Ingredient Soup maker’s percentage Mass used today
Vegetable stock 100% 500g (or 500ml if you prefer)
Coxes apples, peeled and diced 60% 300g (2 medium apples)
Plum tomatoes, skinned and chopped 120% 600g
Smoked bacon lardons 50% 250g
Onion 60% 300g (1 medium onion
Garlic 1% 5g (1 clove)
Brown sugar 1% 5g (1 teaspoon)
Sage leaves, finely sliced 0.2% 1g (6 leaves)
Butter 5% 25g
Olive oil 2% 10g
  1. Finely chop the onion and garlic, and gently fry, for around ten minutes, in the butter and olive oil.
  2. Add half the bacon and cook for a couple more minutes.
  3. Add the rest of the ingredients, save the sage leaves and remaining bacon. Bring to the boil and simmer for around one hour.
  4. Around ten minutes before you end the simmer, heat up a pan and fry off the remaining bacon bits until they are crispy. There is no need to add oil; the fat from the bacon will be enough.
  5. Blend the contents of the pan, then stir in the sage leaves and bacon bits.

Everything in place, ready to make the soup.

To skin the tomatoes, I poured freshly boiled water over them and left the for around 90 seconds, after which I drained the water and replaced it with cold water from the tap. This causes the skins to separate from the flesh, allowing you to peel or rub them off the tomatoes.

The tomatoes sit in boiling water for around 90 seconds.


After sitting in the boiling water, the skins slide straight off the tomatoes.

All that remains for the tomatoes is to chop them up.

Everything in the stock pot, ready to simmer for an hour.

After simmering for an hour, the soup looks more like this.

With the soup blended, I stirred in the bacon pieces and sliced sage leaves.

Served up with some home baked bread, sneakily dipped in the leftover bacon fat!

Post to Twitter Post to Facebook

Mellow Bakers: Rustic Loaf

After baking Dan Lepard’s Simple White Loaf last week, I decided this weekend was a good time to bake one of the breads from the Hamelman BREAD Mellow Baker’s group. Of the three breads scheduled for this month I chose to begin with the Rustic Loaf.

I had been looking forward to this most out of all the six breads scheduled for April; not because it was different or exciting, but because it sounded like a good, decent tasting bread.

Last week I made a tin loaf and half a dozen bread buns from the “quick white loaf” dough. The bread buns made a nice accompaniment to the pea and mint soup I made up, so I decided to follow a similar pattern this week. As well as a stock pot full of soup, I set out to bake a round loaf and six bread buns using the “rustic loaf” dough. To get the right amount of dough, I took one tenth of the metric weight for each ingredient – with the exception of the yeast, as I use instant instead of fresh, so that was reduced to a third again.

I began, on Saturday evening, by mixing up the preferment. This is, I believe, a pâte fermentée which basically makes it a viable bread dough in it’s own right. I tried hand mixing it in the bowl, but it just wasn’t working…

…so I turned it out onto the work surface and kneeded it for a couple of minutes, before rounding it and returning it to the bowl.

I then covered it in a shower cap (I have been going crazy collecting these from hotels when I have stayed away with work recently!) and left it to its own devices overnight.

For some reason, I hadn’t expected it to rise much. I think I confused it with a biga (another form of preferment) which, in my experience, tend to move quite slowly. Not this one! When I came down, in the morning, it was pushing off the shower cap! You can see where it stuck in the photo below.

As a result, it was a little tough to work out if it had domed in the middle, so I decided it was ripe enough and pushed on.

Here is my mise en place:

You can just make out Sebastian, the elder of my two sons, in the background. He helped me out with my bread last week (replicating most of the process with Play Doh) and he wanted to sit with me as I prepared the dough this week, too. You will probably see more of him, and his younger brother Orion, in my future blog entries as I am about to embark on a major life change. From tomorrow, my wife is returning to work after a period of maternity leave; I will be taking the next five months as a period of extended paternity leave to care for the boys myself. I will be recording my experience here in this blog, interspersed by other Mellow Bakers posts and other things which may interest me.

After mixing the remaining ingredients together, I incorporated the preferment and kneeded for around ten minutes, until I was able to form a gluten window pane. I then rounded the dough, and placed into the (freshly cleaned and oiled) mixing bowl, as modelled by Seb:

Bulk fermentation and folding followed, as per the basic recipe in the book. During this time, we made some soup and ate a portion for dinner.

With the soup drunk (I believe that is the correct verb) it was time to divide and shape the dough.

For my round loaf, I used a cane proofing basket. My mother, knowing I enjoyed baking, had recently bought me a bag of malted wheat flakes because she thought they would make a nice topping to some bread. This seemed as good an opportunity as any, so I scattered flakes into the basket before adding the rounded dough to prove.

For the buns, I used a roasting tin, lined with greased baking paper. As the tin would probably have taken twice the number of buns, I placed my empty bread tin next to them to act as a fourth wall.

Around 90 minutes later, they had all risen and looked ready to bake.

As I had employed the empty bread tin, I decided to fill it with boiled water to act as a source of steam within the oven.

I scattered semolina on a spare baking tray, and upturned the loaf onto it from the proving basket. After scoring with a bread knife, it was ready to be transferred onto my baking stone.

Unfortunately, at this point I encountered a little problem. I obviously hadn’t coated the tray with enough semolina – or spread it well, at least – so the loaf stuck to my makeshift peel. I was able to force it off, but it’s elegant, rounded shape was slightly mutated in the process.

Never mind. 40ish minutes later, I was able to remove a delicious smelling, if slightly deformed, loaf out of the oven, alongside six plump bread buns.

We cut a couple of slices from the loaf to accompany our evening meal.

It tasted great, and I was (pleasantly) surprised by the texture. The crust was quite chewy, almost like a good sourdough, and the crumb was nicely open. I’m certainly looking forward to a toasted slice for breakfast tomorrow, and a taste of the bread buns to accompany a little more soup.

Mellow Bakers are a group of people, from around the world, with a shared interest in baking bread. Some of us do it professionally, some just for a hobby, but we all do it for pleasure. The group are currently baking through two books about bread: BREAD by Jeffrey Hamelman, and The Handmade Loaf by Dan Lepard. Each month, three breads are selected at random, from each book, and we each bake as many or few of the selection as we would like – hence the Mellow in the name. Everyone is welcome to join in, so why not treat yourself to one of the books and switch your oven on?

Post to Twitter Post to Facebook

Accessible infographics

It all started when I saw this tweet:

It was almost 23:30 and I was tired (I know! That’s what being a parent does to you) but I had to be up because Orion, our 5 month old son, was demanding milk and I’m afraid you just can’t reason with him when he gets like that. So, bottle in one hand, smart phone in the other, I followed Dominik’s link to see what was so great about this infographic.

Continue reading

Post to Twitter Post to Facebook

Pea and mint soup

I have often enjoyed a bowl of soup, for a light dinner (we’re in the English north Midlands, so that means midday), but I have never made any of my own. I had heard how easy it is to do, but it isn’t that difficult to buy some good quality, fresh soup in the supermarket nowadays, either.

However, knowing that the same is often said about bread, I thought I should really have a proper go at this. So I decided to make some pea & mint soup for today’s dinner.

When it comes to cooking anything, I am afraid I have one big weakness: I always like to experiment with the recipe, even if I haven’t cooked it before. Today was no exception; I scanned my cookbooks, and scoured the internet, for any “pea & ____ soup” recipes I could find. Having seen all manner of variations, I decided to ignore them all and just concoct my own!

The key ingredient to any soup must be the liquid, closely followed by whatever the soup is supposed to taste of :-) So I have brought my baking knowledge and experience to the world of soup making, and present to you the soup maker’s percentages for my pea & mint soup:

Ingredient Soup maker’s percentage Mass used today
Chicken stock 100% 750g (or 750ml if you prefer)
Peas 66.7% 500g (I used straight from the freezer)
Carrot 20% approx 150g (1 medium carrot)
Onion 40% approx 300g (1 medium onion)
Mint leaves 3.3% 25g (1 good handful)
Butter 6.7% 50g

Whereas bread baker’s percentages are based on the total flour weight, my soup maker’s percentages are based on the total liquid weight. I used 750g of stock (that’s what one pod of Knorr chicken stock makes up; some day I will make my own stock again) and grabbed reasonable fractions of that weight for the other ingredients.

  1. Finely chop the carrot and onion; I used the food processor.
  2. Melt the butter in a pan, then gently fry the onion for about 5 minutes. Then add the carrot and continue frying for another 5 minutes.
  3. Add the stock to the pan and bring it the boil. Cover and simmer for 5 minutes.
  4. Add the peas to the pan, bring back to the boil, and simmer for a further 5 minutes.
  5. Using a slotted spoon, remove some of the cooked veg and keep it safe. This will be added back to the soup, after it has been blended, to give a little texture.
  6. Add the mint leaves. Now, using a hand blender (or some alternative), blitz the soup until it is smooth.
  7. Return the veg you saved in the earlier step. Season the soup to taste. I added salt, pepper and the juice of half a lemon.

Everything in its place, ready to begin.

The soup, simmering away, almost ready for blitzing up.

Using a slotted spoon, keep aside some of the cooked veg. This can be added back to the blended soup in order to add substance.

Pea & mint soup, served up with some "quick white loaf" bread buns.

All in all, I am very pleased with this. We ate half of the pan today, so the other half will be saved for tomorrow. The bread rolls I baked yesterday (Mellow Bakers: quick white loaf) were a fine accompaniment.

Post to Twitter Post to Facebook

Mellow Bakers: Quick white loaf

It’s April and the Mellow Bakers Handmade Loaf baking group has begun its challenge.

As is the norm, we have three breads selected at random, from Dan Lepard’s book, for baking during this month. Some members of the group have been very keen and already baked all three of them, but I plan to spread them across the month. Today I baked the first one: quick white loaf.

I can’t take all the credit for what I have baked today; I was ably assisted by my 2 year old son, Sebastian. He provided moral support and entertainment!

Dan Lepard describes this bread as, “a close-textured, soft white bread, with no pretence to be anything other than that.” Exciting! That sounds like exactly the kind of bread I would never bake because anything else I bake would be more interesting and tasty. But one of the reasons I am in this group bake is to force myself to try out recipes I wouldn’t touch otherwise. And, as Seb will be with me for the session, isn’t this the ideal bread to get him into baking? He is usually happy to eat any “Daddy’s Special Bread” that I offer to him, but this promises a quick turnaround from mixing to eating.

As I was preparing for this bake, I decided this would be an ideal dough for making simple bread buns, so the two loaves which this recipe is supposed to yield would actually become one loaf in a tin and six buns. The total flour weight seemed little on the light side for this outcome, so I decided to increase the weights by a third. This was an easy calculation for the 300g bread flour (becoming 400g) but led to silly figures for other ingredients (eg 266.666…g plain flour). Ah, well.

Mise en place; I don't usually do this but, for this recipe, it was easy!

Sebastion, the bread baker's apprentice.

Before the first rise

After the first rise

Shaped and waiting to prove

Ready for the oven

The finished loaf... and rolls, too.

Thoughts on the finished bread? It’s a bit bland. To be fair, for crust alone it beats supermarket sliced white, hands down. But we don’t buy that bread, and I wouldn’t pay much for this.

Saying that…

Someone obviously appreciates it. Seb enjoys a slice of the bread with honey.

Sebastian was very excited when I presented him with a slice. I cut it into quarters and he spread honey on each piece before wolfing them down. He got very upset when he discovered he wasn’t allowed more (it wasn’t long till tea time), although that may say more about 2 year olds than it does about the bread!

Once he finished, he decided to make more in his play kitchen; he remembered all the key steps, including rolling the dough on the table and making it into a ball.

Would I bake it again? For me, no; I’d prefer something with more bite and flavour. But it was an easy bake and, if it encourages him to bake bread himself, I’d gladly do it with Seb – or Orion (four months old) when he’s a bit bigger – again.

Post to Twitter Post to Facebook

Daddy Day: A walk in the park

A young boy runs down a woodland path.

As I mentioned a couple of posts back, I will soon be taking five months paternity leave to care for our two sons when my wife, Anisa, returns to work after her own block of maternity leave.

Yesterday was the practice day. Anisa went into work for the day, to reacquaint herself with the surroundings, so I used a little annual leave so I could look after the boys for the day.

I thoroughly enjoyed myself – and I think the boys enjoyed themselves too – but I can’t remember feeling so tired at the end of a day! I’m going to blame the switch to British Summer Time and the fact I got up at 05:30 to help Anisa prepare for school.

Getting up before the boys rise does have its advantages: I was able to make for myself – and consume uninterrupted – a decent espresso and a couple of slices of toast. In exchange for a lift to work, Anisa offered to prepare packed lunches for everyone, so I was able to focus on getting the boys ready to face the world.

I had a plan – and the day did basically go to plan – which was to load everyone into the car, drop Anisa at work, then head out to Clumber Park to go for a run around and, maybe, feed some ducks. Once we’d had our fill of that, we’d come home and play for a short while, have some lunch, them head out to the local toddler group/toy library. We would then round off the day with more play at home, teatime, bathtime then bedtime.

One complication this morning was the weather: we have had glorious sunshine these last few days, but the morning air is close to freezing. How to dress the boys (and myself) was going to be a challenge, but I found a solution involving shorts and thick jumpers!

A further complication, of an emotional rather than logistical nature, occurred later in the day. When I explained to Seb (our eldest son, 2¼ years) that we were going to the toy library, he began to get a little agitated. Before Anisa began maternity leave, Seb would go to a childminder every day – and still goes once or twice a week – who is involved in running the toddler group. Poor Seb got a little confused about going there with me, and declared we must be going to the book library, not the toy library, because it wasn’t a P__ (childminder) day. In the end we agreed we were going to Daddy’s toy library, but P__ may be there with some different children. I also had to concede to his demand to sit next to him at all times (I was going to anyway; I needed him to protect me from the other parents!).

All in all, the day went well and I am still looking forward to my leave proper. But I think I’m glad to be working again today. I never doubted it before, but I can confirm that being responsible for a baby and a toddler is a full-time job in itself. It is certainly no walk in the park, even when you do go for a real walk in a real park. I am also aware that yesterday was definitely a honeymoon period. I would love for every day to go like that, but a whole day playing with Daddy will not remain a novelty for long. Wish me luck!

Post to Twitter Post to Facebook

Mellow Bakers: Hot cross buns

Hot cross buns.
Hot cross buns.
One a penny, two…

That’s enough of that; everybody’s going to be singing that song!

Here we are with the first Mellow Bakers bread: hot cross buns. This is the starter bake for the Hamelman Bread group. As the Handmade Loaf group aren’t starting till next month, I decided to bake Dan Lepard’s hot cross buns, from his earlier book, Baking With Passion, alongside as a comparison.

One thing which surprised me about both recipes was the wetness of the dough. Both, on paper, are 50% hydration which should be very stiff. In reality the egg and butter add to the effective liquid, producing a reasonably sticky dough to work with.

Not quite as sticky as my initial attempt at the Lepard buns; I mistakenly added only half of the required flour after scaling for the sponge instead of the finished dough! I quickly realised what had happened and took corrective steps.

One thing I have learnt today: I hate working with a piping bag. I managed to pipe the crosses eventually, but my hand shall never be the same again!

Speaking of piping crosses, my Hamelman book has the lemon and vanilla variant; it also has the error with 10 × the required metric weight for butter. Watch out for that; I only just realised in time. As far as quantities go, I made just enough crossing paste for 12 buns by using 20g flour and scaling the other ingredients by the bakers percentages.

Hamelman: Bread

Lepard: Baking with Passion

Verdict

And the winner, in this mightily unfair and non-rigorous contest, is… Jeffrey Hamelman. They are spicy without being overpowering; sweet without being sickly; and fruity without losing their inate breadiness.

But I don’t think we’re going to struggle polishing off the other buns either!

Post to Twitter Post to Facebook

About me and this blog

I am a perfectionist.

It took me about a fortnight to get that first sentence just right.

That pretty well sums up the main difficulty I have writing anything; and why I am trying to make an effort to write more in this blog.

I am in my early thirties and live with my wife, and our two sons, in a Nottinghamshire village. By trade, I am a trainer, an educator, a learning & development specialist or whatever other job title gets thrown at me.

I try to use this blog to record any significant experiences in my life, but primarily so far my faltering attempts to play new on the tin whistle; and to document my successes and failures baking breads and other foodstuffs.

I am about to face a major change in my life: my wife is preparing to return to work, bringing an end to six months of maternity leave following the birth of our second son. We have decided that I will now be taking five months additional leave myself to care for our two boys. I am really looking forward to spending this time with them, although I would be lying if I said I wasn’t a little scared too. I will document some of my experiences here on this blog, and I would be interested to hear from other fathers in similar positions.

Post to Twitter Post to Facebook