Skip to main content
added 183 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369

strategy for reducing the introduction of bugs.

Testing doesn't prevent introducing bugs. The tests can be buggy as well. Testing makes it easy to see what the code actually does. It's not a bug until some human decides if it's the code or the test that needs fixing.

I believe the main mechanism that unit tests reduce bugs is a because unit tests nudges the code to become more testable, and testability implies many other code qualities, such as SOLID. I argue that it is this indirect improvement of code quality that is the main reason for why unit testing reduces bugs.

Good unit tests pass and fail reliably. Those are the ones you don't have to keep rerunning until they pass, against the same code, because you're hoping to get lucky. The desire for tests you can trust after just one run nudge the unit towards being deterministic. Units that do the same thing every time allow tests that do the same thing every time.

That has more to do with writing functional code than SOLID. See Function Core, Imperative Shell. SOLID helps with other things, like code flexibility.

Please note that unit tests are just one of many kinds of tests. Each kind has different requirements, purpose, and audience. If one kind did everything we wouldn’t need so many.

does the reduction in bugs in unit tested code come mainly from the unit tests detecting bugs or

No. Be just as suspicious of tests as you are of code.

mainly from indirect code quality improvements induced by improving testability before the unit tests are written?

No. It used to be true that making code testable forced you to enable run time polymorphism. But now we live in a world filled with mocking tools.

Tests number one code quality improvement is they make the code more readable. I don't have to imagine what it will do when I can see what it did.

The reason I like your teams plan is because I suspect they are operating under one of the oldest requirements: Make sure it does what it did before, except for this one thing.

That requirement is why we care about regression testing. If you're working under that with old code then go read Working Effectively with Legacy Code.

Tests are good at highlighting change and demonstrating behavior. But don't trust them to catch every bug. They don’t. And don't trust them to only fail because of bugs. Sometimes they fail because something got moved.

strategy for reducing the introduction of bugs.

Testing doesn't prevent introducing bugs. The tests can be buggy as well. Testing makes it easy to see what the code actually does. It's not a bug until some human decides if it's the code or the test that needs fixing.

I believe the main mechanism that unit tests reduce bugs is a because unit tests nudges the code to become more testable, and testability implies many other code qualities, such as SOLID. I argue that it is this indirect improvement of code quality that is the main reason for why unit testing reduces bugs.

Good unit tests pass and fail reliably. Those are the ones you don't have to keep rerunning until they pass, against the same code, because you're hoping to get lucky. The desire for tests you can trust after just one run nudge the unit towards being deterministic. Units that do the same thing every time allow tests that do the same thing every time.

That has more to do with writing functional code than SOLID. See Function Core, Imperative Shell. SOLID helps with other things, like code flexibility.

does the reduction in bugs in unit tested code come mainly from the unit tests detecting bugs or

No. Be just as suspicious of tests as you are of code.

mainly from indirect code quality improvements induced by improving testability before the unit tests are written?

No. It used to be true that making code testable forced you to enable run time polymorphism. But now we live in a world filled with mocking tools.

Tests number one code quality improvement is they make the code more readable. I don't have to imagine what it will do when I can see what it did.

The reason I like your teams plan is because I suspect they are operating under one of the oldest requirements: Make sure it does what it did before, except for this one thing.

That requirement is why we care about regression testing. If you're working under that with old code then go read Working Effectively with Legacy Code.

Tests are good at highlighting change and demonstrating behavior. But don't trust them to catch every bug. They don’t. And don't trust them to only fail because of bugs. Sometimes they fail because something got moved.

strategy for reducing the introduction of bugs.

Testing doesn't prevent introducing bugs. The tests can be buggy as well. Testing makes it easy to see what the code actually does. It's not a bug until some human decides if it's the code or the test that needs fixing.

I believe the main mechanism that unit tests reduce bugs is a because unit tests nudges the code to become more testable, and testability implies many other code qualities, such as SOLID. I argue that it is this indirect improvement of code quality that is the main reason for why unit testing reduces bugs.

Good unit tests pass and fail reliably. Those are the ones you don't have to keep rerunning until they pass, against the same code, because you're hoping to get lucky. The desire for tests you can trust after just one run nudge the unit towards being deterministic. Units that do the same thing every time allow tests that do the same thing every time.

That has more to do with writing functional code than SOLID. See Function Core, Imperative Shell. SOLID helps with other things, like code flexibility.

Please note that unit tests are just one of many kinds of tests. Each kind has different requirements, purpose, and audience. If one kind did everything we wouldn’t need so many.

does the reduction in bugs in unit tested code come mainly from the unit tests detecting bugs or

No. Be just as suspicious of tests as you are of code.

mainly from indirect code quality improvements induced by improving testability before the unit tests are written?

No. It used to be true that making code testable forced you to enable run time polymorphism. But now we live in a world filled with mocking tools.

Tests number one code quality improvement is they make the code more readable. I don't have to imagine what it will do when I can see what it did.

The reason I like your teams plan is because I suspect they are operating under one of the oldest requirements: Make sure it does what it did before, except for this one thing.

