The Three Prime Directives are:
1. The system accomplishes a useful task.
2. An external user can successfully install and use the system.
3. An external developer can successfully understand and enhance the system.
1. Interactive Development Environments (Eclipse, VisualStudio, etc.)
PD1: This prime directive is fulfilled as it allows developers to develop a system more efficiently by providing syntax check, debugging etc which saves time and allow the developers to focus on implementing the system instead of handling minor repetitive errors.
PD2: This is generally fulfilled as external users (developers in this case) are able to download them from their site or purchase them and then set up the IDE accordingly.
PD3: This is generally fulfilled, provided the IDE concerned is open source where the source code of the IDE is available for download. Otherwise, developers generally cannot make much change to the copy-righted IDE and enhance it.
2. Coding Standards and Coding Standards Compliance Tools (Checkstyle, etc.)
PD1: These tools fulfill the first Prime Directive by making the codes follow a conventional format and make it easier for developers to understand the code.
PD2: This Prime Directive does not apply to the users as users generally do not need to know the coding standards and the Compliance tools in order to use the system.
PD3: This Prime Directive can be fulfilled for the Coding Standards Compliance tools by having the source code available so that developer can enhance the system. Very often, developer guides are also available to aid developers with understanding the system.
3. Build Systems (Ant, Make, etc.)
PD1: This Prime Directive is fulfilled as these build systems make it easier for developers and users to build the system by automating the tasks required.
PD2: This Prime Directive is also fulfilled as users can download these systems and utilize them to facilitate the build process of other applications.
PD3: This Prime Directive is also fulfilled as developers can enhance the systems according to their own needs for specific projects.
4. Automated Quality Assurance Tools (PMD and FindBugs, etc.)
PD1: These tools fulfilled the first Prime Directive by making sure that the code is bug free by avoiding some coding practices that are likely to cause bug later on.
PD2: The second Prime Directive is also fulfilled as users can use these systems and run them over other systems to make sure they are bug-free.
PD3: Similar to the case of build systems, his Prime Directive is also fulfilled. Developers can enhance the systems accordingly to fit their own needs for their code.
5. Black and White Box Testing
PD1: This prime directive is fulfilled as they help developers find out the bugs, for example run-time errors which are not catch by QA tools, in the program.
PD2: This prime directive does not directly apply as users generally are not concerned with the testing of the program that they are using. However, if the system is thoroughly tested it would generally facilitate the user with installing and using the system.
PD3: This prime directive is fulfilled as developers can enhance the testing to fully cover their code to ensure they are working properly.
6. Automated Testing Tools (JUnit, HttpUnit, etc.)
PD1: This is fulfilled as they are useful tools that automated and simplified the process of testing the codes and thus make sure the codes are working up to expectation by finding out the bugs.
PD2: This Prime Directive is also indirectly fulfilled as users can have an easier time installing and using the system if the system has been tested thoroughly with these testing tools.
PD3: This Prime Directive is fulfilled as developers can utilize them to test other systems by enhancing them accordingly.
7. Configuration Management (CVS, SVN, etc.)
PD1: They fulfilled the first Prime Directive by providing a repository that allows developers to work on the same code at the same pace while solving the problem of simultaneous update.
PD2 & PD3: Both Prime Directives are fulfilled as developers can use the configuration management to work on a project together and thus enhance the system.
8. Issue Driven Project Management
PD1: It fulfills the first Prime Directive as it facilitates the software development process by breaking down a project into smaller parts. This allows programmers to have a better idea of what works are left to done and also helps divide the work among the team.
PD2: It does not apply to the second Prime Directive as users are not involved in the software development process.
PD3: It fulfills the third Prime Directive as it allows developers to better divide the work and keep track of where they are in the software development process, thus enhancing the system produced.
9. Use Cases
PD1: This prime directive is fulfilled as use cases allow developers to better understand how their systems will be used and thus have a clearer direction in designing their systems.
PD2: This prime directive does not apply as use cases are users are not concerned with the use cases scenario of the system they are using.
PD3: This prime directive is fulfilled as developers can come up with use cases according to the system concerned.
10. Software Review
PD1: This prime directive is fulfilled as they allow developers have to their systems reviewed by someone else. With such reviews, they can obtain constructive feedbacks in different areas such as installation procedures, code formatting,
PD2: This prime directive does not apply as software review should be done before the software is released for users to download and use.
PD3: This prime directive is fulfilled as it allows developers to get a better idea of how their programs are doing and enhance it accordingly.
11. Agile Methods (XP, Scrum, etc.)
PD1: This prime directive is fulfilled as Agile Methods allows programmers to work together in team more effectively.
PD2: This prime directive does not apply as Agile Methods are practice of software programming.
PD3: This is fulfilled as developers can enhance the system by practicing these methods to produce higher quality code.
12. Open Source Licenses (GPL, CPL, etc.)
PD1: These fulfilled the first Prime Directive by allowing developers to share their products with everyone freely.
PD2: This prime directive is fulfilled as they allow users to freely download and use programs distributed under them.
PD3: Similarly, this prime directive is fulfilled as they allow developers to freely contribute to the codes and make changes to the system.
13. Online Hosting Services (Google Project Hosting, SourceForge, etc.)
PD1: This prime directive is fulfilled as these online hosting services provide an easy mean for developers to post and share their projects as well as to searcher for other projects. This facilitates the process of posting and sharing projects with each others.
PD2: This prime directive is fulfilled as users can download programs from these hosting services.
PD3: This prime directive is fulfilled as they provide a place for developers to share and search for projects.
Monday, December 10, 2007
Sunday, December 9, 2007
MyIsern-Onyx-2.0 Review
Team reviewed: Onyx
Our team decided to break up the review into four parts and I was given the task to review their web application.
Installation:
Their distribution package is easily found on their hosting site. Downloading and extracting the file was easy and smooth. Installation went well as they have detail instructions on their wiki page and also in the readme file that come in the distribution package. After executing ant -f tomcat.build.xml, I was ready to navigate their site.
Web Design:
They done a good job with the login page. The login page is simple and very informative. Even before logging in, the user can get a comprehensive view of what the page does as a detail description is listed there.
They choose a very nice template which looks professional. The black background stands out nicely. However, as Professor Johnson mentioned during the presentation, the black background and the grey texts in the main body might be hard to see when projected on a projector. Although no
The color scheme was also very good. The white title is catchy against the black background. If the color of the sidebar, which is currently green, can match with that of the main title bar, everything should look even more organized.
Screen Real Estate:
On the whole, team Onyx did a good job in term of screen real estate. The space allocated for the main body text is wide enough. However, when the window is reduced to less than 1/2 of the monitor space, the side bars cannot be show and some of the main body text is also not visible. I have to scroll across the page in order to see all the text.
Quite often, I have to scroll down the page to see some content and I think that can be improved by several ways:
1. Make the title smaller. It is catchy now but it takes up quite a lot of space.
2. Put the Logout Sign on the same level as the title or on the main navigation bar. Right now, it is occupying a separate row at the top.
3. They are too much white space inside the sidebars. Minimizing those white space might be a good idea.
Overall:
I tried their webpage on both Internet Explorer and Firefox and both worked well. Therefore, their website is user friendly regardless of the browser the user is using. Overall, this is a very well designed webpage and as a user, I had an easy time navigating it.
Our team decided to break up the review into four parts and I was given the task to review their web application.
Installation:
Their distribution package is easily found on their hosting site. Downloading and extracting the file was easy and smooth. Installation went well as they have detail instructions on their wiki page and also in the readme file that come in the distribution package. After executing ant -f tomcat.build.xml, I was ready to navigate their site.
Web Design:
They done a good job with the login page. The login page is simple and very informative. Even before logging in, the user can get a comprehensive view of what the page does as a detail description is listed there.
They choose a very nice template which looks professional. The black background stands out nicely. However, as Professor Johnson mentioned during the presentation, the black background and the grey texts in the main body might be hard to see when projected on a projector. Although no
The color scheme was also very good. The white title is catchy against the black background. If the color of the sidebar, which is currently green, can match with that of the main title bar, everything should look even more organized.
Screen Real Estate:
On the whole, team Onyx did a good job in term of screen real estate. The space allocated for the main body text is wide enough. However, when the window is reduced to less than 1/2 of the monitor space, the side bars cannot be show and some of the main body text is also not visible. I have to scroll across the page in order to see all the text.
Quite often, I have to scroll down the page to see some content and I think that can be improved by several ways:
1. Make the title smaller. It is catchy now but it takes up quite a lot of space.
2. Put the Logout Sign on the same level as the title or on the main navigation bar. Right now, it is occupying a separate row at the top.
3. They are too much white space inside the sidebars. Minimizing those white space might be a good idea.
Overall:
I tried their webpage on both Internet Explorer and Firefox and both worked well. Therefore, their website is user friendly regardless of the browser the user is using. Overall, this is a very well designed webpage and as a user, I had an easy time navigating it.
Friday, November 16, 2007
29.MyIsern-1.3-review
Author reviewed: Team Brown
1. Installation Review:
It was very easy to find and download their project as Randy has posted an entry for myIsern-1.3 and the link for download is easily accessible there.
Installation was easy. They have an installation guide and the link to it is also incldued in the blog. By following the instructions there, installation went well. All QA tests passed except for junit.
2. Code format and conventions review:
They did a great job with code format. I couldn't spot any violation only a few minor ones find in the MyIsernActionBean.java which has uncommented prviate members and an irrevalant comment on line 51 from conflicted file during update. There are also some prviate members that are not commented in other files but other than these, everything is good.
3. Test Case Review:
Black box perspective:
Most of the Action Beans are tested throughly, but the model still needs more testings. In particalar, DataIntegrityReportBean is not being tested at all.
White box perspective:
Emma Coverage summary
class: 88% (15/17)
method: 83% (133/161)
block: 70% (1728/2473)
line: 72% (373.8/522)
The coverage is pretty good as almost all classes are tested.
Break da buggah:
The program crush when pressing the save button for the collabotation item. An error always occur there even if no data is changed for that item. Also, by declaring a new organization entry, the xml file would be corrupted. Only the first 4 entries remain while all the rest, including with the new entry created would be erased from the file.
4. User Interface Review:
The user interface was simple and concise. In turns of real estate, they have done a great job! It functions well even when the screen is reduced to a small size. However, it was purely text-based and using more graphic should make it more attractive and professional-looking.
5. Summary and Lessons Learned:
They have achieved a lot with only a week! After reviewing their code, I learned how to implement the login page using Security filter which our group was previously stuck in. Also, the installation guide was a great help to users and our group should include one too.
Monday, November 5, 2007
26.StackStripesExtension
The source code can be found here.
This is a fairly straight forward assignment. All tasks are accomplished and the Emma coverage is 100%.
The main problem I faced was Emma. I keep getting the same error that coverage.ec is missing and thanks to the discussion group, I found the solution to the problem by modifying the emma.build.xml. Other than this, there were only some minor problems.
This is the first time I use Tomcat and Stripes. So far, I feel comfortable with both of them as they are both easy to learn and use. However, the way that emma keeps forcing Tomcat down is very inconvenient and at the beginning, I always forget to start up tomcat again before I run StackStripes or other build.xml files. But soon it becomes a habit and everything was fine.
This is a fairly straight forward assignment. All tasks are accomplished and the Emma coverage is 100%.
The main problem I faced was Emma. I keep getting the same error that coverage.ec is missing and thanks to the discussion group, I found the solution to the problem by modifying the emma.build.xml. Other than this, there were only some minor problems.
This is the first time I use Tomcat and Stripes. So far, I feel comfortable with both of them as they are both easy to learn and use. However, the way that emma keeps forcing Tomcat down is very inconvenient and at the beginning, I always forget to start up tomcat again before I run StackStripes or other build.xml files. But soon it becomes a habit and everything was fine.
25.WebAppQuestions
1.Explain in your own words the meaning of the web "request-response cycle".
The "request-response cycle" refers to a cycle of data-retrieval between a server and a client. The client, usually a user, would send out a request to the server. The server would then try to match the request to produce a response, usually a webpage. The client might send out another request after retrieving the information from the response and the cycle goes on.
2.Explain how servlets facilitate processing of the request-response cycle.
Servlets facilitates the process by allowing user to send in request and then produce dynamic response displayed on a webpage.
3.How do you login to the Tomcat Manager?
Make sure Tomcat is running by invoking "catalina run". Go to http://localhost:8080 and the tomcat page should show up. Click onto the link "Tomcat Manager" and log in with the pre-set username and password.
4.What is the Tomcat Manager used for in the StackStripes application?
It is used for deploying StackStripes.
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 directory is named StackStripes in the Tomcat's webapps folder. There are the 2 .jsp files and two subdirectory named META-INF and WEB-INF. META-INF contains meta data whereas WEB-INF contains java classes.
6.How do you build a war directory structure in Ant? Where is this accomplished in the StackStripes application?
A war directory structure can be created by defining a task that specify the target war file to build, the web.xml and the destination of that war file.
In StackStripes, this is accomplished in the build.xml.
7.How do you install a war directory in a running Tomcat server? What information does the Ant task need to accomplish this?
If Tomcat is running, we can just copy and paste the .war file into the Tomcat's webapps folder. To do so with an Ant task, create a task as described in the previous question.
8.What is the "Model2" architecture? What are its advantages?
Model2 uses the Model-View-Controller design pattern which separate data (model) and user interface (view) concerns by a controller. The advantage is that changes made to the user interface will not affect data handling and vice versa.
9.What are JSP pages? How are they related to servlets?
They are pages that contain java script which provides dynamic response to a web client request. They are compiled into a servlets by a JSP compiler.
10.Why is there a delay when retrieving a JSP page for the first time? Where is the Java code for that page stored?
This is because a JSP page has to be compiled into a servlet. Once it is compiled, it is stored into the servlet and allows quick retrieval of the page. The Java code is stored inside the page.
11.What are JSTL tags? Why are they useful? What is an example JSTL tag from the StackStripes system?
JSTL tags provide most functionality needed in a JSP page. They are useful because they are in XML format and so are convenient to use.
An example is found in index.jsp:
< c:forEach var="element" items="${actionBean.stackIterator}">
12.What are Stripes tags? Why are they useful? What is an example Stripes tag from the StackStripes system?
They are tags that start with "strips:" and they are very useful becuase they link up the Java classes and the JSP pages.
An example is found in index.jsp:
< stripes:submit value="push" name="push"/>
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?
HttpUnit tests the code by simulating browsing a site whereas JUnit can only tests Java code and cannot simulate browser behavior.
An example is found in TestStackActionBean.java:
WebRequest pushRequest = pushForm.getRequest();
pushRequest.setParameter("numToPush", "1");
response = conversation.getResponse(pushRequest);
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?
A method to implement doubling a stack is added and index.jsp is modified to define the button
that execute the method. From this, I learned that the controller need not be modified.
15.What are the equivalence classes that need to be tested for the Double It button?
The equivalence classes includes doubling an empty stack, doubling a normal stack and doubling a stack with a lot of items.
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:
After:
17.What is the singleton design pattern? What is an example of its use in StackStripes? Why is it needed?
It is a design pattern used to restrict instantiation of a class to only one object.
An example is found in StackModel.java:
private static StackModel theInstance = new StackModel();
This is needed to ensure the user is only dealing with the same stack all the time.
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?
TestStackActionBean.java tests on the server side by using HttpUnit and JUnit while TestStackModel.java tests on the client side using JUnit. Emma shuts down Tomcat in order to get the coverage on server side testing.
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.check: Check to see if Tomcat is running
tomcat.undeploy: Undeploy the application from Tomcat if it exists
compile: compile the source code
war: generate the war directory
tomcat.deploy: deploy the application onto Tomcat
junit.tool: runs junit tests over the source code
junit.report: genearte html report on junit tests result
junit: to run junit.tool and junit.report
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?
Tomcat is the only web application frameworks I have worked with so far.
The "request-response cycle" refers to a cycle of data-retrieval between a server and a client. The client, usually a user, would send out a request to the server. The server would then try to match the request to produce a response, usually a webpage. The client might send out another request after retrieving the information from the response and the cycle goes on.
2.Explain how servlets facilitate processing of the request-response cycle.
Servlets facilitates the process by allowing user to send in request and then produce dynamic response displayed on a webpage.
3.How do you login to the Tomcat Manager?
Make sure Tomcat is running by invoking "catalina run". Go to http://localhost:8080 and the tomcat page should show up. Click onto the link "Tomcat Manager" and log in with the pre-set username and password.
4.What is the Tomcat Manager used for in the StackStripes application?
It is used for deploying StackStripes.
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 directory is named StackStripes in the Tomcat's webapps folder. There are the 2 .jsp files and two subdirectory named META-INF and WEB-INF. META-INF contains meta data whereas WEB-INF contains java classes.
6.How do you build a war directory structure in Ant? Where is this accomplished in the StackStripes application?
A war directory structure can be created by defining a task that specify the target war file to build, the web.xml and the destination of that war file.
In StackStripes, this is accomplished in the build.xml.
7.How do you install a war directory in a running Tomcat server? What information does the Ant task need to accomplish this?
If Tomcat is running, we can just copy and paste the .war file into the Tomcat's webapps folder. To do so with an Ant task, create a task as described in the previous question.
8.What is the "Model2" architecture? What are its advantages?
Model2 uses the Model-View-Controller design pattern which separate data (model) and user interface (view) concerns by a controller. The advantage is that changes made to the user interface will not affect data handling and vice versa.
9.What are JSP pages? How are they related to servlets?
They are pages that contain java script which provides dynamic response to a web client request. They are compiled into a servlets by a JSP compiler.
10.Why is there a delay when retrieving a JSP page for the first time? Where is the Java code for that page stored?
This is because a JSP page has to be compiled into a servlet. Once it is compiled, it is stored into the servlet and allows quick retrieval of the page. The Java code is stored inside the page.
11.What are JSTL tags? Why are they useful? What is an example JSTL tag from the StackStripes system?
JSTL tags provide most functionality needed in a JSP page. They are useful because they are in XML format and so are convenient to use.
An example is found in index.jsp:
< c:forEach var="element" items="${actionBean.stackIterator}">
12.What are Stripes tags? Why are they useful? What is an example Stripes tag from the StackStripes system?
They are tags that start with "strips:" and they are very useful becuase they link up the Java classes and the JSP pages.
An example is found in index.jsp:
< stripes:submit value="push" name="push"/>
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?
HttpUnit tests the code by simulating browsing a site whereas JUnit can only tests Java code and cannot simulate browser behavior.
An example is found in TestStackActionBean.java:
WebRequest pushRequest = pushForm.getRequest();
pushRequest.setParameter("numToPush", "1");
response = conversation.getResponse(pushRequest);
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?
A method to implement doubling a stack is added and index.jsp is modified to define the button
that execute the method. From this, I learned that the controller need not be modified.
15.What are the equivalence classes that need to be tested for the Double It button?
The equivalence classes includes doubling an empty stack, doubling a normal stack and doubling a stack with a lot of items.
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:
After:
17.What is the singleton design pattern? What is an example of its use in StackStripes? Why is it needed?
It is a design pattern used to restrict instantiation of a class to only one object.
An example is found in StackModel.java:
private static StackModel theInstance = new StackModel();
This is needed to ensure the user is only dealing with the same stack all the time.
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?
TestStackActionBean.java tests on the server side by using HttpUnit and JUnit while TestStackModel.java tests on the client side using JUnit. Emma shuts down Tomcat in order to get the coverage on server side testing.
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.check: Check to see if Tomcat is running
tomcat.undeploy: Undeploy the application from Tomcat if it exists
compile: compile the source code
war: generate the war directory
tomcat.deploy: deploy the application onto Tomcat
junit.tool: runs junit tests over the source code
junit.report: genearte html report on junit tests result
junit: to run junit.tool and junit.report
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?
Tomcat is the only web application frameworks I have worked with so far.
Monday, October 22, 2007
21.MyISERN-1.2
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.
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.
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.
Tuesday, September 25, 2007
WebSpider Improvement
Thanks to the time extension, I have time to review my code again. It looked fine to me when I completed it as I was probably too excited that I can finally go to bed in the end. When I look at my code again, I find that some of the methods are too long that it is complicated to read. Therefore, I improved my codes by creating other methods and declared some variables as global. I also added more comments. This way, it is easier to see how my program works. Other than that, formatting errors such as use of tabs are also corrected. Please find my refined code here.
I have tried to work on the extra credit portion, but after playing around with the codes, throwing more exceptions and doing some research on the web. I still have no idea how to make it work and so I decided to drop it.
This is the most challenging assignment by far. It took me a lot of time and efforts but I am glad that I have learned quite a lot from it.
I have tried to work on the extra credit portion, but after playing around with the codes, throwing more exceptions and doing some research on the web. I still have no idea how to make it work and so I decided to drop it.
This is the most challenging assignment by far. It took me a lot of time and efforts but I am glad that I have learned quite a lot from it.
Monday, September 24, 2007
11. WebSpider
All tasks are completed while the extra credit section is not attempted. My code can be found here.
This turns out to be a more difficult task than I thought. First of all, there was the problem with JUnit. I didn't realize that the build.xml is incomplete and I wasted a lot of time on trying out different solution. It took me a long while until I finally find out what is wrong. This was frustrating but it gave me the opportunity to learn JUnit and Ant better.
Secondly, there is the httpunit. I was confused with all the different classes and functions like WebRequest and WebResponse. I always end up using the wrong one or having to do a lot of conversion between different types before I can get what I wanted. Moreover, the program always run into different kind of errors when trying to opening the URLs. I have to solve these problems by throwing a lot of exceptions.
Thirdly, there were no sample output and I didn’t know if the result I got is correct. This prohibited me from improving and correcting the program as I couldn’t tell how is my program doing. If I have more time, I would have build up a sample test page so that I can test my program on it.
Fourthly, I have nevery used logging in Java but it was okay as I found some useful examples on the web.
All in all, this is a challenging assignment. Through this assignment, I have explored Emma, JUnit, Ant, HttpUnit and Eclipse in greater detail. I wish I have started on this assignment earlier on so that I would have time to attempt the extra credit portion.
This turns out to be a more difficult task than I thought. First of all, there was the problem with JUnit. I didn't realize that the build.xml is incomplete and I wasted a lot of time on trying out different solution. It took me a long while until I finally find out what is wrong. This was frustrating but it gave me the opportunity to learn JUnit and Ant better.
Secondly, there is the httpunit. I was confused with all the different classes and functions like WebRequest and WebResponse. I always end up using the wrong one or having to do a lot of conversion between different types before I can get what I wanted. Moreover, the program always run into different kind of errors when trying to opening the URLs. I have to solve these problems by throwing a lot of exceptions.
Thirdly, there were no sample output and I didn’t know if the result I got is correct. This prohibited me from improving and correcting the program as I couldn’t tell how is my program doing. If I have more time, I would have build up a sample test page so that I can test my program on it.
Fourthly, I have nevery used logging in Java but it was okay as I found some useful examples on the web.
All in all, this is a challenging assignment. Through this assignment, I have explored Emma, JUnit, Ant, HttpUnit and Eclipse in greater detail. I wish I have started on this assignment earlier on so that I would have time to attempt the extra credit portion.
Monday, September 17, 2007
Stack and QA tools
Code: click to download
All five tasks were completed successfully.
Problems:
I went into several problems in completing this assignment and the following two are the major ones.
1. Eclipse
Somehow, Eclipse fails to recognize my class files and keeps giving me errors saying that the classes Stack and ClearStack are undefined. It gives me the errors now and then even when I haven't made any changes to the code. After some frustrating moments of trying out different possible solutions, nothing worked until I tried renaming the package, thanks to the advice of Mike and Chaofien. It worked, no changes were made to the code and Eclipse can recognize the Stack classes again. However, minutes later, the same thing happens and again, the problem is solved by renaming the package. In the end, I end up renaming the packages whenever the problem came up. It was an unsophisticated solution but that was the only way I could solve the problem. Does anyone have a similar problem with Eclipse? I wonder if Eclipse is having a problem with compiling the project?
2. JavaNCSS.Xml
I have never worked with XML before and so completing the task was like learning a new language to me. I was lost in the beginning but by reviewing the other build.xml files, I was able to pick up on the format and syntax. Also, thanks to the discussions on Google group, some of the problems I went into were also solved.
Ant and other QA tools:
This is the first time I use Ant and I found it very handy. At first, it was very confusing as I was not familiar with the QA tools yet. So I just blindly followed the instructions on the assignment page and typed in the command lines without knowing exactly what each one is doing. It was only until I worked on task 2 and 3 that I learned more about PMD and Findbugs. PMD and Findbugs are both very useful debugging tools. They give a concise report on what and where the error is and provides suggestions to correct the problems. They are absolutely useful for debugging programs, especially for large projects where it would be time consuming and tedious to find out those minor errors.
On the whole, I like Ant. It was a surprisingly useful and powerful build tool. It was also flexible in the way that it can incorporate so many different QA tools. Moreover, this would be especially useful in large projects where there would be so many classes and methods that we would be easy to lost track of.
SCLC vs JavaNCSS:
SCLC gives a count of comment, non-comment, blank and total lines on a variety of languages whereas JavaNCSS also give information about the size of a project but is only limited to Java. Since this class would be mainly dealing with Java, I would prefer JavaNCSS over SCLC as it could give more specific information such as a count on JavaDoc.
This is by far the most demanding assignment I had so far. For we have to install and learn to use several QA tools and to write up a xml file for the first time. There were a lot to learn. However, this is also the most useful assignment as it familiarizes me with these essential debugging tools. I agree it would be better to learn them all in one time rather than one by one. This way, we can get start using them on our future assignments right on and polish our skills.
All five tasks were completed successfully.
Problems:
I went into several problems in completing this assignment and the following two are the major ones.
1. Eclipse
Somehow, Eclipse fails to recognize my class files and keeps giving me errors saying that the classes Stack and ClearStack are undefined. It gives me the errors now and then even when I haven't made any changes to the code. After some frustrating moments of trying out different possible solutions, nothing worked until I tried renaming the package, thanks to the advice of Mike and Chaofien. It worked, no changes were made to the code and Eclipse can recognize the Stack classes again. However, minutes later, the same thing happens and again, the problem is solved by renaming the package. In the end, I end up renaming the packages whenever the problem came up. It was an unsophisticated solution but that was the only way I could solve the problem. Does anyone have a similar problem with Eclipse? I wonder if Eclipse is having a problem with compiling the project?
2. JavaNCSS.Xml
I have never worked with XML before and so completing the task was like learning a new language to me. I was lost in the beginning but by reviewing the other build.xml files, I was able to pick up on the format and syntax. Also, thanks to the discussions on Google group, some of the problems I went into were also solved.
Ant and other QA tools:
This is the first time I use Ant and I found it very handy. At first, it was very confusing as I was not familiar with the QA tools yet. So I just blindly followed the instructions on the assignment page and typed in the command lines without knowing exactly what each one is doing. It was only until I worked on task 2 and 3 that I learned more about PMD and Findbugs. PMD and Findbugs are both very useful debugging tools. They give a concise report on what and where the error is and provides suggestions to correct the problems. They are absolutely useful for debugging programs, especially for large projects where it would be time consuming and tedious to find out those minor errors.
On the whole, I like Ant. It was a surprisingly useful and powerful build tool. It was also flexible in the way that it can incorporate so many different QA tools. Moreover, this would be especially useful in large projects where there would be so many classes and methods that we would be easy to lost track of.
SCLC vs JavaNCSS:
SCLC gives a count of comment, non-comment, blank and total lines on a variety of languages whereas JavaNCSS also give information about the size of a project but is only limited to Java. Since this class would be mainly dealing with Java, I would prefer JavaNCSS over SCLC as it could give more specific information such as a count on JavaDoc.
This is by far the most demanding assignment I had so far. For we have to install and learn to use several QA tools and to write up a xml file for the first time. There were a lot to learn. However, this is also the most useful assignment as it familiarizes me with these essential debugging tools. I agree it would be better to learn them all in one time rather than one by one. This way, we can get start using them on our future assignments right on and polish our skills.
Wednesday, September 5, 2007
CodeRuler Redux
After reading through my classmates’ codes, I found a few interesting and useful strategies and tried them on my codes. But I don’t see any significant improvement on the results, so I switched back to focusing on improving the strategies on Marcius and mine original code instead.
The major changes are firstly, instead of having two groups that attack the castle and knights separately. I added a third, smaller group that attacks only the peasants. That is because killing a peasant is way easier than killing a knight. To win code-ruler, we don’t necessary have to capture all castles but to acquire the highest score. Since killing a peasant is easier with a score similar to that of killing a knight, it is rewarding to put in some labors into hunting after the peasants.
Also, my peasants are quite good at claiming lands and I see that I don’t need too many of them. Therefore, after a specific number of peasants, the castles would just concentrate on producing knights to attack others. Besides, this would be good for scoring point as each knight counts twice the point as the peasants at the end of the game.
Lastly, thanks to the review of Jianfei and Jeffrey, I have found and corrected all the java standard violations in the code. I also kept in mind to follow the java standard when inserting and modifying code, hopefully, this program will not contain any violations.
The revised source code can be found here.
Knowing that there is the “Big Match” in class tomorrow, I tested my code against 4 instead of just 1 sample ruler to see how it did. I did 4 test runs and it wins three of the matches. I hope that was not just a coincidence and that it will continue to do well in the match tomorrow.
The major changes are firstly, instead of having two groups that attack the castle and knights separately. I added a third, smaller group that attacks only the peasants. That is because killing a peasant is way easier than killing a knight. To win code-ruler, we don’t necessary have to capture all castles but to acquire the highest score. Since killing a peasant is easier with a score similar to that of killing a knight, it is rewarding to put in some labors into hunting after the peasants.
Also, my peasants are quite good at claiming lands and I see that I don’t need too many of them. Therefore, after a specific number of peasants, the castles would just concentrate on producing knights to attack others. Besides, this would be good for scoring point as each knight counts twice the point as the peasants at the end of the game.
Lastly, thanks to the review of Jianfei and Jeffrey, I have found and corrected all the java standard violations in the code. I also kept in mind to follow the java standard when inserting and modifying code, hopefully, this program will not contain any violations.
The revised source code can be found here.
Knowing that there is the “Big Match” in class tomorrow, I tested my code against 4 instead of just 1 sample ruler to see how it did. I did 4 test runs and it wins three of the matches. I hope that was not just a coincidence and that it will continue to do well in the match tomorrow.
Friday, August 31, 2007
CodeRulerReview
I was assigned to review Sonwright Gomex’s code. The code is well-organized and do not contain a lot of violations against the Java standard. It was commented well and was easy for me to follow along. I liked his strategy and he did a good job with the knights. All in all, this is a nicely written code and I had a good time reviewing it.
File | Lines | Violation | Comments |
MyRuler.java | 10,11,185,* | EJS-6 | Comment line has more than 100 characters |
MyRuler.java | 12,17,25,* | ICS-SE-Java-6 | Comments hsould always end with a period |
MyRuler.java | 16,17,18,* | ICS-SE-Eclipse-2 | Code should be indented 2 spaces instead of 4 |
MyRuler.java | 16,172 | EJS-5 | The "else-if" should start on a new line |
MyRuler.java | 193,201,210,* | EJS-76 | The "if" or "else" should always has curly braces |
Wednesday, August 29, 2007
Code Ruler Experience
Group members: Marcius Bagwan, Ka Yee Leung
Source code: http://www2.hawaii.edu/~kyleung/kyleung-marcius.zip
Results:
kyleung-marcius vs split-up: 631:201 480:327 792:224
kyleung-marcius vs migrate: 880:0 774:7 823:0
kyleung-marcius vs gang-up: 70:521 596:340 713: 178
Strategy:
Castle – It would alternate between generating a knight and a peasant. When the number of knights runs low, it will generate knights continuously.
Knights – They are split into two groups. One group is specialized in attacking the knights while another is specialized in taking over castles. Once all castles has been taken over, both groups would attack knights together. If all enemy knights are gone, they would then aim at the peasants.
Peasants – They would only move to land that are unclaimed or claimed by the enemies unless no such land are available.
Lesson learned:
Eclipse: I get much more familiar with Eclipse after working on this project. I am more similar with the debugging and how to utilize the different functions provided. I can’t imagine switching back to emacs to type up my program again where I could end up getting twenty error messages just because of a missing semi-colon.
CodeRuler: This is the best programming assignment I have ever done. It was a lot of fun and was very effective in giving us a chance to practice with our java skill. It makes me realize how much Java can do and also, how much java I don’t know. CodeRuler is really a great and fun Java learning project.
Working with another person: I am so grateful to have such a great partner, Marcius for this project. He is patient and helped me a lot. From him, I learned how to cooperate with others so that the whole group can work together and learn together.
Source code: http://www2.hawaii.edu/~kyleung/kyleung-marcius.zip
Results:
kyleung-marcius vs split-up: 631:201 480:327 792:224
kyleung-marcius vs migrate: 880:0 774:7 823:0
kyleung-marcius vs gang-up: 70:521 596:340 713: 178
Strategy:
Castle – It would alternate between generating a knight and a peasant. When the number of knights runs low, it will generate knights continuously.
Knights – They are split into two groups. One group is specialized in attacking the knights while another is specialized in taking over castles. Once all castles has been taken over, both groups would attack knights together. If all enemy knights are gone, they would then aim at the peasants.
Peasants – They would only move to land that are unclaimed or claimed by the enemies unless no such land are available.
Lesson learned:
Eclipse: I get much more familiar with Eclipse after working on this project. I am more similar with the debugging and how to utilize the different functions provided. I can’t imagine switching back to emacs to type up my program again where I could end up getting twenty error messages just because of a missing semi-colon.
CodeRuler: This is the best programming assignment I have ever done. It was a lot of fun and was very effective in giving us a chance to practice with our java skill. It makes me realize how much Java can do and also, how much java I don’t know. CodeRuler is really a great and fun Java learning project.
Working with another person: I am so grateful to have such a great partner, Marcius for this project. He is patient and helped me a lot. From him, I learned how to cooperate with others so that the whole group can work together and learn together.
Sunday, August 26, 2007
02.OSS.Experience
The software I downloaded is Risk. It is the java version of the classic strategic board game. The goal of the game is to control all the territories by taking over territories from other players. This game employs a simple map format, supports 1 to multiple players, allows network play and works in all Operating Systems that have java 1.4 or higher.
It fulfills the first Prime Directive by providing every features you can find in a typical Risk board game. Moreover, while you need at least two players to start the board game, this java version allows the user to play against the computer so that anyone can literally play Risk anytime alone. Also, there is the convenient Save and Load function so that users can save their unfinished game and play again at another time. However, it can improve on the Save function as it takes a long time to save a game. Other than that, it has done a great job in fulfilling the first Prime Directive.
The second Prime Directive is satisfied to some extent. For experienced users, the installation would be easy for them as it only requires the usual downloading procedure: download the zip file, unzip it and run the program. However, for new users, they may find themselves at a lack of help as the readme file is not very useful without much information on installation. Upon unzipping the file, new users would likely to be lost in the long list of files to find the executable Jar file. This problem could have been improved by renaming the executable file as “run”.
Finally, for the third Prime Directive, it is also partially satisfied. A zip file of the source codes comes along with the download package so anyone can access and modify them. However, not all files contain detailed documentation which makes it difficult to follow the code. I can imagine it would take me some time to understand and eventually modify the code.
All in all, this game is well-written with a user-friendly interface. I enjoyed the game! I trust anyone should catch on to the game easily and have fun with it! Below are some screenshots from Risk:
It fulfills the first Prime Directive by providing every features you can find in a typical Risk board game. Moreover, while you need at least two players to start the board game, this java version allows the user to play against the computer so that anyone can literally play Risk anytime alone. Also, there is the convenient Save and Load function so that users can save their unfinished game and play again at another time. However, it can improve on the Save function as it takes a long time to save a game. Other than that, it has done a great job in fulfilling the first Prime Directive.
The second Prime Directive is satisfied to some extent. For experienced users, the installation would be easy for them as it only requires the usual downloading procedure: download the zip file, unzip it and run the program. However, for new users, they may find themselves at a lack of help as the readme file is not very useful without much information on installation. Upon unzipping the file, new users would likely to be lost in the long list of files to find the executable Jar file. This problem could have been improved by renaming the executable file as “run”.
Finally, for the third Prime Directive, it is also partially satisfied. A zip file of the source codes comes along with the download package so anyone can access and modify them. However, not all files contain detailed documentation which makes it difficult to follow the code. I can imagine it would take me some time to understand and eventually modify the code.
All in all, this game is well-written with a user-friendly interface. I enjoyed the game! I trust anyone should catch on to the game easily and have fun with it! Below are some screenshots from Risk:
the map
Roll the dice to determine whether an attack is successful
Tuesday, August 21, 2007
FizzBuzz
It took me 12 minutes to complete this program as I haven't used Eclipse for a long while and it took me some time to pick up on how to create new project and classes.
The biggest problem that I encountered is the Java language itself. I have not programmed in Java for a while too and I am not surprised that I have mixed up Java and C languages' syntax completely. I ended up writing a logically correct but grammatically disastrous program. In this sense, Eclipse is very handy as it points out all the syntax mistakes I made and so I don't have to waste time to read through every line to find the bugs.
From this experience, I learn that I shouldn't take any task lightly. Every program, no matter how unimportant and easy it may seem, should have been taken seriously. This is because in software engineering, every component has to be correct in order to produce a perfect software and a mistake in a small program can lead to serious bug in other programs. Also, I learn that I should familiarize myself with Eclipse and other programming software as it is impossible for a software engineer to take care of every little detail of a program and a good programming software would help a lot in this area.
Subscribe to:
Posts (Atom)