Can functional testing be replaced or significantly reduced by integration testing? For example, by using a CI...
Unit tests are tests built by developers; unit tests are designed to test code at the smallest practical "unit" of functioning code. Tests designed to address units of code that work together are integration tests. Integration tests are also built by developers. Examples help explain so much more than definitions so let me create an example to step through.
Imagine a Web application that requires a login. To keep the example simple, let's imagine a login page that requires an account name and password. A unit test might be built to check the field length of both fields and maybe that the login button doesn't become enabled until a value of the required length is entered in both fields. An integration test, in this example, might be checking that the user views a home page after entering valid values and pressing the login button. So now let's consider the original question and think through what additional tests a functional tester might execute given the unit and integration tests that have been outlined.
Here are a few functional test ideas given this situation:
- First a happy path confirmation test: Can a valid user enter valid values in both fields and login?
- Followed by a process checkpoint: Once the user logs in, should there be a personalized greeting on the home page? Let's suppose "Welcome Karen" should appear. Does it appear?
Here are a few more tests:
- Does a user who has visited the site previously have a cookie stored on the PC and if so, what information is stored in the cookie?
- And how does having a cookie affect or not affect the login and home pages?
- Can a user that has been inactivated log in?
- What if a user forgets their password? Is there reset password functionality available?
- What if the user enters an invalid value or no value in the field? What error messaging appears? Are the messages consistent with other error messages in the application?
- What if the user has lost Internet connection and the home page has been cached in their browser? What messaging appears on an attempt to login with connection?
There are more tests I can think to execute but I'll stop here.
There are more functional tests and ideas testers can think of than developers are likely to build at either unit or integration level tests. From afar, it would seem that unit and integration tests must be enough and why spend more resources testing? But these examples hopefully illustrate that in fact, there is plenty of testing yet to be addressed through functional testing even after unit and integration testing.
Using a continuous integration server may keep unit and integration tests up to date and passing but it's still the same limited tests being executed against the code. The same would be true if automated functional tests were built -- time might be saved executing the tests but the only tests executed would be whatever tests were built. A functional tester who's engaged with the application and has unique ideas and doesn't execute testing in a mechanical rote approach will continue to find bugs.
Dig Deeper on Unit, Integration and Functional Software Testing
Related Q&A from Karen N. Johnson
There are so many resources out there about the ever-changing world of Web design and mobile testing, but to choose the most salient and insightful ... Continue Reading
In this expert response, consultant Karen Johnson describes strategies she uses for browser compatibility testing. Experience and knowledge of common... Continue Reading
Initiating test automation on your project team may seem challenging, or even overwhelming. Fortunately, expert Karen Johnson has been through this ... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.