I've been reading about testing. Here are a few words on my thoughts about testing.
From my reading and understanding there are three types of tests:
- Unit tests: a unit test tests a single function (e.g. an object method). A unit test must take care of isolating the tested function from the functions the tested function normally relies on (when executed outside any test).
- Integration tests: an integration test tests if two or more dependent functions correctly work together.
- User-acceptance tests: a user-acceptance tests whether a given function provides the behavior its users expect. User Interface tests belong to this type.
These three types of tests are complementary, they all have their importance when testing an application.
Applications built with OpenLayers and/or GeoExt and/or MapFish instantiate classes from these libraries. Often, most of their code doesn't include actual logic, and from that regard writing unit and integration tests for such applications doesn't make sense. However, as User Interfaces, these applications would deserve user-acceptance tests.
Providing automated User Interface tests is in my opinion a very difficult task, and I'd be very interested in having feedback from others on that.