You are on page 1of 30

SWE2022

Software Engineering Process, Tools and Methods


REVIEW 3
WEATHER FORECASTING

Team members
NAME REG NO

P Manoj 16MIS0155

V.VAMSI 16MIS0170

A.V 16MIS0324
NAGARJUNA
HARISH M 16MIS0087

Submitted to,
Prof Rama Prabha kp
Introduction :-

In this project we were going to develop an simple interface for an weather


forecasting system using the java programming.

As of the course title is concerned as process and tools ,we were going to
develop the application/interface with the help of the tool called NETBEANS
where we can build the java applications in a easy manner ,maintain them ,we
can connect to the back end say SQL and even we can test our entire project.

• In this project we are going to have a clean look on weather conditions of


the various countries around the world.

 As mentioned weather report will be given on the country.

Climate and weather are same ??

NO climate and weather aren't same !!!!!!

WEATHER FORCASTING

The title it self says that it is something that belongs to the weather.

As mentioned ,in this project we are going to forecaste the weather conditions
of the various areas.

A detailed weather condition's will be displayed.

Abstract :-

In this we develop and interface of weather forecasting with a back end that
supports the data entry.

We can input the city name and the preferred day to know the weather details
as a input

Output of this can be various weather aspects like fogg,mist ,temperature etc of
the weather forecasting .
SAMPLE DATA FLOW DIAGRAM

1.General description :-

This section describes the system being developed with respect to the main
features of its functionality as well as the intended user characteristics

1.1. Product Perspective


The Weather Forecasting System or application is an extension to the system
currently being used in the Systems Ecology Lab. The application provides
near-real time access to environmental monitoring data streams in Arctic and
has become an important tool for the study of climate change. Its success has
created the desire to expand the application since focuses only on the Arctic
region of the globe. Wheather forecasting system will enable this extension to
allow scientists to monitor and analyze weather data from the North America
region by providing access to historical weather data streams needed for
statistical analysis and predictions of climate changes.

1.2. User Characteristics and Actor Descriptions


The system will be available via the World Wide Web, and therefore, there will
be a wide variety of users who have access to the system. The system is
intended for scientists who are knowledgeable about statistics and climate data.
The intended audience will have post-secondary education. We assume that
these users are familiar with web interfaces. The audience may include
occasional users, and thus, the system should guide users to the completion of
given tasks.
An actor is an external entity that interacts with the system to achieve a valuable
goal. An actor may represent a human, a device, or another software system. In
this section, a description of the actors shown in the use case diagram in Figure
1 is provided.

Client Program: Client Program represents a web service client that requests
data. Initially, we anticipate the client to be the descriptive statistics system .
This actor provides the necessary input to initiate a request for historical
weather data or a list of weather stations.

Local Database: Local Database stores historical weather data that was
retrieved recently from the historical weather data source. The intent is to
reduce the workload on the historical weather source by keeping data that we
have acquired.

Weather Data Source: This actor provides weather data to the system if the
requested data are not stored in the local database.

Administrator: The administrator will receive error logs in order to monitor


the system.

Product Features

The weather data tool will be vital to the analysis of climate data; it will provide
access historical weather data necessary to perform statistical and trend
analysis. In order for the tool to access these data, it must also keep knowledge
of what weather stations are available for querying. The tool will also maintain
a local database which is intended to reduce the number of requests to the
historical weather data sources. When data is returned from sources such as
NOAA it will be stored in the local database; in the event that another user
requests the same data the tool can obtain the data from the local database.The
system administrator will also have access to an activity log to monitor system
activity and the completion/incompletion of tasks.
1.2.1. Use Case Description
A use case describes the interactions between the actors and the system. This
subsection describes the use cases for this system.

1.2.1.1. Use Case #1: Acquire Historical Weather Data


Use Case Description: The service client requests weather data specified by
parameters that include weather stations, instrument data types, and time range.
The use case assumes that the parameters are provided in the correct format
(e.g., the start time point is earlier than the end time point in the time range).

Actors: Client Program, Local Database, Historical Weather Data Source.

Precondition: The system is idle and waiting for a request from the Client
Program.

Post-condition: On successful completion, the requested weather dataset is


returned to the Client Program. If the system is unable to complete the request,
the system logs an error message into the activity log.

Trigger condition: The Client Program makes a historical weather data request
specifying weather station(s), data type(s), and time range.
Steps:

