问题描述:

I have to submit my project along with test suits. I would appreciate someone explaining best with example what is it, is there some other tools that build the test or is it a scenario written by myself? I have never written it before so please any info will be of a great help.

网友答案:

Test suite is nothing else but group of UnitTest.

Suppose You have a couple of test: UserDAOTest, BooksDAOTest, BorrowsDAOTest, etc...

public class DAOSuite{
    Class[] testClasses = {
        UserDAOTest.class,
        BooksDAOTest.class,
        BorrowsDAOTest.class
    };
    TestSuite = new TestSuite(testClasses);
}

Alternatively You can do above with annotations style too. Then just run your test suite(s) same way you run jUnit tests.

Additional info [1]

[1] http://www.junit.org/apidocs/junit/framework/TestSuite.html

网友答案:

Lukasz Siwinski states:

"Test suite is nothing else but group of UnitTest."

That is not entirely accurate.

A "test suite" CAN be just a group of unit tests. But it can also include larger scale tests (system tests or integration tests) that are designed to test the larger scale behaviour of a system.

The Wikipedia page on System Testing provides an overview of the kinds of things that may be tested at the system level.


In your case, unit tests may be sufficient to satisfy the project requirements. But I'd advise you to clarify this with the project supervisors.

相关阅读:
Top