Monday, December 10, 2007

33.PrimeDirectivesRedux

* The system successfully accomplishes a useful task.
* An external user can successfully install and use the system.
* An external developer can successfully understand and enhance the system.

1. Interactive Development Environments (Eclipse, VisualStudio, etc.)

PD1: Does not really apply, since an IDE itself does not help the system to accomplish a useful task. But it helps a programmer to write, compile, and execute code. (could be done without an IDE)

PD2: Does not apply because a user should not need an IDE to successfully install and use a system.

PD3: Helps the external user to go and read through the code because an IDE typically has a root project hierarchy window listing that is easy to navigate through.

2. Coding Standards and Coding Standards Compliance Tools (Checkstyle, etc.)

PD1: Helps, the developer to verify that the code he or she is writing will execute successfully by eliminating some bugs.

PD2: Does not apply, since a user should be able to install a system without the knowledge of any standards.

PD3: When a common standards are enforced for projects then it is easier for other members who may take over the project to work on it. They can assimilate and understand the code faster. In addition, it is easier to maintain.

3. Build Systems (Ant, Make, etc.)

PD1: Helps the developers to concentrate on code implementation instead of on how to build the system. Developers write a small portion of code and can test it by building the system painlessly.

PD2: Build systems allow users to build the system without using an IDE. It also ensures that the system can be build universally.

PD3: A build system should allow an external developer to build the system using any IDE of choice. Therefore, making the process of understanding and enhancing the system quicker. In addition, build system is easy to modify and fit to many different needs and projects.

4. Automated Quality Assurance Tools (PMD and FindBugs, etc.)

PD1: Helps the developer to ship a relatively bug less system that will accomplish the task it should.

PD2: Does not apply to PD2, because the user should not need to care about QA tools in order to install the system of choice.

PD3: QA tools help the external developers, since they can verify if the system is relatively well written before they start enhancing it. It also allows them to produce code with high quality.

5. Black and White Box Testing

PD1: Black and White box testing is especially crucial to making a task work. It is important to test the increment to the program before it is released.

PD2: Only applies to the asspact that the user can successfully use the system, because if the system is tested well enough then it will work when an external user uses it. However, a user does not need to know about testing to install the system.

PD3: Let's the external developer know the correct outputs to the given inputs. Therefore, it is easier for the developer to understand what the system supposed to do.

6. Automated Testing Tools (JUnit, HttpUnit, etc.)

PD1: Automated Testing Tools Help to ensure that the useful task produces the correct output.

PD2: Does not apply, since it is not necessary for the user to know about testing tools to correctly install and use the system.

PD3: If a system works well it is easier to understand. It is also easier to maintain and modify. An external developer can make sure that the system works well before he or she takes it over. Of course, only if the person before had a 100% testing coverage and that the tests where good tests.

7. Configuration Management (CVS, SVN, etc.)

PD1: Configuration management helps developers to work at the same projects at different times and using only one copy of the source. Therefore, building a system that accomplishes a useful task for effectively.

PD2: PD2 is satisfied since the user can dowload the latest release.

PD3: Using configuration management tools makes it easy for developers to get, change, and update copies of the actual project. The developer can easily go back to past versions to make improvements.

8. Issue Driven Project Management

PD1: Issue driven project management helps the system to accomplish a useful task because issues are reported with information on how to reproduce them, so that they can be eliminated by any developer without forgetting these issues.

PD2: At times, it might happen that a product was released but it cannot be installed on some environments. An issue can be created on how to overcome this problem. Therefore, updating issues can help the user to install and use the system.

PD3: It is also useful to the external developer to know what previous issues the system had and if they were fixed. This help the developer to understand and enhance the system the the issues are actual documentations.

9. Use Cases

PD1: Use cases help the developers to code the system the way it supposed to behave when it is released.

PD2: Use cases provide the user with documentation on how to use the system. Therefore, it is possible for the user to understand the system and know the expected behaviors.

PD3: An external developer can uses the use cases to understand the expected behavior of the system. Therefore, it is easier for him or her to test, and enhance the system further.

10. Software Review

PD1: As read in "The confession of a terrible programmer" it is useful to have another person review the code. Once reviewed, it is more likely that the system accomplishes the task it supposed to accomplish.

PD2: Does not really apply. However, since the reviewer have to install the software and use the installation guide, the external user can count on a better installation guide that should help to install the system quicker and easier.

PD3: The reviewer can give feedback on how easy it is to go through the code. therefor e, an external developer should benefit from this.

11. Agile Methods (XP, Scrum, etc.)

PD1: Since all members work on every part of the project, it should be quicker to accomplish PD1, then release it and get more feedback on how to enhance it.

PD2: Does not really apply, since it is a method for "code writing". However, there are many and frequent releases, so the installation guide should be well written and therefore a user should be able to install and use the system successfully.

PD3: Does satisfy PD3 if the external developer will join the team since the Agile method is designed for changing a system frequently.

12. Open Source Licenses (GPL, CPL, etc.)

PD1: Open source licenses do not apply to PD1 since they do not act on the functionally of the system.

PD2: Open source licenses allow users to download install, and use the system more freely.

PD3: Depending on the license, and external developer could freely download, install, use, and modify the system and redistribute it as a new product. Most of time, open source project have great documentation.

13. Online Hosting Services (Google Project Hosting, SourceForge, etc.)

PD1: Posting a project online to which a lot of people have access, makes the system more know, useful, and tested. Therefore, all people help it to accomplish a useful task.

PD2: Online hosting services will help users to download it and get the installation guide.

PD3: Online hosting services give an external developer easy access to the source code as well as to any documentation issued for the specific project.

Sunday, December 9, 2007

MyISERN-Onyx-2.0 Review

Our team will perform this review as a team. Therefore, I decided to review team Onyx's project based on the three prime directives and finally give some comments on there web layout and design, as I think that this will help team onyx the most for the final assignment.

An external user can successfully install and use the system
The installation went smooth, but I could not verify the system with the verify target, therefore I strongly recommend team Onyx to fix the pmd errors. Also, I went to the installation guide, which seems to be pretty neat. One note on the installation guide. It tells the user the username and password for the web application, however I believe that the user must change the tomcat-users.xml file in the conf directory of the tomcat system, to fit the distributed username and password. The installation guide says that the server is running locally on the user's computer, which is right. One comment, which might be a little bit confusing. The web application for MyISERN-2.0 is enhanced with the derby database which is also running locally on the user's computer. Therefore, at this point of time it might also be a good idea to tell the user to install Derby onto there system. Otherwise, they won't be able to use the web application fully. Of course, only if a an external database is not yet set up.

The system successfully accomplishes a useful task
The log in with the provided username and password was good. But when I pressed the login button without any username and password, the system crashed. The add, edit, and list Researchers woks fine. The add Organization does not insert multiple items. Therefore, team onyx should still work on that. Because of this fault the edit and display works only partially. It was also possible for me to insert a collaboration with only a name and all other fields blank, but when I tried to edit it it gave me this error: Collaboration field blank (not very useful) and the display collaboration function displays only two fields. The name and the description.

