1. Make sure to write each tests completely independent of other.
2. Don't depend on the order of execution of the tests and it is not guarenteed.
3. Use mocks for external classes and test logic for only one class at a time.
4. And always verify the mocks to validate execution behavior with expected results.
5. Divide the steps in a test into setup, test, verify sections so that its easy to read.
when using spring-context.xml for spring applications.
@DirtiesContext is useful when it is necessary to re-initialize the auto-wiring of beans so that we make use of fresh copies of beans on each test.
This annotation will make sure that after the test, the new objects are created and injected.
Tuesday, June 11, 2013
Friday, June 7, 2013
Eclipse setup - useful plugins
Download the latest version of eclipse.
Install the following plugins
1. FindBugs - Static code analysis tool for possible bugs or performance.
2. CheckStyle - Java coding standand suggestions and violation detector
3. Cobertura - Unit test code coverage tool. shows line and branch coverage
4. Eclipse Color themes - Better (may be not) backgroup theme for editors
5. Git - Source Control. this is a must.
And this is the end of the list. feel free to suggest any better tools.
Install the following plugins
1. FindBugs - Static code analysis tool for possible bugs or performance.
2. CheckStyle - Java coding standand suggestions and violation detector
3. Cobertura - Unit test code coverage tool. shows line and branch coverage
4. Eclipse Color themes - Better (may be not) backgroup theme for editors
5. Git - Source Control. this is a must.
And this is the end of the list. feel free to suggest any better tools.
Subscribe to:
Posts (Atom)