1. The system verifies that the request contains all necessary parameters,
which include a non-empty weather stations list, a non-empty set of
instrument data types for each weather station, and time range
2. The system creates a database search query using parameters provided in
the request and queries the local database for the requested data.
3. The local database returns the requested data
4. The system processes data into a formatted file.
5. The system returns the formatted file to the Client Program.
6. End of use case.

1.2.1.2. Use Case : View Activity Log


Use Case Description: The Activity Log is stored in the local database. It
contains enough information for the Administrator to track the system activity,
namely any error message generated by the system, times that processes are
initiated, and whether processes complete their assigned tasks.

Actors: Administrator, Local Database.


Precondition: The local database is online.

Post-condition: On successful completion, the system will have displayed the


Activity Log.

Trigger: The Administrator activates the Activity Log process.

Steps:

1. The system prompts the Administrator for a userid and password.


2. The Administrator enters the userid and password. The password is
overwritten with characters as it is entered.
3. The system verifies the userid and password .
4. The system queries the Activity Log in the local database for all of the
messages.
5. The Local Database returns all of the messages.
6. The system displays the messages and time stamps for the messages,
ordered by time from most recent to oldest. The system displays 20
messages at a time as well as left and right arrow icons for scrolling
through messages.
7. The Administrator reads the messages and selects the left arrow icon .
8. The system displays the 20 messages previous to the oldest message
currently displayed.
9. The Administrator selects the Quit option.
10.End of use case.
Level 2 DFD:

2.0 Operating Environment


Tool: -This project will be evaluated and done in the netbeans IDE

Programming language :- Java

Server side : My sql console

2.1 Assumptions and Dependencies


- It is assumed that users have web browser software and are familiar with basic
use of web browsers.
- It is assumed that the response time will be fast enough. No response time or
performance metrics have been given.
- Weather data is assumed to be stored in the weather database, which is
accessible from the server.
- The user interface will be built using the shell provided by the client.

3.0 External interface specification:-


3.1 User Interfaces
1.The system shall use standard user interface controls such as buttons, text
boxes, radio buttons, check boxes, labels, list boxes, spin boxes, combo
boxes, sliders, scroll bars, tabs, tool tips, progress bars, and file selection
dialogs The user interfaces shall be presented as web pages and shall be
displayed by web browsers.
2.Each page of the system shall have full screen, minimize, and exit options.
3.Each page of the system shall allow a user to return to the previous page by
selecting a “back” option.
4.The system shall provide a visual display such as a progress bar or hour-glass
icon while any function is being performed.
5.The system shall provide an interface, hereafter called the Administrator
Login Page, which displays the prompt for the Administrator to enter the
userid and password.
6.The system shall provide an interface for viewing the Activity log, hereafter
called the Activity Log Interface.

3.2 Hardware Interfaces


There are no hardware-specific requirements.
Computer with windows 7 or above
Environment –net beans environment

3.3 Software Interfaces


The system shall use a PostgreSQL 8.0 or later database management system.
Net beans IDE

4.0 behavioral requirements :

4.1 Same Class of User


1.The server program shall have only one class of user, the Administrator,
who has access to the Activity Log.
2.The system shall require the Administrator to enter a valid combination of
userid and password in order to use the system.

4.2 Related Real-world Objects


Real-world objects are entities with either physical or conceptual counterparts
in the real world. The entity-relation diagram that motivates the real-world
objects described in this section can be found in Appendix A.

4.2.1Weather Station
1.Each weather station shall have a unique ID and a unique location, which is
specified by longitude and latitude.
2.Each weather station shall have a set of instruments that collect weather data.
4.2.2 Weather Data
Weather data is recorded for a weather station at a given time.

1.The types of instruments possible for a weather station shall include those
that measure temperature in C, relative humidity, wind speed in mph, wind
direction, precipitation, weather condition visibility in km.
2.A weather data element shall be identified by a weather station, a date and
time, and the data value for an instrument on the weather station at that time.

4.2.3 Activity Log


1.The system shall keep an activity log that will list all of the following
types of errors that occur within the system:
 The historical weather data source does not contain requested
weather data.
 The system cannot establish a connection to the historical
weather data source.
2.The activity log shall include the following information for each
entry:
 The type of the error.
 The date and time when the error occurred.

4.3 Related Features


A related feature is an externally desired service provided by the system that
may require a sequence of inputs to affect the desirable results. Use cases that
outline this section can be found in the section 2 of this SRS.

4.3.1 Create List of Weather Stations