An external developer can successfully understand and enhance the systemThe developers guide is satisfactory, but I would recommend to include the information on how to download httpUnit for testing the web application. We have used it through out the semester and it is critical to our project. One more thing, we also have used jaxb and it might be helpful for the developer to know how to install that tool too. Especially, when the developer wants to perform export data into XML files, which should be one of the option.

Summary
Overall, the system satisfies the three prime directives only partially for reasons mentioned above. As for the web application itself, the formatting flows seem to be equally on FF and IE. All the fonts seem to be too large. The drop down is nice, but not formatted correctly. The side navigation is good but I did not use it at all because of the drop down. There, it is better to decide between a drop down or a side navigation, but not both. The Welcome message is way too large. It takes almost all of the screen real estate away. Talking about screen real estate, the window have to be fully open at all times. Finally, when I tried to login without a username and password using IE it did not crash for some reason.

Thursday, November 15, 2007

29.MyIsern-1.3-review

1. Installation Review
I have downloaded the gold's team ISERN 1.3 package from this link. First I was able to download, install, and run the system with no problem using ant. Then I tried running it with java -jar but the build.xml file does not have this target. The verify target passed with no errors, however Emma reported coverage in the range of 20-48, which is not too bad because mine was much lower. I did not find any installation guide.

2. Code format and conventions review
All the code format as well as comments are well written, besides that one "Web interface for the researchers page." which I found in all three action bean files. I am not certain whether it is right or wrong. However, even if it is right it doesn't say much about a class.

3. Test case review
It seems like there are only to classes to test MyIsernAction and MyIsern Model. MyIsernModel is tested well from both the black box and white box perspective. Only one Method the add/edit method was not tested at all. In addition, the whole MyIsernAction class needs to be tested. I understand that we did not have enough time to perform all the tasks assigned therefore as long as it will be done by Monday, it should be fine. From a break-da-bugha perspective, I clicked around and all the link that are not under construction worked well. Now, I think the assignment says to load the xml files from user.home which is somewhere in Document and Settings/name and create files if they don't exist but it loaded the xml files from the downloaded package.

4. User Interface review
Going to the user interface, it is fairly easy to use. The login and home or main page are on the same page but I assume that this is only so for the time until the login page is fully functional. The website utilizes screen estate average, it would be better if the width is a little smaller, because now it takes a little more than half a screen. I would suggest to rename the top researcher, organization, and collaboration tabs to something like list researcher etc. Since the user is not sure what the tab does until he or she clicks it. I was also a little confused where to edit definitions until I found a little note saying enter name to edit but what am I supposed to do then?

5. Summary and Lessons Learned
I did not learn a lot because it is about how people think about design. If I like a web layout that does not mean that everyone else will like it and vise versa. However, this project shows that at least they got a nice style sheet wrapped around the implementation. That is what I did not have the time for.

Sunday, November 4, 2007

25.WebAppQuestions

1. Explain in your own words the meaning of the web "request-response cycle".
A Web request-response cycle consists of the client's software i.e a Web browser sending requests to the Web server and the servers sending a response. This is a cycle known as the HTTP request/response protocol. The server can accept, process, and return the requested information to the client.

2. Explain how servlets facilitate processing of the request-response cycle.
Servlets are implemented in the Java programming language that run inside a web application server. It handles low level details of the HTML protocol, then it facilitates the request/response cycle by allowing developers to write Java code to handle user request. It also gives an object orient interface.

3. How do you login to the Tomcat Manager?
First of all to access the Tomcat manager one must first add a new username and password and associate the role manger. This must be done in the user.xml file. Then you go to this URL the http://localhost:[and the port], where you can login with the set username and password in the user.xml file.

4. What is the Tomcat Manager used for in the StackStripes application?
The Tomcat Manager is used in the StackStripes application for conviniently executing manager commands with Ant. Specifically, in the StackStripes application we use the deploy and undeploy tasks.

5. What is the directory and file layout of an installed web application like StackStripes? (This is NOT the same as the directory and file layout of the
StackStripes distribution!)

The Web module structure contains an assembly root directory that has JSP pages, static HTML pages, and applet classes and a WEB-INF subdirectory. The WEB-INF directory contains files such as web.xml, sun-web.xml, and *.tld. It has the lib, classes, and tags as its subdirectories. The lib directory contains all library archive files. The classes directory contains all server-side .class files for the instance of the current web module, and the tags directory contains all .tag files.

6. How do you build a war directory structure in Ant? Where is this accomplished in the StackStripes application?
To build a WAR file under Ant you must specify the dest webxml and destfile targets. In the StackStripe application this is done in the build.xml file with the war target.

7. How do you install a war directory in a running Tomcat server? What information does the Ant task need to accomplish this?
You can use the Tomcat server's deploy tool, the asAnt creat-war, or just simply copy the war file into the Webapps directory since it will find and install any war files which reside in that directory. The Ant task needs to know where the WebBass directory resides.

8. What is the "Model2" architecture? What are its advantages?
Model 2 architecture uses Model-View-Controller design pattern to separate presentation from content. The controller's job is to pass the request to the right view (JSP), which in turn invokes the JavaBean which then may access a database.
The advantages of Model2 architecture is that it brings the "write once, run anywhere" paradigm to interactive Web pages, it is also fairly simple to learn and wield Java as a server-side scripting language. However the biggest advantage is that it helps effectively separate presentation from content.

9. What are JSP pages? How are they related to servlets?
JSP (Java Server Pages) is a language that allows easy creation of web content that contain both static and dynamic components. JSP are text based documents that contain implementation of how to process a request and construct a response. They also are extensions to servlets. When a request to a JSP is made, it looks if the the JSP pages's servlet is older than the JSP page itself. If this is the case it will translate the JSP page into a servlet class. The advantage is that the compilation is automated.

10. Why is there a delay when retrieving a JSP page for the first time? Where is the Java code for that page stored?
The delay occurs because the JSP page must be translated, compiled, and checked for errors when loaded the first time. I could not find any information on where the Java code is stored but I assume it is stored on the server side.

11. What are JSTL tags? Why are they useful? What is an example JSTL tag from the StackStripes system?
JSTL contains sets of standard tag libraries that give the required functionality which are needed when writing dynamic JSP pages. They are useful because they fix the shortcomings of JSP scriptlet tags. A JSTL tag used in StackStripes is for each.

12. What are Stripes tags? Why are they useful? What is an example Stripes tag from the StackStripes system?
Stipes tags are tags defined in the standard tag library and a dynamic attribute tag library. They are useful because they give easy implementation for comunication between the Web page and the Java code. Example Stripes tag:

