You are here: ProjetSEG Web>JUnitTestPlan (01 Jun 2005)

JUnit Test Plan

Description

  • These are the tests that help verify what actions are possible with the goal of being able to measure progress.
  • We are using a top-down approach at defining our tests.
  • The total number of tests must not be modified but the actual tests can change in explicitness as we progress.
  • Iím only listing automatable tests here.
  • I greatly encourage defining other regression tests during the development, but they will not be accounted for here.
  • We will need discipline creating our Commands. See Req Action Undo One and Dev Doc Commands
  • A tool was created to generate the code structure. For example, given the table, it should produce code like this:

//    /**
//     * Test #1 for requirement ReqCompCompBind
//     * 
//     * Author:
//     */
//    public void testReqCompCompBind1() {
//        //  TODO: implement
//        assertTrue("Unimplemented", false);
//    }

  • Use ctrl-/ to uncomment the block when ready to implement it.
  • We will use this tool once to generate the structure of all our tests. We will comment out those that we canít yet implement. When ready to implement them, we will uncomment them.
  • Keeping the number of tests to implement constant lets us graph out our progress (% of tests implemented, % of tests passing)
  • The tests listed here are very general; when implemented should try to cover as much code as possible, testing from the highest level possible.
  • We have 71 tests for our mandatory requirements.
  • 1 requirement has been put out of scope. 70 tests remain.

Tests

Req Action Undo One

0 explicit tests.

All Commands must implement execute/redo/undo/canexecute/canundo properly. Usual sequence: canExecute() ? execute()->redo() and later: canUndo()?undo();

All Commands should leave the model in a valid UCM state. To verify this, the top level class of our seg.jUCMNav package shall include two methods: testPreConditions(), testPostConditions(). These methods shall be used in JUnit tests but also in our debug build using assertions. If they arenít overwritten, these methods should fail so that we know we have to create them. This will test our model manipulation layer extensively; higher level tests wonít have to worry about these details but since they will be executed everytime a command is executed (in debug mode or in JUnit tests), they will be tested VERY often.

testPreConditions(): will check the model to see if it is valid to call redo(). This can involve calling canExecute() but its main goal is to check that if a redo has already been called, followed by undo, the model is back in its initial state. Should verify that newly created elements are not in the model, etc. Should be the first line executed in redo() and last in undo().

testPostConditions(): will check the model to see if it is valid after the execution of the command. This usually involves checking to see if the newly created elements are actually in the model, that removed ones are no longer in it, that Path Nodes? have appropriate in/out connections. Should be the last line executed in redo() and first in undo().

Req Comp

2 explicit tests.

Requirement concerns both Component Element? and Component REf?

  1. Creation scenario: Component Ref? must be in palette.
    When put on content pane, must be added to the model.
    Must always be linked to a Component Element?
  2. Edition scenarios: Properties view must show x,y,id,name,width,height, compDef:EObjectPropertySource.addPropertyToDescriptor(Collection descriptors, EAttribute attr, EClass c) must modify descriptors.

X,y,width,height Map And Path Graph XYLayout Edit Policy?.createChangeConstraintCommand(Edit Part? child, Object constraint) shall create a command. If fixed should not be able to move or resize.

Req Comp Comp Bind

2 explicit tests

  1. When a component is moved inside another, parent is set.
  2. Properties view must show parent EObject Property Source?.addPropertyToDescriptor(Collection descriptors, EAttribute attr, EClass c) must modify descriptors. Should see dropdown of possible componentrefs.

Req Comp Comp Unbind

2 explicit tests

  1. When a component is moved outside its parent, parent is unset.
  2. Properties view must show parent EObject Property Source?.addPropertyToDescriptor(Collection descriptors, EAttribute attr, EClass c) must modify descriptors. Should have a none option in the componentrefs dropdown list.

Req Comp Path Bind

2 explicit tests.

  1. When a Path Node? is moved inside a Component Ref?, parent is set.
  2. Properties view must show parent EObject Property Source?.addPropertyToDescriptor(Collection descriptors, EAttribute attr, EClass c) must modify descriptors. Should see dropdown of possible componentrefs.

Req Comp Path Unbind

2 explicit tests.

  1. When a Path Node? is moved outside its parent, parent is unset.
  2. Properties view must show parent EObject Property Source?.addPropertyToDescriptor(Collection descriptors, EAttribute attr, EClass c) must modify descriptors. Should have a none option in the componentrefs dropdown list.

Req Connections

3 explicit tests.

  1. When end and start/wait/timer are selected, connect appears in the contextual menu.
  2. Connect element overlaps others, disconnect appears in contextual menu.
  3. Connect command moves two selected elements.

Req Elem And Fork

