Thursday, November 15, 2007

29.MyISERN-1.3-Review

  • Reviewer: Chiao-Fen Zielinski-Liu
  • Author: Silver Group (Matsuo & Zhang)
  • Installation Review:
    • The myisern-silver-1.3.1114 zip file was successfully downloaded into to my workplace.
    • Myisern-silver-1.3.1114 does not have a 'java - jar' interface to the system.
    • I was able to run myisern-silver in a few minutes because the InstallationGuide was very clear and easy to follow. Myisern-silver also provides a link to their login page in the InstallationGuide. I find this so sweet.
    • CheckStyle = failed.
    • JUnit = failed.
    • PMD = successful.
    • FindBugs = failed.
  • Code Format and Conventions Review:
    • After running the 'CheckStyle' task, there were several warnings. These warnings are all about 'Missing a Javadoc comment'. Hence, it violates 'EJS-35' which is about 'no documentation comments'.
  • Test Case Review:
    • Black box perspective:
      • There are two unit test classes which are 'TestMyIsernModel' and 'TestXmlLoader'. I believe that several unit tests for the MyIsernAction class are missing.
    • White box perspective:
      • Bring up tomcat, involve ant -f tomcat.build.xml, and then run the emma task. I kept getting a message called "could not find ${env.HOME} coverage.ec to copy. However, I changed to ${basedir} coverage.ec. The emma coverage is as follow for the myisern-silver group.
        • [concat] Emma Coverage summary
        • [concat] class: 22% (2/9)
        • [concat] method: 26% (40/152)
        • [concat] block: 53% (1533/2899)
        • [concat] line: 47% (260.2/550)
    • Break da buggah:
      • I could access myisern.jsp and other *.jsp without entering valid username and password. I would suggest to lock other web applications if users try to visit other web application without signing in.
      • I could successfully login the system. However, when I tried to involve more functions, I received a warning "HTTP Status 500-, Exception report".
  • User Interface Review:
    • The user interface for all of web applications is very simple and clear without any fancy images or background color. It contains only boxes for entering information, links, and buttons with white color as background. This user interface is good for users do multi tasks on the window at the same time.
  • Summary and Lessons Learned:
    • I would like to mention again that the installation guide is clear and concise. If any user follows it, it is impossible to make mistake.
    • The only button that works successfully is the 'login' button. I could not involve any function after I signed in. Therefore, I believe that I would try to make at least one function work successfully.
    • This assignment is very interesting because it involves the web application. What if this assignment was an individual project and more time was given, it would be more challenge for each of us in class.

Monday, November 5, 2007

26.StackStripesExtension

  • What was difficult about this assignment?
    • In my case, the first difficult task was that I did not know the localhost was needed to be running in order to login to the Tomcat Manager.
    • The second difficult task was that I did not follow instructions carefully, so I brought up Tomcat from different directory. This caused my verify tool failed.
    • When coding the "Double It" button, I ran into some errors because I did not use the iterator method but tried to get the size of stack. It turned out I changed the original stack instead of creating a new one.
  • What problems were encountered in carrying out the work, and how did you resolve them?
    • My verify task did not pass after I tried many times and I re-did the task1, task2 and task3 about five times. Then, I decided to watch how Michal ran his program. I realized that I did not bring up Tomcat in the right directory. This was because I did not follow the instructions carefully. It is very important to read and follow instructions carefully.
  • Were all of the assigned tasks completed?
    • Yes, I have completed all assigned tasks.
    • Emma coverage:
      • [concat] Emma Coverage summary
      • [concat] class: 100% (2/2)
      • [concat] method: 100% (18/18)
      • [concat] block: 94% (129/137)
      • [concat] line: 90% (37/41)

Sunday, November 4, 2007

25.WebAppQuestions

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

After studying the "request-response cycle" from different online sources, the "request-response cycle" is between a client and a server. Normally, a client requests a task and a server responses it. For example, you are looking for some information about the "request-response cycle" on google, so you type the key inside the searching box. Then, you will receive lists of articles about the "request-response cycle". I think what it is.


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

To understand servlets, we have to know what the request-response cycle is. Hence, please read the Q1. A servlet runs on a server. In the "request-response cycle", response is represented as a server. Therefore, when a server responses to a client, the server needs a servlet to generate HTML pages (also known as web pages) which are sent to the client. HTML pages can be static, dynamic or both.


3. How do you login to the Tomcat Manager?

Before you login to the Tomact Mangaer, you will need to know what the username and password is. How can you get the username and password?

Apache-tomcat-6.0.14 -> conf -> tomcatusers Then, you will find the username and password.

Then, go to "http://localhost:8080/" and click "Tomcat Manager". Now, you can enter the username and password.


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

In the StackStripes application, the Tomcat manager is to implement the Java Servlet (a server) and the JavaServer pages and to provide an environment for Java code to run in a web application. In the StackStripes application, we use commands like catalina start and catalina stop to deploy and undeploy tasks.


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

We would need to install Tomcat tool, Stripes tool and set environment variables. We would also need to copy a .war file from Stripes to Tomcat.


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

When running ant –f build.xml, a war directory would be created under a build directory. Therefore, in our cases, the war directory would be generated inside the build directory.


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

In order to install a war directory, the Tomcat tool is needed because a running Tomcat server would create a war directory automatically under the same name within the webapps directory and deployed for use. The information would be like the “catalina start” command to start up a web, then ant –f tomcat.build.xml.


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

The “Model2” architecture or Model-View-Controller (MVC) is a hybrid approach for serving dynamic content. Model is included data; View is the interface and Controller is for the requests from client. Its advantages are included the use of both servlets and Java Server Pages. By using both technologies, the “Model2” architecture would have a clean content, clear roles and responsibilities of the developers.


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

Java Server Pages (JSP) is a server side technology that lets you mix static HTML with dynamically-generated HTML. A dynamic Web page contains content that a user can interact with and normally the extension of a file is .jsp not .html. When a JSP page is called, it will be compiled by the JSP engine into a Java servlet. Then, the servlet is compiled by the servlet engine to generate dynamic HTML to be sent to a client.


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

When retrieving a JSP page for the first time, servlet acts a security to check whether or not a web application is dynamical. I am not sure where the Java code is stored. Since the JSP page is from the server side, so the Java code should be stored in the server.


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

JSP Standard Tag Library (JSTL) is a set of tag libraries and is needed when writting dynamic JSP pages.

An example from the StackStripes system would be the "c:forEach" tag in the "index.jsp" file.

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

Stripes tags are included a standard tag library and a dynamic attribute tag library. Their function is to link both a web application and a Java code.

An example from the StackStripes would be the "stripes" tag in the "index.jsp" file.


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 framework based on JUnit, which allows the implementation of automated test scripts for “Web applications”. Therefore, when running HttpUnit testing, tomcat needs to be run at the same time. The example from the stackstripes system will be these objects such as Webconversation, WebResponse, WebForm and WebTable which would need to be used in HttpUnit testing.


14. What needed to be changed in order to implement the Double It button? What didn't need to be changed? What did you learn about the MVC design pattern from this exercise?

In order to run the “Double It” button, a method called “doubleIt” should be added in the StackModel class and an object of iterator would need to be created to hold what is in the original iterator because it is not a good idea to manipulate the original iterator. Then, a string list would be created. All the objects in the newer iterator would be converted into string which would be added into the string list. Finally, push each string from the string list to stack.

What does not need to be changed would be the method call “doubleIt” in the StackActionBean class. It is pretty much the same as push in the StackActionBean but without the argument.

Model-View-Controller (MVC) is separated into three cores which are the input, processing, and output of an application. Therefore, I believe that the StackModel class is represented for Model, the StackActionBean class is represented for Controller and the Web Application is represented for View. It is similar to object orient language. Each class does a different task. When all classes are combined, a product is completed.


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

When testing the “Double It” button for the StackModel class in the TestStackModel class, some pushes are needed to be done first. Then, the doubleIt() method would be called for testing purpose.


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?

The singleton design pattern allows many parts of a program to share a single resource to work out the details of the sharing themselves.

An example from the StackStripes would be as follows:

public class StackModel {

/** The singleton StackModel instance. */
private static StackModel theInstance = new StackModel();
}

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

Server side includes the TestStackModel class and client side includes the TestStackActionBean class.


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:

[get] Getting: http://localhost:8080//manager/list
[get] To: C:\ICS413Tools\stackstripes-1.0.1027\list-results.tmp
[delete] Deleting: C:\ICS413Tools\stackstripes-1.0.1027\list-results.tmp
[echo] Tomcat and its management interface contacted successfully.


tomcat.undeploy:

[get] Getting: http://localhost:8080//manager/undeploy?path=/stackstripes
[get] To: C:\ICS413Tools\stackstripes-1.0.1027\remove-results.tmp
[echo] OK - Undeployed application at context path /stackstripes
[delete] Deleting: C:\ICS413Tools\stackstripes-1.0.1027\remove-results.tmp


Compile: checks any new updates which are needed to be compiled.


War: checks any .war files needed to be re-generated.


tomcat.deploy:

[echo] Starting hot deployment to stackstripes.
[unwar] Expanding: C:\ICS413Tools\stackstripes-1.0.1027\build\stackstripes.war into C:\ICS413Tools\stackstripes-1.0.1027\build\tmpwar
[get] Getting: http://localhost:8080/manager/deploy?path=/stackstripes&war
=C:\ICS413Tools\stackstripes-1.0.1027\build/tmpwar
[get] To: C:\ICS413Tools\stackstripes-1.0.1027\install-results.tmp
[echo] Install results: OK - Deployed application at context path /stackstripes
[delete] Deleting: C:\ICS413Tools\stackstripes-1.0.1027\install-results.tmp


Junit.tool: checks whether or not Junit tests are passed.


Junit.report: creates a Junit directory which contains reports to let developers understand what tests are failed and successful.


Junit.: let developers know whether Junit is built successfully or failed.


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?

So far, the assignment 26 is my first experience using a web application framework. Hence, it is difficult for me to compare it to other web application frameworks.