Sunday, December 9, 2007

33.PrimeDirectivesRedux

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

For the first Prime Directive, an IDE helps to develop a system on the code level. It checks the syntax and eliminates repetitive procedures so that a developer can efficiently release a product that accomplishes a useful task. It really serves no purpose for an external user so it does nothing for the second PD but for the third PD, an IDE is great for developers because coding style can remain consistent throughout the code. It also allows an external developer to quickly make sense of the source code and efficiently edit the code because the IDE lets them develop code on an environment customized to their preference.

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

Coding standards satisfy the first and third PD because it helps to keep code easy to read and edit. If everyone was to code in their own way, then external developers would have a difficult time making sense of the code and would waste that much time and the motivation to actually work on the code. Compliance tools help to keep code bug free and to assure that the quality of the code is at release level.

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

Build systems are a great tool for saving time. They basically do the job of compiling all code and keeping version control. They check to make sure that all code that has been edited is recompiled when needed and make it simple to build and pack a project. It is also helpful because different IDEs can work together on the same code. This is a great benefit to all developers old and new so it satisfies all PD. Users will most likely benefit from the fact that either the program comes packaged and ready to go or compiling the program and running it is a one step process.

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

These tools help to keep code bug free and running smoothly. Thus they affect the first PD because those tools make sure that the task being accomplished is actually done right. External developers benefit from these tools as well because they can make sure that the code they edit is at the same level of quality and as bug free as when they started. External installers don't really benefit much other than knowing that the code works. Maybe not completely bug free but most common errors are weeded out.

5. Black and White Box Testing

Black and White Box testing help developers find bugs that might come up in their code. Black box testing try to categorize user inputs and runs tests to see if those inputs will break the system. White box testing shows developers which lines of code are executed during tests. This ensures that certain methods are called when they need to be called. This satisfies the first PD because it ensures that a task is accomplished successfully. This also satisfies the third PD because external developers can also ensure that their code is doing what they think its doing. Installers don't really worry too much but users will want a program to do what it’s supposed to do. So it satisfies all three PD.

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

Automated testing tools make it easy for all developers to create tests. Tests ensure that a program works the way it is intended thus it affects all three PD. It helps to develop a quality program that will accomplish a useful task, then users can install and use a program as it is intended, lastly external developers can enhance the code and run more tests. These test show that the original functions work as well as the new functions.

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

Configuration Management helps groups of developers to work on a program without having to worry about trampling over each other’s code. These programs help to ensure that code written in one file from one developer can be merged with code that was written by another developer at the same time. Thus files can be edited without worrying about it being out of sync with the rest of the files. This helps out all developers but does little for users and installers because they will probably never use these tools.

8. Issue Driven Project Management

Issue Driven Project Management allows all the work that must be done on a program to be divide into “issues” that can be resolved to form a milestone. This helps to keep developers up to date on the difference between versions and the evolution of the program itself.

9. Use Cases

Use Cases are an example of just how the program works to accomplish a task. This sets up the design process so that developers can model the code after this case. It shows the developer how to make the code. The end result is a program that works the way is was intended leaving users satisfied.

10. Software Review

Software review helps developers look through their code and ensures that the code is following the design. It begs developers to ask other developers to look at their code so that both developers can become better developers. They can show each other how things could be implemented better or more efficiently. It also shows a developer that he can make mistakes but learn from them. This is essential for all PD because although developers are the ones carrying out this process, users benefit with a robust program.

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

The agile methods change the way code is being developed. Instead of wasting time looking and waiting for requirement, two or more programming can just get cracking on some code and incrementally build a better system. In the end, the code almost always turns out better, which also leads to happy users.

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

These licenses help to develop and grow the open source community by protecting what they have developed. Each license has it own set of restrictions and while some are very tight, others are very loose and viral. This helps out the whole open source community because they can step on the shoulders of giants and release ever better code. Although the whole situation can be convoluted at times, there is proof that this works. We have to look no further than Linux itself.

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

Online hosting services help out the development community by working along with things like the open source licenses. Online hosting services makes it easy to access source code so that other developers can add to or learn from it. In the end, it helps to generate better code and program

Team Yellow MyIsern 2.0 Review

Installation Review:

Right off the bat, I was able to download the distribution file but I had difficulty opening it. I used window XP's default unzipping tool but that didn't work. Finally after the whole team gave it a try, we found that if you used winRar to open the file, then it would uncompress.

There was also no installation guide so I had to resort to using the developer's guide which was barely helpful. I was able to download XAMPP and Symfony with no problem. I also extracted both with ease. I was also able to setup XAMPP easily using the developer's guide. But when it came to installing symfony, I was confused as to what to do. I didn't know how to install symfony and the webpage provided was also confusing and set for a unix user. The symfony site asks to uncompress the symfony download into the root web directory of the server yet I have no idea what folder that is. The developer's guide basically assumes that you can install this program easily, which I couldn't do.

The main errors that occurred were getting PEAR to work. I tried all the commands provided on the symfony site: pear install symfony/symfony, pear config-show, and pear update-channels. I especially had trouble with pear update-channels because it just wouldn't do it. It found no channels. So I went ahead and tried, pear update pear and that gave me even more errors. I moved on to pear upgrade-all and it told me that there was nothing to update. I went back to beginning and tried all the commands again. pear update-channels finally worked! But then crashed in a horrid blaze of fire.

I tried to install phing after that and much of the same occurred. Entered a command, crash. Enter another command, crash. Go back to step 1 and semi-work then crash horribly. The entire team tried to run this application, at the same time, but we all had the same results. I actually got the furthest because for some strange reason XAMPP actually WORKED for me. Everyone else was stuck there.

