DOC PREVIEW
Penn CIT 591 - Test Suites

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Test SuitesTest classesTest classes for the current assignmentTest suitesExample test suite (slightly edited)Running the test suiteThe EndTest SuitesRecommendations for current assignmentTest classesA unit test is a test of an individual classBy convention, we name test classes after the class that is being testedFor example, if we have a CodeMachine class, we would have a CodeMachineTest class for testing itInterfaces have no actual methods to be testedAbstract classes may have non-abstract methods that can be tested (and abstract ones that can’t)If a project has multiple classes, it makes sense to have a test class for eachTest classes for the current assignmentHere are the classes you need:SecretCode2 (GUI class—not readily testable)CodeMachine (abstract)SimpleCodeMachineArrayCodeMachinePigLatinMachineHere are the test classes I recommend:CodeMachineTestSimpleCodeMachineTestArrayCodeMachineTestPigLatinMachineTestTest suitesA test suite is a class that contains calls to unit test classes (and sometimes other test suites)This is sometimes more convenient than running your unit tests one at a timeNaturally, Eclipse will help you create a test suiteCreate your unit test classesFile  New…  Other…  Java  JUnit  JUnit Test SuiteClick the Next button to choose which unit tests to include in the suiteIf you add test classes later, you can hand-edit this suiteLike the JUnit test classes, it’s just ordinary javaExample test suite (slightly edited)import junit.framework.Test;import junit.framework.TestSuite;public class AllTests { public static Test suite() { TestSuite suite = new TestSuite("Test for default package"); suite.addTestSuite(CodeMachineTest.class); suite.addTestSuite(ArrayCodeMachineTest.class); suite.addTestSuite(SimpleCodeMachineTest.class); suite.addTestSuite(PigLatinMachineTest.class); return suite; }}Running the test suiteRun the test suite just like any other unit test:Run  Run As  JUnit TestResults are very similar to those for a simple JUnit testThe


View Full Document

Penn CIT 591 - Test Suites

Documents in this Course
Stacks

Stacks

11 pages

Arrays

Arrays

30 pages

Arrays

Arrays

29 pages

Applets

Applets

24 pages

Style

Style

33 pages

JUnit

JUnit

23 pages

Java

Java

32 pages

Access

Access

18 pages

Methods

Methods

29 pages

Arrays

Arrays

32 pages

Methods

Methods

9 pages

Methods

Methods

29 pages

Vectors

Vectors

14 pages

Eclipse

Eclipse

23 pages

Vectors

Vectors

14 pages

Recursion

Recursion

24 pages

Animation

Animation

18 pages

Animation

Animation

18 pages

Static

Static

12 pages

Eclipse

Eclipse

23 pages

JAVA

JAVA

24 pages

Arrays

Arrays

29 pages

Animation

Animation

18 pages

Numbers

Numbers

21 pages

JUnit

JUnit

23 pages

Access

Access

18 pages

Applets

Applets

24 pages

Methods

Methods

30 pages

Buttons

Buttons

20 pages

Java

Java

31 pages

Style

Style

28 pages

Style

Style

28 pages

Load more
Download Test Suites
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Test Suites and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Test Suites 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?