'. '

APIFest08:TaskX

From APIDesign

(Difference between revisions)
Jump to: navigation, search
Current revision (18:39, 22 October 2008) (edit) (undo)
 
(6 intermediate revisions not shown.)
Line 1: Line 1:
-
The [[APIFest08:TaskX|judgment day]] is here! Dear [[APIFest08]] participants, today you have to stop looking just into your own solution, but you need to start digging in solutions provided by others to find possible [[BackwardCompatibility|evolution]] mistakes. This is new task, different to what you've been doing so far, but I hope you'll make it. Because only if you find mistakes in solutions provided by others, only then you can win [[TheAPIBook]].
+
The [[APIFest08:TaskX|judgment day]] is here! Dear [[APIFest08]] participants, during the last rounds, you were concentrated on making your own solution perfect. However since today you will have to stop looking just at your own solution, you will need to start digging in solutions provided by others to find possible [[BackwardCompatibility|evolution]] mistakes. This is a new task, different to what you have done so far, but I hope you'll make it. Because only if you find mistakes in solutions provided by others you will be allowed to win [[TheAPIBook]].
-
If your own solution is found [[BackwardCompatible]], you'll be awarded with '''10 points'''. By default you all have those points. However you can be awarded with '''1 point''' by showing [[BackwardCompatible|compatibility]] problems in each solution provided by someone else. Of course, in case somebody finds such problem, the author of the solution '''looses own 10 points'''. As I wrote in last post [[APIFest08:Task4]], I know that at least five solutions has some problems. So please do not give up and seek for some problems!
+
If your own solution is found [[BackwardCompatibility|backward compatible]] and it successfully passed the [[APIFest08:Task4|4th round]], you'll be awarded with '''10 points'''. By default you all have those points. However you can be awarded with '''1 point''' by showing [[BackwardCompatibility|compatibility]] problems in each solution provided by someone else, who advanced to [[APIFest08:Task4|4th round]]. Of course, in case somebody finds such problem, the author of the solution '''looses own 10 points'''. As I wrote in the [[APIFest08:Task4|last post]], I know that at least five solutions have some problems, so do not give up and seek for them! Your points are waiting! Also please note that the fact that I may know about a problem of your solutions does not mean other participants are going to find it. Don't give up and good luck!
First of all you need to setup your working environment:
First of all you need to setup your working environment:
Line 9: Line 9:
# or update it
# or update it
hg pull; hg update
hg pull; hg update
-
cd taskx
 
# create directory named by you Joe Hacker would have:
# create directory named by you Joe Hacker would have:
-
mkdir jhacker
+
mkdir taskx/jhacker
</source>
</source>
-
and now repeat following tasks as many times you wish. Somehow select the solution you want to find problem in. Usually I use a diff:
+
and now your hunt can start. Repeat following tasks as many times you wish. First of all somehow select the solution you want to find problem in. Usually I use a diff:
<source lang="bash">
<source lang="bash">
-
cd ..
+
diff -ru task2/solution03 task3/solution03
-
diff -ru task1/solution03 task4/solution03
+
</source>
</source>
-
If I notice some potential evolution problem, then I setup the '''against''' project and write test to show the error:
+
Each difference is potential candidate for compatibility problem. It is just necessary to write code against the old API that does something different in the new version. If I notice some potential evolution problem, then I setup the '''against''' project and write a test into it to show the error:
<source lang="bash">
<source lang="bash">
# select the solution you want to break, let supposed it is #3:
# select the solution you want to break, let supposed it is #3:
-
hg copy jtulach/against-solutionXY/ jhacker/against-solution03
+
hg copy taskx/jtulach/against-solutionXY/ taskx/jhacker/against-solution03
# now open some of the created files in your favorite editor:
# now open some of the created files in your favorite editor:
-
netbeans --open jhacker/against-solution03/project.properties
+
netbeans --open taskx/jhacker/against-solution03/project.properties
</source>
</source>
Now adjust the content of the properties file:
Now adjust the content of the properties file:
Line 38: Line 36:
Now you can open the project in the NetBeans IDE
Now you can open the project in the NetBeans IDE
<source lang="bash">
<source lang="bash">
-
netbeans --open jhacker/against-solution03/
+
netbeans --open taskx/jhacker/against-solution03/
</source>
</source>
or directly edit its ''jhacker/against-solution03/test/apifest/CurrencyTest.java'' file. The goal is to make this file compilable against api available in the version ''taskA''. If you execute the project:
or directly edit its ''jhacker/against-solution03/test/apifest/CurrencyTest.java'' file. The goal is to make this file compilable against api available in the version ''taskA''. If you execute the project:
<source lang="bash">
<source lang="bash">
-
ant -f jhacker/against-solution03/build.xml run
+
ant -f taskx/jhacker/against-solution03/build.xml run
</source>
</source>
-
or by pressing F6 in the IDE, your test is compiled, executed against ''taskA'' and it has to succeed. If it does, the test is executed against ''taskB'' library. If it fails, you have demonstrated [[BackwardCompatibility]] problem and that is why the build succeeds. '''Make sure you open the Output Window''' to see the real result! If the test succeeds with ''taskB'' library, the sources of your test are compiled once again against ''taskB'' library. This can fail, if there are source incompatibilities. Failure means your success, as you have demonstrated incompatibility! Perfect, you can repeat these steps for another solution.
+
or by pressing F6 in the [[NetBeans]] IDE, your test is compiled, executed against ''taskA'' and it has to succeed. If it does, the test is executed against ''taskB'' library. If it fails, you have demonstrated [[BackwardCompatibility]] problem and that is why the build succeeds. '''Make sure you open the Output Window''' to see the real resul! There is also the '''JUnit Result Window''' and it is not really helpful in the '''against''' project, but I do not know how to suppress its appearance. If the test succeeds with ''taskB'' library, the sources of your test are compiled once again against ''taskB'' library. This can fail, if there are source incompatibilities. Failure means your success, as you have demonstrated an incompatibility! To see result of these steps in action, look at my [http://source.apidesign.org/hg/apifest08/rev/e8b0f13fd4fb attack against solution02] (I can show it as it did not advanced into this [[APIFest08:TaskX|final task]] and you cannot be awarded with points by finding problems in it). If you managed to attack one solution, perfect, you can repeat these steps for another one.
 +
The rules for writing compatibility tests are similar to [http://openide.netbeans.org/tutorial/api-fest.html API Fest One] - e.g. the less '''tricks''' you use the better. Where trick means more or less Java Permission. Do not try to use reflection that could obviously break each solution. Also do not use wildcard imports in source, that can easily break each solution as well. Do not put the code into the API package, that would allow you to use package private methods and would be unfair. Rules are simple: ''less tricks is better'' and ''[[User:JaroslavTulach|I]] am the judge''. Enjoy!
-
Then generate the diff using ''hg diff'' and submit your solutions by Sun, Oct 26, 2008, morning of CET to [mailto:apifest08@apidesign.org our mailing list]. As soon as I process your submissions, I'll write an [[APIFest08]] report and announce winners. Also I will prepare [[TheAPIBook]] for the winner. Good luck!
+
After you are done, please generate the diff using ''hg diff'' and submit your solutions by Sun, Oct 26, 2008, morning of CET to [mailto:apifest08@apidesign.org our mailing list]. Possibly you can ZIP your sources and send them to us too. As soon as we process your submissions, I'll write an [[APIFest08]] report and announce winners. Also I will prepare [[TheAPIBook]] for the winner.
-
 
+
-
There will be multiple rounds each with new task. The goal is to finish the last round and select the winner by Oct 26, 2008 - that is the day of the [[NetBeans]] first release anniversary!
+

Current revision

The judgment day is here! Dear APIFest08 participants, during the last rounds, you were concentrated on making your own solution perfect. However since today you will have to stop looking just at your own solution, you will need to start digging in solutions provided by others to find possible evolution mistakes. This is a new task, different to what you have done so far, but I hope you'll make it. Because only if you find mistakes in solutions provided by others you will be allowed to win TheAPIBook.

If your own solution is found backward compatible and it successfully passed the 4th round, you'll be awarded with 10 points. By default you all have those points. However you can be awarded with 1 point by showing compatibility problems in each solution provided by someone else, who advanced to 4th round. Of course, in case somebody finds such problem, the author of the solution looses own 10 points. As I wrote in the last post, I know that at least five solutions have some problems, so do not give up and seek for them! Your points are waiting! Also please note that the fact that I may know about a problem of your solutions does not mean other participants are going to find it. Don't give up and good luck!

First of all you need to setup your working environment:

# create the repository
hg clone http://source.apidesign.org/hg/apifest08/
# or update it
hg pull; hg update
# create directory named by you Joe Hacker would have:
mkdir taskx/jhacker

and now your hunt can start. Repeat following tasks as many times you wish. First of all somehow select the solution you want to find problem in. Usually I use a diff:

diff -ru task2/solution03 task3/solution03

Each difference is potential candidate for compatibility problem. It is just necessary to write code against the old API that does something different in the new version. If I notice some potential evolution problem, then I setup the against project and write a test into it to show the error:

# select the solution you want to break, let supposed it is #3:
hg copy taskx/jtulach/against-solutionXY/ taskx/jhacker/against-solution03
# now open some of the created files in your favorite editor:
netbeans --open taskx/jhacker/against-solution03/project.properties

Now adjust the content of the properties file:

# change definition of apitotest property to solution03:
apitotest=solution03
# you can also adjust the taskA and taskB variables to 
# reflect the days that you want to compete against
# for example if there is compatibility problem between
# task2 and task3, change them to:
taskA=${apifest}/task2
taskB=${apifest}/task3

Now you can open the project in the NetBeans IDE

netbeans --open taskx/jhacker/against-solution03/

or directly edit its jhacker/against-solution03/test/apifest/CurrencyTest.java file. The goal is to make this file compilable against api available in the version taskA. If you execute the project:

ant -f taskx/jhacker/against-solution03/build.xml run

or by pressing F6 in the NetBeans IDE, your test is compiled, executed against taskA and it has to succeed. If it does, the test is executed against taskB library. If it fails, you have demonstrated BackwardCompatibility problem and that is why the build succeeds. Make sure you open the Output Window to see the real resul! There is also the JUnit Result Window and it is not really helpful in the against project, but I do not know how to suppress its appearance. If the test succeeds with taskB library, the sources of your test are compiled once again against taskB library. This can fail, if there are source incompatibilities. Failure means your success, as you have demonstrated an incompatibility! To see result of these steps in action, look at my attack against solution02 (I can show it as it did not advanced into this final task and you cannot be awarded with points by finding problems in it). If you managed to attack one solution, perfect, you can repeat these steps for another one.

The rules for writing compatibility tests are similar to API Fest One - e.g. the less tricks you use the better. Where trick means more or less Java Permission. Do not try to use reflection that could obviously break each solution. Also do not use wildcard imports in source, that can easily break each solution as well. Do not put the code into the API package, that would allow you to use package private methods and would be unfair. Rules are simple: less tricks is better and I am the judge. Enjoy!


After you are done, please generate the diff using hg diff and submit your solutions by Sun, Oct 26, 2008, morning of CET to our mailing list. Possibly you can ZIP your sources and send them to us too. As soon as we process your submissions, I'll write an APIFest08 report and announce winners. Also I will prepare TheAPIBook for the winner.

Personal tools
buy