Finally after two hours, I got pear install symfony/symfony to work. SUCCESS! Only to find that somehow my ad hoc ways of getting this program to install seriously screwed up my localhost page. Defeated, I wiped the tears off my face and hit the close all tabs button.

I actually googled (has google finally made itself a verb?) the subject earlier in the process only to find out that everyone shared much of the same problems as me. Apparent there really is no support for windows/xampp/php/symfony. Those that could get it to run used many ad hoc methods to change things here and there. There even a webpage that shared my sentiments.

http://trac.symfony-project.com/wiki/WindowsXPDevelopmentEnvironment

This person actually tells you to do something knowing that it will fail. Then he goes around and tells you how to fix it using heuristic methods. In the end, I still failed. I consider this a complete failure because it utterly defies Prime directive 2. There really is no easy way to install Symfony. Especially with the Prime Directive Redux questions to answer, finals to study for, and sleep deprivation. I'm actually angry right now.

I do not blame Team yellow for this. I blame Symfony for making it so hard to use. I'm sure once I spent a lifetime or two looking through the thousands of wikis that describe how to install symfony with this program or with this environment or any combination of the above mentioned items, all of which don't work in my opinioin, I might actually get it to run. Then maybe go on to review it.

I was also not able to contact Team Yellow for their help.

Code format and conventions review

We really don't know php at all so we can't really review the code format or the conventions.

Test case review

We could not get the page to run. At all. Therefore we cannot run the tests.

User Interface review

See above.

Summary and Lessons Learned

I've learned absolutely nothing. This was a waste of my time and very frustrating. I'm still angry. But I hope that I at least made this review a fun and delightful piece of reading. Enjoy, cheers!

Thursday, November 15, 2007

29.MyIsern-1.3-review

1. Installation Review: Myisern team Red

I was able to download the installation file through their google project hosting site but none of them actually had a blog page that easily pointed to it. I can't really say much because my team didn't do the same since it wasn't assigned to us but it would have been helpful. After downloading and unzipping the file I realized that there really isn't any way to start this program without having to use ant to deploy it. But there is always the option of uploading the war file to your tomcat manager. I decided to just run it from ant and then uses the tomcat manager to access the website. There didn't seem to be much a guide either but there was a README file that contained what the site could and could not do. Lastly I did run ant -f verify.build.xml to run all the tests and it looks like all the tests passed. Emma showed:

Class 60%
method 25%
block 29%
line 26%

2. Code format and conventions review:

Right off the bat there were many variables that weren't being read according to Eclipse. Otherwise the code and the javadocs actually seem neat and tidy. There are comments in place of missing code and it is all easy to read. Everything seems to be up to standards and coding is modular which helps readability.

3. Test case review:

So far the only tests that exists where 4 tests that ensure that the three adding pages and the main menu page showed up on the test host. There was also a test for the model that made sure that the instance of the model followed the singleton method. Other than this there were no other tests.

As for breaking the buggah, the page had many links that didn't work, such as all the editing pages as well as a few buttons that didn't do what it said it would do. The print buttons for Organization and collaboration didn't work. In the read me file it did state that the editing functions still weren't developed so I can see why those pages didn't work but I couldn't see why the print button didn't work.

On the other hand, the adding functions did work and I could see it added after brought up the display page. Otherwise I had no idea if I added the item or not.

4. User Interface review:

As for the UI, it was texted based with no graphics. It was a bit hairy to read and a bit confusing but this is still a work in progress. I could see it going a long way with a simple UI using css or even basic html. As for screen real estate, being text based it used screen real estate very well. Sizing the screen to just about any respectable size still still held the interface clearly. Lastly, there are many improvements that can be made here aside from the basic html/css layout design. Everything seems to be aligned to the top left which is great for resizing the screen but horrible at full screen.

5. Summary and Lessons Learned:

The things that I've learned is that looking back on my own program I can see how a simpler approach might actually be better then complicated css/html code thrown everywhere. It might not be the prettiest of all the projects but it does get some of the jobs done with mild discomfort. I also realized how important it is to actually give feedback to the user after they have accomplish a task such as editing or adding a researcher. Without letting them know that the action was completed, it just adds more steps to actually getting through the page.

Sunday, November 4, 2007

26.StackStripesExtension

At first, I thought that this was going to be a horrible assignment that would take me all week to do and that I would have to slave over it for hours. But in actuality it was pretty simple. It took a while to get used to but that could be said for just about any new piece of software. So, of course, I had the basic hiccups when it came to installing tomcat and stripes. Tomcat was a bit harder since we had to edit the conf directory files. But all in all it was pretty easy to get going.

I think the hardest thing was just getting used to using tomcat, making sure that it was running, restarting it after Emma, restarting tomcat every time we made changes and such. The actual code wasn’t very hard at all once you grasped the theory behind it. It just took me a while to grasp that theory. It wasn’t as hard as our previous assignments where I had to trace over all the code but it was a bit challenging. Overall, I’m happy to say that I’ve completed all the tasks with enough time to get some sleep!


here's the link to my program...

http://www2.hawaii.edu/~eykim/stackstripes-1.0.1106.zip

25.WebAppQuestions

1.) Explain in your own words the meaning of the web "request-response cycle".

The request-response cycle is basically the cycle where a user looks at a page, clicks on some object which then tells the browser to send a HTTP request to the server. The server in turn takes the request, works it out and sends back a response. (Wash, Rinse, Repeat.)

2.) Explain how servlets facilitate processing of the request-response cycle.

Servlets are basically java classes that reside on the server. They process the information sent by the user and returns data accordingly. This allows for dynamic web pages.

3.) How do you login to the Tomcat Manager?

First, tomcat must be running. Then go to the localhost manager page on your web browser or through ant. (http://localhost:8080/manager/list). Enter the username and password that was set in the tomcat conf directory.

4.) What is the Tomcat Manager used for in the StackStripes application?

