Skip to content

Instantly share code, notes, and snippets.

@bdfinst
bdfinst / example.feature
Created July 30, 2019 20:01
BDD Example
Given I have 10 dollars
When I purchase a lottery ticket for 2 dollars
Then I will have 8 dollars
And I will get a lottery ticket
And I will be congratulated for paying the mathematically challenged tax.
Given I have 1 dollar
When I purchase a lottery ticket for 2 dollars
Then I will have 1 dollar
And I will not get a lottery ticket
@bdfinst
bdfinst / addWholeNumbers.js
Last active August 25, 2022 09:57
Adding two numbers badly
/* Return the sum of two integers */
/* Return null if one of that parms is not an integer */
function addWholeNumbers(a, b) {
if (a % 1 === 0 && b % 1 === 0) {
return a + b;
} else {
return null;
}
}
it('Should not return null of both numbers are integers' () => {
/*
* This call will return 4, which is not null.
* Pass
*/
expect(addWholeNumbers(2, 2)).not.toBe(null);
/*
* This returns "22" because JS sees a string will helpfully concatenate them.
* Pass
@bdfinst
bdfinst / badJavaTest.java
Last active February 8, 2021 11:48
Example of dangerous test
/*
The following is a simple example of real outcomes from mandating code coverage
minimums instead of measuring delivered quality with deploy frequency and defect rates.
This test will result in 100% code coverage but tests nothing.
If you find tests like these, DELETE THEM IMMEDIATLY. They provide less value than
not having a test. It's better to know that this wasn't tested.
*/
@Test
public void testMultiply() {
Construction Software
Well understood need Discovering the need
Applying known solutions Innovating new solutions
Done when signed off Done when replaced
Value is known before delivery Work must be delivered to have value validated
Quality can be inspected Quality is unknown without user feeddback
Exspensive or impossible to change Cheap and easy to change
Detailed planning is critical Detailed planning is waste
@bdfinst
bdfinst / review.md
Last active October 20, 2021 10:46
Upgrading the Agile Manifesto

Change log

2021-10-20

Expand on the reasoning for the post.

From Duena Blomstrom's blog

  • Clarify 5th principle
  • Clarify 12th principle
it('Should not return null if both numbers are integers' () => {
addWholeNumbers(2, 2);
addWholeNumbers(2, '2');
addWholeNumbers(1.1, 0);
})
@bdfinst
bdfinst / PerfectNeverShips.js
Created July 12, 2023 16:57
Perfect Never Ships
let perfect = false;
let percentValue = 100;
while (!perfect) {
percentValue = percentValue/2;
}
shipIt(percentValue);
Scenario: A story is ready to start
Given we have a story to refine
When we decompose the story
And we agree that any team member with the technical skills can work on the story
Then the team member should be able to complete the story in less than 3 days
And the team member should not need to ask clarifying questions
And the team memeber should have all information needed to test the story
Scenario: Swarming user stories as a team
Given we have a story we can complete in less than 3 days


When we decompose the story
And we agree that any team member with the technical skills can work on the story
Then the team member should be able to complete the story in less than 3 days
And the team member should not need to ask clarifying questions
And the team memeber should have all information needed to test the story