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

If you mock the DB in your test, make that clear.

Don’t expect me to know that because you called it a unit test. I’ve seen things called a unit test for no better reason then that they were run with jUnit.

The point is ifIf you mock something out you aren’t testing it. If you don’t test it don’t act surprised if what it does surprises you.

Maybe it’s not yours. Maybe someone else tested it and you trust them. Fine. Just make that clear.

But justMaybe you worked real hard to make sure the code under test was deterministic so the test would be reliable. Fine. Make that clear.

Just because a test exists doesn’t mean it has to test anything besides what it cares about. Just make clear what it cares about. That way we know what has and hasn’t been tested.

That’s what’s important. Not this unit vs integration stuff. That is literally arguing semantics.

If you mock the DB in your test, make that clear.

Don’t expect me to know that because you called it a unit test. I’ve seen things called a unit test for no better reason then that they were run with jUnit.

The point is if you mock something out you aren’t testing it. If you don’t test it don’t act surprised if what it does surprises you.

Maybe it’s not yours. Maybe someone else tested it and you trust them. Fine. Just make that clear.

But just because a test exists doesn’t mean it has to test anything besides what it cares about. Just make clear what it cares about. That way we know what has and hasn’t been tested.

That’s what’s important. Not this unit vs integration stuff. That is literally arguing semantics.

If you mock the DB in your test, make that clear.

Don’t expect me to know that because you called it a unit test. I’ve seen things called a unit test for no better reason then that they were run with jUnit.

If you mock something out you aren’t testing it. If you don’t test it don’t act surprised if what it does surprises you.

Maybe it’s not yours. Maybe someone else tested it and you trust them. Fine. Just make that clear.

Maybe you worked real hard to make sure the code under test was deterministic so the test would be reliable. Fine. Make that clear.

Just because a test exists doesn’t mean it has to test anything besides what it cares about. Just make clear what it cares about. That way we know what has and hasn’t been tested.

That’s what’s important. Not this unit vs integration stuff. That is literally arguing semantics.

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

If you mock the DB in your test, make that clear.

Don’t expect me to know that because you called it a unit test. I’ve seen things called a unit test for no better reason then that they were run with jUnit.

The point is if you mock something out you aren’t testing it. If you don’t test it don’t act surprised if what it does surprises you.

Maybe it’s not yours. Maybe someone else tested it and you trust them. Fine. Just make that clear.

But just because a test exists doesn’t mean it has to test anything besides what it cares about. Just make clear what it cares about. That way we know what has and hasn’t been tested.

That’s what’s important. Not this unit vs integration stuff. That is literally arguing semantics.

If you mock the DB in your test, make that clear.

Don’t expect me to know that because you called it a unit test. I’ve seen things called a unit test for no better reason then that they were run with jUnit.

The point is if you mock something out you aren’t testing it. If you don’t test it don’t act surprised if what it does surprises you.

Maybe it’s not yours. Maybe someone else tested it and you trust them. Fine. Just make that clear.

But just because a test exists doesn’t mean it has to test anything besides what it cares about. Just make clear what it cares about. That way we know what has and hasn’t been tested.

If you mock the DB in your test, make that clear.

Don’t expect me to know that because you called it a unit test. I’ve seen things called a unit test for no better reason then that they were run with jUnit.

The point is if you mock something out you aren’t testing it. If you don’t test it don’t act surprised if what it does surprises you.

Maybe it’s not yours. Maybe someone else tested it and you trust them. Fine. Just make that clear.

But just because a test exists doesn’t mean it has to test anything besides what it cares about. Just make clear what it cares about. That way we know what has and hasn’t been tested.

That’s what’s important. Not this unit vs integration stuff. That is literally arguing semantics.

Source Link
candied_orange
  • 119.7k
  • 27
  • 233
  • 369

If you mock the DB in your test, make that clear.

Don’t expect me to know that because you called it a unit test. I’ve seen things called a unit test for no better reason then that they were run with jUnit.

The point is if you mock something out you aren’t testing it. If you don’t test it don’t act surprised if what it does surprises you.

Maybe it’s not yours. Maybe someone else tested it and you trust them. Fine. Just make that clear.

But just because a test exists doesn’t mean it has to test anything besides what it cares about. Just make clear what it cares about. That way we know what has and hasn’t been tested.