You are on page 1of 24

SCHOOL OF INFORMATION TECHNOLOGY AND ENGINEERING

SWE2005-SOFTWARE TESTING

PROJECT TITLE: MEDICAL STORE BILLING SYSTEM

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();
}
}

public Connection getConnection()


{
return con;
}
}
USER:
class User {
private String Name,Company,BatchNo,MnfDate,ExpDate;
private Float PricePerUnit;
private int Quantity;
public User(String Name,String Company,String BatchNo,String MnfDate,String
ExpDate,int Quantity,Float PricePerUnit)
{
this.Name=Name;
this.Company=Company;
this.BatchNo=BatchNo;
this.MnfDate=MnfDate;
this.ExpDate=ExpDate;
this.PricePerUnit=PricePerUnit;
this.Quantity=Quantity;
}
public String getName(){
return Name;
}
public String getCompany(){
return Company;
}

public String getBatchNo(){


return BatchNo;
}
public String getMnfDate(){
return MnfDate;
}
public String getExpDate(){
return ExpDate;
}
public int getQuantity(){
return Quantity;
}
public Float getPricePerUnit(){
return PricePerUnit;
}
}
LOGIN MODULE:

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:

Medicine Sales Button:


new Medicines().setVisible(true);
dispose();
View Stock Button:
new Stock().setVisible(true);
dispose();
MEDICINES 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);
}
}
Buy Item Button:
Connection con;
Myconnection registercon=new Myconnection();
con=registercon.getConnection();
PreparedStatement pst=null;
ResultSet rs=null;
try{
TableModel model = tb1.getModel();
int indexes[] = tb1.getSelectedRows();
Object row[] = new Object[7];
Billing bill = new Billing();
DefaultTableModel model2 = (DefaultTableModel)bill.tb2.getModel();
for(int i=0;i<indexes.length;i++)
{
row[0] = model.getValueAt(indexes[i],0);
row[1] = model.getValueAt(indexes[i],0);
row[2] = model.getValueAt(indexes[i],0);
row[3] = model.getValueAt(indexes[i],0);
row[4] = model.getValueAt(indexes[i],0);
row[5] = model.getValueAt(indexes[i],0);
row[6] = model.getValueAt(indexes[i],0);
model2.addRow(row);
}
JOptionPane.showMessageDialog(null, "Added Successfully");
bill.setVisible(true);
dispose();

}
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:

Test case input Expected Actual Status


id Output output
1 Username:17MIS0006 Navigate to Navigated to Pass
Password: jay billing page billing page
2 Username:17MIS0402 Invalid Invalid check fail
Password:var check the username lenght
length of
username
3 Username:17MIS0076 Navigate to Navigated to Pass
Password:Harsha billing page billing page
BILLING MODULE:
Test case Id Input Expected output Actual output Status

1 Eldopar and quantity Details entered Details updated Pass

2 Coldact and quantity Details entered Details updated Pass

Advantages of the “test complete tool”:

Simplistic Cross Platform Testing


TestComplete Platform includes Test-complete Web, TestComplete Desktop and
TestComplete Mobile thereby allowing automated testing for of the above mentioned
platforms.As for Desktop application testing, you can create robust tests at object level so
that regression testing doesn’t fail even with the change in GUI. .NET applications can be
tested thoroughly through scripts calling various java and .NET classes directly. Windows
API can also call DLL and WMI functions. 3rd party control tools like Telerik, Sync fusion,
Microsoft etc. can be used and testing apps on virtual machines or on cloud is also
feasible.For Web apps, TestComplete Web supports Selenium, in which a single test of code
can be utilized for cross browser testing. Selenium Web Driver also provides a huge
advantage by allowing TestComplete to execute the web driver’s tests. With the usage of
just one test, testing across multiple mobile apps can also be done. It is similar to desktop
version but with a surplus of 3rd party controls availability.In the case of Mobile testing,
TestComplete Mobile allows users to test varied apps that include native, web iOS, Android
and hybrid apps, also with iOS8 and Apple’s new programming language Swift. For mobile
apps, gestures can be recorded and executed for testing.
Cloud testing is viable leading to reduction in expenses and hardware usage .
Swift Execution
TestComplete Platform helps you to create accurate and repetitive automated testing
swiftly on different devices, platforms and environments. There is availability of a simple
Record and Playback functionality which can be availed by novices as well as experienced
testers. A feature ‘Test Visualizer’ identifies the changes done by capturing the screen shots
of every single operation performed which in turn, helps in saving time for the developers
while debugging.
Test Quality Improvement
TestComplete’s accessibility to internal objects and application properties provides
increased test coverage and unique test logic from the base test data. Diverse checkpoints
are available for verification of operations. As a part of automated testing, Regression
testing is also very much possible, to ensure enhanced quality. Similar to QTP and other
tools, TestComplete lets you test at GUI and API level with the help of integration with
Soap UI, Service V to name a few.
Trimming the Costs of Testing
Because each of them – Desktop, Web and Mobile platform, has individual licensing costs,
it is cost effective to purchase the one which is needed. This is sure to save out on initial
investments and maintenance costs in future. There are possibilities of executing
automated testing on distinct workstations simultaneously, without buying a separate
license for each individual machine. Yet another feature which can further reduced costs is
Cloud testing.
Easy Continuous Integration
With its simplistic continuous integration feature, TestComplete turnsout to be easily
accessible and usable. Jenkins plug-in can be used to launch and perform the necessary tests.
The test logs and bug reports can be automatically attached to popular bug tracking tools
like JIRA etc. Soap UI, Service VPro etc. can be used for creating functional API tests to be
integrated with TestComplete.
Integration with different source control systems like CVS and Microsoft SCCI compatible
systems is possible. Also, integration with HP QC, AQ time etc. would help in improving
the quality of automated testing applications especially for developers.

Working:

1. Opening the tool and creating a new project.

2. Recording the test.

3. Running the test.

4. if it is found to be true then the test will be successful.

5. if not test will be false.

6. Test case statistics are displayed.


Opening the tool:

Validating test suit:


Run the test cases:

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.

You might also like