3 explicit tests.

  1. Appears in palette and can be inserted on path. Adds a second outgoing path.
  2. Appears in Path Node? contextual menu, adds a second path
  3. Appears in contextual meunu, when Empty Node? and Start Point? are selected; doesnít add a path, removes the start point.

Req Elem And Join

3 explicit tests.

  1. Appears in palette and can be inserted on path. Adds a second incoming path.
  2. Appears in Path Node? contextual menu, adds a second path
  3. Appears in contextual meunu, when Empty Node? and End Point? are selected; doesnít add a path, removes the end point.

Req Elem Delete

5 explicit tests. changed text; May 30th
  1. Can delete any Path Node? that have exactly 1 input, 1 output at any time.
  2. When deleting the last input/output of a stub/fork/join, stub/fork/join transforedm to empty node.
  3. Can delete componentrefs at any time, can delete components if they have no references.
  4. For all Path Nodes? that have multiple inputs or outputs, deleting all elements on the optional inputs or outputs removes the optional paths.
  5. Deletion of completely selected paths is possible.

Req Elem Direction Arrow

2 explicit tests.

  1. Appears in palette and can be inserted on path.
  2. Is oriented properly; not only the direction but the angle. this test must also be able to orient end points properly.

Req Elem Dynamic Stub

2 explicit tests.

  1. Appears in palette and can be inserted on path. Replaces Empty Node? if placed on one.
  2. Can consume start/end points; when dragged on them, they are linked.

Req Elem Empty Point

2 explicit tests.

  1. Appears in palette and can be inserted on path.
  2. To be used as test subject for edit/movement of Path Nodes?.
    Properties view must show x,y,id,name
    EObject Property Source?.addPropertyToDescriptor(Collection descriptors, EAttribute attr, EClass c) must modify descriptors.

X,y Map And Path Graph XYLayout Edit Policy?.createChangeConstraintCommand(Edit Part? child, Object constraint) shall create a command.

Req Elem End Point

3 explicit tests

  1. Path tool exists in palette and can be inserted onto path
  2. Start/End points can be merged.
  3. Can have guard condition

Req Elem Or Fork

3 explicit tests.

  1. Appears in palette and can be inserted on path. Adds a second outgoing path.
  2. Appears in Path Node? contextual menu, adds a second path
  3. Appears in contextual meunu, when Empty Node? and Start Point? are selected; doesnít add a path.

Req Elem Or Join

4 explicit tests.

  1. Appears in palette and can be inserted on path. Adds a second incoming path.
  2. Appears in Path Node? contextual menu, adds a second path
  3. Appears in contextual meunu, when Empty Node? and End Point? are selected; doesnít add a path, removes the end point.
  4. Can have guard condition

Req Elem Responsibility

2 explicit tests.

  1. Responsibility tool exists in palette and can be inserted into diagram
  2. Must always be linked to Responsibility. Properties view should show Responsibility dropdown.3)

Req Elem Start Point

2 explicit test.

  1. Path tool exists in palette and can be inserted onto path.
  2. Can have guard conditions

Req Elem Start Point Attributes

1 explicit test.

  1. Properties view shows workload attribute

Req Elem Static Stub

2 explicit tests.

  1. Appears in palette and can be inserted on path. Replaces Empty Node? if placed on one.
  2. Can consume start/end points; when dragged on them, they are linked.

Req Elem Stub Actions

6 explicit tests.

  1. Must be able to create plugin.
    • creates a new map
    • positions editor at a new navigationlocation
    • from contextual menu
    • from views
  2. must be able to view plugin
    • double click in editor
    • from views
    • positions editor at a new navigationlocation
  3. add plug-in
    • if static and has no plug-ins, must be able to select maps from a list of possibilities
    • if dynamic, should be able to add a map from a list of possibilities to a list of plugins
    • during execution, stub binding conditions are examined to know which plug-in to be used
  4. remove plugin
    • inverse of previous operations
  5. rename plugin
    • a plugin is just another map.
  6. bind plugin
    • wizard or property page
    • activated by contextual menu on stub
    • select a plugin
    • match stub inputs with plugin start points
    • match stub outputs with plugin end points
    • numbers do not need to match

Req Elem Timer

2 explicit tests.

  1. Timer appears in palette and can be inserted into diagram
  2. Contextual menu allows for the creation of a timeout path.

Req Elem Wait

2 explicit tests

  1. Wait appears in palette and can be inserted onto path
  2. can have guard condition

Req Export Bitmap

2 explicit test

  1. Appears in file/export
  2. Appears in contextual menu of a diagram in package explorer

Req Help About

1 explicit test

  1. help about exists

1 implicit Daniel finds it sufficient.

Req Help On Line

1 explicit test

  1. online help exists