1.The system shall accept requests for a list of weather stations based on any of
the following attributes:
 Station’s ID
 Station’s longitude
 Station’s latitude
 Station’s location defined by longitude and latitude
 State where the station is located
 A rectangular region defined by latitudes and longitudes of the
corner points of the rectangle
4.3.4Weather Data Request
1.The system shall allow a request for data from multiple weather stations,
multiple instrument data types for each weather station, and a single time
range to be made in a single request.

4.4 Stimulus
Transitions between the states of the system are often initiated by a stimulus.
State transition diagram that that motivates the requirements described in this
section can be found in Appendix B.

1.When the system receives a request from the Client Program, the system shall
verify that the request is either for a list of weather stations or for a table of
historic weather data.

4.4.1 Acquiring a List of Weather Stations


1.When the system receives a request for a list of weather stations, the system
shall query the historical weather data service and return the list to the Client
Program.
2.When the system receives a request for a list of weather stations by any of the
attributes listed in R
3. the system shall query historic weather data source for the available weather
stations satisfying the requested parameters.
4.When the system receives from the historical weather data source the list of
weather stations satisfying the requested parameters, the system shall return
it to the Client Program. If the system cannot establish connection to the
historical weather data source, the system shall log an error in the activity
log along with the time stamp when the failure occurred, and return an error
message to the statistical module.
5.The system shall query the historical weather data source for all weather
stations within one degree from the requested longitude and/or latitude.
6.The system shall query historical weather data source for all weather stations
within the requested state.
7.The system shall query historical weather data source for all weather stations
within the rectangular area defined by the latitude and longitude of the
corner points.

4.4.2 Acquiring Weather Data


NOAA only allows a user to request the same data once per hour. The system
should store any data it receives from the Weather Data Source so that repeated
requests can be serviced.
1.When the system receives a request for weather data, the system shall verify
that the request contains all of the following parameters: a non-empty set of
weather stations, a non-empty set of instrument data types, and a time range.
If any of the parameters is missing, the system shall return an error message
to the Client Program.
2.When the system receives a request for weather data and the system has
verified that the request contains all required parameters the system shall
query the local database for the requested data.
3.When the system receives an empty file from the local database while
querying the database for weather data, the system shall query the historical
weather data source for the requested data.
4.When the system receives requested weather data from the local database, the
system shall verify that all requested data are received and return data to the
statistical module

4.5 Functional
No further functional requirements have been identified.

5.0 Non- behavioural requirement

5.1 Performance Requirements


No performance requirements have been identified.

5.1.1Security
1.The server system shall require the Administrator to login.
2.The system shall be delivered with a default sys admin.
3.The system shall require the system admin to change password on first
login.

5.2 Qualitative Requirements


5.2.1 Availability
No availability requirements have been identified.

5.2.2 Maintainability
The parts of the system coded in JAVA be coded using NETBEANS.
5.2.3 Portability
The user interface shall run on Microsoft Internet Explorer 8.0, Mozilla
Firefox 3.5, Google Chrome 3.0, and Apple Safari 4.0.

6.0 Other requirements :-

6.1 Database
1.The system shall store the weather data in the CEON Weather Database
managed by MYSQL.
2. The system shall not store duplicate set of data into the database.
3.The database schema shall be based on the existing database schema,
presented in netbeans Operations
No operations requirements have been identified.

6.2 Site Adaptation


No site adaptation requirements have been identified.

7.0 Static model


8.0 collaboration diagram

when: Data found/ Return data to the query source


Idle when: Request for weather data recieved Query Internal Database

when: Error logged/ Return error to query source

when: Requested weather data is not found

Log Error

when: Requested weather data is not found/ Log error

Query Historical Data Source

when: Data found/ Return data to the query source and store data in database

9.0 Functional model

Historical Weather Data Query


Historical Acquire Historical
Requested Weather Station Data
Weather Data Weather Data
Requested Weather Station Data
Source

Local
Historical Time Range
List of Weather Stations Weather Weather Station(s)
Data Type(s)
Database
Historical Weather Data Query

Error Message
Retrieved Weather Data
Acquire List of Weather Station List
Station ID, State, Location,
Weather Statistical Package
Longitude, Latitude, or Priority List
Stations

Error Message

Administrator View Activity Performance Data Log


Activity Log
Log Details Cache
Sequence diagram:-

*Weather Information :SatComms :WeatherStation :CommsLink :WeatherData


System*

Request(report)

acknowledge

reportWeather()

acknowledge

get(summary)

summarize()

send(report)

acknowledge

reply(report)

acknowledge
Class diagram

Implementation:

