Browse by Tags
All Tags »
unit testing (RSS)
Summary Motley: Just use a batch file to execute unit tests - it's easy and quick. Maven: Use a unit test framework to write and execute unit tests. A framework makes tests easy to write, executes tests quickly and consistently, and provides features
Read More...
Summary Motley: A simple if-then-else hook is the simplest and best way to inject a mock object. Maven: First, you have to design to interfaces. Then, techniques like dependency injection, factories, and endo-testing are more effective ways to inject
Read More...
Summary Motley: To get high code coverage, we should be testing both public and private methods Maven: Only test public methods. Testing private methods gets in the way of refactoring ______________________________ [Context: Maven checks in on Motley's
Read More...
Summary Motley: Contracts don't apply to software - leave them for baseball players and cell phone providers Maven: Contracts (preconditions, postconditions, invariants) help drive your unit tests ______________________________ [Context: Motley is all
Read More...
Summary Motley: If I hit 100% code coverage for my tests, then there is nothing left to test. Maven: 100% line coverage does not necessarily mean you have full test coverage. You have to consider condition coverage as well. ______________________________
Read More...
Summary Motley: Every time I make a change in refactoring I either cause compile problems or break functionality. Refactoring is slow and not worth the effort. Maven: Use tools to refactor and leverage unit tests to improve your confidence that your refactoring
Read More...
Summary Motley: Refactoring takes too much time - I have to ship you know! Maven: Refactoring leads to much more maintainable code, and if you have tests in place, the return on investment far outweighs the cost. ______________________________ [Context:
Read More...
Summary Motley: Tests need to validate code that has already been written - not the other way around. Maven: Writing tests before you code allows the tests to drive your code while providing more sound requirements validation. ______________________________
Read More...
Summary Motley: You can't possibly write tests before code - there's nothing to test. Maven: Writing tests for a method before coding it has all kinds of design advantages. ______________________________ [Context: Motley has been writing unit tests for
Read More...
Summary Motley: Unit tests take too long to execute. I'm not going to bother. Maven: Unit tests need to run quickly - you need to execute them frequently. Mock objects can help. ______________________________ [Context: Motley has been writing unit tests
Read More...
Summary Motley: Unit testing is the test team's job! I am not paid to write tests. Maven: White box (unit) tests help with code quality and give you confidence to change your code. ______________________________ [Context: During a previous conversation
Read More...
Summary Motley: I rely on the debugger when I am writing code. Without it, I'd have a really hard time tracking down all the bugs in my code. Maven: Write code as if the debugger does not even exist. Include unit tests, assertions, tracing, logging, static
Read More...