Link to our project page: http://code.google.com/p/myisern-1-red/
Project download: http://code.google.com/p/myisern-1-red/downloads/list
Tasks:
All tasks for this assignment are completed.
Difficulty:
There were several problems faced. Firstly, we were confused with how to implement the methods to edit current researcher, collaboration or organization. We come up with several possible implementation ideas and finally clarified with Dr. Johnson on what the users expects to do when editing information. However, the actual implementation was not as easy as we thought. We come into problems when we write these methods and checking the link is a particular one that gave us lots of troubles. We used httpunit to check and validate the links but it kept giving us various errors when we run the program. After spending a whole night on adding in more data checking and throwing in exceptions, this problem was finally solved. Secondly, there was the problem with displaying our data in the table. We used Swing to print out tables. It worked fine for printing the researchers and organization which has a relatively simpler structure than the collaboration data. However, when it came to the collaboration data, we have trouble with displaying some entries. For example, those with missing years cannot be displayed at all. Thirdly, when my groupmate Jared did the testing, he kept receiving error: “junit.framework.AssertionFailedError: Forked Java VM exited abnormally” which is probably due to the vast amount of data put into the heap. After trying other possible tests, in the end, he has to take out those tests as there was no way to get around the problem caused by limitation of memory available. Lastly, there is the problem with entering the data. I entered the collaboration data and it was quite tedious to figure out the collaboration data from the given pdf, there was a lot of missing data so a lot of guesses was put in to make it as complete as possible. However, this is not a big problem compared to coding and it gave a good taste of what it is in real life at work because the users won’t always give you every data or requirements you need and you have to be able to sort them out.
Group work:
This is a nice experience working with my groupmates Jared and Phuoc as we are all willing to help each other whenever needed. One problem we faced was the lack of overall coordination. We didn’t assign work explicitly to each member. We all just took up whatever work is not done at that moment and worked on it. If we faced problem as we worked on our tasks, we would bring it out and the other members would always be willing to help which is encouraging. However, we feel that it would be more efficient if we just break down the tasks and assign them to each member instead.
Improvement for next Milestones:
There is mainly two ways to improve the process and the project itself. Firstly, in terms of group work, we would improve the overall coordination by breaking down the tasks into smaller parts and assign them to each member instead of volunteering to take up whatever part is left undone. This should make this programming process more efficient. Secondly, we would consolidate the code. For example, we have separate methods for adding or editing researchers, collaborations, and organizations respectively. In these methods, there are all performing similar actions and these actions could possibly be simplified by grouping them as another method. Moreover, given this project has grown so much in size that we have thousands of codes now, there would absolutely be other places with reluctant codes. We would go through the code in details for our next milestone and sort these codes out.
Monday, October 22, 2007
19. Use Case Specification
Link to the use cases for our team: http://code.google.com/p/myisern-1-red/w/list
When we started working on the use cases during our meeting, one minor problem we faced was finding a suitable template for it. This problem is solved after doing some googling and looking at other group's use cases.
By writing up the use cases, we pulled back from our programmer's perspective and looked at the program from the user's point view. This is very useful when we work on the user-interface and the program design as we have this as a reference guide. This way, we know what the users are using it for and expects and we can then model our design to best accommodate their need while saving us time on pondering through various design implementations. Moreover, by writing out the steps that the user takes to perform a particular action, we can see clearly whether there are reluctant steps and then simplify it.
When we started working on the use cases during our meeting, one minor problem we faced was finding a suitable template for it. This problem is solved after doing some googling and looking at other group's use cases.
By writing up the use cases, we pulled back from our programmer's perspective and looked at the program from the user's point view. This is very useful when we work on the user-interface and the program design as we have this as a reference guide. This way, we know what the users are using it for and expects and we can then model our design to best accommodate their need while saving us time on pondering through various design implementations. Moreover, by writing out the steps that the user takes to perform a particular action, we can see clearly whether there are reluctant steps and then simplify it.
Wednesday, October 17, 2007
22.MyISERN-1.1.Review
Author reviewed: Ben Karsin of team Ivory
This is the first time we can choose the author to review and so I chose a graduate student’s team to learn from them.
1. Installation Review:
I went to the project page listed on his blog and downloaded the package successfully. Installation was quick and easy. Verify passed indicating JUnit, Checkstyle, PMD, and FindBugs tasks all passed too. The program also enable the creation of a jar file upon typing “ant jar”.
It was very easy to figure out how to use their program as they provided a helpful list of queries upon typing in “java –jar myisern-ivory.jar”. It also listed the link to the user guide in case the user needs more instruction on using the program. I found this queries list very helpful and I always return to it when I was testing the program as it was hard to remember all the different combination of queries. However, there was a typo in one of the queries: “-listCollaboraitons -researcher
2. Code format and conventions review:
They modularized their codes and so there are a number of files in this project. However, after going through all of them, only TestQueryParser.java contains some minor violations. All the codes are also commented well. They have done a good job on code format and conventions.
File | Lines | Violation | Comments |
TestQueryParser.java | 59,60,71,* | EJS-7 | Should include white spaces |
3. Test Case Review:
Black box perspective:
The purpose of this program is to print out tables based on the input queries and they have done a lot of testing on the input. However, they have missed out testing the boundary cases for “-listOrganization”. Other than that, they have done a pretty good job on black box testing.
White box perspective:
Emma Coverage summary
class: 100% (12/12)
method: 89% (65/73)
block: 87% (2684/3091)
line: 85% (452.5/532)
One reason why some coverages are not 100% is they forgot to check “-listOrganiztion” as indicated above. The TestXmlQuery.java was supposed to test all the methods in XmlQuery.java but they have left out this one.
Break da buggah:
They have done throughout testing and managed to catch most of my incorrect/invalid queries. However, upon typing “java -jar myisern-ivory.jar -describe -researcher PhilipJohnson” it returns the NullPointerException.
Similar errors also with “-describe –organization < uniqueID>” and “-describe –collaboration < uniqueID>” occur upon typing in anything other than a valid < uniqueID> that exists in the database.
4. Summary and Lessons Learned:
Overall, this program is pretty well-written. One thing I learned from Ben’s team is how to modularize a program. When I first imported the project into Eclipse, I was overwhelmed by the long list of java file there are and didn’t know where to start. It was a big difference from our team’s project which only comprises of two file and all the methods are put within MyIsernXmlLoader.xml. However, once I started going through their project, I was impressed with how organized the codes are. They broke down everything and put them into separate classes which makes it very easy to locate a particular method and to make changes. Given MyIsern is such a big project, I can see how modularization will be especially useful. This is something that my team is going to work on in the next milestone.
Sunday, October 14, 2007
18. MyISERN-1.1
All tasks for this assignment are completed.
Our team's project page is http://code.google.com/p/myisern-1-red/ and the source code can be downloaded here.
Assignment difficulty:
This assignment is more difficult than the first one. One of the problems encountered is how to obtain the collaboration from a given researcher. There were some confusion at the beginning but thanks to the discussion group, we found the clarification by the professor and the problem is solved. Another problem is conflicts during commits. I encountered several unsuccessful commits or updates due to these conflicts and merging the changes are usually quite complicated. Other than these, there are just some minor problems such as if we should use httpunit to validate the links and implementation detail of the method.
Problems encountered with group working:
It has been a very pleasant experience working with my groupmates Jared and Philip. We didn't encounter much problem with group working. However, sometimes it is a bit unclear as of who is working on which part. So one time I was working on a method but when I was almost done, I finally realized that my group mate has already started working a long way on that. So there was some communication problem but other than that, everything was great. I learned a lot from them, especially Jared who is a very good programmer and can always use the minimal lines of codes to achieve the same purpose. He has made our program very concise and easy to read.
Future improvements:
The issues have been a useful tool as it gives a clear outline of what else are yet to be done. I will stick to it in my future projects and I think breaking down the issues into more details might be more efficient and easier to assign work to members.
Overall, this is not a very hard assignment but writing out good methods is another thing. There are many way to implement a method and we sometimes have to switch from return different type. I feel that we could have saved time if we agreed in the beginning what return type to use.
This time, our group practiced pair programming for the first time and I found it very effective. My groupmates can spot my mistakes immediately and they pointed out errors in my Eclipse setting which I never recognized before. I come to appreciate pair programming as I never thought that having someone to watch me program would be so productive. If time allowed, I would love to practice more pair programming.
Our team's project page is http://code.google.com/p/myisern-1-red/ and the source code can be downloaded here.
Assignment difficulty:
This assignment is more difficult than the first one. One of the problems encountered is how to obtain the collaboration from a given researcher. There were some confusion at the beginning but thanks to the discussion group, we found the clarification by the professor and the problem is solved. Another problem is conflicts during commits. I encountered several unsuccessful commits or updates due to these conflicts and merging the changes are usually quite complicated. Other than these, there are just some minor problems such as if we should use httpunit to validate the links and implementation detail of the method.
Problems encountered with group working:
It has been a very pleasant experience working with my groupmates Jared and Philip. We didn't encounter much problem with group working. However, sometimes it is a bit unclear as of who is working on which part. So one time I was working on a method but when I was almost done, I finally realized that my group mate has already started working a long way on that. So there was some communication problem but other than that, everything was great. I learned a lot from them, especially Jared who is a very good programmer and can always use the minimal lines of codes to achieve the same purpose. He has made our program very concise and easy to read.
Future improvements:
The issues have been a useful tool as it gives a clear outline of what else are yet to be done. I will stick to it in my future projects and I think breaking down the issues into more details might be more efficient and easier to assign work to members.
Overall, this is not a very hard assignment but writing out good methods is another thing. There are many way to implement a method and we sometimes have to switch from return different type. I feel that we could have saved time if we agreed in the beginning what return type to use.
This time, our group practiced pair programming for the first time and I found it very effective. My groupmates can spot my mistakes immediately and they pointed out errors in my Eclipse setting which I never recognized before. I come to appreciate pair programming as I never thought that having someone to watch me program would be so productive. If time allowed, I would love to practice more pair programming.
Tuesday, October 9, 2007
16. MyIsernReview
Author reviewed: Chiao-Fen Zielinski
1. Installation Review:
I downloaded the package from the link provided in her blog successfully. Installation went well. There was no instruction on how to execute the program but I was able to invoke "ant jar" from the command prompt to produce a jar file. After that, it wasn't difficult to figure out how to run the program as I could execute the program by "java -jar MyISERN-1-Orange.jar". The tables are produced as desired. Verify passed indicating JUnit, Checkstyle, PMD, and FindBugs tasks all passed too. Her team also achieved 100% Emma coverage. Good job!
2. Code format and conventions review:
There are a few violations in the code:
File | Lines | Violation | Comments |
MyIsernXmlLoader.java | 48,49,50 | EJS-38 | Document all private memberss |
MyIsernXmlLoader.java | 206, 207, 208 | EJS-36 | Use one-line comments to explain implementation details |
TestMyIsernXmlLoader.java | 51 | EJS-7 | Extra blank line between methods |
3. Test Case Review:
Black box perspective:
Since the purpose of this assignment is to print out the tables based on data given in the 3 xml files, they have fulfilled this requirement. However, they seem to have misinterpreted the data in the colaborations.example.xml as there is only one collaboration item but they split up some data such as "collaborating-organizations" in two separate rows. This would cause confusion as users might mistake the second row as a separate item with missing fields. Since this is a mistake based on misinterpretation of data, even writing test cases could not have spotted that. Other than this, as printing out the data correctly is the only objective, I can't think of other test cases.
White box perspective:
They achieve 100% Emma coverage in all four areas, indicating that all codes has been covered at least once. They also have tests to make sure that the lists are returning the correct value which is nice.
Break da buggah:
The methods to print out the tables are entirely tailored to the data given in this set. If the xml files are revised, such as by adding more items to the collaboration file, the table would fail to print out the new data.
4. Summary and Lessons Learned:
Writing test cases are useful for catching a lot of errors but they still have their limits. In this case, the problem is caused by misinterpretation of data which cannot by spotted by tests. This is when reviewing by another person is especially useful. Through this exercise, I learn about how useful it is to have someone review your code as sometimes you are limited by your perspective and cannot spot some trival minor errors. Also, by comparing their codes with my group's, I learn more about ways to test the main methods as I am quite clueless whenever it comes to writing tests for void methods. On the whole, her team did a good job on this assignment.
Monday, October 8, 2007
15. MyIsern-1.0
This task was completed successfully and the link to the project page can be found here
JAXB
This is the first time I work with JAXB and I was confused by it at the beginning. The idea of converting XML data into java codes and vice versa is brilliant. A large portion of time I spent on this project was on reading about JAXB and XML so that I understand the idea of unmarshalling and marshalling. After knowing how JAXB linked XML and java, it was not difficult to come up with the methods to extract the data from XML and turn them into java tables.
XML
Compared to JAXB, I found XML schema easier to understand. It is basically the language for XML which allows user to define the structure and data types for XML files. However, for this assignment, I focused on learning about JAXB and haven't explored it in detail yet. Hopefully, as we move on with this MyISERN project, I will have more chances to work with it.
Table implementation
At the start of the project, I expected the extraction of data from XML files would be the hardest part of this assignment but it turned out not as difficult as implementing a table in Java. Our group started out with no idea on implementing the table and decided to use JTable after doing some research online. The good thing about using this class is that GUI interface is possible which produced nicer result than simply printing out in text form. However, as we started implementing methods to print out JTables, we were presented with several problems such as table overriding each other. By doing some research online again, we were able to solve these problems and we are much more familiar with using JTable and its related classes now.
Jar file compiling
I didn't know how to enable a file to compile using command prompt before and thought it would be a difficult task. However, after reading through the build.xml from previous assignment I found that it is quite easy. I am comfortable with implementing it in my future assignments.
Emma
For this assignment, the data are given and we can not do anything to change them. As a result, a couple of try-catch and if statements can not be covered at all. We spent a while on figuring out how to get around this problem but concluded that there is nothing we can do without modifying the given data. Besides, I found myself more unwilling to spend time on Emma when it comes to testing void methods. This is because I don't see how useful it can be with assignments like this one where there are a lot of such methods. We can cover a large portion of the code by simply running the main method which is virtually doing no constructive testing at all.
SVN
I enjoyed using SVN in this project a lot. It is very convenient and efficient. However, I do encountered problems with it at the beginning when I updated the code. My group member was implementing the print table method in a very different way as mine. As a result, when I updated the code, I got a warning saying "one or more files are in a conflicted state." I have to go through quite a lot of troubles with merging the changes. Some parts of the codes cannot be merged without going through a lot of revision. In the end, I decided to follow my group member’s way to construct the method so that the conflict can be resolved. Other than that, my experience with SVN was pleasant.
Google project hosting
This is a powerful free service provided by google. I never imagined sharing a project to be so easy. I will absolutely stick to this project hosting service in the future.
Group software development
Working in a group is easier than working alone. Our group couldn't meet in person everyday but meeting online served the purpose well already. We were able to work on the code on our own, ask questions once we get into trouble instead of wasting a lot of time to figure it alone. Besides, working in group makes sure that there's someone to review your work and I learned most from it, especially by comparing my codes with theirs. For example, the way I generated the table was a bit complicated and my group member was able to come up with a simpler one. All in all, this is a nice group working experience. I guess the most important thing is making sure everyone is on the same pace so that we can work on the project together steadily.
JAXB
This is the first time I work with JAXB and I was confused by it at the beginning. The idea of converting XML data into java codes and vice versa is brilliant. A large portion of time I spent on this project was on reading about JAXB and XML so that I understand the idea of unmarshalling and marshalling. After knowing how JAXB linked XML and java, it was not difficult to come up with the methods to extract the data from XML and turn them into java tables.
XML
Compared to JAXB, I found XML schema easier to understand. It is basically the language for XML which allows user to define the structure and data types for XML files. However, for this assignment, I focused on learning about JAXB and haven't explored it in detail yet. Hopefully, as we move on with this MyISERN project, I will have more chances to work with it.
Table implementation
At the start of the project, I expected the extraction of data from XML files would be the hardest part of this assignment but it turned out not as difficult as implementing a table in Java. Our group started out with no idea on implementing the table and decided to use JTable after doing some research online. The good thing about using this class is that GUI interface is possible which produced nicer result than simply printing out in text form. However, as we started implementing methods to print out JTables, we were presented with several problems such as table overriding each other. By doing some research online again, we were able to solve these problems and we are much more familiar with using JTable and its related classes now.
Jar file compiling
I didn't know how to enable a file to compile using command prompt before and thought it would be a difficult task. However, after reading through the build.xml from previous assignment I found that it is quite easy. I am comfortable with implementing it in my future assignments.
Emma
For this assignment, the data are given and we can not do anything to change them. As a result, a couple of try-catch and if statements can not be covered at all. We spent a while on figuring out how to get around this problem but concluded that there is nothing we can do without modifying the given data. Besides, I found myself more unwilling to spend time on Emma when it comes to testing void methods. This is because I don't see how useful it can be with assignments like this one where there are a lot of such methods. We can cover a large portion of the code by simply running the main method which is virtually doing no constructive testing at all.
SVN
I enjoyed using SVN in this project a lot. It is very convenient and efficient. However, I do encountered problems with it at the beginning when I updated the code. My group member was implementing the print table method in a very different way as mine. As a result, when I updated the code, I got a warning saying "one or more files are in a conflicted state." I have to go through quite a lot of troubles with merging the changes. Some parts of the codes cannot be merged without going through a lot of revision. In the end, I decided to follow my group member’s way to construct the method so that the conflict can be resolved. Other than that, my experience with SVN was pleasant.
Google project hosting
This is a powerful free service provided by google. I never imagined sharing a project to be so easy. I will absolutely stick to this project hosting service in the future.
Group software development
Working in a group is easier than working alone. Our group couldn't meet in person everyday but meeting online served the purpose well already. We were able to work on the code on our own, ask questions once we get into trouble instead of wasting a lot of time to figure it alone. Besides, working in group makes sure that there's someone to review your work and I learned most from it, especially by comparing my codes with theirs. For example, the way I generated the table was a bit complicated and my group member was able to come up with a simpler one. All in all, this is a nice group working experience. I guess the most important thing is making sure everyone is on the same pace so that we can work on the project together steadily.
14. CM practice
All three tasks are completed successfully. Verify passes but for some reasons, it takes more than 5 minutes to complete this ant task. The links to my project page and discussion groups are as follows:
WebSpier Project
Disucssion Group
SVN Group
Task 1:
I downloaded TortoiseSVN by googling it online. It is a popular software and doesn't take me long to find a suitable package to download. Installation was also straightforward.
Task 2:
The project was downloaded and I followed the instruction on the lecture notes. The instructions are detailed and I didn't encounter any problem.
Task 3:
Again, the lecture notes were the most useful resources for this task. I followed it closely to go through all the steps with creating a new Google Hosting Project. Without the instructions on the lecture notes, I will probably have a hard time figuring how to set up the project. I was confused with how to set up the discussion groups at first as the lecture note is different from the website. But the instruction on the website is easy to follow and I didn't encounter further problems with setting up the discussion groups.
Lesson learned:
This assignment explored me into SVN which is entirely new to me. Checking out new projects and committing changes are surprisingly convenient and fast. It would be very useful in group projects as programmers can share the changes they made easily and be always up-to-date with others' work on the project. It can avoid them from wasting time on working on the same part of codes simultaneously. I am also surprised at how easy it is to set up a Google Project page and that I am enjoying these services completely for free. Google has done a great work in creating this platform for programmers to share their work.
WebSpier Project
Disucssion Group
SVN Group
Task 1:
I downloaded TortoiseSVN by googling it online. It is a popular software and doesn't take me long to find a suitable package to download. Installation was also straightforward.
Task 2:
The project was downloaded and I followed the instruction on the lecture notes. The instructions are detailed and I didn't encounter any problem.
Task 3:
Again, the lecture notes were the most useful resources for this task. I followed it closely to go through all the steps with creating a new Google Hosting Project. Without the instructions on the lecture notes, I will probably have a hard time figuring how to set up the project. I was confused with how to set up the discussion groups at first as the lecture note is different from the website. But the instruction on the website is easy to follow and I didn't encounter further problems with setting up the discussion groups.
Lesson learned:
This assignment explored me into SVN which is entirely new to me. Checking out new projects and committing changes are surprisingly convenient and fast. It would be very useful in group projects as programmers can share the changes they made easily and be always up-to-date with others' work on the project. It can avoid them from wasting time on working on the same part of codes simultaneously. I am also surprised at how easy it is to set up a Google Project page and that I am enjoying these services completely for free. Google has done a great work in creating this platform for programmers to share their work.
Monday, October 1, 2007
12. WebSpider review
Reviewed Package Author: JianFei Liao
1. Installation Review:
I downloaded JianFei's code and extracted it with ease. The installation also went well.
Test results:
JUnit: the test runs with 2 failures. The failures are found in testFindTotalLinks and testFIndMostPopular.
Checkstyle: the test runs successfully with no errors.
PMD: the test runs successfully with no errors.
FindBugs: the test runs successfully with no errors.
Jar File Construction and execution: a jar file was built successfully. However, it was named named webspider.jar instead of webspider-jianfei.jar.
I was able to invoke "java -jar webspider.jar -totallinks http://www.hackystat.org 100" and it returns 3257.
2. Code format and conventions review
File | Lines | Violation | Comments |
WebSpiderExample.java | 117,118, 254, * | EJS-7 | Unnessary blank lines within a method |
TestWebSpiderExample.java | 16,49,100 | EJS-7 | Unnessary blank lines within a method |
TestWebSpiderExample.java | 19,20,21,* | EFS-39 | Document all private members |
3. Test case review
Black box perspective:
All methods and classes in WebSpiderExample were tested in
TestWebSpiderExample.java. However, two of the tests failed as indicated by JUnit.
For the class WebItem, only increaseCounter() is tested while getCounter() and getLink() are only indirectly tested by calling the main method.
No tests for boundary cases are included. It should consider checking the following cases:
- crawling through 0 page
- crawling through -1 page
- crawling through 9999999999999 pages
- entering an invalid URL such as http://hackystat
- entering no URL
- crawling through a page with no links
The best test to do with this program is to create a test site so that we can compare the results.
White box perspective:
Running Emma produces the following coverage summary:
class: 100% (2/2)
method: 100% (9/9)
block: 79% (476/602)
line: 85% (99/116)
This indicates that some blocks and lines are not covered. This can be improved by adding the following test which crawl through more pages:
String[] testArgs7 = { totallinks, testStartUrl, "10", logging };
WebSpiderExample.main(testArgs7);
By employing this, block and line coverages are improved to 81% and 90% respectively.
Break da buggah:
I tried to invoke "java -jar webspider.jar -totallinks http://httpunit.org 9999999999999" but it returns the warning: "Argument for number of pages to crawl is not an integer." It also returns the invalid result "The total number of links discovered while crawling the first 0 pages accessible from http://httpunit.org is: 0".
4. Summary and lessons learned
Overall, this is a well-written program with throughout exception handling. Even though it is hard to determine if the program is returning the correct number of links, I tested it against Randy Cox's test site and it passed the test by returning the correct results. So it does a good job on that.
Exceptions were handled well. I have tried to break the code with a lot of test cases like entering negative or decimal argument for pages to crawl, invalid URL, employ URL, URL with no links etc. The program manages to catch all the exception. However, no appropriate error messages are displayed. This is something that can be improved. I also tried to run the program with my friends' myspace and xanga account, google.com and a few other websites. I was actually surprised that it doesn't crash at all which indicate that he did a good job with exception handling. On the whole, this is a well-done program.
From this exercise, I have learned that testing is important. When I did my assignment, I had no intention of implementing black box and white box perspective in my tests. After implementing them on reviewing other's code, I realize that this would make sure I was not testing randomly and to ensure maximum coverage of my tests.
I also gained more experience with working with JUnit, PMD, Emma and Checkstyle. Even though I am still puzzled at times by how to ensure maximum coverage of Emma, I am at least more familiar with the other QA tools now.
Further more, by comparing JianFei's code with mine. I realize that my code could be improved by removing some redundant codes. He employed a similar algorithm as mine but his was more organized and concise. This is what I have to work on with my code.
Subscribe to:
Posts (Atom)