Code :

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package jdbc_connectivity;

import java.sql.*;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.ResultSet;

import javax.swing.JOptionPane;
/**

* @author Manoj puthalapattu

*/

public class jdbc extends javax.swing.JFrame {

/**

* Creates new form jdbc

*/

public jdbc() {

initComponents();

/**

* This method is called from within the constructor to initialize the form.

* WARNING: Do NOT modify this code. The content of this method is always

* regenerated by the Form Editor.

*/

@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jScrollPane1 = new javax.swing.JScrollPane();

jTable1 = new javax.swing.JTable();

jLabel1 = new javax.swing.JLabel();

jLabel2 = new javax.swing.JLabel();

jLabel3 = new javax.swing.JLabel();


jLabel4 = new javax.swing.JLabel();

jLabel5 = new javax.swing.JLabel();

jTextField2 = new javax.swing.JTextField();

jTextField3 = new javax.swing.JTextField();

jTextField4 = new javax.swing.JTextField();

jTextField5 = new javax.swing.JTextField();

jTextField6 = new javax.swing.JTextField();

jButton1 = new javax.swing.JButton();

jLabel7 = new javax.swing.JLabel();

jTextField1 = new javax.swing.JTextField();

jTextField7 = new javax.swing.JTextField();

jTextField8 = new javax.swing.JTextField();

jLabel6 = new javax.swing.JLabel();

jLabel8 = new javax.swing.JLabel();

jTable1.setModel(new javax.swing.table.DefaultTableModel(

new Object [][] {

{null, null, null, null},

{null, null, null, null},

{null, null, null, null},

{null, null, null, null}

},

new String [] {

"Title 1", "Title 2", "Title 3", "Title 4"

));

jScrollPane1.setViewportView(jTable1);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

getContentPane().setLayout(null);

jLabel1.setFont(new java.awt.Font("Segoe UI Black", 1, 18)); // NOI18N

jLabel1.setForeground(new java.awt.Color(0, 255, 255));

jLabel1.setText("ENTER THE CITY");

getContentPane().add(jLabel1);

jLabel1.setBounds(20, 60, 170, 24);

jLabel2.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 18)); // NOI18N

jLabel2.setForeground(new java.awt.Color(255, 255, 255));

jLabel2.setText("COUNTRY");

getContentPane().add(jLabel2);

jLabel2.setBounds(20, 110, 90, 20);

jLabel3.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 18)); // NOI18N

jLabel3.setForeground(new java.awt.Color(153, 0, 51));

jLabel3.setText("TEMPERATURE");

getContentPane().add(jLabel3);

jLabel3.setBounds(20, 150, 110, 20);

jLabel4.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 18)); // NOI18N

jLabel4.setForeground(new java.awt.Color(153, 0, 153));

jLabel4.setText("HUMIDITY");

getContentPane().add(jLabel4);

jLabel4.setBounds(20, 190, 110, 20);


jLabel5.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 18)); // NOI18N

jLabel5.setForeground(new java.awt.Color(0, 255, 204));

jLabel5.setText("WIND");

getContentPane().add(jLabel5);

jLabel5.setBounds(30, 230, 90, 14);

getContentPane().add(jTextField2);

jTextField2.setBounds(200, 100, 120, 30);

getContentPane().add(jTextField3);

jTextField3.setBounds(200, 140, 100, 30);

jTextField4.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jTextField4ActionPerformed(evt);

});

getContentPane().add(jTextField4);

jTextField4.setBounds(200, 180, 103, 30);

getContentPane().add(jTextField5);

jTextField5.setBounds(200, 220, 130, 30);

getContentPane().add(jTextField6);

jTextField6.setBounds(200, 260, 140, 30);

jButton1.setBackground(new java.awt.Color(0, 0, 0));

jButton1.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 24)); // NOI18N

jButton1.setForeground(new java.awt.Color(153, 153, 0));

jButton1.setText("get detailes ");


jButton1.setBorder(new
javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(0,
255, 255), new java.awt.Color(153, 255, 153), new java.awt.Color(0, 204, 204), new
java.awt.Color(51, 51, 0)));

jButton1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton1ActionPerformed(evt);

});

getContentPane().add(jButton1);

jButton1.setBounds(80, 310, 220, 33);

jLabel7.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 18)); // NOI18N

jLabel7.setForeground(new java.awt.Color(0, 255, 51));

jLabel7.setText("PRESSURE");

getContentPane().add(jLabel7);

jLabel7.setBounds(30, 260, 110, 20);

