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

Re: Thinking of improving the auto generation of test cases

Expand Messages
  • junitheadache
    I ve dled the bundle from EMF website however I ve no idea how to install it? I ve unzipped it and its just a bunch of jar files? I am new to eclipse should I
    Message 1 of 32 , Dec 31, 2006
      I've dled the bundle from EMF website however I've no idea how to
      install it? I've unzipped it and its just a bunch of jar files?

      I am new to eclipse should I copy all of those files into the
      respective eclipse directory or something?

      Help needed,
      Jimm


      --- In junit@yahoogroups.com, Ole Ersoy <ole_ersoy@...> wrote:
      >
      > You may also want to check out the Eclipse Modeling
      > Framework (EMF), as it generates stub tests for all of
      > it's model classes using JET templates. This may
      > server as a good baseline to generate tests on top of.
      >
      > Also Ecore (The EMF Meta Modeling Framework) is useful
      > for thinking about the Semantics of Java and object
      > oriented structure.
      >
      > For example an EAttribrute is used to model primitives
      > in Java, as well as Strings.
      >
      > So if you start with models of what Java lets you do,
      > you can use those models to Enumerate all
      > possibilities and generate tests that test the
      > expectations around what is to be returned by method
      > calls and recommend various model invarient
      > constraints that would give feedback on illegal values
      > that would produce unwanted results.
      >
      > Alternatively if you use Java's Reflection
      > capabilities that should get you a long ways as well.
      >
      >
      >
      >
      >
      >
      > --- Kevin Lawrence <kev.lawrence@...> wrote:
      >
      > > On 12/27/06, junitheadache
      > > <bohs01@...> wrote:
      > > > Hi all,
      > > >
      > > > I am currently working on auto generation of test
      > > cases for TDD for
      > > > my honors year project. And was considering
      > > modifying JUnit such
      > > > that it will auto generate some test cases based
      > > values flagged by
      > > > users.
      > > >
      > > > E.g.,
      > > > Public boolean isLegalInt(int x){
      > > > /* input - 0 < x < 10, result - True*/
      > > >
      > > > }
      > > > given a comment like the above will generate
      > > assert statements such
      > > > as
      > > > assertFalse(isLegalInt(0));
      > > > assertTrue(isLegalInt(1));
      > > > assertTrue(isLegalInt(9));
      > > > assertFalse(isLegalInt(10));
      > > >
      > >
      > > Hi Junitheadache,
      > >
      > > You should read David Saff's recent post on this
      > > list about "The
      > > Practice of Theories".
      > >
      > > David proposes an extension to JUnit that would
      > > allow programmers to
      > > create DbC-like tests that would apply to *all*
      > > parameters to a
      > > method, for example:
      > >
      > > @Theory public void multiplyIsInverseOfDivide(Money
      > > amount, int multiplier) {
      > > assertEquals(amount,
      > > amount.times(multiplier).divideBy(multiplier));
      > > }
      > >
      > > A specialized test-runner would then behave as a
      > > kind of "theorem
      > > disprover" and look for counter-examples that cause
      > > the assertion to
      > > fail. There is way more to it than this simple
      > > example - read the
      > > paper at
      > >
      > http://shareandenjoy.saff.net/2006/12/new-paper-practice-of-
      theories.html
      > >
      > > Note that this is not exactly TDD - it is more of a
      > > specification and
      > > testing tool than a design tool - but it could be a
      > > very nice
      > > complement to TDD to document /general rules/ rather
      > > than /specific
      > > examples/ .
      > >
      > > See also my blog about "For all vs There Exists"
      > > thinking at
      > >
      > http://www.developertesting.com/archives/month200604/20060413-
      ForAllVsThereExists.html
      > >
      > >
      > > Note that David's approach does not actually
      > > generate code in the way
      > > that you are suggesting. But it could, for example,
      > > generate specific
      > > tests to illustrate the cases where the theory does
      > > not hold.
      > >
      > > Kevin
      > >
      > > www.junitfactory.com
      > > You send us code. We send you tests.
      > >
      >
      >
      > __________________________________________________
      > Do You Yahoo!?
      > Tired of spam? Yahoo! Mail has the best spam protection around
      > http://mail.yahoo.com
      >
    • Kevin Lawrence
      ... I have sent you an invitation. No license required. It s free. Kevin www.junitfactory.com You send us code. We send you tests. For free.
      Message 32 of 32 , Jan 16 9:31 AM
        >
        > I am not sure that we need the license to try this
        > out. If so, can you provide me a temporary license or
        > a week or so?
        >

        I have sent you an invitation. No license required. It's free.

        Kevin
        www.junitfactory.com
        You send us code. We send you tests. For free.
      Your message has been successfully submitted and would be delivered to recipients shortly.