Professional Documents
Culture Documents
SWE2005-SOFTWARE TESTING
TEAM MEMBERS:
1. 18MIS0044 - R.YESWANTH
2. 18MIS0019 - J.SANJAY
3. 18MIS0247 - A.HITHESH
FACULTY: UMA K
ABSTRACT:
The medical store billing system ease the medical shops and the salesperson by
providing the fully computerized data storage facility which help them to generate the
bill and update the stock at the same time without any extra manual work.
The process of billing faster than before as the staff do not have to check the register
for each medicine that it is available in their stock or not, he/she must just search in
system for the drug and it will show the stock detail which makes the billing less time
taking process.
It also provides the multi-user interface which allows the user to login and slide
through the details of the medicine, the stock of the store where new medicines can be
added, unwanted medicines deleted, details of the medicines updated and search for
medicine, save and print the bill of the purchased medicines.
MODULES:
The medical store billing system consists of five basic modules. They are:
1. SignUp
2. Login
3. Stock
4. Medicines
5. Billing
The description of these modules is as follows:
1) SIGNUP: This module is used to create users by reading the username and
password and by confirming the password using three labels (Username, Password
and Confirm Password), three text fields (for each label) and a button (SignUp) for
registering.
2) LOGIN: This module allows the registered users to access the software by reading
the username and the password. This uses two labels (Username and Password),
two text fields for each label and a button (Login).
3) STOCK: This module allows the user to Search, Add, Delete and Update the
details of a medicine. It shows the altered or updated medicine under the Alteration
label. It gives us various details of the medicines stored
4) MEDICINES: This module allows the user to Search for a medicine or View the
details of all the medicines stored.
5) BILLING: This module allows the user to Save or Print the list of medicines
bought by the customer on particular date by generating a bill on the name of the
customer.
SIGNUP MODULE:
LOGIN MODULE:
STOCK MODULE:
MEDICINE MODULE:
BILLING MODULE:
MY CONNECTION:
import java.sql.*;
public class Myconnection {
Connection con;
public Myconnection()
{
try{
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Searching for Connection class. .. ");
}
catch(ClassNotFoundException cnf)
{
System.out.println("Class not found and unable to
connect.... "+cnf.getLocalizedMessage());
}
try{
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/msbs","root","harsha@99");
}
catch(SQLException e2)
{
e2.printStackTrace();
}
}
Login Button:
private void bActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Connection con;
Myconnection registercon=new Myconnection();
con=registercon.getConnection();
PreparedStatement pst;
ResultSet rs;
try{
String sql="select * from login where Username=? and Password=?;";
pst=con.prepareStatement(sql);
pst.setString(1,u.getText());
pst.setString(2,p.getText());
rs=pst.executeQuery();
if(rs.next())
{
JOptionPane.showMessageDialog(null,"Login successful");
new commonscreen().setVisible(true);
dispose();
}
else{
JOptionPane.showMessageDialog(null,"Login unsuccessful");
}
}
catch(SQLException e)
{
Logger.getLogger(Login.class.getName()).log(Level.SEVERE,null,e);
}
}
Sign Up Button:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
new SignUp().setVisible(true);
dispose();
}
SIGN UP MODULE:
SignUp Button:
Connection con;
Myconnection registercon=new Myconnection();
con=registercon.getConnection();
PreparedStatement pst;
ResultSet rs=null;
try
{
String name = t1.getText();
String pass = t2.getText();
String cpass = t3.getText();
if(cpass.equals(pass))
{
String sql="insert into login(Username,Password) values(?,?)";
pst=con.prepareStatement(sql);
pst.setString(1,name);
pst.setString(2,pass);
int rows=pst.executeUpdate();
JOptionPane.showMessageDialog(null,"Sign in finished");
new Login().setVisible(true);
dispose();
}
else
{
JOptionPane.showMessageDialog(null,"Please fill the fields properly");
}
}
catch(SQLException e)
{
Logger.getLogger(Login.class.getName()).log(Level.SEVERE,null,e);
}
COMMONSCREEN MODULE:
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
STOCK MODULE:
public ArrayList<User> userList(){
ArrayList<User> userList = new ArrayList<>();
try{
Connection con;
Myconnection registercon=new Myconnection();
con=registercon.getConnection();
Statement st=null;
ResultSet rs=null;
String sql = "select * from medicines";
st = con.createStatement();
rs = st.executeQuery(sql);
User user;
while(rs.next()){
user= new
User(rs.getString("Name"),rs.getString("Company"),rs.getString("BatchNo"),rs.getString("M
nfDate"),rs.getString("ExpDate"),rs.getInt("Quantity"),rs.getFloat("PricePerUnit"));
userList.add(user);
}
}
catch(SQLException e){}
return userList;
}
public void show_user(){
ArrayList<User> list = userList();
DefaultTableModel model = (DefaultTableModel)tb1.getModel();
Object[] row = new Object[7];
for(int i=0;i<list.size();i++){
row[0]=list.get(i).getName();
row[1]=list.get(i).getCompany();
row[2]=list.get(i).getBatchNo();
row[3]=list.get(i).getMnfDate();
row[4]=list.get(i).getExpDate();
row[5]=list.get(i).getQuantity();
row[6]=list.get(i).getPricePerUnit();
model.addRow(row);
}
}
Add New Item Button:
Connection con;
Myconnection registercon=new Myconnection();
con=registercon.getConnection();
PreparedStatement pst=null;
ResultSet rs=null;
String name = t1.getText();
String company = t7.getText();
String bno = t2.getText();
String md = t3.getText();
String ed = t4.getText();
int quantity = Integer.parseInt(t5.getText());
Float price = Float.parseFloat(t6.getText());
try{
String query="insert into
medicines(Name,Company,BatchNo,MnfDate,ExpDate,Quantity,PricePerUnit) values
(?,?,?,?,?,?,?)";
pst = con.prepareStatement(query);
pst.setString(1,name);
pst.setString(2,company);
pst.setString(3,bno);
pst.setString(4,md);
pst.setString(5,ed);
pst.setInt(6,quantity);
pst.setFloat(7,price);
int rows = pst.executeUpdate();
JOptionPane.showMessageDialog(null, "Added Successfully");
}
catch(SQLException e){
}
Delete Button:
Connection con;
Myconnection registercon=new Myconnection();
con=registercon.getConnection();
PreparedStatement pst=null;
ResultSet rs=null;
try{
int row = tb1.getSelectedRow();
String cell = tb1.getModel().getValueAt(row, 0).toString();
String query = "DELETE FROM medicines where Name='"+cell+"'";
pst = con.prepareStatement(query);
pst.executeUpdate();
DefaultTableModel model = (DefaultTableModel)tb1.getModel();
model.setRowCount(0);
show_user();
JOptionPane.showMessageDialog(null, "Deleted Successfully");
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
BILLING MODULE:
New Bill Button:
String Name=t1.getText(); String
Date=t2.getText();
new Medicines().setVisible(true);
dispose();
Save Bill Button:
String Name=t1.getText(); String
Date=t2.getText();
JOptionPane.showMessageDialog(this,"Bill saved successfully"); Print
Bill Button:
String Name=t1.getText(); String
Date=t2.getText();
JOptionPane.showMessageDialog(this,"Printing Bill. ... ");
Logout Button:
new Login().setVisible(true);
dispose();
TEST CASES:
LOGIN MODULE:
Working:
Test Success:
Conclusion:
So by using test complete (30 day free trial version) “Medical store billing system” is
checked by giving all the necessary inputs and the required test cases have been
generated and written in the document ,and the tool records the action first and
later display the test result whether it is success or not ,so at last I conclude that this
tool supports a lot for all the web and java applications and is user friendly with good
interface and clear idea about the tasks inherited in it.