getContentPane().add(jTextField1);

jTextField1.setBounds(200, 60, 120, 30);

getContentPane().add(jTextField7);

jTextField7.setBounds(350, 150, 170, 30);

getContentPane().add(jTextField8);

jTextField8.setBounds(450, 60, 80, 30);

jLabel6.setFont(new java.awt.Font("Tw Cen MT Condensed", 1, 18)); // NOI18N

jLabel6.setForeground(new java.awt.Color(0, 51, 255));

jLabel6.setText("ENTER THE DAY ");

getContentPane().add(jLabel6);

jLabel6.setBounds(330, 70, 110, 20);


jLabel8.setIcon(new javax.swing.ImageIcon("C:\\Users\\HP Customer\\Desktop\\jdbc6.jpg")); //
NOI18N

jLabel8.setText("jLabel8");

getContentPane().add(jLabel8);

jLabel8.setBounds(0, 0, 550, 380);

pack();

}// </editor-fold>

private void jTextField4ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

String un=jTextField1.getText();

String bn=jTextField8.getText();

String i=("city not found");

Connection conn=null;

PreparedStatement pstmt=null;

ResultSet rs=null;

try{

Class.forName("com.mysql.jdbc.Driver");

conn=DriverManager.getConnection("jdbc:mysql:///weather_report","root","");

pstmt=conn.prepareStatement("select*from weather9 where city=?");

pstmt.setString(1,un);

pstmt=conn.prepareStatement("select*from weather9 where date=?");


pstmt.setString(1,bn);

rs=pstmt.executeQuery();

while(rs.next()){

jTextField2.setText(rs.getString("country"));

jTextField3.setText(rs.getString("temp"));

jTextField4.setText(rs.getString("humidity"));

jTextField5.setText(rs.getString("wind"));

jTextField6.setText(rs.getString("pressure"));

jTextField7.setText(rs.getString("climate"));

// TODO add your handling code here:

catch(Exception u){

JOptionPane.showMessageDialog(null , u);

JOptionPane.showMessageDialog(null , i);

finally{

try{

conn.close();

pstmt.close();

rs.close();

}
catch(Exception e){

JOptionPane.showMessageDialog(null ,i);

/**

* @param args the command line arguments

*/

public static void main(String args[]) {

/* Set the Nimbus look and feel */

//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">

/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.

* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

*/

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break;

} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(jdbc.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(jdbc.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(jdbc.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(jdbc.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

//</editor-fold>

/* Create and display the form */

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new jdbc().setVisible(true);

});

// Variables declaration - do not modify

private javax.swing.JButton jButton1;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel4;

private javax.swing.JLabel jLabel5;

private javax.swing.JLabel jLabel6;

private javax.swing.JLabel jLabel7;

private javax.swing.JLabel jLabel8;

private javax.swing.JScrollPane jScrollPane1;


private javax.swing.JTable jTable1;

private javax.swing.JTextField jTextField1;

private javax.swing.JTextField jTextField2;

private javax.swing.JTextField jTextField3;

private javax.swing.JTextField jTextField4;

private javax.swing.JTextField jTextField5;

private javax.swing.JTextField jTextField6;

private javax.swing.JTextField jTextField7;

private javax.swing.JTextField jTextField8;

// End of variables declaration

Output:
Test cases that we have generated:

Here we will be tsting our java project using the tools called as the JUNIT
testing tool .where the test cases will be generated for each and every module
and execustion will be done accordingly .

We have the code such that it fails for the main class

Then we have written the code for the test case to pass the given scenario

Therefore the test cases have been generated for each module and have tested
accordingly with the pass case and the fail case

Method of development :

Here as of in the view of the simple project we have selected the development
style of water fall model .

Justification for selection of water fall model :

Since our is a small scale project and our requirements were well defined by the
client so that we can choose the development style of water fall model .

Where each process is developed in a iterative model .


After the completion of one module lets say design the coding part was included
so here we can say that we have used the water fall method approach
effectively.

Process stimulation:

Whenever we were doing the project in the large scale a brief outline should be
present in order to develop in an effective manner.

So here we will be using the ADOBE XD to stimulate the overall original


process

how the process flow will be happening from one module to the other module
were explained in a neat manner .
Conclusion:-

Therefore ,the neat explanation of the project weather forecasting was done with
the necessary class diagrams ,sequence diagrams ,with neat implementation
along with the generation of the test cases with the process stimulation was
made in a neat manner .

THANK YOU

You might also like