13. What is HttpUnit? How is it different from JUnit? Why is it useful? What is an example use of HttpUnit from the StackStripes system?
Programmers can use HttpUnit to imitate a real mouse click on a Web link. Therefore, it is crucial for writing test cases for programs with Web applications, whereas JUnit can only test the client site program. An example from the StackStripes is: WebConversation conversation = new WebConversation();

// Get welcome.jsp page and check for successful retrieval
String Url = testHost + "stackstripes";
WebResponse response = conversation.getResponse(Url);

14. What needed to be changed in order to implement the Double It button? What didn't need to be changed? What did you learn about the MVC design pattern from this exercise?
In order to implement the Double It button the index.jsp needed to include a submit tag with the name doubleIt and value Double It. The stackModel class needed a new doubleIt method and the StackActionBean class needed a new doubleIt Resolution method. No other methods or code needed to be changed. This exercise nicely illustrates the MVC design. By doing this exercise I learned how it all works.

15. What are the equivalence classes that need to be tested for the Double It button?
From a black box perspective it is good to test for the empty stack, stack with one item, average items, and many items. But since we only need to make sure that the doubleing works, it should be sufficient to push an item onto the stack and then simulate the double it click and check that the items doubled.

16. Provide two screen images of your new StackStripes application with the Double It button, one showing the page before and one showing the page after hitting the "Double It" button.
Before hitting Double It:


After hitting Double It:


17. What is the singleton design pattern? What is an example of its use in StackStripes? Why is it needed?
A singleton design pattern is supported by the static keyword. This allows working only on one object. Therefore, no other class or method can make a copy of that object, but rather access it directly via getting an instance of it. I think this is needed because we have to make sure, with the synchronized keyword, that we change only one object at the same time. An example is:
private static StackModel theInstance = new StackModel();

18. Some of the StackStripes tests exercise code on the "server side", while others exercise code on the "client" side. Which test classes exercise code on the "server", and which exercise code on the "client"? How does Emma deal with this to create appropriate coverage data?
The server side tests are in StackActionBean whereas the client side test are in StackModel. Emma gathers the needed data when from the Tomcat server and creates the appropriate coverage. However, the coverage is not available until the Tomcat server is shut down.

19. Running 'ant -f junit.build.xml' results in the following target invocations: tomcat.check, tomcat.undeploy, compile, war, tomcat.deploy, junit.tool, junit.report, junit. Explain what each of these targets do.
tomcat.ckeck, makes sure that the server is running and that we have access to it.
tomcat.undeploy, removes stackStripes from the Tomcat server.
compile, compiles the code.
war, builds the directory structure need for tomcat deployment.
tomcat.deploy, deploys the war directory into Tomcat server.
junit.tool, execute junit test on the server and client side.
junit.report, creates a HTML junit reprot.
junit, runs junit.tool, junit.report and shows errors as encountered.

20. (Optional) If you have experience using one or more other web application frameworks, discuss your initial reactions to Stripes. How is it similar, or different, or better, or worse than your previous experience?
I only created Web sites using basic HTML and Notepad, so I don't have any experience with such applications, but Stripes seems fairly easy to use.

Thursday, November 1, 2007

26.StackStripesExtension

The goal of this assignment was to gain some initial familiarity with new technologies including: Tomcat, JSP, JSTL, Stripes, and HttpUnit and to understand how to apply our previous experiences with Java, Ant, JUnit, PMD, FindBugs, Checkstyle, etc. to the domain of web application development.

What was difficult about this assignment?
I have completed all the tasks for this assignment, therefore I gained a lot of knowledge about building Web applications and using tools such as JSP, JSTL, and Stripes. The major task for this assignment was to understand how the index.jsp, StackActioanBean class, and the StackModel class all communicate and work together.
Now I understand that the index.jsp is the actual web page. When the user clicks on any button on that web page the index.jsp sends this information to the appropriate method in StackActionBean class. The code in the StackActionBean class calls methods in StackModel class, which perform the actual processing. After the call returns the StackActionBean class returns the modified index.jsp and it is displayed on to the web site. This was not hard to figure out but it was essential to understand this process before enhancing StackStripes.

What problems were encountered in carrying out the work
First of all, I made a really stupid mistake. The instructions in the assignment say: "If you are on Windows, you will also need to edit the file conf/context.xml file to change the <Context> tag to include the antiJARLocking and antiResourceLocking attributes as follows: <Context antiJARLocking="true" antiResourceLocking="true">" Even though it is very clear what to do, I just copied the line and inserted it between the already existing <Context> </Context> tags. That is why I was not able to connect to http://localhost:8080 and had to trace all the installation tasks back to figure out the problem. My bad, it took me an additional hour to figure that bug out. In addition, when I wrote test code for the stack pop method, I realized that the stack still contained values which were pushed onto the stack in a previously called test method. I tired to solve it by getting an instance of the stack and calling the stack clear method but this did not work. So, I decide to leave the values for testing the pop method.

Monday, October 22, 2007

21.MyISERN-1.2

The goal of this assignment is to continue developing our group-based software engineering skills and begin developing the ability to present our system status to "management".

Distribution package

All tasks were completed!

What was difficult about this assignment?
In my opinion, there were not many real challenges when coding this assignment. However, I found that there was lots of code to write. The three add methods where pretty easy to implement. But the edit was a little bit more difficult. Therefore, to change the state we decided to make the xmlLoader object static. When the user finally decides not to save the changes, the xmlLoader object gets assigned to the previous state, the state before the user started the edit. Another, difficult task was to write test cases for user input. With our knowledge and tools it is impossible. Since we did not have enough time to learn new tools, we decided to write good test cases from the black box perspective. However, the user input or standard output is not test and therefore the Emma coverage suffers. This does not mean that our program doesn't perform well! In addition, it was pretty hard to verify if all the links between Collaborations, Organizations, and Researchers are kept valid after adding new instances. We decided to perform checks on empty name field, uniqueness of id, year, and verify that organization exists when adding new Researchers and Collaborations. However, we did not make sure that all the Researchers exist when adding Collaborations or Organizations since this would go into an infinite loop, never solving the problem.

What problems were encountered in organizing the group and carrying out the work?
There were not really any problems with the group. We all decided to start on this assignment early. The first add method we got working on Wednesday and Thursday morning all the other add methods were finished. Then we implemented edit and after that we finished the marshaling methods. However, this was only the code, and we still had to improve the user interface as well as add all the informations.

What will you do differently during the next Milestone to improve the process and the product of your efforts?
Our group work was good and if anything I would like to have more time to meet with the group members to implement the code together. I find that if we work in a group the code gets more efficient and also it is quicker implemented than if a single person thinks and implements all the code. On the other hand when writing all the program by yourself the classes may be better distributed and redundant code is easier to omit. Therefore, one thing that comes to my mind as an improvement would be to actually draw a class hierarchy diagram and follow it for the implementation to omit writing redundant code.

19.UseCaseSpecification

The use case specification assignment helps with becoming familiar with the specification of a system in terms of Use Cases. It also help better understanding the ultimate vision' of MyIsern that we are working toward.

Link to use cases for MyIsern.

Our group extracted ten uses cases from the previous lecture. All use cases are clearly documented however there was no time to include some pictures that illustrate mock ups of the screens that the user would be interacting with. Once we put all the gathered information from the lecture together it was moderately easy to put it into a specific use case. However, this was our first time designing use cases and therefore it may not have all the quality a use case supposed to have.

I learned that use cases may help understand how the whole program will work in the future. The use cases collected from the lecture were already helpful for MyIsern 1.2, when we had to decide on certain code flow. But it was pretty difficult to get all the use cases from the lecture because it sometimes seemed as I could not keep up with the writing. Therefore, it is possible that in the short amount of time, when writing down the use case, I may have interpreted the use differently than expected.

Monday, October 15, 2007

22.MyISERN-1.1 Review

This time we could choose form a list of names containing classmates and students from Software Engineering 613, which is a master's class, who we want to review. I thought it would be more helpful to review code from a person who is approaching higher eduction. Therefore, I chose to review Lisa Chen's code and it was a brightening experience.

Installation Review
I downloaded the MyISERN Milestone package from this link with no problems at all. Once downloaded, I used the unzip feature and I placed the folder into my test directory C:\test. Then, I looked through the downloaded package for its contents. Luckily, the author has thought about the users, and included a Usage file in plain text format in the doc directory documenting all the commands the user could use on the provided system. Since I already opened the file, I decided to copy some of the commands and try it for workability. However when I pasted the first command from that file into command prompt it gave me this error:

COMMAND: C:\test\myisern-xml-1.0.1007>java -jar myisern-1-purple.jar -listCollaborations -organization University_of_Hawaii

ERROR: Unable to access jarfile myisern-1-purple.jar

Then I tried to build a jar file with this:

COMMAND: ant jar
ERROR: Buildfile: build.xml does not exist! Build failed

The issue with this problem was that, once I imported the unzipped project into my Eclipse environment, an additional folder (myisern-xml-1.0.1007) in my C:\test directory was created. So, I cd under command prompt into the wrong folder because I was using the tab and did not pay careful attention to which directory I change to, since the C:\test directory should only contain the project (myisern-xml-1.0.1015).

Once I figured out this problem, I changed to the proper working directoty (myisern-xml-1.0.1015) which contains all the files needed. This time I was sure that the command in the Usage file would work. However, the same error appeared even after using ant jar.

After a long while, I figured out what the problem was. In the Usage file it says to use this command:

java -jar myisern-1-purple.jar -listCollaborations -organization <uniqueID>

but it should actually be this:

java -jar myisern-1.1-purple.jar -listCollaborations -organization <uniqueID>

Did you catch the error? It took me a while to realize that the jar file is wrong in the provided command. Maybe, I should have written up the command on my own and use tab, then I am sure that I would get the right output. Besides, I am still not sure why I got another directory when I imported the project into Eclipse. The directory contains only the .project file.

Code format and conventions
The code looks really nice! It is properly structured into several classes that contain only methods that also represent the class name. There really aren't any problems regarding the code format and conventions. Also, all variables are properly named.
The only suggestion I would like to give is that when you comment out some code
(I think it is for later use) then I would use this pair /* ... */ instead of the line comment //.

Test case review

White Box
Form a white box perspective the test cases cover a huge amount of the code. The Emma report shows 100% class coverage, 97% method coverage, 98% block coverage, 97% line coverage. These numbers are pretty impressive. Since a lot of effort was put to establish the test cases, I would suggest to add the following test.
In MyIsern.java there is a block of code that is run when the semantics of the XML files are incorrect. You could code your own test semantic XML file and run a test on it. Following the Emma coverage, it seems like in class command.java the method setUniqueId is never used.

Black Box
I looked through all the test java files and it seems like all test cases are well written form a black box perspective. I understand that tests were written for equality, null, and for wrong data on all test java files. Job Well Done!

Break da buggah
I tired for a long time to crash the program but I didn't find yet a good solution. It seems to me that you followed all the requirements correctly and also have a well working system. Here is one way I was able to crash it:

command:
java -jar myisern-1.1-purple.jar -listOrganizations -collaborationLevelGreaterThan 9999999999 it printed
error:
java.lang.NumberFormatException.forInputString(Unknown Source)

But I think that this is lame because an integer can only hold a max value of 2147483647 and I don't think that this program will ever have to hold so many Organizations. Moreover, I got the same error when I inputed a string instead of the required integer for -collaborationLevelGreaterThan.

Summary and Lessons Learned
Reviewing a well written code is very good for improving my coding style in object oriented programming. In this code I saw a lot of different opportunities to improve my coding style. In the next assignment I will concentrate on creating a class or methods that will hold values for me. Basically, I will take advantage of get... and set... . Moreover, I will design class that are easier to enhance.

On the other had, I would like to make you aware that when invoking java -jar yourjar.jar the program gives a list of suggested program usage. That list suggest to use a jar file that is not existing. In other words, it seems like you renamed your jar file in build.xml but did not rename it anywhere else. Moreover, I don't know if it was a requirement but it would be nice to have a command to print all the tables, just like in MyISERN-1.0.

It was nice reviewing your code.

18.MyISERN-1.1

Overview
This assignment is a Milestone therefore some really useful information for the everyday user as well as for the developer along with some facts on how to improve this wonderful project can be found at this Google wiki page.

Distribution package

Project Hosting
Discussion Group
SVN Group

As always all tasks were completed

What was difficult about this assignment?
First of all, this assignment required more java coding practices than most previous assignments. Actually, the coding was not the problem. However, in my option the time constrain, from getting the "right" requirements, until our group had a clear understanding of the project and could start coding the assignment was a little short. But it was very useful having three people work on the requirements of this assignment, because each of us had different ideas on how to start the assignment. In addition, it was good that we did not had a conflict of choosing which way to go.

The next major problem in this assignment was when using SVN. Somehow, I coded my part of this assignment and wanted to commit the project, but SVN told me that one or more files might be in a conflict state. Since this was the first time dealing with a conflict all of us spend more then two hours on solving it until all of us had the current version on their machine. That is also why we think that our version number is at least at 45.

Finally, since all of us work and each of us has a different working schedule it was little difficult to make everybody "happy" with the meeting time. Nevertheless, as always, for the first couple days of the week we met for about 30 - 45 minutes and discussed potential questions and problems that might appear in this assignment. Furthermore, the last couple of days we met to code the assignment. It was also difficult to concentrate on the assignment since all of us still had many other assignments due this week (for other classes).

What problems were encountered in organizing the group and carrying out the work?
Despite of a couple of different views of the actual interpretation of the assignment requirements, the whole project went very smooth. One reason for that was, because we met every day to talk about the assignment. Another reason was that we made fast decisions on distributing the work and all of us made sure that the job gets done. Moreover, as described above getting this and other projects done, does require to spend some time on it.

What will you do differently during the next Milestone?
I want to promise myself that I will work on the SVN conflict situation. As for this Milestone we spend way to much time getting rid of the conflict. This time could be used to improve our algorithms, however the conflict happened at the last day before the project was due, and it was kind of annoying having to sit there and not to work on the actual implementation (not fun). Concerning time, we actually spend a relative amount of time on this project, so I hope that for the next Milestone my group members will be also as motivated as our group was for this week.

Monday, October 8, 2007

16.MyIsernReview

As always the goal of reviewing peer's code is to improve the ability to read, write, and test Java systems. Today, I will review Kevin's code who is a graduate student taking Software Engineering 613 at the University of Hawaii.

Initial Problem
I was assigned to review Kevin's code. When visiting his Blog entry for MyISERN-1.0, I did not find and links pointing to the distribution file. Technically, I would be done now, since I was not able to download any project to review. However, I like reviewing someone's code because most of times I learn more about the Java programming language. Therefore, I went through the list of names trying to figure out if his project partner had a pointer to the project distribution. I was glad that he had, because it saved my contacting Kevin by email and it also saved him some stress editing his Blog entry.

Installation Review
I have downloaded Kevin's project from this link. The download went smooth and I was able to unzip the distribution into my local directory. I also did not have any complication when importing the unzipped distribution into Eclipse. Right after importing the project into Eclipse, I decided to open the command prompt and try executing his code using this command: java -jar .... however, as it seemed there was no jar file present. Therefore, I tried to create a jar file using the ant command ant jar. The build was successful and a jar file was established. Now I was able to invoke java -jar myisern.jar and it printed the desired three tables within the prompt. Although, the tables could be formatted nicer, they seemed to have the correct values. (Tables look better in Eclipse) Running the command ant -f verify.build.xml did not return any errors and Emma coverage was at 100%. However, a 100% Emma coverage doesn't indicate that the system was properly tested which I will find out in the "Break da buggah" section of this assignment.

Code format and conventions
This section was pretty well covered. I could only find a few violations which are presented in the table below.

FILE
LINESVIOLATION
COMMENTS
TestMyIsernTable.java6
ICS-SE-Java-2Do not use wild card "*" in import statements
TestMyIsernTable.java1
EJS 41
Provide a summary discription (Empty)
MyIsernTable.java
82
EJS 32
Write documentation for those who must use your code and those who must maintain it
MyIsernXmlLoader.java
123
EJS 1
Adhere to the style of the original (no space)
TestMyIsernXmlLoader.java18
EJS 1
Adhere to the style of the original (@Test)


Test case review

Black box perspective

There are tests that test if the correct values are read from the XML files. The method testGetResearchersTable() tests at least one field from each researcher. However the field picture-link and Bio-statement are never tested. Therefore, I would suggest to test these two values at least in one researcher. In the second test method testGetOrganizationsTable(), I would suggest to also write a test for Affiliated-Researchers. Since for one researcher this value is null and for the other not. Checking this test case, made me wonder if the table output is correct. That is why I ran the program. I figured out that it doesn't even print the Affiliated-Researchers. Then I found out that for other tests it is similar. Wherever I thought there is a test case missing, it did not print the values to standard output. Now, I am thinking if this was done with purpose, because otherwise the content couldn't fit onto the screen the way the table was formatted, or were the values left off unintentionally.

White box perspective

The testing is well done from the white box perspective. I ran Emma on this program and it returned a 100% coverage for all areas. Job well done! But, I suggest not to rely on that result. After knowing that the code is covered 100%, I would advise to close the coverage report and look at the test cases from a block box perspective again. Make some logical decisions whether to test each important part or just do testing for certain values.

Break da buggah

When running this program it does not return all the values contained in the example XML files. Does this mean that it returns incorrect values? Other then that, even if I run it with additional arguments it still prints the tables. On the one had it is good because this doesn't mean that the program crashed, but on the other hand it would be useful to the user if a statement would be printed informing that additional arguments are not supported at this time.

Conclusion

I believe that for this assignment we supposed to print ALL the values contained in the example XML files. However after reviewing Kevin's code, it made me wonder, because that code did not print all of the values, at least I didn't see them on the console. Especially, because the program seemed to work and look right. Certain values were missing in the output. Now, imagine if this would be distributed to the customers and they could not find the needed values in the just so expensive bought software. Seems like I learned that designing logical test cases and checking the output is very crucial to the correctness of a software output.

Sunday, October 7, 2007

15.MyISERN-1.0

Project Links
Distribution package
Project Hosting
Discussion Group
Svn Group

Using JAXB
Once we figured out how to use JAXB, this assignment seem to be easy. However, learning a new tool isn't always as easy as it is described on several websites. I learned a lot by trying to figure out how to use JAXB to extract values from a XML file. As mentioned it was not that easy at first. I went to some "help" websites that had example code of unmarshalling and marshalling. I took the exact same code from various websites and changed some variable names. At first it didn't work. But after thinking and rewriting that code, it suddenly made sense how JAXB works and it was fairly easy to continue with the assignment.

Implementing Tables
After we accomplished this task, we debated on the format of the tables. Since in the assignment instruction it was never clear if the tables should be command line implemented, we decided to take it a step further and create nice tables which use the Java swing package. However, after reading assignment 16 (Next Assignment), it seem like we should rather stay with System.out because it would be easier for implementing assignment 16.

What about XML
Even though we were working with XML files, a person not knowing XML would also be able to complete this assignment. This is because the XML files, as well as the XML schema files, were provide by the professor which saved us a lot of detailed work. This is also why we were able to fully concentrate on our actual task; learning to use JAXB. In addition, JAXB did all the work for us. Nevertheless, it was still a hard assignment because this was the first assignment which required working in groups and it also required using TortoiseSVN which none of our group members used before. Therefore, we had to learn to use this tool as well, within a short time period.

Group development
Actually, I must say that group projects as experienced this time make really fun. Not only because I didn't have to think about the code implementations all on my own, but also because I learned a lot of new "tricks" in using Eclipse. I was also able to see other peoples' way of coding and learned a different process of thinking about implementing certain methods. I was actually, surprised that we were able to meet every day for at least one hour. I was surprised because each of us work on a different shift and each of us still has other homeworks to do. That was amazing one of the member works mornings, I work afternoons, and another group member works nights. But we still figured a time to meet and there was never a situation where one member had to wait for another member to appear to the group meeting. So, this was a really good experience.

Saturday, October 6, 2007

14. CM Practice

Below are the links which proof that all tasks were completed.

Links

Project Hosting
Discussion Group
SVN Status Group

The Practice

For this assignment, I decided to review the lecture notes and slides presented during class time. Tasks one and two were straightforward, since they only required to download and use TortoiseSVN.

Task three was a little more difficult. However, I didn't run into any major problems which I wouldn't know how to solve. I did not want to use any other sources for creating the Google hosting project because I wanted to make sure that my project fits the Professor's requirements. But some of the slides are not very clear, especially the slides which included snap shots. In addition Google seem to have changed the user interface which is different then presented on the slides. Nevertheless, with some minor decision debating, I completed all tasks. One of the decision I debated over, was whether or not to give the members the email option.

From working on this assignment, I have learned that it is required to make small decisions fast. If I didn't make these decisions promptly, I would probably still be sitting and working on this assignment. I have also learned that Google provides a lot of useful resources for free. Now, I know that I can upload all the programs that I have written in my past classes unto Google hosting and control them with TortoiseSVN.

Friday, September 28, 2007

12.WebSpiderReview

The goal of reviewing a classmate's WebSpider assignment is to improve the ability to read, write, and test Java systems.

1. Installation Review
This process should be fairly smooth since we all used the same IDE and the same tools to write and test our code. I downloaded my classmate's software and extracted it into my Eclipse workspace. The packages contains two source code files (WebSpiderExample and TestWebSpider), a lib directory with checkstyle, emma, findbugs, and pmd sub directories, and various build and documentation files. The package had all the necessary files. Therefore, I was able to import his project into Eclipse without any effort.

The command ant -f verify.build.xml returned no errors and completed successfully. Because, I was a little bit suspicious, I decided to execute each build file individually but no errors were found. However, emma block coverage is only 83% and the line coverage is only at 85%.

I was able to build a jar file and execute his code with java -jar webspider-ivanw.jar -totallinks http://www.hackystat.org 100. As read from the console, it seemed that some Websites refused the connection. However, this did not bother the code execution and there were 1585 links found. At this time I can not be certain if this number is true since my code returns a slightly lower number of links (Read on).

2. Code format and conventions review
After reviewing the code, I recommend the following formatting corrections:

FILE
LINESVIOLATION
COMMENTS
WebSpiderExample.java46
EJS 6
Spelling ("of" twice)

WebSpiderExample.java58, 161
EJS 33
Keep comments and code in sync

WebSpiderExample.java71, 174, 183, *
EJS 7
use space between code blocks
WebSpiderExample.java150
EJS 49
Omit the subject in summary descriptions of actions or services
TestWebSpiderExample.java3
ICS-SE-Java-2
Do not use wild card "*" in import statements
TestWebSpiderExample.java22
EJS 33
Keep comments and code in sync


3. Test case review

Black box

Ivan's TestWebSpiderExample.java tests all methods within WebSpiderExample through calling the main method. Since all methods are in the same class, it seem like the test cases cover all methods written. Form a black box perspective this might be enough. But I would suggest covering all if-then-else statements as well.

In TestWebSpiderExample.java there are 4 calls to the main method each testing with different number of parameters but the same values. In addition there is one call to testMainMethod.

A nice extension to the tests that he already has would be testing for -totallinks and -mostpopular with 0 pages. Then testing it with a high number of pages and later with some illegal value such as, providing string input instead of number. He also could test with an empty parameter. For example, the URL String, or any other required parameter, could be empty/null. In addition a self made website could be set up to see if the code returns the correct values.

Since only the one call to testMainMethod has a assert statement I would suggest putting more assert statements and maybe calling testMainMethod on all tests since this method returns a value that can be compared for correctness.

White box

The emma coverage report returned 83% of block and 85% of line coverage, which does not seem satisfying from a white box perspective.

Analyzing emma's coverage report, I would suggest to include testing for the following:

1 - The length of linksVisited array is set to 65535. Since all test cases test only 5 pages, the linksVisited will never reach over 65535 links. Therefore, a test case must be set up or the length should not be preset.

2 - Various catch boxes are not covered. My suggestion is to set up a Website that would satisfy covering all the exceptions.

3 - Set up a test case were the user enters something else than the supposed -totallinks or -mostpopular option, and one of the else statement would have sufficient coverage under emma.

Break da buggah

I have set up my own very basic test website. The expected test results for -totallinks should be 3 and -mostpopular should return http://www2.hawaii.edu/~michalz/WebSpiderTestWebSite.html with 2 links when the maximum number of pages to traverse is set to 3 or higher.

Running Ivan's code on it returned incorrect results.

command: java -jar webspider-ivanw.jar -totallinks http://www2.hawaii.edu/~michalz/WebSpiderTestWebSite.html 3

output: 5

Changing the number of pages to traverse from 3 to 5 returned 9.

command : java -jar webspider-ivanw.jar -mostpopular http://www2.hawaii.edu/~michalz/WebSpiderTestWebSite.html 3

output: The most popular page is: http://www2.hawaii.edu/~michalz/WebSpiderTestWebSite.html with 0 pages that point to it.

comment: Right website, wrong number of pages.

Setting the maximum pages to traverse to a different number, gives all kinds of results with one of them being the right one.

command: java -jar webspider-ivanw.jar -totallinks http://www.myspace.com/shakadownstreet 10

output: crash - Sys.Application.notifyScriptLoader(); 'failed: SyntaxError: illegal character

4. Summary and lessons learned
I have learned to think and design better test cases for programs. Most people, including me, tried to get emma coverages as high as possible without even thinking if the tests we write are actually helping to test the actual program execution. I have also learned that it is important to set up an own testing environment before testing the code for correct output. For example, if I would set up a test website for WebSpider right from the beginning, I could be more certain that my code does what it supposed to be doing. I have also learned that using someone's test website isn't very good since I found one link on Randy's website that was down, and therefore my code returned a different answer than expected. If you know what your code does, than it is easy to set up a testing environment and write more sufficient test cases.

Wednesday, September 26, 2007

Extra Credit (revised)

Source Code: Available here

So, I did some research on the httpunit package and I found a nice article named "introduction to Httpunit". From, this article I have learned that we must set the script error exception to false. However, this did not solve my problem crawling the myspace Website. Then I found other useful Website that helped me learn and understand the Httpunit package. However, most of the other articles did not help in solving the problem. Since you are allowed to set options in Httpunit as in : HttpUnitOptions.setExceptionsThrownOnScriptError(false);
I then looked, with help of the Javadoc in Eclipse, at setting other options. When I set HttpUnitOptions.setScriptingEnabled(false);
the problem of crawling the myspace site was solved.

11 WebSpider (revised)

Source Code: Available here

First of all, it was a good experience having this assignment extended because I was able to improve my logging feature which is implemented with java.util.Logging.Logger. Although, my web spider was working already before, I decided to revise the code and add more security to it. Therefore, I have surrounded necessary code with try and catch blocks. The only problem associated with it is when running Emma on it. Since the code won't always go through the catch block, Emma will complain about it and the coverage drops down from the expected 100%. But at least it won't stop the code execution when a link is down or when a website is not accessible. In addition, I think that writing Junit tests isn't always very easy. Sometimes it seems like Junit tests are not necessary for certain blocks of code but then Emma coverages will drop. So, to satisfy this I must write a test which just goes through a block which only contains a print statement. I have also found a way of turning off the scripting errors in httpunit and therefore my code works for nearly all web pages, including myspace.com.

Monday, September 24, 2007

Extra Credit

I have tried to accomplish the extra credit assignment by playing with the code until it would actually execute the myspace site without any exceptions. However it always complained about ASP.NET AJAX Framework is missing. While trying to make it work I found that httpunit has a function called HttpUnitOptions.setExceptionsThrownOnScriptError(false); that would skip all the scripting but this did not help either. The function takes either true or false as the parameter whether you want scripting errors to be printed or not. Then I went on to Google to get some more information on how to solve the problem however in the end I was not able to execute myspace without any errors. At leat my web spider works for a lot of other site.

11. WebSpider

Source Code: Please click here to download

I was able to accomplish all the tasks. However the third task which required us to implement logging, I was able to completed it only partially since I choose to put a bunch of System.out.print line statements. I could have implemented a better logging, but I did not have the time to finish it with a complete logging application before the due date. Therefore, I realized that it is important to start on harder assignments at least a week before the due date.

Write the web crawler was for me the hardest part. Since the httpunit package doesn’t come with all the Javadoc comments which are always very useful when writing Java code in Eclipse. I also missed some helpful documentation or examples for httpunit on Google or even on their own Website. If I would be more familiar with the package then I am sure that I could write better and more robust code then the one which is available here. That is what I think that writing the actual web crawler made more difficult.

A problem that I ran into in the very beginning was:

When I issued the command ant run, it gave me an error saying that Junit.org does not exist. It took me a while to figure out that putting Junit into the fileset in the build.xml file would actually solve my problem. After that it ran fine, but I ran into problem with the httpunit package.

Finally, I was able to get a good coverage from emma which was near 100% for all. I was not able to get the full 100% because PMD complained about ArrayList which I could not solve in the short time.

In conclusion, I think that this assignment was helpful in dealing with unfamiliar packages and it also gave me a chance to brush up on recursion. Once I heard from a senior worker that he has never used recursive methods in his career when writing programs. I would agree that recursion is not necessary since it is heavier on the memory, has slower execution (as can be observed when executing this code) and is more prone to errors.

By the way, be patient when executing this code since it may take a while until it recursively traverses through the Web links until a specified number of pages have been visited.

Sunday, September 16, 2007

10. Stack

Source Code: Please click here to download

This assignment was not as easy as it seems when reading the assignment instructions. Various tasks had to be mastered in order to complete this assignment including learning the Ant build system as well as several Java automated quality assurance tools. Personally, I was glad when at the end all the specified tasks were successfully working.

I have encountered a few major problems while I was working myself down the instruction list.

problem - 1
I was able to download and install SCLC Code Size Counter correctly, however when I tried to invoke it via command line it gave me an error. It turned out that I did not have Perl 5 installed on my machine.

solution - 1
I downloaded ActivePerl and the problem was resolved. At this point I was able to execute all the targets in Task 1 but verify, without errors.

problem - 2
Another problem that I ran into was associated with javaNCSS. The download and installation were rather easy but I found the actual instruction on kclee.de a little difficult to follow. However, the actual problem was that I had to learn how to write the build.xml file for javancss.build.xml, which was a little more challenging than all the previous tasks since I did not write any XML before. Fortunately, I know HTML which did help a little.

solution - 2
In order to complete the required tasks for the javancss.build.xml file, I looked at and studied all the other build.xml files that are included in stack-5.0.909.zip. In addition, I used Google to search for related topics.

ANT vs. MAKE


I remember writing several MAKE files and having the "tab" problem because it is necessary for MAKE to have proper indentation. When working with ANT I did not have this kind of problem. However, in order to write the necessary files for ANT tasks I was forced to learn XML. After all, I believe that ANT is a more powerful tool and when allowed I would chose it over MAKE. On the other hand, knowing a scripting language such as XML is very important for the future.

SCLC vs. JavaNCSS


Both, SCLC and JavaNCSS can be used out of an ANT build.xml file. Currently, SCLC supports 27 different file types while JavaNCSS is designed specifically for the Java programming language. (I believe) Therefore, JavaNCSS looks more at packages, objects, and functions while SCLC looks at files with various extensions and concentrates on lines, comments, etc. JavaNCSS provides the number of javadocs generated whereas SCLC gives an overview of the number of files with different file extensions, and much more. Therefore, I believe that both are good tools but most powerful when they are used together on a project.

Conclusion


This assignment, as many other ICS-projects, was time consuming. Therefore, it is important to allocate enough time to be able to learn all the useful tools. At first, this assignment may seem a little difficult, however after mastering all the basic readings on all the tools involved, it is rather understanding than confusing. Finally, it would safe me a lot of trouble in my previous programming courses, when I would be aware of these open source Java automated quality assurance tools.

Wednesday, September 5, 2007

08. CodeRulerRedux

Group members: Michal Zielinski & Chiao-Fen Zielinski-Liu

Source Code: Please click here to download

This time we had more time to think about a better strategy for our CodeRuler project. After reading other classmates' code we found a better way to claim land. Jared has an interesting loop in his CodeRuler code that loops through the whole grid starting in the left upper corner. We implemented a similar strategy. However, we divide the grid into four equal squares and assign peasants to each square. Since the fourth square gets less peasants and therefore they cannot finish claiming all the land, once the peasants in the first square finish claiming the land we assign them to help peasants in the fourth square. In the meantime, our knights are instructed to capture all castles that we don't own and anything that is in their way. After that the knights will capture all enemy peasants. When all enemy peasants are captured the knights go on to capture the enemy knights. We instruct our knights to capture all the castles first in order to be able to create more knights when needed in the battle with other knights. Therefore, peasants are only created when we have twice as many knights as other knights or when we don't have any peasants. This strategy works out pretty good against all the sample rulers. We were also able to include Java Documentation and Coding Standards in our CodeRuler source code which makes our code more readable and understandable to another reader.

This are the result runs:


Result 1Result 2Result 3
michalz-chiaofen vs. migrate ruler854 - 0
827 - 1
833 - 0
michalz-chiaofen vs. gang up ruler782 - 184
784 - 140
553 - 399
michalz-chiaofen vs. split up ruler725 - 256
733 - 230
748 - 182

Writing this code gave me a chance to become more familiar with the Java Documentation and Coding Standards which I learned by reading "The Elements of Java Style". I must say that it is not very easy to follow exactly what the book says since it doesn't have enough examples of certain rules. Hopefully, as this class goes along, I will be able to write code with perfect documentations.

Thursday, August 30, 2007

07. CodeRulerReview

For this assignment my tasks were to review Jung's implementation of the CodeRuler class and find any formatting errors that do not follow the Java coding and documentation standards. After reading "The Elements of Java Style", I learned that there is more than just inserting comments, choosing proper variable names and method names to make our code more readable.

At first sight it seemed to me like Jung did a good job in formating his code and making it readable to a reviewer. However, I found some minor and some major issues that do not follow Java Style which is alright since our class did not have the chance to read "The Elements of Java Style" before implementing the CodeRuler class. Moreover, some of the loops should include block statements to make the code more readable and easier to modify if necessary.

In conclusion, it was very interesting to see someone else's style of writing Java code and to find out potential Java coding and documentation standard errors. Finding such errors in code that was not written by me, helped me to stayed focused through out the whole review while learning the correct way of documenting Java code.

Just a suggestion, try to figure out how to use your knights to attack either the enemy peasants or the enemy knights and I am sure that you will have a greater chance of winning.

Below is a Table summarizing all the Java coding and documentation standard errors that I found in Jung's implementation of the CodeRuler class.

FILE
LINESVIOLATION
COMMENTS
MyRuler.java94, 104
EJS 6
Break up long lines

MyRuler.java32, 33, 34, *
EJS 8
Do not use hard tabs

MyRuler.java41, 48, 63, *
EJS 37
use one-line comments to explain implementation details
MyRuler.java
23
not sure
put closing '}' at newline
MyRuler.java8, 9
EJS 46
Establish and use a fixed ordering for Javadoc tags (@version missing)
MyRuler.java116
EJS 49
Omit the subject in summary descriptions of actions or services
MyRuler.java63
EJS 59
Add internal comments only if they will aid others in understanding your code.
MyRuler.java63
EJS 60
Describe why the code is doing what it does, not what the code is doing
MyRuler.java33
EJS 62
Explain local variable declarations with an end line comment
MyRuler.java108, 109, 112, *
EJS 64
Lable closing braces in highly nested control structures
MyRuler.java110, 125, 134, *
EJS 76
Use block statements instead of expression statements in control flow constucts

Wednesday, August 29, 2007

05. CodeRuler

Group members: Michal Zielinski & Chiao-Fen Zielinski-Liu

Source Code: Please click here to download

We have chosen a special strategy for our knights and peasants to follow. Fist of all the peasants are instructed to walk in certain directions as a group. This means that all peasants, rather than wondering randomly around, follow a path in any direction for a specific number of turns which makes them all walk towards one direction for a certain timespan, therefore occupying more and more land.

In the meantime the knights are instructed to find out the location of the enemy peasants and capture them as they are discovered. The knights also have a second task that is to capture any enemy object that is in the location of one square in either direction.

As this battle of occupying land and capturing peasants goes on and we inherit more and more land, we also produce more peasants as well as knights. Although, the code is written such that if our ruler has less knights then peasants, we try to create more knights.

This are the result runs:


Result 1Result 2Result 3
michalz-chiaofen vs. migrate ruler524 - 135481 - 32441 - 73
michalz-chiaofen vs. gang up ruler198 - 220512 - 302225 - 189
michalz-chiaofen vs. split up ruler189 - 221147 - 178114 - 152


Finally, the chosen strategy works well against the migrate ruler and the gang up ruler but it did not help winning against the split up ruler.

Writing this game application I used the chance to learn the eclipse platform as well as to brush up my Java programming knowledge. I have not used Java for a wile but it took not long to remember and realize all the functionalities that Java provides and which I have learned in previous classes. With the eclipse software I did not have many problems yet. However, we had to look up how to run javadoc over our files. With a little of searching on the net everything became clear and we were able to generate the needed HTML doc pages. In addition, we had some trouble with the CodeRuler game itself, when downloading it. After successful downloading of the CodeRuler zip file and proper extraction of them into the right folders, first we weren't able to see the other folder under New -> Project... . However after activating the Java Runtime environment the folder magically appeared.
Our teamwork was well. It was fun not to have to come up with a well organized strategy all by yourself. After, we plan out our strategy we thought about how to start writing the code and I must confess that if two people think about the code, it is generated much faster with even fewer bugs because the other person who is not writing code at that time has the chance to look for potential bugs. Therefore, I support teamwork at all times.

Monday, August 27, 2007

02. OSS Experience

I downloaded an open source software at sourceforge.net called Bolzplatz 2006.


Bolzplatz is a 3D soccer game in a comic style appearance inspired by the 2006 Soccer World Cup held in Germany. "This game is written in two programming languages: Java and C++. Java is used for the game engine (gameflow, artificial intelligence, game data handling, ...), while the libraries for video, audio and input are coded in C++. The connection between the Java classes and the native binaries is achieved by the Java Native Interface (JNI). Most game data is coded in XML, so it's really easy to edit it." (http://www.bolzplatz2006.de/de/development.php)

Bolzplatz 2006 is one of the best free computer games I have ever played. It definitely fulfills the first Prime Directive (The system successfully accomplishes a useful task). For instance, the user can choose any soccer nation that was qualified for the 2006 Soccer World Cup. The user has also the choice of playing a friendship game or the whole World Cup tournament. In addition, the user is allowed to change the stadiums, referees, and many other common options.

The second Prime Directive (An external user can successfully install and use the system) is fulfilled by the easy process from download till installation and pleasure. The actual download took about ten minutes. Once downloaded there is only an executable to double click before the installation can begin. The installation process is pretty smooth. Basically all the user have to do is click the next button to set up all configurations and then enjoy the game.

Finally, the third Prime Directive (An external developer can successfully understand and enhance the system) is somewhat satisfied by the documentation found at Boltplatz2006.de under technical background.




04. FizzBuzz

This is the FizzBuzz program written in Java.

public class FizzBuzz {
public static void main(String[] args) {
int i=1;
while(i!=101){
if(i%3==0 && i%5==0){
System.out.println("FizzBuzz");
}
else if(i%3==0){
System.out.println("Fizz");
}
else if(i%5==0){
System.out.println("Buzz");
}
else{
System.out.println(i);
}
i++;
}
}
}
It took me a little more than five minutes to write this program. However, I did not just start writing the code, but thought first of its implementation. Learning about Software Engineering or going into this field one must understand that before writing the code for software one must first plan it out therefore minimizing the probability of certain bugs. Since, I didn't take any courses the last semester that required me to write programs, I got a little rusty with the syntax and use of the Java programming language. I found only one mistake, that I made when I though about how to write this code, when running it in Eclipse. The initial code had this if statement:
if(i%3==0 && i%5==0){
System.out.println("FizzBuzz");
}

in an else if statement, making the output wrong.

Even though it took me as little as five minutes to write the code, I spent more than half an hour getting familiar with Eclipse, reading its documentation, and the tutorials, because I have not used this software before. After reading the tutorial I found out that Eclipse is an easy to use software with many capabilities.

Finally, it should be clear too anyone that software always will have bugs. If you don't believe me then read "Writing Secure Code" by Howard and LeBlanc. It is a very good book and I recommend it to anyone.