Thursday, November 15, 2007

29.MyIsern-1.3-review

Reviewed Team: myisern-1-green
Source Code: Here

Installation Review:
-There are no problem to run "ant -f verify.build.xml".
-WAR file can be generate.
-Be able to import project to eclipse.
-No error appear on eclipse.

Tool Execution:
Junit - OKey! Successful run all the test.
-Enable to see a status, when it run.

Checkstyle - OKey!

Emma - Okey!
emma.echo: [xslt] Processing C:\svn-google\myisern-1-green\build\emma\coverage.xml toC:\svn-google\myisern-1-green\build\emma\coverage.brief.txt
[xslt] Loading stylesheet C:\svn-google\myisern-1-green\lib\emma\hackystat.emma.xsl
[concat] Emma Coverage summary
[concat] class: 68% (17/25)
[concat] method: 57% (123/217)
[concat] block: 81% (5713/7044)
[concat] line: 80% (1315.7/1645)

Verify - Okey! Successful run all the test.
BUILD SUCCESSFUL

Code Format and Conventions Review:
File Line# violation Comment
No Violation Found!

The emma coverage is look not enough, I think you need to write a little bit more code on test case that bring up the emma coverage.

Black Box Perspective:
For LOGIN Page:
Enter username and password to test is it point to right page, or insert either one wrong input to test the page will display right error message.

For ADD Page:
Is the data will extract to right xml file and return message to user.
Do the page show all the field for each attributes.
Is the page had error handing.

For EDIT Page:
Is the show all the data of that attributes?
Is the page will point to right page when user click on submit button.
Is the page had error handing?

White Box Perspective:
White box testing include two parts, one is testing the system file which is myisern. Emma coverage will show the result of which parts the system do not cover. the other part is testing over the web, this test is only testing the web connection between the system and web server, also you need to write some code to cover all the web action.
For this case, your emma coverage no bad, but still need some to cover each requirement.

Break da buggah:
In this case, the first page is not a login page.
If I enter nothing in ADD page it will point it to web server error page, which is not successful to add data, and edit page too.

User Interface review:
Your system successful run on tomcat web server, and can be display each page.
Your had pretty nice user interface, clearly display the information on each page.

Summary and Lessons Learned:
What I learn on this assignment is transfer everythings into web interface, and it is very challenge on create user interface by using JSP which is totally new language, and I need to learn how to they implement to current system.

Monday, November 5, 2007

26.StackStripesExtension

Here is my code StackStripes.


From task 1 to 3 is very easy to do, just setup the Tomcat Web Server and run it. But the difficult parts increase Emma coverage to 100% that I spend about 2 to 3 hours to bring up the coverage. Also, I spend 1 to 2 hours on making Double it button work.
For the Emma testing, I think many people have a same problem that Emma test cannot be build successful, same time its work and same time it didn't work, so I figure out by reading some post on the discussion post, and know we have to make sure JUnit run successfully then Emma should be work. Otherwise, it come out an error about coverage.ec file not exist.
After fixed this problem, I bring the Emma coverage, and make it as 100%. Now, for my final application that my Emma coverage is 100%.
This is a good exercise to practice how to use JSP and Servlets. How are they work?

25.WebAppQuestions

1.Explain in your own words the meaning of the web "request-response cycle".
As I known, request is like a message that sent from client web browser, and response is the server who received the message and feedback to client. So “request-response cycle” is a term of client-server.

2.Explain how servlets facilitate processing of the request-response cycle.
Servlets is API software that listen a request and base on request to create a response.

3.How do you login to the Tomcat Manager?
First, make sure tomcat is running, then create an account name and password by modify “tomcat-user.xml” file. Then, go to browse and type “localhost:8080”, go to Tomcat Manager by using the username and password that created before.

4.What is the Tomcat Manager used for in the StackStripes application?
Since, we need to run an application on tomcat web server, so we need to get authorize on web server to make the application run, so we need tomcat manager to communicate between application and web server.

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!)
In StackStripes directory it include a folder call “web”, under that folder is web page for JSP, also it had a folder call WEB-INF, it include a stripe library that the system need these when compile with stripes.

6.How do you build a war directory structure in Ant? Where is this accomplished in the StackStripes application?
To build a war directory structure in Ant we need tomcat manager to compile the whole java file and they make a war file (this file same with jar file). Tomcat will use this file to execute the application.
In StackStripes application we run tomcat.build.xml that will do the above process to make a war file and deploy on tomcat web server, then show the application on web browser.

7.How do you install a war directory in a running Tomcat server? What information does the Ant task need to accomplish this?
When Tomcat server running we can use Tomcat Manager to install a war directory. In Ant, we need to run tomcat.build.xml to build war directory.

8.What is the "Model2" architecture? What are its advantages?
Model 2 is combine servlets and JSP together, it’s make the application server more dynamic. The advantages of model 2 is separate process request and respond action, servlets will control all process and send to JSP to respond client side.

9.What are JSP pages? How are they related to servlets?
JSP is Java Server Page is able to receive client request and respond to client, which is able to interact between server and client. JSP is compiled into java servlets by 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?
When JSP received a request then servlets will compile the application, we know compile java application that the system will send a lot of compiled data back to client side, so it may take a long time for first time. The java code will store it at the browser cache.

11.What are JSTL tags? Why are they useful? What is an example JSTL tag from the StackStripes system?
JSTL tags is able to call the library from JSP. JSTL can do some code programming code on HTML code i.e. call FOR loop in HTML. The example on StackStripes is .

12.What are Stripes tags? Why are they useful? What is an example Stripes tag from the StackStripes system?
Stripes tags are the tags to let JSP recognize which parts need to compile by JSP. If don’t have Stripes tags that JSP won’t be know which components of HTML will send the request to JSP, and JSP won’t be able to compile. For example, all PHP code is within a beckets <$PHP$> outside of this beckets is normal HTML code. There is an example on StackStripes application.

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 test java application through the internet protocol and create a test result. JUnit is only test java application in local system and HttpUnit that able to test request and respond from java application server. If without HttpUnit that it won’t be able to test web feature, which is web form button, server connection and web application. Here is an example of HttpUnit on StackStripes WebResponse response = conversation.getResponse(Url);


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?
To implement Double it button that need to change the form ID name and value that display string on Double it button. It didn’t need to change is the HTML tag for create button. Http form is user interface for people easy to interact with the application. If no MVC that user may not be interact with application.

15.What are the equivalence classes that need to be tested for the Double It button?
The goal for Double it button is duplicate default value into stack, so to test Double it button that must be push one value into stack, if the double it button is work, it may have two equal value in the stack.

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 hitting the “Double it” button that it will show double it button on the page, then after hitting Double it button it will direct to java stack application and duplicate value into stack and send it back to original page, and then iterator to display what value into stack.




17.What is the singleton design pattern? What is an example of its use in StackStripes? Why is it needed?
Singleton design pattern is makes many process into one instance or object. An example of its use in StackStripes is
public static synchronized StackModel getInstance() {
return StackModel.theInstance;
}
It operates more efficiently when only one or a few objects exist.

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 TestStackActionBean code is on the server side and the StackActionBean code is on client side, because the TestStackActionBean code is use HttpUnit to go through internet protocol to test the code, and use JUnit to test StackActionBean in local system. Emma only deal with which method in these code are execute or not to create appropriate coverage data, so if one of exercise code doesn’t execute, the emma coverage will not be 100%.

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 – To check the connection of Tomcat web server, make sure Tomcat is running or not.
tomcat.undeploy – Undeploy application on Tomcat Web Server
compile – Compile application on Tomcat Web Server
war – Servlets base on java files and deploy it as an archive file for web call war.
tomcat.deploy - Deploys application on Tomcat Web Server.
junit.tool – Testing application by using test case.
junit.report – Generate test report return what error occur in code.
junit – To run the test case and test the application.

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?