New answers tagged

0

Ensure there is technical leadership for code quality !!! I recently heard another version of this, i.e. "Our developers don't want to write tests, how to persuade them?" They literally say "everywhere I've worked we had a QA team that did that for us. it slows us down. i'm a developer not a tester." Answer... When you don't write tests you frequently ...


3

Indeed, the input is "irrelevant" for checking this function. What does it do? 1 - If the return of bar(input) is true, return baz(0) 2 - If the return of bar(input) is false, return baz(1) How can you mock bar and baz to validate such a behavior? You can have two stubs of bar: One that always returns true One that always returns false And for baz, ...


0

I don't thinks there's a good or bad here, its a tradeoff. My own preference would be to hardcode values you assert on - Decoupling your tests from the implementation has its benefits. i.e. do you want to change the test if the implementation changes, without the behavior changing? If you need to change your test a lot if the implementation changes, you ...


Top 50 recent answers are included