Phase III: Implementation, Testing and Documentation



Phase III: Implementation, Testing and Documentation

• Coding

• Testing

• Documentations

• TimeLog

• Presentation III (.ppt) (.html) (May 12, 2003)

• Report (.doc)

3.1 Coding (LOC total:2261)

• ConnectionBean (subtotal: 300)

➢ connectionBean.zip

• DatabaseTableBean (Subtotal 1072)

➢ DatabaseBean.zip

• DrawChartBean (Subtotal 562)

➢ DrawChartBean.zip

• CopyFileBean (subtotal 327)

➢ CopyfileBean.zip

3.2 Testing

3.2.1 ConnectionBean:

o wrong database url selected: should not let user connect to database and show a error message

o wrong database driver selected: should not let user connect

o     login with empty user id and/or password: showed error message

o     login with invalid user id and/or password: showed error message

o     login with correct user id and password: login success,

3.2.2 DatabaseTableBean:

• Select an item: User can select each record currently in the table. And move the cusor by using Fist,Last,Prior and Next Buttton.

• "Insert" button: 

o If the new input in NewRecord dialog is empty or incorrect , an error message will show up.

• "delete" button: 

o If there is no item being selected, nothing will be deleted.

• "updat" button:

o If there is no item being selected, a dialog with error message will come out.

o If the new input is incorrect or empty a error message will show up.

3.2.3 DrawChart:

• Set property value:

o If a wrong value being set to DrawChart’s properties, there will be an error message coming out.

3.2.4 CopyFile Bean:

• Wrong file path: If the path for input file is incorrect, a error message shows up

• Wrong format: If the input file’s format is not correct, user cann’t view the content of file and will not save it into database either.

3.3 Documentations

3.3.1 JBuilder tutorial ( )

3.3.2 Database Java Beans user manual:

Currently, we have 4 java beans in this project. They are Database connection bean, Database table bean, Draw chart bean,

and Copy file bean . All these beans were developed in JBuilder7 enterprise edition by using JDK1.4.

For using these beans you can follow the steps below.

1.To add components from current project in JBuilder, you have to create a library for the current project, then select this library from the Palette Properties .

2 To create a library, choose Tools, Configure Libraries to bring up a Library properties box. Click new to display the New Library wizard, as shown in Figure 1.1

Figure 1.1

[pic]

. Enter the new Library name – Oracle in the Name field and add the path for classes12_g.zip( which can be downloaded at

or some other websites) in the Class section,

as shown in Figure 1.2.

[pic]

Click OK to add the library. Then, you can go ahead to add another four Libraries (connecttionpanel, DatabaseTables, drawchart and copyfile). The installations for these two libraries are a little different from Oracle library, because these two are Jbuilder projects instead of JAR files. To do this, you have to specify the path of src and classes folder of ConnectionPanel DataBaseTable, DrawChart and CopyFile. as shown in Figure 1.3.

Figure 1.3

[pic]

Figure1.3.1

[pic]

Figure1.3.2

[pic]

Figure1.3.3

[pic]

Figure1.3.4

[pic]

Figure1.3.5

[pic]

3.1 All the classes from AWT and Swing are already beans. Some of them, such as JList, JButton ans JTable, are already added into the Swing page and Swing Containers group in the component palette.

[pic]

3.2 Suppose we want to use all the four beans, which we mentioned before, in the JBuilder visual environment. First we must add it to the component palette following the steps below.

1) Choose Tools, Configuration Palette or right-click anywhere in the component palette and choose Properties. The palette Properties dialog box appears, as shown in Figure1.4

Figure 1.4

[pic]

Figure 1.5

2)Select the Pages tab and choose the page on the component palette on which we want the component to appear. Optionally, we may create a new page by clicking the Add button and entering the page name in the Add Page dialog box.

3)Suppose we want to add new beans to the Other group. Select Other in the pages column and click the Add components tab to display the dialog box for adding components, as shown in Figure1.6

Figure1.6

[pic]

4.Click the Selected Library button to display the Browser for Class dialog, as shown in Figure 1.7.

Figure 1.7

[pic]

5).Then, click Add From Selected Library button to locate Connectionpanel ,CreateTable, DrawChart and CopyFile in the connectionpanel, databasetable, drawchart and copyfiles package, as shown in Figure 1.8

Figure1.8

[pic] [pic] [pic] [pic]

6)Click OK in the Browser for Class dialog box to display a dialog box , as shown below:

[pic] [pic] [pic] [pic]

7.

At this point of time, we are ready to test the beans you just added to the component palette. First of all, you need create a new project. Choose File, New Project to bring up the Project wizard dialog box, as shown in Figure 2.0

Figure2.0

[pic]

Because this is Database application. We are going to use the JDBC driver from Oracle library we just installed. Click next go to Project Wizard Step 2 of 3. Add Oracle9i into the Required libraries box as shown below:

[pic]

Then click Finish button to finish creating a new Project.

8. Next step, we need create a new application. To do this, choose File, New to display the Object Gallery. Click the Application icon to bring up the Application wizard, as shown Figure 2.1 and 2.2

[pic]

Figure2.1

[pic]

Figure2.2

9.Type BeanTest in the Class field of the Application wizard Step 1 of 2 and Next to display the Application wizard’s Step 2 of 2, as shown in Figure 2.3

[pic]

Figure2.3

10. Check Center frame on screen. Click Finish.

11.The new project should looks like this in JBuilder.

[pic]

11.With the Frame1.java selected in Project Pane, choose the Design tab in the content pane to start the UI designer. Then, select contentPane in the component tree. Select its layout property on the Properties tab of the Inspector. Click the drop-down arrow and select null from the list as follow:

[pic]

12.To use all the beans we just added in JBuilder, click the Connectionpanel ,CreateTable, DrawChart and CopyFile components from the Other tab in the component palette and drop them in the frame, as shown in Figure 2.4

[pic]

Figure2.4

13. select contentPane in the component tree. Select its connecttoTable property on the Properties tab of the Inspector. Set the value to True. In the meantime, also set the value of copyfile and drawchart to be true. as shown in Figure 2.5

Figure2.5.1

[pic]

Figure2.5.2

[pic]

Figure2.5.3

[pic]

14. After all these done, choose the Source tab in the content pane to go back source code page of Frame1.java. Add three more lines code in Frame1.java

connectionpanel1.setTable(tableEditor1);

connectionpanel1.setChart(drawChart1);

connectionpanel1.setCopy(copyfiles1);

[pic]

15. The next thing we need to do before we can run the program is set the properties of DrawChart bean.

To do this, select drawChart1 in the component tree. In the component inspector for drawChart1,set the value of nameTo property to 1 and the value of numbers to 3.

We do this because the following is what our testing database looks like:

Name Type

------------------------------- -------- -------------

F_NAME CHAR(10)

L_NAME CHAR(10)

AGE NUMBER(38)

The value of nameTo property tells the program which column of database will be used as a name showing up at the drawChart

bean . Here we set it as 1, which means the F_NAME will be there on the chart.

Changing numbers to 3 let program it should draw charts depends on each person’s age

15. At this point of time , we are ready to test our program.

After running, it should looks like this:

[pic]

16 To connect a database(Oracle 8i running on zaurak.cis.ksu.edu), select JDBC driver, and DataBase URL. Type your User Name , Password and the name of the table where you wan t to get information from. Click Connect button, all the items currently in the table will be list in the table. You can insert , delete, or update all these information.

[pic]

To insert a new record

[pic]

[pic]

To delete a record, select a record first, then delete it.

[pic]

[pic]

To change information of records:

[pic]

[pic]

3.4 Evaluation

Evaluation on Phase One

In phase one, Dr. Hankley and me, we talked what kind of project need to be done and why we want to do this project. Through these talks, the concepts of this project are formed. Tools and other approaches are determined. Project requirements as well as project plan are made.

Evaluation on Phase Two

The major task in Phase Two is to develop a detailed design guiding the implementation of project. It includes SQA, formal specification, object model, test plan, and formal technique inspection. Tutorials on models, IDE tools and quite a few books and articles are read or learnt in this phase.

The design diagrams form the major contribution of this project to future development.

Evaluation on Phase Three

Phase Three of the project focuses on the actual implementation including coding and testing of the source code, documenting what was done in the previous phases, writing testing report, and writing developer manuals as well as user manual.

In this phase, testing is basically performed simultaneously while coding. When the coding reaches the end, the system test and integration test are performed using the test cases designed in Phase Two.

The line of code of (LOC) this project is approximately 2400, which is also close to the empirical estimate provided in Chapter 1. The gap between actual LOC and that based on COCOMO is about 500 lines, and this is mainly due to the factor that tells how many lines of code per function points

Retrospect on Time

The project started from August 2002 and is finished in early April 2003. Some 8 months were consumed before the final report came out. All milestones are listed below:

1st presentation scheduled: 10/01/02 actual 10/16/02

2nd presentation scheduled: 12/01/ 02 actual: 12/15/ 02

3rd presentation scheduled: 03/25/03 actual: 05/12/ 02

Conclusion

The project is finished successfully according to the software requirement specification in Phase One. This project will have a positive impact in CIS 501 and CIS 560 teachings (GUI user beans for cis501 and database beans for 560). The student may well use the GUI and the source code to help them get a deeper understanding in database applications and software architecture principles. At same time, the developer, I had a better understanding how reusable software components works in a bigger project than we used to write. In the coding phase, I start to realize the power of combination of IDE builder tools and Java Bean Technology. It enables programmers to rapidly build application by assembling objects and testing them during design time.

Finally, this project achieves what it is supposed to do, and from three-month trial applications of the software developed, the product itself is durable in quality. The period for developing this project is really a good experience for my graduate study.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download