Loading ...
Sorry, an error occurred while loading the content.

Re: [junit] your opinion needed: package for unit testing codes

Expand Messages
  • J. B. Rainsberger
    ... If tests are to be documentation about how to use the code being tested, then tests should only use only public methods/interfaces. Also, if tests depend
    Message 1 of 31 , Jan 30, 2004
    • 0 Attachment
      veny wrote:

      > I would prefer to put it under the same package in different source folder.
      > What is the drive behind not using the same package?

      If tests are to be documentation about how to use the code being tested,
      then tests should only use only public methods/interfaces.

      Also, if tests depend on non-public parts of production classes, then
      the tests "get in the way" of refactorings that /should/ not affect
      client code.

      The whole point (!!) of the protected and private keyword is to shield
      client code from the inner-workings and details of design. Tests are
      client code. Why should tests get special access to these inner workings?

      I favor Interface Segregation over the protected and private keywords.
      --
      J. B. Rainsberger,
      Diaspar Software Services
      http://www.diasparsoftware.com :: +1 416 791-8603
      Let's write software that people understand
    • Joakim Ohlrogge
      Hi, So JUnit is more of a developer-tool than it is a testingtool. From what you want to do it seems like fit/fitnesse is more apropriate (maintaining test
      Message 31 of 31 , Nov 19, 2006
      • 0 Attachment
        Hi,

        So JUnit is more of a developer-tool than it is a testingtool. From what you
        want to do it seems like fit/fitnesse is more apropriate (maintaining test
        suites of testdata that can be repededly executed and verified).

        Of course your develpers really should do unit testing to prevent "bugs"
        from entering the code in the first place.
        In short the process is that acceptance tests are written in fitnesse and
        fixtures to run those tests are implemented by developers.
        In order to realize those demands in code the developers use JUnit to
        discover and test the units required to implement those demands.
        When the fitnessetests pass the developers are done :) The idea is to have
        self verifying demands as much as possible.

        fitnesse: http://www.fitnesse.org there is a demo there that you can try out
        to see if that would work for you.
        I've heard of teams that use only JUnit, in those teams it is still the
        developers writing the tests in colaboration with the customer/QA.
        I guess you can make anything work with communication; the opposite is also
        true.

        I hope thie helps,
        / Joakim Ohlrogge

        On 11/19/06, friends4ever_8in <friends4ever_8in@...> wrote:
        >
        > Hi all,
        > I am a new member to join the grp.
        >
        > I needed some help. Please suggest something in this regard.
        >
        > I have always been in testing and that too functinality/manual
        > testing. So I was never involved in deveopment or automated testing.
        >
        > But these days, talks are going on in our project to automate some of
        > our testing tasks. For this they want to use Junit as the main testing
        > tool. But also, we want to have a GUI, through which test data can be
        > entered or the other option being, maintaining the test data in an xml
        > file and then automating the process of extracting values from that
        > file and using those values in test cases which can be run
        > continuously one after the another, each time taking a different set
        > of value from the file.
        >
        > Also, the result of the test case should be communicated back to the
        > tester.
        >
        > Please suggest how this can be achieved and what sort of
        > framework/design should be used for this test suite.
        >
        > Will be waiting for response from all the members of the group.
        >
        >
        >


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.