Monday, December 10, 2007

33.PrimeDirectivesRedux

PD1: The system successfully accomplishes a useful task.

PD2: An external user can successfully install and use the system.

PD3: An external developer can successfully understand and enhance the system.


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


PD1: IDEs satisfy the PD1, because one of the properties that IDEs have called “Integrated stepwise execution (debugger) can help programmers to detect errors.

PD2: IDEs satisfy the PD2, because an external user can install and use IDEs on his/her local working environment when he/she follows the IDE installation guide carefully.

PD3: IDEs satisfy the PD3, because IDEs support for coding, testing, debugging, and refactoring. Hence, an external developer who is familiar with IDEs can understand, correct and improve software systems faster.


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


PD1: Coding Standards and Coding Standards Compliance Tools satisfy the PD1, because they can help programmers improve the code readability, understandability and maintainability. When using the Checkstyle tool, a report would be generated to inform programmers whether violations are existed or not in the code.

PD2: Coding Standards and Coding Standards Compliance Tools do not satisfy the PD2, because an external user does not need to know any program code. Since users only care about whether the software they use are running smoothly or not. If not, users can simply call programmers to fix the software. Hence, PD2 is not in this scope.

PD3: Coding Standards and Coding Standards Compliance Tools satisfy the PD3, because when a software system follows the coding standards, an external develop can understand the software system faster. Then, the external developer can improve the software system efficiently.


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


PD1: Build Systems such as Ant (Java-based), and Make (C, C++ based) satisfy the PD1, because the build systems help programmers compile all files with one line of code. If one of the files is changed by a programmer, the build systems would only compile that file and the rest of files stay the same. It saves compiling time.

PD2: Build Systems satisfy the PD2, because an external user can run a software system with a line of code. For example, ant webspider.jar. Build Systems enable users to use the software system other than IDEs.

PD3: Build Systems satisfy the PD3, because an external developer can understand a software system by reading the build file which the external developer can easy know what files are involved when running the build systems. Moreover, the external developer can enhance the software system by adding other different tools in the build systems.


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


PD1: Automated Quality Assurance Tools such as PMD, FindBugs satisfy the PD1, because PMD helps programmers improve the code design, and FindBugs helps programmers pay attention on byte code than source code. For example, consider using equals( ) instead of = = when comparing two strings.

PD2: Automated Quality Assurance (QA) Tools do not satisfy the PD2, because an external user does not need to know the QA of a system when running the system.

PD3: Automated Quality Assurance Tools satisfy the PD3, because these tools help external developers understand the code qualities. When the external developers understand the code qualities, they can then enhance the system.


5. Black and White Box Testing


PD1: Black and White Box Testing satisfy the PD1, because the Black Box Testing helps programmers understand whether an input generates the expected output, and the White Box Testing helps programmers understand which line, block, method and class have not been covered by testing.

PD2: Black and White Box Testing do not satisfy the PD2, because an external user does not

PD3: Black and White Box Testing satisfy the PD3, because black box testing helps external developers understand whether an input generates the expected output, and the white box testing helps external developers understand which part of code have not been tested yet. By doing the white box testing, the external developer can write more testing cases for untested code. It is to make sure that the system has a better quality.


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


PD1: Automated Testing Tools satisfy the PD1, because these tools help programmers understand whether or not a system generates a correct result which programmers expect.

PD2: Automated Testing Tools do not satisfy the PD2, because an external user does not need to know any test cases to install and use the system.

PD3: Automated Testing Tools satisfy the PD3, because an external developer can understand and enhance a system by applying these testing tools. If one of testing fails, the external developer can read a automated generated report to fix the error.


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


PD1: Configuration Management satisfies the PD1, because it would identify errors and track all relevant elements of the configuration of a system.

PD2: Configuration Management satisfies the PD2, because an external user can install and use the system. For example, a user can checkout a system when using the SVN.

PD3: Configuration Management satisfies the PD3, because an external developer can understand a system, modify the system then commit the system back to trunk for the enhancement of the system.


8. Issue Driven Project Management


PD1: Issue Driven Project Management satisfies the PD1, because every issue is meant to be improved. Hence, a programmer can try to improve the system by following the issues.

PD2: Issue Driven Project Management satisfies the PD2, because an external user can view the issue page to understand the status of a system. Of course, the issue page is needed to be updated regularly.

PD3: Issue Driven Project Management satisfies the PD3, because an external developer can read these issues to improve a system.


9. Use Cases


PD1: Use Cases satisfy the PD1, because any use cases describe the result of certain action.

PD2: Use Cases satisfy the PD2, because an external user can expect the result if he/she reads the description in the use cases.

PD3: Use Cases satisfy the PD3, because an external developer can get information from these use cases to realize whether a system is generating an output as described in the use cases. If not, the external developer can enhance the system by modifying the code.


10. Software Review


PD1: Software Review satisfies the PD1, because a tester tests the software to find out whether or not the software accomplishes what it is supposed to do.

PD2: Software Review satisfies the PD2, because an external user can follow an installation guide to install and use the system successfully.

PD3: Software Review satisfies the PD3, because an external developer can follow an installation guide to install the system. If the installation guide is not well written, the external developer can write his/her feedback about it and suggest how to re-write the installation. If the installation guide is well written, the external developer can improve the system.


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


PD1: Agile Methods satisfy the PD1, because agile methods make sure that each member understands every part of the code. Hence, every system would accomplish a useful task.

PD2: Agile Methods do not satisfy the PD2, because an external user does not have to know whether each member understands or not a system.

PD3: Agile Methods do not satisfy the PD3. Since Agile Methods seek once and only once, these methods come and go fast well. It might not be a good way to let an external developer to join the project. If the external developer starts at the beginning of the project, it might work well.


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


PD1: Open Source Licenses satisfy the PD1, because they are not discriminated to certain people, free redistribution and available for business use. Hence, a system can be modifies frequently by many people. The system accomplishes a useful task.

PD2: Open Source Licenses satisfy the PD2, because an external user can freely install and use the system any time and any place.

PD3: Open Source Licenses satisfy the PD3, because an external developer learns more about open source licenses through discussion board or from the installation guide. Then, the external developer can spend time on improving the system.


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


PD1: Online Hosting Services satisfy the PD1, because the online hosting services are for both owners and viewers. Only owners can modify the services. Viewers can view the services and get feedback through discussion board. Hence, the services are tested by many people. Then, the system is able to accomplish a useful task.

PD2: Online Hosting Services satisfy the PD2, because an external user can install and use the system by reading the installation guide and the discussion board.

PD3: Online Hosting Services satisfy the PD3, because an external developer can read the online hosting site to understand a system. Then, the external developer can write some feedback about the system. Finally, owners of the online hosting services can modify the system. With this way, the external developer enhances the system indirectly.

Sunday, December 9, 2007

MyIsern-Onyx-2.0 Review

  • Team Pink decided to distribute the review assignment into four parts.
  • Reviewee: Team Onyx
  • Installation Review:
    • I was able to download the zip file (myisern-onyx-2.0.1205.zip) from the team Onyx google hosting project site (http://code.google.com/p/myisern-onyx/).
    • In the zip file, team Onyx provides a readme file which has a great detail about how to install their system and view their web application.
  • Code Format and Conventions Review:
  • Quality Assurance Tools Review:
    • "CREATE TABLE " appears 8 times.
    • "tbl_RESEARCHER" appears 4 times.
    • "INSERT_INTO " appears 6 times.
    • "VALUES (" appears 6 times.
    • "'," appears 6 times.
    • "FROM " appears 4 times.
    • Most of warnings are about the "nonconstant string passed to execute method on an SQL statement." Consider using a prepared statement instead.
    • Some warnings are about using the plus sign (+) to add string together in a loop. Consider using a StringBuffer or StringBuilder in Java 1.5.
    • A few of warnings are about unread field. Consider removing them.
  • Testing Tools Review:
    • There are no derby unit tests.
  • Test Case Review:
    • After involving "ant -f emma.build.xml", the emma coverage had shown as below.
    • Team Onyx misses a few test cases for class such as LogoutActionBean, SanityCheckErrorItem, SanityCheckErrorMessage, and MyIsernXMLSaver.
  • Summary:
    • I believe that most groups focus on how to use the database with their web application. Hence, some groups might have neglected to take care of the code qualities and testings. I will suggest team Onyx to take a look at our review reports on four different parts of their project. Hopefully, these reports will provide a great help for them to improve their project.

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.

Monday, October 22, 2007

21.MyISERN-1.2

  • MyISERN-1-Orange team members:
    • Ivan Wu
    • Chiao-Fen Zielinski-Liu
    • Michal Zielinski
  • What was difficult about this assignment?
    • Besides the test cases, this assignment was pretty straightforward. Basically, the program first follows user's input. If the name is in the system, users can only edit the existing information. Otherwise, we consider it a new information. Then, one or more Xml files will be updated according to users' decision.
    • Since this assignment needs user's input, I find the most difficult about this assignment is to write test cases for adding and editing. This is why our emma coverage report for blocks and lines show only 45% and 55 %.
  • What problems were encountered in organizing the group and carrying out the work?
    • Last Wednesday afternoon we spent five hours together to discuss the assignment and we also wrote a method together for adding researchers. The main purpose of writing the first method together was to let every member in MyIsern-Orange follow the coding format according to the method that we created together. Therefore, our users can easily perform tasks when using our system.
    • We did not really have serious problems when completing this assignment. We divided the assignment evenly to each member and we also assigned the due dates for each small section of the system. Then, other members could update the system by using SVN. On Sunday, we gathered together to run the system and to make sure the system works successfully. If problems occur, three brains are always better than one brain. Then we can easily remove bugs from our system.
  • Were all aspects of the milestone completed?
    • Yes, we completed all tasks for this assignment. For task2, we did our best to enter all data to test our program. Luckily, our system did not have any unexpected errors when inserting information. Everything is under our expectation.
  • What will I do differently during the next milestone to improve the process and the products of your efforts?
    • Weekdays, we really do not have much time to get together except Wednesday afternoon. If we could spent more time and get together more often on weekdays, I am pretty sure that we would complete every assignment before weekend comes, because we can think fast and code fast. This is the only thing that I can think of.

19.UseCaseSpecification

  • Summary:
    • A voice recorder would be very helpful on Wednesday, October 10 while I was trying so hard to take notes down from the professor who lectured on use cases for the MyIsern project.
    • I did not know that there are a lot of restrictions when writing use cases until I read those articles about use cases. When we wrote the use cases, we tried to follow the use case modeling tips on the IBM website. For example,
      • use active voice
      • write from the point of view of users
      • write scenario text
      • alternate courses of action
      • think the user interface
    • The use cases we wrote help me understand features of the system because use cases provide basic and alternate courses from the point of view of users. This is what we have to concern when we code MyIsern.
    • One article says that use cases should be written before a system is created. I agree with this statement because a good use case shows a real situation that a user can face when using the system. Therefore, software developers can code better programs.