The Tomcat Manager is used to deploy the StackStripes Application on to tomcat. Since tomcat is password protected, we use the manager to log in and deploy or undeploy the application.

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!)

Inside StackStripes is…


Stackstripes\index.jsp //homepage
Stackstripes\META-INF //meta info
Stackstripes\WEB-INF //web info


Stackstripes\WEB-INF\web.xml // xml containing configuration info


Stackstripes\WEB-INF\classes //classes
Stackstripes\WEB-INF\classes\commons-logging.properites //config info
Stackstripes\WEB-INF\classes\log4j.properites //log4j info
Stackstripes\WEB-INF\classes\StripesResources.properites //stripes resources info
Stackstripes\WEB-INF\classes\edu/ // all the things I’ve written

6.) How do you build a war directory structure in Ant? Where is this accomplished in the StackStripes application?

The stack Stripes application builds the war directory through ant in the build.xml file. To build the war directory you need the location of the directory to be created, the web xml file with all the configurations, and all the side info like classes, libraries, and file sets.

The build.xml file should set all these attributes accordingly.

7.) How do you install a war directory in a running Tomcat server? What information does the Ant task need to accomplish this?

Installing a war directory in a running Tomcat server is as simple as just copying the war directory into the webapps folder in Tomcat. The webapps directory is found in the home directory for CATALINA. This can also be accomplished in ant but just setting the destination directory to the webapps folder.

8.) What is the "Model2" architecture? What are its advantages?

The model2 or MVC (model – view – controller) architecture is a architecture pattern that consist of a large amount of data to the user i.e. the model and represents in it a view i.e. interface so that the changes do not affect the data. This is done through an intermediate called the controller. The advantage is it solves the problem of decoupling data access from user interaction.

9.) What are JSP pages? How are they related to servlets?

JSP pages are Java Server Pages and are basically html pages with JavaScript embedded. The JavaScript is compiled into a servlet, and the servlet handles, processes, and return data to the html page where the script is located. This allows for dynamic html pages.

10.) Why is there a delay when retrieving a JSP page for the first time? Where is the Java code for that page stored?

There is a delay when retrieving a JSP page for the first time because the server needs to compile the JSP pages into a servlet. Afterwards the servlet is held within memory on the server for as long as needed. The Java code for that page is stored within the page itself.

11.) What are JSTL tags? Why are they useful? What is an example JSTL tag from the StackStripes system?

JSTL tags are JSP Standard Tag Library tags are simply tags that surround core functionality commonly needed to make dynamic html pages. They are useful because they are in XML standard format and work well in html. This avoids the need to write the java code into the html making the html code easy to read and edit by someone that does not know Java.

Example:

${element}

12.) What are Stripes tags? Why are they useful? What is an example Stripes tag from the StackStripes system?

Stripes tags are basically html tags that allow the linking of button and fields on a webpage to their appropriate java classes. They are useful because they link a button or such to the respective get or set function in java which saves a lot of code.

Example:

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 is a java class that allows a programmer to access web sites without a browser. It is useful for testing any Java code that deals with web pages because it can go beyond JUnit because JUnit will only test java code running on the client.

Example:

WebForm pushForm = response.getFormWithID(PushForm);

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?

All that you needed to do was to create a DoubleIt method for the Action bean and a double it button in the index.jsp file. Nothing else was needed. I actually didn’t learn too much about the MVC design pattern through this other than the button and the method needs to have a relevant link.

15.) What are the equivalence classes that need to be tested for the Double It button?

The equivalence classes would be to test on an empty stack, a stack with one or more object, and a stack with a ridiculously large amount of objects.

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.









17.) What is the singleton design pattern? What is an example of its use in StackStripes? Why is it needed?

The singleton design pattern is a pattern that restricts the instantiation of a class to just one object. This is needed because we want all users to interact with just one instantiation of the stack class. This way all the users will have and work on the same information even through multiple “views” across the internet.

Example:

private static StackModel theInstance = new StackModel();
private ClearStack stack;
private StackModel() {
this.stack = new ClearStack();
}

18.) Some of the StackStripes tests exercise code on the "server side", while others exercise code on the "client" side. Which test classes exercise code on the "server", and which exercise code on the "client"? How does Emma deal with this to create appropriate coverage data?

The file TestStackModel.java exercises test cases on the client side while TestStackActionBean.java exercises test cases on the server side. Emma deals with this to create appropriate coverage data by shutting down Tomcat.

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

This checks to see if tomcat is up and running.

Tomcat.undeploy

This undeploy the application from tomcat.

Compile

Complies the code, what else?

War

This builds the war directory.

Tomcat.deploy

This deploys the application on Tomcat.

Junit.tool

This runs the JUnit test on the given code.

Junit.report

Reports any errors found in the JUnit tests.

JUnit

This runs the Junit.tool and Junit.report tasks. It will display errors if found.

Monday, October 22, 2007

21.MyISERN-1.2

There were many things difficult about this project. A lot of the issues were from the XML itself. The first issue was trying to figure out how to marshall things back into XML format in general. After our first meeting, we were able to figure this out with very little difficulty. We thought that this project would be easy but in actuality, I ended up losing a night's sleep just to finish all the tasks. I'm proudly, and very wearily, able to pronounce that we have finished all the tasks. Although I'm not sure if this is the most robust piece of code I’ve written however.

More difficulties arose from creating all the different adding function. Each in itself wasn't very hard but it was very tedious. I believe each one took us numerous hours because as we were writing each one, we kept running into slight problems with omission errors and just fixings those errors took many hours. I've learned having a clear and complete design before going off and writing code would have helped us tremendously. I can honestly say that when I started to code, I went off in my usually "I'll think of it as I'm writing it" kind of mode. This eventually lead me to the "Oh, god. I'm going to kill myself soon..." mode.

