|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 - 3 - 4 | Next > |
|
|
Re: 100%% Method Testing and Generating Unit TestsOn 1/4/07, Cédric Beust ♔ <cbeust@...> wrote:
> > On 1/3/07, Ole Ersoy <ole_ersoy@...> wrote: > > > > CÃ(c)dric, > > > > Just building on your example to show how 100% testing > > would be done. > > The question wasn't to figure out whether it can be done (it's a graph > traversal problem, we know it can be solved) but to decide whether it's > practical to try to reach 100% branch coverage. > > You seem to persist in believing that it is. > > It's pretty obvious to me that your tool will never scale past toy programs, > but good luck with your quest. > In fact I got the impression that Ole is not gonna start building such a tool, but challenging others to do it for him :-). ./alex -- .w( the_mindstorm )p. TestNG co-founder EclipseTestNG Creator > -- > Cédric > http://testng.org > > [Non-text portions of this message have been removed] > > |
|
|
Re: 100%% Method Testing and Generating Unit TestsCédric,
When you are right, you are right. That's why I'm not coding it. Jimm is :-) Right Jimm...Hey...Where you goin??? Anyways this is not an NP hard integer optimization problem where we have 2 to the N possible number of combinations to check and if N gets large, the time it takes to solve takes 15 billion years, even with the fastest algorithms on earth. We are just enumerating the set of possible paths by using Boundary (Min Max and Min-1 and Max+1) data points per defined DataType (A model of int, float, Double, etc. per the Platform (AMD-64, Itanium, Pentium 4, Mac, etc.) running the code, etc.) Also 10 < b < 20 is a DataType the way I have defined it. It's a datatype that can only have the values [11,19] I'm going to say that it's simple to do and in the bag already. Jimm Go! :-) Cheers, - Ole --- Cédric Beust â <cbeust@...> wrote: > On 1/3/07, Ole Ersoy <ole_ersoy@...> wrote: > > > > CÃ(c)dric, > > > > Just building on your example to show how 100% > testing > > would be done. > > > The question wasn't to figure out whether it can be > done (it's a graph > traversal problem, we know it can be solved) but to > decide whether it's > practical to try to reach 100% branch coverage. > > You seem to persist in believing that it is. > > It's pretty obvious to me that your tool will never > scale past toy programs, > but good luck with your quest. > > -- > Cédric > http://testng.org > > > [Non-text portions of this message have been > removed] > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
|
Re: 100%% Method Testing and Generating Unit TestsHey Ole,
On 1/3/07, Ole Ersoy <ole_ersoy@...> wrote: > > CÃ(c)dric, > > When you are right, you are right. > > That's why I'm not coding it. Jimm is :-) > > Right Jimm...Hey...Where you goin??? > > Anyways this is not an NP hard integer optimization > problem where we have 2 to the N possible number of > combinations to check and if N gets large, the time it > takes to solve takes 15 billion years, even with the > fastest algorithms on earth. Well, I actually do feel a bit better reading this, since it means you at least have a little idea of what you are up against. It's not NP hard, but it's definitely exponential. And the worst part is... it's actually useless. But I know I won't talk you out of it, so go ahead (or your friend) and prove me wrong :-) -- Cédric [Non-text portions of this message have been removed] |
|
|
Re: 100%% Method Testing and Generating Unit TestsOn 1/3/07, Cédric Beust ♔ <cbeust@...> wrote:
> > The question wasn't to figure out whether it can be done (it's a graph > traversal problem, we know it can be solved) but to decide whether it's > practical to try to reach 100% branch coverage. > > You seem to persist in believing that it is. > > It's pretty obvious to me that your tool will never scale past toy programs, > but good luck with your quest. > Now that sounds like a challenge! <blatant vendor plug> Take a look at www.junitfactory.com </blatant vendor plug> Actually I don't feel too bad about the plug because the service is free. We even provide some toy examples in a demo - seeing whether we can scale beyond them is an exercise left to the reader ;-) I certainly agree with Cedric that it's not desirable to strive for 100% (I even blogged about it http://tinyurl.com/ymgzha ) but the economics of testing change quite a lot when the tests are essentially free. Kevin www.junitfactory.com You send us code. We send you tests. |
|
|
Re: 100%% Method Testing and Generating Unit TestsHi Guys,
Personally, I feelthat its not possible to achieve 100%, since testing requires alot of creativity, especially testing OO applications. However, every bit that is auto generated saves the tester effort to write them allowing him to focus on more creative tests? LoL its a dream in the pipes! Jimm P.S. Ole, I've started a bit of coding based on reading in input from a template which I plan to design. I am still tryin to get the danmable EMF to work ... --- In junit@..., Ole Ersoy <ole_ersoy@...> wrote: > > Cédric, > > When you are right, you are right. > > That's why I'm not coding it. Jimm is :-) > > Right Jimm...Hey...Where you goin??? > > Anyways this is not an NP hard integer optimization > problem where we have 2 to the N possible number of > combinations to check and if N gets large, the time it > takes to solve takes 15 billion years, even with the > fastest algorithms on earth. > > We are just enumerating the set of possible paths by > using Boundary (Min Max and Min-1 and Max+1) > data points per defined DataType (A model of int, > float, Double, etc. per the Platform (AMD-64, Itanium, > Pentium 4, Mac, etc.) running the code, etc.) > > Also 10 < b < 20 is a DataType the way I have defined > it. It's a datatype that can only have the values > [11,19] > > I'm going to say that it's simple to do and in the bag > already. > > Jimm Go! :-) > > Cheers, > - Ole > > --- Cédric Beust â" <cbeust@...> wrote: > > > On 1/3/07, Ole Ersoy <ole_ersoy@...> wrote: > > > > > > CÃ(c)dric, > > > > > > Just building on your example to show how 100% > > testing > > > would be done. > > > > > > The question wasn't to figure out whether it can be > > done (it's a graph > > traversal problem, we know it can be solved) but to > > decide whether it's > > practical to try to reach 100% branch coverage. > > > > You seem to persist in believing that it is. > > > > It's pretty obvious to me that your tool will never > > scale past toy programs, > > but good luck with your quest. > > > > -- > > Cédric > > http://testng.org > > > > > > [Non-text portions of this message have been > > removed] > > > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > |
|
|
Re: 100%% Method Testing and Generating Unit TestsHehe - Yeah - We'll give it a go.
Jimm seems to have some interest, so we'll see whether he wants to give it a go. I need this down the line so if I start the code, it will be Apache open source, and most likely a Maven plugin. Cheers, - Ole --- Cédric Beust â <cbeust@...> wrote: > Hey Ole, > > On 1/3/07, Ole Ersoy <ole_ersoy@...> wrote: > > > > CÃ(c)dric, > > > > When you are right, you are right. > > > > That's why I'm not coding it. Jimm is :-) > > > > Right Jimm...Hey...Where you goin??? > > > > Anyways this is not an NP hard integer > optimization > > problem where we have 2 to the N possible number > of > > combinations to check and if N gets large, the > time it > > takes to solve takes 15 billion years, even with > the > > fastest algorithms on earth. > > > Well, I actually do feel a bit better reading this, > since it means you at > least have a little idea of what you are up against. > > It's not NP hard, but it's definitely exponential. > And the worst part > is... it's actually useless. But I know I won't > talk you out of it, so go > ahead (or your friend) and prove me wrong :-) > > -- > Cédric > > > [Non-text portions of this message have been > removed] > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
|
Re: Re: 100%% Method Testing and Generating Unit TestsHey Jim,
Good to hear you are still onboard :-) Did you try a fresh Eclipse install. Callisto lets you check off everything you want and then it just fetches it for you. You just need to press the "Grab Dependencies Button" Maan. - Ole --- junitheadache <bohs01@...> wrote: > Hi Guys, > > Personally, I feelthat its not possible to achieve > 100%, since > testing requires alot of creativity, especially > testing OO > applications. > > However, every bit that is auto generated saves the > tester effort to > write them allowing him to focus on more creative > tests? > > LoL its a dream in the pipes! > > Jimm > P.S. Ole, I've started a bit of coding based on > reading in input > from a template which I plan to design. I am still > tryin to get the > danmable EMF to work ... > > --- In junit@..., Ole Ersoy > <ole_ersoy@...> wrote: > > > > Cédric, > > > > When you are right, you are right. > > > > That's why I'm not coding it. Jimm is :-) > > > > Right Jimm...Hey...Where you goin??? > > > > Anyways this is not an NP hard integer > optimization > > problem where we have 2 to the N possible number > of > > combinations to check and if N gets large, the > time it > > takes to solve takes 15 billion years, even with > the > > fastest algorithms on earth. > > > > We are just enumerating the set of possible paths > by > > using Boundary (Min Max and Min-1 and Max+1) > > data points per defined DataType (A model of int, > > float, Double, etc. per the Platform (AMD-64, > Itanium, > > Pentium 4, Mac, etc.) running the code, etc.) > > > > Also 10 < b < 20 is a DataType the way I have > defined > > it. It's a datatype that can only have the values > > [11,19] > > > > I'm going to say that it's simple to do and in the > bag > > already. > > > > Jimm Go! :-) > > > > Cheers, > > - Ole > > > > --- Cédric Beust â" <cbeust@...> wrote: > > > > > On 1/3/07, Ole Ersoy <ole_ersoy@...> wrote: > > > > > > > > CÃ(c)dric, > > > > > > > > Just building on your example to show how 100% > > > testing > > > > would be done. > > > > > > > > > The question wasn't to figure out whether it can > be > > > done (it's a graph > > > traversal problem, we know it can be solved) but > to > > > decide whether it's > > > practical to try to reach 100% branch coverage. > > > > > > You seem to persist in believing that it is. > > > > > > It's pretty obvious to me that your tool will > never > > > scale past toy programs, > > > but good luck with your quest. > > > > > > -- > > > Cédric > > > http://testng.org > > > > > > > > > [Non-text portions of this message have been > > > removed] > > > > > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
|
Re: 100%% Method Testing and Generating Unit TestsCédric Beust ♔ wrote:
> > > On 1/3/07, Ole Ersoy <ole_ersoy@... > <mailto:ole_ersoy%40yahoo.com>> wrote: > > > > We first have to agree on what 100% means. > > > > I provided a very simple example in the earlier post. > > > > The example gives a 100% tested tested method example, > > given that the assumptions hold. > > > > This example can be entirely generated using DataType > > meta data. > > Yes, but your example is too simple since it only contains one branch (most > examples extolling the virtues of code coverage have this flaw :-)). > > 100% coverage means you should cover all the possible branches of your code, > which is impossible to achieve in practice. Even when code coverage tools > report 100% coverage (hardly ever happens in my experience), they are still > lying to you. > > Consider the following simple code: > > public URL createUrl(int a, int b) { > > try { > if (a == 0 || b == 0) { > } > > if (c == 0 && d == 0) { > } > } > catch(IOException ex) { > } > catch(MalformedURLException ex) { > } > > 100% coverage for this code means something like 2*2*2*2 = 16 test cases > (I'm approximating, but you get the idea). > > Do you really feel it's useful to write 16 test cases for these 6 lines of > code? > > Wouldn't you be better off black-box testing this function instead, and > ignore the screams of complaint from your code coverage tool? I don't understand how black-box testing will help you avoid running all 16 tests. You still need to know whether your exception handlers work, and you still want to try tuples of (a, b, c, d) with 0s and 1s in the appropriate places. At least with white box tests, I can much more easily test that the exception handlers work. -- J. B. (Joe) Rainsberger :: http://www.jbrains.ca Your guide to software craftsmanship JUnit Recipes: Practical Methods for Programmer Testing 2005 Gordon Pask Award for contribution Agile Software Practice |
|
|
Re: 100%% Method Testing and Generating Unit TestsOle Ersoy wrote:
> > > Cédric, > > Just building on your example to show how 100% testing > would be done. > > It's easy to automate, and would be a valuable tool in > the developer toolbelt. No. No it isn't. If you think it's so easy, hang out with Parasoft and work on JTest for a while. -- J. B. (Joe) Rainsberger :: http://www.jbrains.ca Your guide to software craftsmanship JUnit Recipes: Practical Methods for Programmer Testing 2005 Gordon Pask Award for contribution Agile Software Practice |
|
|
Re: 100%% Method Testing and Generating Unit TestsOle Ersoy wrote:
> To answer that you would have to > analyze the simple example I gave earlier > and then show why you think what you just said > is accurate. Usually when someone asks me to clarify what I wrote, it's because they didn't understand me. I find that responding cryptically rarely helps them understand better; I prefer to attempt to clarify my position. -- J. B. (Joe) Rainsberger :: http://www.jbrains.ca Your guide to software craftsmanship JUnit Recipes: Practical Methods for Programmer Testing 2005 Gordon Pask Award for contribution Agile Software Practice |
|
|
Re: 100%% Method Testing and Generating Unit TestsJ.B,
I'll be glad to elaborate, but you have to something specific, within the context of what was already written. Try for instance taking an some of the example material I wrote and look for a part that could use clarification. Cheers, - Ole --- "J. B. Rainsberger" <jbrains762@...> wrote: > Ole Ersoy wrote: > > > To answer that you would have to > > analyze the simple example I gave earlier > > and then show why you think what you just said > > is accurate. > > Usually when someone asks me to clarify what I > wrote, it's because they > didn't understand me. I find that responding > cryptically rarely helps > them understand better; I prefer to attempt to > clarify my position. > -- > J. B. (Joe) Rainsberger :: http://www.jbrains.ca > Your guide to software craftsmanship > JUnit Recipes: Practical Methods for Programmer > Testing > 2005 Gordon Pask Award for contribution Agile > Software Practice > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
|
Re: 100%% Method Testing and Generating Unit TestsLooks like it's Closed source?
--- "J. B. Rainsberger" <jbrains762@...> wrote: > Ole Ersoy wrote: > > > > > > Cédric, > > > > Just building on your example to show how 100% > testing > > would be done. > > > > It's easy to automate, and would be a valuable > tool in > > the developer toolbelt. > > No. No it isn't. If you think it's so easy, hang out > with Parasoft and > work on JTest for a while. > -- > J. B. (Joe) Rainsberger :: http://www.jbrains.ca > Your guide to software craftsmanship > JUnit Recipes: Practical Methods for Programmer > Testing > 2005 Gordon Pask Award for contribution Agile > Software Practice > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
|
Re: 100%% Method Testing and Generating Unit TestsOle Ersoy wrote:
> J.B, > > I'll be glad to elaborate, but you have to > something specific, within the context of what was > already written. > > Try for instance taking an some of the example > material I wrote and look for a part that could use > clarification. You made this statement: ----- Sure - getting methods that are 100% tested should take 0 time (For the person doing the coding). ----- I wasn't sure what you meant, so I asked this question: ----- Do you mean "it would be nice if 100% tested code took 0 time"? or that "it should be possible today to have 100% tested code in 0 time"? It seems to me the first is not possible and the second is obviously false. What am I missing? ----- I'm sorry, Ole; I don't know how to ask that question more directly, simply nor specifically. Further, I don't understand why you just can't answer it directly and simply. Take care. -- J. B. (Joe) Rainsberger :: http://www.jbrains.ca Your guide to software craftsmanship JUnit Recipes: Practical Methods for Programmer Testing 2005 Gordon Pask Award for contribution Agile Software Practice |
|
|
Re: 100%% Method Testing and Generating Unit TestsHey JB,
Oh - Maybe when I said, "Within the context of what has already been written..." you thought I meant "Within the context of what has already been written in this email alone..." :-) If that's the case then I can definitely see how that would be tricky :-) Actually I was pretty sure, and a little concerned, that this type of scenario would happen when David asked if he could summarize a whole bunch of stuff I wrote earlier...which is what I'm referring to when asking for more specific questions. OK - Maybe I jumped the gun in the earlier explanations a bit. I know ya'll are really sharp, so let me start with a little higher up, and then dig a little, which will serve as more of a starting point for the material in the earlier posts. Here's a more general scenario. There's a developer. She fires up eclipse, creates a new class, and codes a method. Just 1. Then she selects the Eclipse menu (Hypothetical) Test > test and a src/main/test directory within her project is automatically created with tests that cover her method exhaustively (100%). So when I say 0 time for the developer, I mean 0 time coding the tests. Now she reviews the tests. Could be that she finds that her method needs some tweaking, to further contrain it's behaviour. Then she regenerates the tests. Etc. Now I think the question becomes: "Well, how do we know the test is tested 100%/Exhaustively?" This is where the part about reading some of the other stuff I wrote earlier in previous posts comes in. I'll be glad to elaborate on those :-) Cheers, - Ole --- "J. B. Rainsberger" <jbrains762@...> wrote: > Ole Ersoy wrote: > > > J.B, > > > > I'll be glad to elaborate, but you have to > > something specific, within the context of what was > > already written. > > > > Try for instance taking an some of the example > > material I wrote and look for a part that could > use > > clarification. > > You made this statement: > > ----- > Sure - getting methods that are 100% tested should > take 0 time (For the person doing the coding). > ----- > > I wasn't sure what you meant, so I asked this > question: > > ----- > Do you mean "it would be nice if 100% tested code > took 0 time"? or that > "it should be possible today to have 100% tested > code in 0 time"? > > It seems to me the first is not possible and the > second is obviously > false. What am I missing? > ----- > > I'm sorry, Ole; I don't know how to ask that > question more directly, > simply nor specifically. Further, I don't understand > why you just can't > answer it directly and simply. > > Take care. > -- > J. B. (Joe) Rainsberger :: http://www.jbrains.ca > Your guide to software craftsmanship > JUnit Recipes: Practical Methods for Programmer > Testing > 2005 Gordon Pask Award for contribution Agile > Software Practice > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
|
Re: 100%% Method Testing and Generating Unit Tests> As a matter of fact...it would be nice to have
> something that enumerates the branches and generates a > report on which methods has a number of branches over > a certain limit...for code refactoring and maintenance > purposes. Hi Ole, I have not read the whole thread yet so if this has already been suggested I'm sorry. PMD actually reports methods with a cyclomatic complexity that is larger than 10. If I'm not mistaken that is what you're looking for. I find this helpful to find targets to refactor in legacy code. When TDD:ing the PLP (my abbreviation for path of least pain) keeps the cyclomatic complexity down (Like Jeff Langr suggested earlier in the threat). Cheers! /J |
|
|
Re: 100%% Method Testing and Generating Unit TestsWow - Dud - You Da Man!!
(And judging by the name - quite possibly Norwegian, which explains why u so da Man :-) ) This actually looks a lot like what I've been trying to describe, with the possible exception that I don't think it generates tests like Jimm wants to do, but hey this is real ;-). HooohHahhh! Jimm in order for this to work the way it says it works it has to parse source and store it in some model. Then analyze it...looks like using rule sets. I'm sure you could use the same model and rule sets to generate tests (Just shooting from the hip. I'd have to look at it a little more to see whether I could come up with a concrete example. ) http://pmd.sourceforge.net/ Thanks for letting me us Joakim. Can't wait to to hook it up to my maven projects. Cheers, - Ole Joakim Ohlrogge wrote: > > > As a matter of fact...it would be nice to have > > something that enumerates the branches and generates a > > report on which methods has a number of branches over > > a certain limit...for code refactoring and maintenance > > purposes. > > Hi Ole, > > I have not read the whole thread yet so if this has already been > suggested I'm sorry. > PMD actually reports methods with a cyclomatic complexity that is > larger than 10. If I'm not mistaken that is what you're looking for. > > I find this helpful to find targets to refactor in legacy code. When > TDD:ing the PLP (my abbreviation for path of least pain) keeps the > cyclomatic complexity down (Like Jeff Langr suggested earlier in the > threat). > > Cheers! > /J > > |
|
|
Re: 100%% Method Testing and Generating Unit Tests> Wow - Dud - You Da Man!!
> > (And judging by the name - quite possibly Norwegian, which explains why > u so da Man :-) ) Actually Swedish... but thats even better right? ;) > > This actually looks a lot like > what I've been trying to describe, > with the possible exception that I don't think > it generates tests like Jimm wants to do, > but hey this is real ;-). HooohHahhh! True doesn't generate tests, actually has nothing to do with tests, just statically analyzes the code. > > Jimm in order for this to work the way it says it > works it has to parse source and store it in some > model. Then analyze it...looks like using rule sets. > Yes it does, it creates an AST and the rules can be written in java, or xpath if the rules are simple enough. I actually learned xpath with PMD and it works great :) Used it to find errorprone exception-handling for CMP:s in our codebase and guess what... I did find some bugs. > I'm sure you could use the same model and rule sets > to generate tests (Just shooting from the hip. I'd have to look at it a > little more > to see whether I could come up with a concrete example. ) > Possibly, the parser is already in place so why not start in that end. You may also want to check out javaCC and jjTreeif you want to parse Java.. it comes with a java 1.5 grammar in the examples. But maybe what Jimm wants to do can be expressed even with annotations? (I've opened the parser can of worms enough times to have some respect for that topic) > http://pmd.sourceforge.net/ > > Thanks for letting me us Joakim. Can't wait to > to hook it up to my maven projects. > And don't forget to try the eclipse plugin aswell :) I hope that PMD will be as helpful to you as you seem to think it will be. Good luck! |
|
|
Re: 100%% Method Testing and Generating Unit TestsYeap it aint what I had in mind, in fact i dont think i can come up
with something like it LoL What i had in mind was just some sort of template for a user to fill in the blanks sortof and a tutorial which asks questions whose answers are used to fill in the above mentioned blanks Thus, in a way i think it helps with TDD, since it drives the design process but asking questions like what are the pre and post conditions, class invariants etc, that the user needs to answer in order to generate the test cases. It also automates the generation of the test cases, "generating of the source code" that is. yeap actually i've been reading the posts, and am not sure what PMD does exactly... Jimm Quoting Ole Ersoy <ole_ersoy@...>: > Wow - Dud - You Da Man!! > > (And judging by the name - quite possibly Norwegian, which explains why > u so da Man :-) ) > > This actually looks a lot like > what I've been trying to describe, > with the possible exception that I don't think > it generates tests like Jimm wants to do, > but hey this is real ;-). HooohHahhh! > > Jimm in order for this to work the way it says it > works it has to parse source and store it in some > model. Then analyze it...looks like using rule sets. > > I'm sure you could use the same model and rule sets > to generate tests (Just shooting from the hip. I'd have to look at it a > little more > to see whether I could come up with a concrete example. ) > > http://pmd.sourceforge.net/ > > Thanks for letting me us Joakim. Can't wait to > to hook it up to my maven projects. > > Cheers, > - Ole > > > > > Joakim Ohlrogge wrote: >> >> > As a matter of fact...it would be nice to have >> > something that enumerates the branches and generates a >> > report on which methods has a number of branches over >> > a certain limit...for code refactoring and maintenance >> > purposes. >> >> Hi Ole, >> >> I have not read the whole thread yet so if this has already been >> suggested I'm sorry. >> PMD actually reports methods with a cyclomatic complexity that is >> larger than 10. If I'm not mistaken that is what you're looking for. >> >> I find this helpful to find targets to refactor in legacy code. When >> TDD:ing the PLP (my abbreviation for path of least pain) keeps the >> cyclomatic complexity down (Like Jeff Langr suggested earlier in the >> threat). >> >> Cheers! >> /J >> >> > > |
|
|
|
|
|
Re: 100%% Method Testing and Generating Unit TestsBob,
What you are describing sounds like it has a lot in common with this: http://www.eclipse.org/articles/Article-EMF-Codegen-with-OCL/article.html EMF generates code for your model. However you can model invarient constraints, derived value operations, etc. as well. However without OCL EMF will just generate method stubs for overriding. With OCL EMF generates the entire method. So the type of template you are describing could be used to generate the OCL string as well. With that the Operation could be generated. Then test cases could be generated that complement and prove that the method body generated based on the OCL string is correct, giving the developer further confidence in the solution. Just an idea. Cheers, - Ole --- bohs01@... wrote: > Yeap it aint what I had in mind, in fact i dont > think i can come up > with something like it LoL > > What i had in mind was just some sort of template > for a user to fill > in the blanks sortof > > and a tutorial which asks questions whose answers > are used to fill in > the above mentioned blanks > > Thus, in a way i think it helps with TDD, since it > drives the design > process but asking questions like what are the pre > and post > conditions, class invariants etc, that the user > needs to answer in > order to generate the test cases. > > It also automates the generation of the test cases, > "generating of the > source code" that is. > > yeap actually i've been reading the posts, and am > not sure what PMD > does exactly... > > Jimm > > > Quoting Ole Ersoy <ole_ersoy@...>: > > > Wow - Dud - You Da Man!! > > > > (And judging by the name - quite possibly > Norwegian, which explains why > > u so da Man :-) ) > > > > This actually looks a lot like > > what I've been trying to describe, > > with the possible exception that I don't think > > it generates tests like Jimm wants to do, > > but hey this is real ;-). HooohHahhh! > > > > Jimm in order for this to work the way it says it > > works it has to parse source and store it in some > > model. Then analyze it...looks like using rule > sets. > > > > I'm sure you could use the same model and rule > sets > > to generate tests (Just shooting from the hip. > I'd have to look at it a > > little more > > to see whether I could come up with a concrete > example. ) > > > > http://pmd.sourceforge.net/ > > > > Thanks for letting me us Joakim. Can't wait to > > to hook it up to my maven projects. > > > > Cheers, > > - Ole > > > > > > > > > > Joakim Ohlrogge wrote: > >> > >> > As a matter of fact...it would be nice to have > >> > something that enumerates the branches and > generates a > >> > report on which methods has a number of > branches over > >> > a certain limit...for code refactoring and > maintenance > >> > purposes. > >> > >> Hi Ole, > >> > >> I have not read the whole thread yet so if this > has already been > >> suggested I'm sorry. > >> PMD actually reports methods with a cyclomatic > complexity that is > >> larger than 10. If I'm not mistaken that is what > you're looking for. > >> > >> I find this helpful to find targets to refactor > in legacy code. When > >> TDD:ing the PLP (my abbreviation for path of > least pain) keeps the > >> cyclomatic complexity down (Like Jeff Langr > suggested earlier in the > >> threat). > >> > >> Cheers! > >> /J > >> > >> > > > > > > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
| < Prev | 1 - 2 - 3 - 4 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |