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.