With each section being so long and requiring many methods and variables here and there, I often found myself stuck with merging conflict with my partner who was right next to me or generally waiting for him to finish his side of the code. We decided that since it took so long to write each section, we would split the work up. This actually led to more problems because we all kind of just jumped right into the code. I'll remember to hold a meeting where we go through the design of the code before we actually implement it.

The last and most excruciating difficulty was loading the XML files with all the researchers, organizations, and collaborations. Not only was it difficult to find all the connections in general, we all decided to split up the work and had a horrible time trying to merge everything together. At 4 in the morning, after doing all the work over myself, I finally got everything to work while developing carpel-tunnel syndrome in places I never knew possible.

But alas, in my semi-delirious state, I write this blog as my final testament to finishing this code that practically store another weekend away from me. Hurt, but proud that I could finish such a monstrous task.

As for organizing the group and carrying out the work, we went about it in our normal way of choosing a starting position and coding our way to each other. This definitely was not the best way to carry out this task. A united front would have saved us much time. Deliberately holding out on the coding and planning everything ahead of time would have been the best solution. I have learned another lesson yet again, the hard way.


And here's my link to our program: http://myisern-1-green.googlecode.com/files/myisern-xml-1.2.1022.zip

Wednesday, October 17, 2007

22.MyISERN-1.1.Review

1. Installation Review:

I decided to review Hong Nguyen project because it was among the few left over, and because I worked with him at the library and I'm curious to see how his project came out. I was able to download the installation file from their code.google.com website with no problems. From there, I was able to launch the system without using ant or eclipse and even got a nifty help feature when I just called the jar file. I also got an error telling me that there were no arguments so I know that at least that part is error free. I was able to run the verify build task with no problem and it completed successfully. I was also able to run the program normally, calling all the tables finding certain researchers, and etc. with no problems at all. It was very easy to use the program normally because of the help file.

2. Code format and conventions review

I didn't really find any code format and convention errors. If I was to be really picky, then I would say that some of the parameter names could have been named better but the general meaning is still easily derived from the names that they have chosen.

3. Test case review

Black Box testing:
All the tests were successful and it seem like they have a test for pretty much every single scenario. What's important for black box testing is testing for omission and it seems like the tests are very complete in the sense that they cover every single viable input. Since this program simply prints out the information it contains, black box testing consists mostly of ensuring that the right information is outputted. This Hong's group was smart in creating fake files and making sure that the data was complete and true.

White Box testing:
For line coverage, EMMA came up with:
class 100%
method 100%
block 98%
line 98%

This is quite amazing since our group was only able to get to 96% for our block coverage. After looking at the code, I found that the coverage wasn't 100% because there were lines that could have only been passed through if there was an error within the XML files, an error with linking, or errors with duplicate values.

Break the buggah:
The program was able to handle all the input I could give it. I ran through all the different possible inputs and their erroneous versions as well. I tried to test for all the different cases of omission and misspelling. Since this program really doesn't do much then listing the information it has in the XML files, it's really easy to code so that it is not error prone.

4. Summary and Lessons Learned

For previous review assignments I was usually handed code that wasn't always complete or didn't have much or any testing at all, so this was a great learning experience. I learned a lot about black box testing and just what it is exactly. I learned that black box testing is used to ensure that the data that comes out was the "right" data and that there were no omission errors. What I've learned from reviewing Hong's group's code was that I should try to test for more. Hong' group tested to see if their code would work with erroneous XML data and I should have done that too because it not only tests to see if the linking is working but also tests to see if duplicates were caught or not. It would have also been good to test if the XML files were found at all and to send out an error if that occurred. Basically I learned to test for complete coverage over the whole system and not just the code. I can try and pass through every single line of code but I should also test that everything works from when you start the program and it looks for data file to the output being correct.

Monday, October 15, 2007

18.MyISERN-1.1

The only thing that was difficult about this assignment was trying to figure out how to link all the different fields together. After brainstorming for the first day, we all had different ideas about how to go about it. I thought about creating another class that would be a link to all three fields but we felt that it was too much work and too much thinking. Eventually, our mighty teacher, Philip Johnson, posted a different way to look at the problem. By using a map, we could keep each field in an array and used their unique ID as a key. This way each field had their own link to each other and we could reference them anywhere in the code. This was the method we decided to use for our code.
Other than that, there really weren’t too many problems. It was a very long and tedious job but because our group met everyday, we managed to complete the project early. I was actually out for most of the week because of some issues with my full time job outside of class and also due to a motorcycle accident on Wednesday but I was able to quickly catch up and help my team through this assignment.
As for carrying out the work, we splitting the group work would be a better idea than working through XP. Jon started out in the back end by working with the XML files and trying to develop the maps for each field, while I worked on the interface and built my way back. Jung also helped out here and there. I believe that the fact that my team got together everyday starting from Thursday really helped us to finish this project quick. With that said I can proudly say that we finished all the tasks and wrote some very robust code. I tried to make sure that there was no way to break the code at all.
For the next milestone date, I would really change much at all. I believe that the work ethic that I have right now with my team is probably the driving force that keeps our project done on time. If anything, the only thing I would really change is trying to make sure that I don't get into anymore motorcycle accidents.


link to file: http://myisern-1-green.googlecode.com/files/myisern-xml-1.1.1014.zip

Wednesday, October 10, 2007

16.MyIsernReview

1. Installation Review

