Skip to content

Commit b88e094

Browse files
committed
Fixed some typos, added new post about "a second pair of eyes".
1 parent fd6fb1f commit b88e094

5 files changed

+69
-3
lines changed

content/posts/2018/10/31/openfasttrace-2-0-2-released.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Openfasttrace 2 0 2 Released"
2+
title: "OpenFastTrace 2.0.2 Released"
33
date: 2018-10-31T20:29:27+02:00
44
draft: false
55
params:

content/posts/2018/11/24/gradle-plugin-upgraded-to-openfasttrace-2-1-0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Gradle Plugin Upgraded to Openfasttrace 2.1.0"
2+
title: "Gradle Plugin Upgraded to OpenFastTrace 2.1.0"
33
date: 2018-11-24T20:33:37+02:00
44
draft: false
55
params:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "Test Coverage Pitfalls"
3+
date: 2017-01-14T15:29:02+02:00
4+
draft: false
5+
params:
6+
author: Sebastian
7+
---
8+
9+
When did I test enough?
10+
11+
While code coverage is a good indicator, you still have to know how code coverage works. Today I was hunting a bug in a Markdown importer I wrote for OpenFastTrace. The class where the bug sits had a whooping 93.1% code coverage and part of that missing coverage was owed to the fact that the JaCoCo coverage tracer can’t mark code that throws exceptions as covered – even though there is a test case for it.
12+
13+
So I wrote a new issue ticket, created a fix branch and wrote a three line test case that reproduced the problem. While the test now failed as expected, the code coverage didn’t go up.
14+
15+
I used the [Mockito](http://mockito.org/) mocking framework to verify that an interaction with a mocked observer happened or in my case due to the bug didn’t.
16+
17+
The error was hiding in a regular expression which read
18+
19+
"Needs:\\s*(\\w+(?:,\\s*\\w+)+)"
20+
21+
instead of
22+
23+
"Needs:\\s*(\\w+(?:,\\s*\\w+)*)"
24+
25+
Notice the asterisk in the end.
26+
27+
So while there are a lot test cases waiting to be written for this regular expression, code coverage won’t tell you.
28+
29+
You get what you measure, so be sure you understand what it is you are measuring.
30+

content/posts/2024/06/04/tracability-talk-at-the-xen-summit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Tracability Talk at the Xen Summit"
3-
date: "2024-06-04T19:59:27+02:00"
3+
date: 2024-06-04T19:59:27+02:00
44
draft: false
55
params:
66
author: Sebastian
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: "A Second pair of Eyes"
3+
date: "2024-06-29T13:53:22+02:00"
4+
draft: false
5+
params:
6+
author: Sebastian
7+
---
8+
9+
Which developer does not know this situation: you debug like a mad person and form all sorts of crazy theories my the code in front of you does not work. Especially if you are new to a topic — like we are with our shiny new Hugo blog.
10+
11+
When I created the blog, I intended to keep the directory structure identical to the old WordPress blog:
12+
13+
<domain>/<year>/<month>/<day>/<post>
14+
15+
All good and well, until I updated to a different theme, because the [minimal theme](https://github.com/calintat/minimal) by Calin Tataru that I originally chose — and which I still find stunningly beautiful in its clean simplicity — is apparently not maintained anymore. At least the last commit dates four years back.
16+
17+
But this story was not supposed to be about the challenges of supply chain management. That's a whole different story.
18+
19+
It's about your thoughts going in circles and ending up in a cargo cult[^1]. I had all sorts of crazy theories, why we only get the year 2018 in the index with the new theme. I even hypothesized that a kind of hidden cache in Hugo held pre-built pages.
20+
21+
Turns out, I couldn't have been more off. Christoph, whom I called for help debugged the current template and found out that Hugo has a concept of main sections. And 2018 simply got auto-picked because it had the most entries.
22+
23+
So here's the fix:
24+
25+
1. Put your posts under the top level directory `posts`
26+
```
27+
<domain>/posts/<year>/<month>/<day>/<post>
28+
```
29+
2. List it in the configuration
30+
```yaml
31+
params:
32+
mainSections: ['posts']
33+
34+
Big thanks to Christoph for saving my sanity.
35+
36+
[^1]: The term "[Cargo cult](https://en.wikipedia.org/wiki/Cargo_cult)" refers to the practice of primitive civilizations believing that one factually unconnected thing influences the other, because the mechanism behind the correlation is not understood by the observer. First appearance of the term "cargo cult" in print Norris Mervyn Bird, *Pacific Islands Monthly*, November 1945.

0 commit comments

Comments
 (0)