That requirement is why we care about regression testing. If you're working under that with old code then go read Working Effectively with Legacy Code.

Tests are good at highlighting change and demonstrating behavior. But don't trust them to catch every bug. They don’t. And don't trust them to only fail because of bugs. Sometimes they fail because something got moved.

added 53 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369

strategy for reducing the introduction of bugs.

Testing doesn't prevent introducing bugs. The tests can be buggy as well. Testing makes it easy to see what the code actually does. It's not a bug until some human decides if it's the code or the test that needs fixing.

I believe the main mechanism that unit tests reduce bugs is a because unit tests nudges the code to become more testable, and testability implies many other code qualities, such as SOLID. I argue that it is this indirect improvement of code quality that is the main reason for why unit testing reduces bugs.

Good unit tests pass and fail reliably. Those are the ones you don't have to keep rerunning until they pass, against the same code, because you're hoping to get lucky. The desire for tests you can trust after just one run nudge the unit towards being deterministic. Units that do the same thing every time allow tests that do the same thing every time.

That has more to do with writing functional code than SOLID. See Function Core, Imperative Shell. SOLID helps with other things, like code flexibility.

does the reduction in bugs in unit tested code come mainly from the unit tests detecting bugs or

No. Be just as suspicious of tests as you are of code.

mainly from indirect code quality improvements induced by improving testability before the unit tests are written?

No. It used to be true that making code testable forced you to enable run time polymorphism. But now we live in a world filled with mocking tools.

Tests number one code quality improvement is they make the code more readable. I don't have to imagine what it will do when I can see what it did.

The reason I like your teams plan is because I suspect they are operating under one of the oldest requirements: Make sure it does what it did before, except for this one thing.

That requirement is why we care about regression testing. If you're working under that with old code then go read Working Effectively with Legacy Code.

Tests are good at highlighting change and demonstrating behavior. But don't trust them to catch every bug. They don’t. And don't trust them to only fail because of bugs. Sometimes they fail because something got moved.

strategy for reducing the introduction of bugs.

Testing doesn't prevent introducing bugs. The tests can be buggy as well. Testing makes it easy to see what the code actually does. It's not a bug until some human decides if it's the code or the test that needs fixing.

I believe the main mechanism that unit tests reduce bugs is a because unit tests nudges the code to become more testable, and testability implies many other code qualities, such as SOLID. I argue that it is this indirect improvement of code quality that is the main reason for why unit testing reduces bugs.

Good unit tests pass and fail reliably. Those are the ones you don't have to keep rerunning until they pass, against the same code, because you're hoping to get lucky. The desire for tests you can trust after just one run nudge the unit towards being deterministic. Units that do the same thing every time allow tests that do the same thing every time.

That has more to do with writing functional code than SOLID. See Function Core, Imperative Shell. SOLID helps with other things, like code flexibility.

does the reduction in bugs in unit tested code come mainly from the unit tests detecting bugs or

No. Be just as suspicious of tests as you are of code.

mainly from indirect code quality improvements induced by improving testability before the unit tests are written?

No. It used to be true that making code testable forced you to enable run time polymorphism. But now we live in a world filled with mocking tools.

Tests number one code quality improvement is they make the code more readable. I don't have to imagine what it will do when I can see what it did.

The reason I like your teams plan is because I suspect they are operating under one of the oldest requirements: Make sure it does what it did before, except for this one thing.

That requirement is why we care about regression testing. If you're working under that with old code then go read Working Effectively with Legacy Code.

Tests are good at highlighting change and demonstrating behavior. But don't trust them to only fail because of bugs. Sometimes they fail because something got moved.

strategy for reducing the introduction of bugs.

Testing doesn't prevent introducing bugs. The tests can be buggy as well. Testing makes it easy to see what the code actually does. It's not a bug until some human decides if it's the code or the test that needs fixing.

I believe the main mechanism that unit tests reduce bugs is a because unit tests nudges the code to become more testable, and testability implies many other code qualities, such as SOLID. I argue that it is this indirect improvement of code quality that is the main reason for why unit testing reduces bugs.

Good unit tests pass and fail reliably. Those are the ones you don't have to keep rerunning until they pass, against the same code, because you're hoping to get lucky. The desire for tests you can trust after just one run nudge the unit towards being deterministic. Units that do the same thing every time allow tests that do the same thing every time.

That has more to do with writing functional code than SOLID. See Function Core, Imperative Shell. SOLID helps with other things, like code flexibility.

does the reduction in bugs in unit tested code come mainly from the unit tests detecting bugs or

No. Be just as suspicious of tests as you are of code.

mainly from indirect code quality improvements induced by improving testability before the unit tests are written?

No. It used to be true that making code testable forced you to enable run time polymorphism. But now we live in a world filled with mocking tools.

Tests number one code quality improvement is they make the code more readable. I don't have to imagine what it will do when I can see what it did.

The reason I like your teams plan is because I suspect they are operating under one of the oldest requirements: Make sure it does what it did before, except for this one thing.

That requirement is why we care about regression testing. If you're working under that with old code then go read Working Effectively with Legacy Code.

