You are on page 1of 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/340565274

Stock Market Data Viewer -JAVA

Technical Report · September 2016


DOI: 10.13140/RG.2.2.30973.18401

CITATIONS READS

0 1,074

1 author:

Murtadha Arif Bin Sahbudin


Universiti Sains Islam Malaysia (USIM)
18 PUBLICATIONS   38 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Song Recognition View project

All content following this page was uploaded by Murtadha Arif Bin Sahbudin on 10 April 2020.

The user has requested enhancement of the downloaded file.
















DEPARTMENT OF COMPUTER SCIENCE


COM6516:
Object Oriented Programming and Software Design
2015

ASSIGNMENT:
Stock Market Data Viewer - JAVA


STUDENT:
MURTADHA ARIF SAHBUDIN

LECTURER:
DR MARK STEVENSON


UML class diagram
Below is the UML class diagram which represent all the classes and methods use within the program. The main class MarketGUi provides the user interface of
the program and call other instance of an object from other classes. The second main class is the drawGraph which initiated from the main UI to draw multiple
options of graph based on the selection. Other classes that extend JPanel, are headerPanel and customPanel for customizing the UI attributes. The relation and
multiplicity between marketGUI and drawGraph are 1 to many. This is required for multiple graph windows to be displayed for each option.

2
Program Design
In designing the main panel interface, the layout approached is to navigate the user input from left to right
panel. First by selecting the ticker symbol, second the start and end dates, and then the option for which
graph to be view. The type of graph is separated for each option for easy viewing.



UI Designs
From the drawing window, a few UI usability factor was taken into consideration:
1. Flexible label option. Hide or show labels – this was considered if a user decided to view a large date
range of data, so its impossible to show each label of dates and data point. Thus, it allows the user to see
the graph patterns instead.However if it’s a range of 1-2 month user will be able to view all the data label
nicely with grids layout. See below screen capture


2. Flexible frame size. -the program designed to also cater for a resizable frame. This does mean if the user
decided to enlarge the window size, the drawing will relatively in real-time follow the window size. This
feature is very useful when it comes to different screen resolution or multiple screen display.
3. User Interface compatibility. - The code was tested on OS X El Capitan and Windows 10. As java.swing
may have slightly different of both interface, however, some code patch did all the work to ensure does
work in both platforms well.
4. Error handling – Each of the parameters does have extensive error handling to avoid any misguided input
by the user. This is especially for the dates selection, need to ensure that user does input the correct
date selection. The number of days also generated upon selection of year and month uses the java
calendar, guarantee days are correct for leap years. Any broken internet connection or URL also will be
displayed to inform the user.
5. File Input/Output – The ticker list selection and the year are stored in a tickerList.txt and yearList.txt.
The list can be add on without having to change the source once the application is packaged. The google
finance URL input data, however, is stored in a collection of an array(reversed) in the readURL class, as
the data only required once every query drawing so it's not necessary to store as a permanent file.
6. Design Style. Minimalist and elegant. The program black background theme was chosen to make the
contrast of the graph drawing viewable and also from any other application running in the desktop which

is normally by default is grey or white. In addition, if the graphs are displayed on projector viewer will
have better focus of the drawing lines because it’s a luminous color.

The Graph Drawing Architecture.
1. The basic of graph drawing is the concept of understanding data representation in an X and Y axis
plot, and any programming code the x and y coordinates are the drawing pencil. To know where
is point A and B for drawing.
2. The first approach was to draw the horizontal and vertical line for X and Y axis. And in
programming coordinates origin (0,0) generally starts with top-left. For the dates on the X axis,
the scale lines distribution is constant as it will take the length of the padded x line and divided
by number of data(dates). However, for data point line in Y Axis, we have to consider the max
and min of the data points then produce a scale for the data size and draw the lines. Within that
scale, each point will relatively get their own location within that range.
3. Once the both X and Y line a drawn it will produce a grid of intersection line for each similar data
index line L1 and L2. Each line will produce two set of coordinates start and end points; thus, it
could be represented as:
L1 have (x1,y1) and (x2,y2)
L2 have (x3,y3) and (x4,y4)
P the intersection of L1 and L2 computed as below:




4. The L1 and L2 are coordinate that is stored in an ArrayList of an object of Tuple class. (two set of
instance in 1 index array). Later on, the sets were pass to the intersectPoint method which will
compute the intersection point and stored in an array list. This point of coordinate will be the
reference of drawing the graph line. As example, from intPoint.get(i) to intPoint.get(i+1) and
incrementally until end of collection. The source of intersection computation for the line was
referenced as below.

1. Line–line intersection. Wikipedia, the free encyclopedia. Retrieved 2015-12-17
2. "Weisstein, Eric W. "Line-Line Intersection." From MathWorld". A Wolfram Web Resource.
Retrieved 2015-12-17.


Program testing
The testing phase was done to ensure the program is error free. The testing model approach was to use
category partition method which validate each independet feature of the interface that interacts with the
classes and methods. Therefore, it will verify the correctness and completeness of each specification. In
producing the test case,pair wise combinatorial was used to reduce the number test case that are only have
optimal combination of input types

1. The main feature of this program is the MarkGUI panel. The category partition of parameters
identified as below. The pairwise combination produces 10 test cases, and additional 3 test cases
were created manually as a random testing. The test cases result produced a few number of error
flag such as unused code statements or methods, or misspelled string e.g “Mac” for “Mar”. This test
input also serves to check on missing data point as an example for FB Facebook sample “17-May-12,-
,-,-,38.00,0”. For further details of the input values used and the result, please refer to the full test
case table at this link. http://1drv.ms/1m8MBW7



2. The second feature was the drawGraph class. In this sub application the label feature
option(show/hide) been identified as the parameters. Similar to the main program pair wise
combinatorial was used in producing total of 8 test cases. For further details of the input values
used and result, please refer to the full test case table at this link. http://1drv.ms/1m8MBW7




Testing Code Coverage

From the testing exercise total of 98% of the statement and 78% of branch coverage overall was achieved.
Another random testing such as URL link and the internet connection was done thoroughly but does not
include within this coverage report. Fur further details of the code coverage report please download from
this link. http://1drv.ms/1YBJ6sb



The main classes MarkertGUI and drawGraph each have 99% and 100% of statement coverage.

View publication stats

You might also like