Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

When QAs write automated selenium tests to test a multi-layered website (e.g. testing a web app which is on mvs design, spring and database) should the tests make use of existing classes and frameworks written by developers or should we write simplified classes to serve the test?

The downside of relying of frameworks developed by devs, is if there is a logical error in the framework it will be present in the tests.

a typical example is a class that fetches some links form a database and some framework printing them on the webpage.

If the tests rely on the framework to define the expected results and then verify them against the output on the webpage, then if the logic in the framework is incorrect, then the defined expected results will also be incorrect and there is a risk that the tests will pass even though the results are wrong.

In my opinion, the automated system tests written by QA should be independet on the underlying framework where as the automated unit tests should rely on the underlying framework.

What are your thoughts?

share|improve this question

migrated from stackoverflow.com Nov 4 '11 at 17:59

This question came from our site for professional and enthusiast programmers.

    
what your talking about is using the framework of the site to be tested to test the site. While that may be easier in the short term I think that would introduce some potential down the line errors in your program. to me testing should be stand-alone so that it can independently verify the site. –  CBRRacer Nov 4 '11 at 15:33
add comment

1 Answer 1

I think you answered your own question in your question when you asserted "If the tests rely on the framework to define the expected results and then verify them against the output on the webpage, then if the logic in the framework is incorrect, then the defined expected results will also be incorrect and there is a risk that the tests will pass even though the results are wrong." Your automation would in effect not be testing anything, it would simply be exploring the happy path.

You should not use the app itself to drive your automated tests, but it is perfectly reasonable and expected to use data from the app for validation within the automated tests. For instance, it is common practice to perform a test case and then compare results in the UI with results from the database or web service.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.