Tests are good at highlighting change and demonstrating behavior. But don't trust them to catch every bug. They don’t. And don't trust them to only fail because of bugs. Sometimes they fail because something got moved.

added 223 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369

strategy for reducing the introduction of bugs.

Testing doesn't prevent introducing bugs. The tests can be buggy as well. Testing makes it easy to see what the code actually does. It's not a bug until some human decides if it's the code or the test that needs fixing.

I believe the main mechanism that unit tests reduce bugs is a because unit tests nudges the code to become more testable, and testability implies many other code qualities, such as SOLID. I argue that it is this indirect improvement of code quality that is the main reason for why unit testing reduces bugs.

Good unit tests pass and fail reliably. Those are the ones you don't have to keep rerunning until they pass, against the same code, because you're hoping to get lucky. The desire for tests you can trust after just one run nudge the unit towards being deterministic. Units that do the same thing every time allow tests that do the same thing every time.

That has more to do with writing functional code than SOLID. See Function Core, Imperative Shell. SOLID helps with other things, like code flexibility.

does the reduction in bugs in unit tested code come mainly from the unit tests detecting bugs or

No. Be just as suspicious of tests as you are of code.

mainly from indirect code quality improvements induced by improving testability before the unit tests are written?

No. It used to be true that making code testable forced you to enable run time polymorphism. But now we live in a world filled with mocking tools.

Tests number one code quality improvement is they make the code more readable. I don't have to imagine what it will do when I can see what it did.

The reason I like your teams plan is because I suspect they are operating under one of the oldest requirements: Make sure it does what it did before, except for this one thing.

That requirement is why we care about regression testing. If you're working under that with old code then go read Working Effectively with Legacy Code.

Tests are good at highlighting change and demonstrating behavior. But don't trust them to only fail because of bugs. Sometimes they fail because something got moved.

strategy for reducing the introduction of bugs.

Testing doesn't prevent introducing bugs. The tests can be buggy as well. Testing makes it easy to see what the code actually does. It's not a bug until some human decides if it's the code or the test that needs fixing.

I believe the main mechanism that unit tests reduce bugs is a because unit tests nudges the code to become more testable, and testability implies many other code qualities, such as SOLID. I argue that it is this indirect improvement of code quality that is the main reason for why unit testing reduces bugs.

Good unit tests pass and fail reliably. Those are the ones you don't have to keep rerunning until they pass, against the same code, because you're hoping to get lucky. The desire for tests you can trust after just one run nudge the unit towards being deterministic. Units that do the same thing every time allow tests that do the same thing every time.

That has more to do with writing functional code than SOLID. See Function Core, Imperative Shell. SOLID helps with other things, like code flexibility.

does the reduction in bugs in unit tested code come mainly from the unit tests detecting bugs or

No. Be just as suspicious of tests as you are of code.

mainly from indirect code quality improvements induced by improving testability before the unit tests are written?

No. It used to be true that making code testable forced you to enable run time polymorphism. But now we live in a world filled with mocking tools.

Tests number one code quality improvement is they make the code more readable. I don't have to imagine what it will do when I can see what it did.

The reason I like your teams plan is because I suspect they are operating under one of the oldest requirements: Make sure it does what it did before, except for this one thing.

Tests are good at highlighting change and demonstrating behavior. But don't trust them to only fail because of bugs. Sometimes they fail because something got moved.

strategy for reducing the introduction of bugs.

Testing doesn't prevent introducing bugs. The tests can be buggy as well. Testing makes it easy to see what the code actually does. It's not a bug until some human decides if it's the code or the test that needs fixing.

I believe the main mechanism that unit tests reduce bugs is a because unit tests nudges the code to become more testable, and testability implies many other code qualities, such as SOLID. I argue that it is this indirect improvement of code quality that is the main reason for why unit testing reduces bugs.

Good unit tests pass and fail reliably. Those are the ones you don't have to keep rerunning until they pass, against the same code, because you're hoping to get lucky. The desire for tests you can trust after just one run nudge the unit towards being deterministic. Units that do the same thing every time allow tests that do the same thing every time.

That has more to do with writing functional code than SOLID. See Function Core, Imperative Shell. SOLID helps with other things, like code flexibility.

does the reduction in bugs in unit tested code come mainly from the unit tests detecting bugs or

No. Be just as suspicious of tests as you are of code.

mainly from indirect code quality improvements induced by improving testability before the unit tests are written?

No. It used to be true that making code testable forced you to enable run time polymorphism. But now we live in a world filled with mocking tools.

Tests number one code quality improvement is they make the code more readable. I don't have to imagine what it will do when I can see what it did.

The reason I like your teams plan is because I suspect they are operating under one of the oldest requirements: Make sure it does what it did before, except for this one thing.

That requirement is why we care about regression testing. If you're working under that with old code then go read Working Effectively with Legacy Code.

Tests are good at highlighting change and demonstrating behavior. But don't trust them to only fail because of bugs. Sometimes they fail because something got moved.

added 240 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369
Loading
deleted 20 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369
Loading
added 542 characters in body
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369
Loading
Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369
Loading