I was able to download the program successfully from their code.google.com website with no problems. I also able to run the system using without using ant (using java -jar method) and was pleasantly surprised to see an actual window pop up with all the information in a neat table instead of the usual print out to dos. That was a very nice touch. It made things a lot easier to see and made it look very professional. After I ran the ant verify task and found that the coverage wasn't at 100% but aside from that all the other tasks went through fine and verify passed. After taking a look at the code, I found that the only reason EMMA wasn't at 100% was because of a catch statement in case something went wrong. Since was only had the file that we were given and here are no errors there, I don't expect the coverage not being at 100% a problem.

2. Code Format and Conventions Review


For once, I could not spot any code format or conventions violations. I actually spent the time to go through the Elements of Java Style book and looked for each format violation and couldn't find anything. Good job!

3. Test Case Review

Since this a simple application that just takes data from xml files and then converts them to Java usable files that can e displayed easily in a window there really isn't much to break. Hence, there was no other option that I could use to bring up the table other than actually calling it. As for black box testing, the same can pretty much be said. There isn't much that can be done for testing. The data comes from an xml file and is converted into something that can be used in Java. So as long as the data in the xml file matches the data that comes up on screen and runs then pretty all tests will pass. All the tests included follow along this line of thought. If any part of the program fails, an equivalent test fails as well.

As for white box testing, Phil's coverage is at 99% which might actually be better than 100% because his code include a catch statement that really can't be tested but will notify users of an error if anything does happen to go wrong.

As for breaking the code, since no arguments are passed when the program is called, anything written after the java -jar *.jar command is effectively ignored which is good and bad because it won't crash the program but the user doesn’t know that anything included in the call isn't used at all.

4. Summery


Phil has really gone above and beyond for this assignment. Where I just made sure the jar file was created and run an output the screen, Phil made a GUI that displays the information in a nice table. This program was a bit hard to test for because it was really hard to create a test for something that just prints information to the screen. Off the top of my head, I can only think of testing that the data is right during each step it is being converted. But at the same time, just looking at the output in general is about the same thing. If there is an error usually the error is apparent in the output, i.e. getting a block address instead of a name. I know that I didn't really put many tests other than just making sure the output was sent to the screen. But Phil actually has a few lines that test whether a few of the steps along the way also pass.

Monday, October 8, 2007

15.MyISERN-1.0-Green

link to MyISERN-1-Green: http://www2.hawaii.edu/~eykim/myisern-xml-1.0.1007.zip

JAXB: JAXB is a great tool to convert XML to Java, and vice-versa, and was very easy to use. Since everything was set up already, I didn't really learn too much about it but from the code that I did inspect, it seems like one of those tools that "just works." The one thing I needed to learn was how the marshaller and unmashaller worked, and from there I pretty much could tell that I could just pull information as I wanted. JAXB's marshaller and unmarshaller could be used to change XML data to a file and the data in the file was converted to a type: collaborations, organizations, or researchers from which I could pull information that was previously in XML format.

XML: With each assignment I start to learn more and more about XML. This assignment probably helped me the most because I wanted to go above and beyond and create a jar file that was command line executable. To do this, I really had to dig deep into all the previous assignments and see what I needed to do to create a jar file. It was pretty simple using the format of the previous assignments but I gained a deeper understanding of the file structure and formatting of XML. Before this, when I looked at the build file, it really looked like a jumbled mess. Now I look at it and I can see clear distinctions within the code, kind of like when you first start looking at Java or C++ code. It seems really fuzzy and confusing at first but with more practice and a common standard, everything starts to really make sense. I think I came away from this assignment with that sense of clarity.

Group Software Development: In previous ICS classes, working in groups really wasn't enforced too much. But in the real world, it seems like most of the time, you will be working with another person or probably an entire group of people trying to get a single project done. It's probably safe to say that more often then not; you will be working people in real life, so I really liked working in a group. My group tried to do Extreme programming and found that it was extremely helpful. We could get better code done in a shorter amount of time. We would often catch each others mistakes and sometimes find better ways of doing things. Although we only met twice and the second time our third partner wasn't there, we pretty much got the whole assignment done within those two meetings. We even tried doing SCRUM programming and at times that worked well too. I think each specific situation calls for its own programming method.

MISC.: One of the problems that I ran into during this whole process was waiting for people to catch up to me assignment wise. Since my other two partner didn't really finish the previous assignments completely, one more so than the other, it really took away at the amount of time we could have spent coding. Luckily, it gave me time to go set up all the pages for svn, discuss, and the google project hosting. Other than that, I think I had a great group and I feel a little sad that I'm going to be with other people. I just hope that I don't run into a lot of problems with the other groups.

Thursday, October 4, 2007

14.CM.Practice

I was able to complete all three tasks although most of the tasks were easy; the last task specifically the google groups creation was quite confusing. I was able to install tortoiseSVN with no problems and aside from using https instead of http to commit; I really didn't have much problem with that task either. But with the third task, I was a bit confused with creating all these groups and the project hosting site as well. Creating the project hosting site was done with no problems but trying to configure and to find out the use of the google groups was a bit complicated. I wasn't exactly sure where to put the mailing lists and just how it all worked. Also having multiple tabs open and trying to get all the windows to accomplish single goals was a bit overwhelming as well.
I guess my lesson learned really was just getting used to using google groups and the whole idea of the mailing list. After I've run through the whole assignment and I getting everything to work, I have a better grip on just what each group is doing but I think I still need more practice to really have a firm grasp on it. I think after creating another group and running through the procedures over again will really solidify my hold on this subject.

Monday, October 1, 2007

12.Webspider Review

Program author: Jung Kim


1. Installation Review
I.
Running software

Jung Kim's program pretty much worked "right out of the box." I was able to extract the file successfully, and I could import it with no problem.

II. Build tests

JUnit: It ran successfully.

CheckStyle: CheckStyle had one error.
"Using the '.*' form of import should be avoided - java.util.logging.*."
Upon looking at his code, he didn't even use this library so I deleted it and checkstyle ran fine.