1 implicit Daniel finds it sufficient.

Req Open

1 explicit test

  1. top level model element is URNSpec

Req Save

1 explicit test

  1. top level model element is URNSpec

Req Save As

0 explicit tests

Supported by framework; implicit if Req Save is done.

Req Save Backup

No longer in scope 1 explicit test

  1. UCM Editor supports Team Support for Local History purposes.

Req Select All

0 explicit tests.

Req Select Group

0 explicit tests.

Req Select Group Delete

0 explicit tests. See Req Elem Delete

Req Select Group Move

0 explicit tests.

Req Select Single

0 explicit tests.

Req Select Unselect All

0 explicit tests.

Req Select Unselect One

0 explicit tests.

Req Browse History

1 explicit test

  1. Navigation Location implemented for all diagrams in one UCM

Req Browse Model

4 explicit tests

  1. Outline view is implemented properly
  2. Explorer is implemented properly (remember to be able to rename map)
  3. Responsibilities view is implemented properly
  4. Description view is implemented properly

Req Labels

2 explicit tests

  1. Contextual menu on Component Ref?/PathNode shows show/hide label
  2. Properties view must show label EObject Property Source?.addPropertyToDescriptor(Collection descriptors, EAttribute attr, EClass c) must modify descriptors.

Req Select Feedback

0 explicit tests.

Req Documentation

0 explicit tests.

Req Java Version

0 explicit tests.

If it builds, it runs.

Categories

Palette tests

  1. Req Comp 1?
  2. Req Elem And Fork 1?
  3. Req Elem And Join 1?
  4. Req Elem Direction Arrow 1?
  5. Req Elem Dynamic Stub 1?
  6. Req Elem Empty Point 1?
  7. Req Elem End Point 1?
  8. Req Elem Or Fork 1?
  9. Req Elem Or Join 1?
  10. Req Elem Responsibility 1?
  11. Req Elem Start Point 1?
  12. Req Elem Static Stub 1?
  13. Req Elem Timer 1?
  14. Req Elem Wait 1?

Properties tests

  1. Req Comp 2?
  2. Req Comp Comp Bind 2?
  3. Req Comp Comp Unbind 2?
  4. Req Comp Path Bind 2?
  5. Req Comp Path Unbind 2?
  6. Req Elem Empty Point 2?
  7. Req Elem End Point 3?
  8. Req Elem Or Join 4?
  9. Req Elem Responsibility 2?
  10. Req Elem Start Point 2?
  11. Req Elem Start Point Attributes
  12. Req Elem Wait 2?
  13. Req Labels 2?

Behaviour tests

  1. Req Comp Comp Bind 1?
  2. Req Comp Comp Unbind 1?
  3. Req Comp Path Bind 1?
  4. Req Comp Path Unbind 1?
  5. Req Connections 3?
  6. Req Elem Delete 1?
  7. Req Elem Delete 2?
  8. Req Elem Delete 3?
  9. Req Elem Delete 4?
  10. Req Elem Delete 5?
  11. Req Elem Direction Arrow 2?
  12. Req Elem Dynamic Stub 2?
  13. Req Elem End Point 2?
  14. Req Elem Static Stub 2?
  15. Req Labels 1?

Contextual Menu tests

  1. Req Connections 1?
  2. Req Connections 2?
  3. Req Elem And Fork 2?
  4. Req Elem And Fork 3?
  5. Req Elem And Join 2?
  6. Req Elem And Join 3?
  7. Req Elem Or Fork 2?
  8. Req Elem Or Fork 3?
  9. Req Elem Or Join 2?
  10. Req Elem Or Join 3?
  11. Req Elem Timer 2?
  12. Req Export Bitmap 2?

Stub action tests

  1. Req Elem Stub Actions 1?
  2. Req Elem Stub Actions 2?
  3. Req Elem Stub Actions 3?
  4. Req Elem Stub Actions 4?
  5. Req Elem Stub Actions 5?
  6. Req Elem Stub Actions 6?

General non-editor tests

  1. Req Export Bitmap 1?
  2. Req Help About 1?
  3. Req Help On Line 1?
  4. Req Open 1?
  5. Req Save 1?
  6. Req Save Backup 1? no longer in scope
  7. Req Browse History 1?
  8. Req Browse Model 1?
  9. Req Browse Model 2?
  10. Req Browse Model 3?
  11. Req Browse Model 4?

(jkealey: changed categories, June 1st)

Topic attachments
I Attachment Action Size Date Who Comment
docdoc tests.doc manage 100.0 K 10 Apr 2005 - 14:19 Jason Kealey Draft document I have been working on for a few days.
Topic revision: r10 - 01 Jun 2005 - 20:20:37 - Jason Kealey
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback