java testing methodologies, choosing the appropriate one!

Discussion in 'Java' started by hvt, Feb 20, 2007.

  1. hvt

    hvt Guest

    Objective:
    Preparation of JUnit testcases for bundle of classes, require almost
    full test coverage.

    Scenario:
    struts based application, with very heavy middle tier code which
    mainly performs:
    1. interaction with database
    2. application logic implementation
    3. talking to other web-servers and handling response back from them

    Problem:
    I require preparation of junit testcases for above mentioned
    middletier javacode. For simpler method with clear ip/op it's very
    easy to write test cases though for heavy methods which performs lots
    of database operation or other implementations there is the problem in
    writing test cases.
    These method requires a particular state of system. Number of such
    methods are really large.

    I 've come across following possible solution none seems to fit in a
    smooth way:
    1. Using Cactus, JTestCase with JICE to automate the test case
    Automation in terms of input/assert-output preparation, through
    jice it's easy to write your input beans/complex-type such as hashmap
    etc.
    Problem in using this approach was when the input bean has member
    beans which may extend some base class the size of xml becomes really
    very large, now for developer to fill in the value of every field
    which in turn denotes the state of the system that leads to many
    manual errors.
    I though try to automate xml formation but then if the return value is
    bean/complex-type JTestCase doesn't support jice tags inside assert/
    assertgroups.

    2. Using JMock or JDummy for preparation of mock object
    Though it's intended for good development practice, I 've tried it
    for already developed code which then I found difficult to automate
    and somewhat complex for developers. The doc clearly says it's usage
    is when u start developing a code.


    I assume this to be a common problem/challenge for such applications
    which are huge and already developed now requires test case
    preparation.
    It would appreciate any suggestions/comments on proper approach for
    handling such situation.
     
    hvt, Feb 20, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vinh Pham
    Replies:
    5
    Views:
    587
    Vinh Pham
    Dec 8, 2003
  2. A
    Replies:
    3
    Views:
    475
    jeffc
    Nov 26, 2003
  3. Replies:
    1
    Views:
    439
    Nicholas Paul Collin Gloucester
    Feb 5, 2009
  4. Joe Kesselman
    Replies:
    0
    Views:
    951
    Joe Kesselman
    Sep 27, 2011
  5. Joe Kesselman
    Replies:
    0
    Views:
    920
    Joe Kesselman
    Sep 28, 2011
Loading...

Share This Page