PMD: It ran successfully.

FindBugs: It ran successfully.

Emma: Emma did not run at all.
The error that was found was "C:\webspider-kimjung-1.0.927\emma.build.xml:68: input file C:\webspider-kimjung-1.0.927\build\emma\coverage.xml does not exist." I believe the lack of JUnit tests caused an error in Emma so that it cannot run at all.

Verify: Build failed because of the Emma error.

III. Building the jar file
ant -f dist.build.xml worked fine and created another distribution. ant jar also worked and created just the jar file.

IV. Invocation
I was able to successfully invoke "java -jar webspider-kimjung.jar -totallinks http://www.hackystat.org 100." But it gave me a total of one link. When I looked into the code, I realized that he didn't change much at all. The code still looks at the page that it's given and returns the number of links on that page alone. It doesn't travel to any other pages and retrieve links.

2. Code Format Review

File

Lines

Violation

Comments

WebSpiderExample.java

7

ICS-SE-Java-2

Do not use wild cards in import statements.

WebSpiderExample.java

12, 43, 44, ...

EJS-33

Keep code and comments in sync


3. Test Case Review
There simply was no test cases. Not even a JUnit annotation was present. In order to break the program, all that's needed is to travel outside of the format originally given. So if I was to enter "java -jar webspider-kimjung.jar http://www.hackystat.org” I would get an array out of bound error. I also know that the last argument, which handles how many pages it need to travels till it stops, really does nothing at all. There is no ways to distinguish from -totallinks to -mostpopular nor is there any kind of logging available in the code. In the end, there really isn't much to review at all.

4. Summary
I really didn't learn much from this exercise at all. Seeing as Jung Kim's assignment didn't really leave me much to work with, I couldn't really learn much from this experience. The sum total number of things I did was 4. I fixed a checkstyle error, figured out that Emma won't run without any test to run on, read code that was basically unchanged, and wrote a blog. I really wish I could have learned something from this experience but after reading Randy Cox's blog, I generally understand the point that this lesson is trying to get across. I should not look at a program as being done until I've crossed over to the other side, users versus programmers, and actually try to run my program from that perspective. I should experience everything from first installing the package on a fresh system to actually trying to break the program as a user and not a programmer.

Although I did not get to really think much about black box or white box testing with this program, I do see the difference. After reading other people's blogs and experience, it seems like black box testing aligns more with the point of view of the user. You put in something and expect something to come out. If what comes out is not what you expect, then something wrong. On the other hand, white box testing is generally good for programmers that want to make sure all the methods are being executed. If a code doesn't have 100% coverage, then you know that one of you methods, catch statements, etc. aren't being used. This helps to write more tests and eventually have a more robust code.


Wednesday, September 26, 2007

11 webspider part 2

I tried to work on the webspider project again but found that the only significant change I made was to the logging part. Instead of using System.out.println to output any logging, I used the java logger class to implement my logging. This was mildly difficult because I had no experience with this class or anything like it. At least when I had to use map I had a basic idea of what I wanted in a nut shell. With logging, I didn't even know where to begin. So like any other good program, I looked up example on the internet.
Even on the internet there weren't many useful links. I tried to look at the API but as complex as it is, I found myself unmotivated and bored. There were a few pages that described how to use the logging class but what I really wanted was an example of just how the code worked. There nothing like seeing the code in action to really grasp what it can do.
I tried to work on other parts of the code but I was just not motivated enough to think up a better, more robust code. It may be because I feel that I am "done" with this assignment or just the lack of sleep over the past week catching up with me, but it seems like I'm satisfied with this code and can't bring myself to really dive into it and make it more efficient.

here's the link to the new version...

http://www2.hawaii.edu/%7Eeykim/webspider-eykim-1.0.925.zip

Monday, September 24, 2007

11.webspider

This was probably the longest assignment I've done in a while. It was very complicated and I still can't believe that I actually finished it. I'll admit that I had to look to a lot of other people for inspiration but I finally got it done. It's also not the prettiest piece of code that I've written but that's my fault. I procrastinated till the end and suffered for it. I eventually got all three tasks done.

What I've learned from this homework assignment is that simultaneously learning a new language, xml, while trying to brush up on an old language, java, leads to some very frustrating problems. The problem that comes to mind was that one line in the build file that we needed to change so that the java library files were included externally. It took me a long time to read through the code and understand what it all meant. Even then, I still had no idea what I needed to do. It was through the help of a friend that finally solved the problem.

I'm not proud of it but I also depended heavily on the work of those that finished before me to get me through this homework. Although I did finish task 1 mostly on my own, I still needed to look into Randy Cox's code to figure out how to translate the weblinks into string format. Afterward, I had to rely on Jared Sunouchi's idea of using a map to find the most popular page. I had a similar idea but to implement it would mean rewriting my code from scratch at 3 in the morning. Thanks to Jared's map idea, I could easily convert what I was using in my code to a map and traverse it to see which links came up the most.

All in all, I wished that I started earlier but I know that without any help, I don't think I would have finished this assignment. I feel dirty using other people's code to get me through my assignment, but I have to give them due credit because their ideas were brilliant.

http://www2.hawaii.edu/~eykim/webspider-eykim-1.0.924.zip

Monday, September 17, 2007

10.Stack

Here is my file for stack...
http://www2.hawaii.edu/~eykim/stack-eykim-5.0.916.zip

This was actually one of the first project that I got an early start on. I'm also glad that I worked with a bunch of friends. Without their help, I believe I would have been up all night, pondering subtle details about eclipse errors that really had nothing to do with the homework at all. But due to their help, I was able to complete all five tasks.
Although most of the problems that I ran into dealt with very obscure details such as, "I can't get ant to work on the command line" and "Where are the layouts for the JavaNCSS report page?” it would have taken me hours on my own to find the answers to these problems. Evenly dividing the work between all of us, helped to alleviate the stress and lighten up the atmosphere. I believe the biggest problem that we ran into was trying to figure out how to write the ant task for JavaNCSS. It really was like learning a new language in just one day. I had to continuously research online and read over the code to get a firm grip on just what each tag did. I've never used xml before this but I feel that after looking at and developing code for the JavaNCSS, I have a decent grasp on xml. The other problems I ran into were just a result of not reading the manuals enough or just doing a simple bit of research on the topic.
As for Ant, I believe that it is a great program. It seems like a hassle for a non-trivial program but I can easily imagine how it could literally "save my ass" if I had a monster of a program with hundreds of classes and methods. Aside from making sure that all of my code was recently compiled, the tests that I could easily run and the information from programs like "emma" really help me to become a better programmer overall. Before this assignment there was a number of methods that I didn't even know existed.
There really aren't too many standards that I don't understand the motivation for. The "tabs" rule is a great rule because I've run into multiple problems when transferring code over from one computer to the next or from one platform to another. As for naming conventions, number of tab spaces and the like, it really depends on your style but having one common convention really makes it easy for everyone to be on a level playing ground. Also using an IDE like eclipse where you can add formatting standards makes converting to the standard very easy.
As for SCLC and JavaNCSS, SCLC is nice because it tells you just how many lines may differ from each version of code but I think that using JavaNCSS is more efficient because you can use it to figure out just when you should refactor. Using the code metrics in JavaNCSS, I can easily see when I don't have enough comments for a certain method or if a method is getting too unruly. As opposed to SCLC where I get hard facts about just how big my source code is in general. I really do prefer JavaNCSS. Now, if only I could use it efficiently.

Wednesday, September 5, 2007

Code Ruler Redux

LINK TO CODE:
http://www2.hawaii.edu/~eykim/eykimv2.zip


MEMBERS: Like before, I did this homework on my own but I'm seriously considering doing the other project with a partner from now on.


RESULTS:
I decided that I needed to work on improving the code that deals with the peasants. I decided that just moving them randomly was not enough. I noticed that most of the sample ruler tried to go after the peasants at first so I decided to give them a chase. I wrote code that would check the area around each peasant for any opponent and moved in the opposite direction of the opponent.
It took me a long time to actually develop code that wouldn't give off errors and the resulting code was actually pretty ugly. But I got it cleaned up and it got the job done. I noticed that when I faced off against gang up ruler, I stood a much better chance of survival due to the fact that gang up ruler would send all his knights after my peasants. My peasants on the other hand avoided the knights pretty well giving my castle plenty of time to create more knights to ultimately defeat gang up ruler's knights.
Split up ruler was a completely different story. It seemed like I faired worse than before when it came to split up ruler. Split up ruler completely destroyed my peasants before they even had a chance to run. Afterward they would attack all my knights and I usually ended up with either no minions or sending countless knights to their doom. This was one error that I wish I had more time to fix. I noticed that if I was left with just a few knights and a castle, all my knights would just attack the castle a few at a time. Split up ruler would kill these few knights and gain incredibly high points off of it.

