tdd
1.5K views | +0 today
Follow
tdd
tdd
Curated by AM
Your new post is loading...
Your new post is loading...
Scooped by AM
Scoop.it!

Code coverage considered harmful

AM's insight:

Since the developers know this is being measured and have easy access to the results, they often just find uncovered code and write tests just to cover that code with meaningless asserts – e.g. assert that a class has 8 properties. Or potentially worse, with no asserts at all!

 

There is no business reason why a class should contain 8 properties, there is no business reason for a class to exist at all for that matter. There is no business reason to test code which can never be run in production, there is no business reason to test code so that code coverage is higher. There’s no business reason to generate tests just to satisfy a metric.

 

What’s the solution?

more...
No comment yet.
Suggested by Papapetrou Patroklos
Scoop.it!

Alexander Beletsky's Development Blog: New Tools in My TDD Arsenal

Alexander Beletsky's Development Blog: New Tools in My TDD Arsenal | tdd | Scoop.it

Recently my TDD arsenal has been enhanced with 3 new cool tools, which I'm about to share with you. More precisely it one tool and two frameworks. Let's go for it.

more...
No comment yet.
Suggested by Papapetrou Patroklos
Scoop.it!

Naresh Jain » Agile FAQs Blog » Managed Chaos » Why should I bother to learn and practice TDD?

Naresh Jain » Agile FAQs Blog » Managed Chaos » Why should I bother to learn and practice TDD? | tdd | Scoop.it
My 2 cents, based on personal experience: With TDD, I...
more...
No comment yet.
Suggested by Papapetrou Patroklos
Scoop.it!

Test Driven Development without Tears | Agile Zone

Test Driven Development without Tears | Agile Zone | tdd | Scoop.it
Every company that I worked for has its own method of testing, and I've
gained a lot of experience in what works and what doesn't. At last, that
stack of...
more...
No comment yet.
Scooped by AM
Scoop.it!

Unit testing done right – Better then sliced bread

Maybe the biggest thing since the rise of object oriented programming is test driven development. It’s also as hard to “get”. To help you on your journey, here some tips.

more...
No comment yet.
Scooped by AM
Scoop.it!

How to avoid the very dangerous ALWAYS-GREEN test

When a test passes the first time it’s ever run, a developer’s reaction is “Great! Let’s move on!”. Well this can be a dangerous practice as I discovered one cold rainy day. 

more...
No comment yet.
Scooped by AM
Scoop.it!

Are your tests lying to you?

If you've written a test for a module, and the module is changed in the future, there are three things that can happen:

 

 

1. The test keeps passing because nothing is broken. (Good.)
2. The test fails because something is wrong. (Great – this is the test's job!)
3. The test keeps passing, but it silently stops testing the thing it claims to (BAD, BAD, BAD!).

more...
No comment yet.
Scooped by AM
Scoop.it!

Jokes for testers

Top 24 replies by programmers when their programs don't work:

24. "It works fine on MY computer"
23. "Who did you login as ?"
22. "It's a feature"
21. "It's WAD (Working As Designed)"
20. "That's weird..."

more...
No comment yet.
Scooped by AM
Scoop.it!

Writing unit tests is reinventing functional programming in non-functional languages

When Java developers use TDD what they are doing is that they’re reinventing functional programming.


Anyone care to make my argument better or shoot it down?

more...
No comment yet.
Suggested by Papapetrou Patroklos
Scoop.it!

Several benefits that I have reaped from having tests drive my coding

Several benefits that I have reaped from having tests drive my coding | tdd | Scoop.it
We all will agree that having good tests to exercise and validate a developer’s code is a good thing. Unfortunately, so often, writing unit tests is the last thing developers have time for, if th...
more...
No comment yet.
Suggested by Papapetrou Patroklos
Scoop.it!

The second D in TDD

Some proponents of TDD say, that TDD forces you to find a good design. Some even translate TDD to Test Driven Design. I don’t agree. Mostly.

 

Lets start with the small part where I do agree...

more...
No comment yet.
Scooped by AM
Scoop.it!

BDD is like TDD if…

BDD is like TDD if… | tdd | Scoop.it
I’ve noticed a number of people recently declaring that BDD really is just TDD, such as Robert Martin on Twitter and Ron Jeffries on the XP list. I can understand where this mindset comes ...
more...
No comment yet.
Scooped by AM
Scoop.it!

Why I Hate Unit Testing

Why I Hate Unit Testing | tdd | Scoop.it

If you have entered a company with poor unit testing practices, you will likely encounter other problems.

 

Don’t Hate the Game, Hate the Player

more...
No comment yet.
Scooped by AM
Scoop.it!

Why Code Coverage Alone Doesn’t Mean Squat

100% code coverage does not mean that your code is bug free. It doesn’t even mean that your code is being properly tested.

 

TDD gives you, by the mere nature of the process, a unit test suite that executes 100% of the code. This can be a very nice thing to have.

However, like most things in life, people often focus on the destination, and pay little attention to the journey required to get there. We as human beings are always looking for short cuts.

 

Some software managers see 100% code coverage as a must have, not really caring how that goal is achieved.

 

But it is the journey to 100% code coverage that provides the benefits that most associate with simply having 100% code coverage. Without taking the correct roads, you can easily create a unit test suite that exercises 100% of your code base, and still end up with a buggy, brittle, and poorly designed code base.

more...
No comment yet.
Suggested by Papapetrou Patroklos
Scoop.it!

Towards a Theory of Test-Driven Development

Towards a Theory of Test-Driven Development | tdd | Scoop.it
This post examines how well we really understand the practice of Test-Driven Development (TDD). Red, Green, Refactor By now we all know that Test-Driven Development (TDD) follows a simple cycle con...
more...
No comment yet.
Suggested by Papapetrou Patroklos
Scoop.it!

InfoQ: TDD/BDD as Architectural Tools

InfoQ: TDD/BDD as Architectural Tools | tdd | Scoop.it
James Kovacs explains how to use TDD and BDD to focus the architectural efforts on the high-value areas of the code in order to obtain just-in-time software architecture.
more...
No comment yet.
Scooped by AM
Scoop.it!

Kata - The only way to learn TDD

Kata - The only way to learn TDD | tdd | Scoop.it

Kata is a Japanese word meaning “form”, and in the martial arts it describes a choreographed pattern of movements used to train yourself to the level of muscle memory. I study Kenpo myself and have a number of kata that I practice regularly both in training and at home.

more...
No comment yet.
Scooped by AM
Scoop.it!

Unit tests: An API design tool

Unit tests: An API design tool | tdd | Scoop.it
Many people think that unit tests are written to catch bugs, however this is only partially right.

 

Test first is API design!

more...
No comment yet.
Scooped by AM
Scoop.it!

TDD is Kanban for Code

TDD is Kanban for Code | tdd | Scoop.it

If TDD is kanban for code

- What is the product?
- What is the kanban card?
- What are the production steps?
- How does demand flow backward and products flow forward?
- What are the feedback loops?

more...
No comment yet.
Scooped by AM
Scoop.it!

You won’t believe how old TDD is

You won’t believe how old TDD is | tdd | Scoop.it
Kent Beck is credited as the the TDD inventor.
Yet, he claims he just re-discovered it.

 

When asked why does he refer to the rediscovery (not the invention) of test-driven development he explained:

 

The original description of TDD was in an ancient book about programming. It said you take the input tape, manually type in the output tape you expect, then program until the actual output tape matches the expected output.

more...
No comment yet.
Suggested by Papapetrou Patroklos
Scoop.it!

Why you need to make your tests fail

Why you need to make your tests fail | tdd | Scoop.it

Yesterday I found another benefit of writing the tests before the code – you get to see them fail!


A while back I wrote about another shortcoming of MSTest – how it does not have any built in facility to test against expected exception message.

more...
No comment yet.
Scooped by AM
Scoop.it!

Why you should not use SetUp and TearDown in NUnit

When I lead the team that built NUnit we implemented SetUp and TearDown similar to the way they were implemented in JUnit. For those who do not know SetUp and TearDown are attributes on methods in a TestFixture that perform common initialization and destruction.
more...
No comment yet.
Scooped by AM
Scoop.it!

Why You Can't Trust "No Reported Errors"

Why You Can't Trust "No Reported Errors" | tdd | Scoop.it
Users are unlikely to phone up and give you a detailed bug report. They might treat even an error as expected system behavior. Don't rely on their feedback.
more...
No comment yet.
Scooped by AM
Scoop.it!

Helping the Customer Stick to the Purpose of a User Story

Helping the Customer Stick to the Purpose of a User Story | tdd | Scoop.it

I work as a tester on a development team for a financial services company. Our software manages all aspects of 401(k) retirement plans. Even though we've been practicing agile development for eight years, or maybe because of it, our customers sometimes fall into a trap. Rather than tell us the business problem they need to solve, they give us a user story with the technical implementation already all figured out.

 

In a recent estimating meeting, our Product Owner read this story: "As a third-party administrator, I want to upload a loan, with my own loan term, interest rate, amount, and generate a corrective action to liquidate the funds and process the out check."

more...
No comment yet.