- Last edited July 18, 2002 |
A: Here's an example; if you had some method foo in the class Bar and JesTer reported:
Bar.java - changed string at 654 from 0 to 1 for (int i = £0; i < numbers.length; i++)and Bar.java included the method foo (the character '0' in this method is character 654 in Bar.java):
void foo(int[] numbers){ for (int i = 0; i < numbers.length; i++){ process(numbers[i]); } }this means that the tests pass whether the loop in foo starts with i=0 or i=1 The significance of this is probably one of the following:
If a test is missing, then it is simply a test that would have failed if the loop incorrectly started with i=1 instead of i=0 (assuming that the loop was correct to start with i=0)
A: This is the percentage of changes that JesTer made that caused the tests to fail. It's a number between 0-100; the higher the number the more completely the tests test the code (but it does not necessarily equate to the percentage of code covered measured by conventional code coverage tools. The result from such tools could be 100%, and from Jester could be much lower than 100%).
A: The tests only cover those things that run in VisualAgeForJava? (it was mostly developed in VisualAgeForJava?) - the tests are incomplete (nobody said that JesTer was itself a good example of testing!)
A: Don't run JesTer on itself or on JUnit as it uses these classes to run, so will not run correctly if they are changed.
A: use '>'; e.g.
java jester.TestTester myPackage.TestAll myPackage > results.txt
at jester.TestTester.run(TestTester?.java:81) at jester.TestTester.main(TestTester?.java:74)what is SourceChangeException ?
A: See SourceChangeException. In this case, try executing:
java jester.functionaltests.TestAllto see why the tests didn't pass before any changes were made. It may be that you don't have everything necessary on the classpath (i.e. the current directory, jester.jar and junit)
`Couldn't run test tester because tests didn't pass before any changes made` even tho junit passes the TestClassBenHogan
A: See JesTer version 1.16 - it now logs what it is trying to do which can help to diagnose problems running Jester
A: Note that putting jester.jar, junit.jar and mockobjects.jar into *\jre\lib\ext as jar extensions doesn't work - they have to be on the static classpath.
Tue Mar 19 02:04:52 PST 2002 Trying to run command "java jester.TestRunnerImpl j ester.functionaltests.TestAll" Tue Mar 19 02:04:52 PST 2002 running command "java jester.TestRunnerImpl jester. functionaltests.TestAll" resulted in "[Suite class "jester.functionaltests.TestA ll" not found]"
A: Most problems running JesTer are to do with not having everything on the static classpath. Is the directory 'jester' on the static classpath (in the installation directory - i.e. is the installation directory on the static classpath)? If you run (with NO changes, e.g. NOT "java -cp ...") "java jester.TestRunnerImpl jester.functionaltests.TestAll" what happens? If you run "java jester.functionaltests.TestAll" what happens? Please feel free to email me directly if you are having a problem running JesTer - IvanM.
A': My classpath is c:\programs\jdk1.3\jre\lib\rt.jar;c:\programs\junit;c:\programs\mockobjects\lib\mockobjects.jar;c:\programs\jester\jester116\jester.jar;.;c:\programs\jester\jester116
C:\>java jester.TestRunnerImpl jester.functionaltests.TestAll . Time: 30 PASSED
java jester.functionaltests.TestAll -- The awtui comes up and shows a green bar with 1 test run
I hate this stupid classpath stuff. Whose dumd idea was it anyway?
Here's what happens when I try to run Jester:
C:\ProgramsJesterjester116\TDD>java jester.TestTester Money.MoneyTest . Exception in thread "main" jester.SourceChangeException: couldn't compile (missi ng .class file) ./Money/MoneyTest.class [...]
Afterwards, the file MoneyTest?.class, which was there and running correctly moments before, has disappeared.
Hmmm (IvanM again) - try (with NO changes) "javac ./Money/MoneyTest.java" - javac has to be on the path. (You can use an alternative, but then you have to change "jester.cfg" to specify the alternative compilation command). JesTer compiles code by using exec("javac ...") - to make sure that it has successfully compiled code, it deletes the original .class file, tries to compile, and checks if a replacement .class file has been created. Unfortunately, if JesTer fails to compile (e.g. because javac is not on the path) then it's deleted the original .class file so things won't work any more. NOTE the latest version of JesTer is Jester1?.20 rather than Jester1?.16; I strongly recommend using the latest version of JesTer.
That was it. jdk1.3 wasn't properly installed, so it couldn't run javac. Duh... You can't protect me from my own stupidity. Thanks for the help. I was exercising the example code for groups.yahoo.com/group/testdrivendevelopment. The only hole found in the tests was a fake implementation of hashCode() that just returned 0, and wasn't explicitly tested.
thank you for persevering and using JesTer - the error messages that it produces are quite unhelpful - I'll improve them or find some other way to improve the diagnosis of problems running JesTer (when I can get my computer at home working again!) IvanM
JesTer now (version >= 1.22) reports problems much better. IvanM
- Last edited July 18, 2002 |