My book, my movies, my videos, my podcasts, my events ... the big collection of paul wheaton stuff!
Originally posted by Ernest Friedman-Hill:
One statement I disagreed with: "Functional test suites are usually run with JUnit." I guess it depends what kind of code we're talking about, but I've never written functional tests with JUnit. Functional tests are application tests, and as such, use the application's interface, not the coder's interface.
My book, my movies, my videos, my podcasts, my events ... the big collection of paul wheaton stuff!
Originally posted by Ernest Friedman-Hill:
Another disagreement is "A unit test never uses the filesystem". If this were an article about testing Ruby, maybe I'd buy that. For Java, though, following this would force me into an unreasonable corner, if only because somehow encoding test data into Java code (in one case, finite element mesh data in NetCDF format) would be so difficult it'd be a strong deterrent to testing.
I guess you could argue, then, that those tests should become functional tests. but I think deciding that a test is a functional test because of the form of the test data is artificial and odd.
My book, my movies, my videos, my podcasts, my events ... the big collection of paul wheaton stuff!
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
-file/network I/O or file system;
- another application;
-the console (System.out, System.err, etc.)
- logging
Originally posted by Pradip Bhat:
Paul,
I dont understand why Unit tests can't use the above items. Why can't it use the console API or do logging.![]()
My book, my movies, my videos, my podcasts, my events ... the big collection of paul wheaton stuff!
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Originally posted by Ernest Friedman-Hill:
One statement I disagreed with: "Functional test suites are usually run with JUnit." I guess it depends what kind of code we're talking about, but I've never written functional tests with JUnit. Functional tests are application tests, and as such, use the application's interface, not the coder's interface.
The file system is a different "unit". It is already tested and verified to be working properly. What needs to be tested is your business logic that uses that unit. The file system would be mocked, and you could verify that your business needs are being properly passed to the file system.
SCJP