SCORES:

               `My score      enemy

split 122 446

split 137 416

split 168 407



migrate 596 11

migrate 577 16

migrate 559 9



gang up 376 224

gang up 382 282

gang up 294 373


LESSON LEARNED:
I've learned that to truly develop code is an on going process and that no code is really ever done. There will always be some kind of improvement that could be made. Everything from studying the problem from all angles to collaborating with my fellow students can greatly improve the quality of code that I write. I should have made better use of these resources.
I also realized that as I delved deeper and deeper into my strategy, the more complicated the code became and the more frustrated I've become. After looking at other people's code, I noticed that complicated strategies with endless condition usually faired the best. I tried to emulate this strategy but eventually ran out of time. I honestly thought that my modifications to the peasant's code would be enough. But it was not and left me with a hard learned lesson.

Friday, August 31, 2007

Code Ruler Review





































FileLinesViolationsComments
MyRuler.java22, 23, 25, *EJS-5Code indents 4 space. It should be 2
MyRuler.java22, 23, 90, *EJS-7
MyRuler.java36, 37, 38, *EJS-8
MyRuler.java66EJS-35Need to clearly describe what this method does in terms of strategy.
MyRuler.java232EJS-54Need to describe the x and y parameter.

Wednesday, August 29, 2007

Code Ruler Results

LINK TO CODE:
http://www2.hawaii.edu/~eykim/eykim.zip is the link to the file


MEMBERS:
Since I am the only person that worked on this project I guess I am the only person to list.


RESULTS:
The strategy that I used was to take the first two knights and send them to attack the enemy's peasants. This is to cut off the amount of land they can accumulate therefore cutting down the number of peasants and knights that they can produce. The next three knights are sent to take over castles. This is to ensure that the enemy cannot produce anymore knights or peasants and to ensure that if my own castle is taken over, I have a squad ready to take it back. The remaining knights are sent to attack the others knight in an effort to keep them at bay. If there are no more remaining peasants, then those first two knights are sent to attack more knights. If there are no castle, those knights also fight more knights.

If there are no knights, peasants, or castle, then the knight remain where they are and all the castle under my control produce mass amounts of peasants to accumulate land since land can bring the score up a considerable amount.


SCORES:
migrate Ruler
eykim: 445

Migrate: 113
eykim: 435
Migrate: 134

eykim: 456
Migrate: 123


Split Ruler
eykim: 236
Split: 220

eykim: 105
Split: 436

eykim: 20
Split: 480


Gang Up
eykim: 436
Gang: 237

eykim: 412
Gang: 380

eykim: 230
Gang: 234



Against the three samples, my own strategy didn't work as well as I thought it would. Against migrate though I did fantastic. All three trial yielded high scores mostly due to the fact that the peasants were killed right away, the castle taken quickly, and all the knights were hunted down efficiently. For each trial I nearly triple the score of Migrate Ruler if not more. They stood no chance.

Against Split up Ruler, I didn't fair as well. To be honest, it was a crap shoot. If I was lucky enough to take their castle right off the bat, then I stood a solid chance of clearing all the peasants and then finally going after all the knights. If I couldn't capture their castle, then i found that as soon as my peasants died, the enemy knights would stop and amass in their castle. At which point they would demolish all knights that I would send toward them.

Against Gang up Ruler it was much the same way as Split up ruler. If I could take the castle then i stood a good chance of winning. If i didn't take the castle then I stood a good chance of just mindlessly sending knights to their doom against their castle, or being completely demolished right from the start.

LESSONS LEARNED:
I've learned that eclipse can be either a very handy tool or a nightmare. At first, it was a pleasure to use because I had a lot of my coding automatically filled out for me. But as I copy and pasted item here and there, I started to get random errors that I could not fix unless i just rewrote the code all over again.

Another nightmare was javadoc and learning how to use it. At first i tried to run javadoc through the command line but it would not recognize the javadocs command. I later learned that I needed to reinstall java again. Eventually i got it to work but only after hours of research, installing and reinstalling, and a couple red bulls.

As for CodeRuler, I realized that I knew what i wanted the object to do and when I wanted them to do it but to actually code it so that they listened to you was not as easy as I thought it would be. One feature I wanted the knights to do but couldn't figure out, was to make all the knights wait until there was a large number of them before they go off attacking someone. I also wanted the castle to produce knights at first and then peasants when the enemy knights were far away. But after an hour of watching simulation after simulation, I realized that most sample ruler go after peasants too! So i had to wait until all the enemy knights were dead before I started to produce more peasants.

All in all, it was quite difficult to make the strategies themselves. I went through multiply different scenarios from just taking castles over and over to just staying in my own castle. Through trial and error, i found that the smart split style of commanding your army was the best solution yet coding my own peasants and knights to act according was very difficult.

Wednesday, August 22, 2007

Jtag

The program I decided to download and review is called Jtag. It's a Java based ID3 tag editor. It basically edits the ID3 tag which is a data container within an MP3 that includes information such as Artist, Album, Song Title, and such. The reason I chose this program is because of my huge archive of MP3s. This program is useful because it will load a whole directory of Mp3s and edit all the ID3 tags.

Itunes and Windows Media Player all use ID3 tags when playing a song and displaying what song is being played. So if you were to upload a whole directory of songs and edited the file names so that each filename correctly represented the MP3s but left the ID3 tags how they were, Itunes or WMP will list each file using the ID3 tag which might confuse you. Or even worse, if your ID3 tags were blank, then you would have no idea what song would be playing until you recognized the song.

Editing each MP3 by hand is very tedious and cumbersome, which is where this program comes in. It can load a whole directory of MP3s and simultaneously edit all the tags or a selected few. As i tested this product, I find that it does what it is intended to do but also came with many features that just made it more and more useful. There is the option to rename all the files uploaded so that it reflects the artist and song title in the ID3 tags. Thus saving you the time it takes to rename each individual file. Although I did notice a few bugs where certain MP3 ID3 tags couldn't be edited although it says that it was edited in Jtag.

As for the second prime directive, this program might be a little tricky to use. There really is no installation process but also no intuitive "start button" as well. Those that don't know anything about .bat file might be reluctant to double click on that file. But all that's really needed to use the program is to double click that start.bat file and the program starts up right away. No installation is needed. A readme file would have been helpful but I'm sure enough poking around would have started the program.

As for documentation, the source code is included so you have access to the program and rewrite it to your needs or modify it so that it runs without bugs but there are sparse comments and no real documentation. Even so, the program doesn't seem to be overly complicated and a quick look at the function names and classes give a good idea of what it's about. After edited the files, it seems like you can just as easily compile the program and run it right away since there is no installation.








http://sourceforge.net/project/showfiles.php?group_id=44125

Tuesday, August 21, 2007

fizzbuzz

So I finally got around to doing the fizzbuzz homework and realized a few things. The first thing is that I've very rusty with java. It's been around 2 years, I think, since I really coded in java and this was a wake up call. I remember a lot of the functions and how to generally code in java but the specific things like the exact syntax eluded me. For example, I forgot that the for loop as ";" as delimiters and it took me a few minutes to figure that out. Stupid, huh?

Another speedbump was using eclipse itself. I'm not used to using an IDE. I generally code by hand and I kept finding myself hitting tab when eclipse would do it for me, throwing off my formatting. It actually took me quite a while just to find out where to type my code. I'm not used to starting a new project, looking for the src folder, creating a new class and finally writing code. I like to just open up note and start coding. I usually deal with where the file goes later, but I will admit that using eclipse is really helpful. Esp, since it list all the functions that matches what you're currently typing. Very helpful if you forget the exact name of the function.

Well here's my code...

public class fizzbuzz {

/**
* @param args
*/
public static void main(String[] args) {
int x;
for(x = 1; x < 101; x++){
if(x%15 == 0) {
System.out.println("fizzbuzz");
}
else {

if(x%5 == 0) {
System.out.println("buzz");
}

else {

if(x%3 == 0) {
System.out.println("fizz");
}

else {
System.out.println(x);
}

}
}
}
}

}

Completion time: 13 mins

I've come to realize that software engineering is like solving a puzzle. it's very creative and it's best to come in with a game plan instead of jst driving into it. I actually enjoy this very much and I think I'm going to really enjoy this class. I'm very anxious to see what else we are going to learn.